Indonesian

List of a person's encounters available in the database

The following client script will request the remote server to return a list of all encounters of a person. The script will display the resulting list on a table.

Select a PID number from 10000000 to 10000004, enter it in the input box and press "Start demo". Note if you enter an invalid value or if the PID or encounter does not exist in the remote database, an error message will be displayed.

 
// Load the library
require('ixr_library.inc.php');

// Create the client and connect to the remote server
$client = new IXR_Client('http://207.44.195.231/~care2x/foundry/modules/hxp/server.php');

// Create the header and supply the username and password
$header['usr'] = 'hxp';
$header['pw'] = 'hxp';

// Set the PID
$PID = $HTTP_GET_VARS['pid'];

// Call the remote procedure
if (!$client->query('Person.Encounter', $header, $PID)){
	
	// If error, show info
	echo ('An error occured - '.$client->getErrorCode().' : '.$client->getErrorMessage();

}else{

	// Get the result
	$response = $client->getResponse();

	// Display the result
	echo '<TABLE BORDER=0>';

	echo "<TR>
	<TD> Encounter nr </TD>
	<TD> Date/Time </TD>
	<TD> Admission type </TD>
	<TD> Discharged </TD>
	<TD> Discharge date </TD>
	</TR>";
	
	while(list($x,$v) = each($response)){
		echo "<TR>";
		while(list($y, $z) = each($v)){
			echo '<TD>'.$v.'</TD>';
		}
		echo "</TR>";
	}


	echo '</TABLE>';
}
Select a PID number from 10000000 to 10000004, enter it in the input box and press "Start demo". Note if you enter an invalid value or if the PID or encounter does not exist in the remote database, an error message will be displayed.


©2004 HXP All rights reserved