Indonesian

Search for encounters(s) based on a supplied keyword

The following client script will request the remote server to search for encounter(s) based on a keyword that you supply and return a list of matching encounters with very basic data (family/first names, DOB and sex). The script will display the resulting list on a table. (Pls. scroll down)

Enter a keyword for searching e.g. family or first name or their first few characters Note: if the search does not find a match, an error message will be returned and 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';

$keyword = $HTTP_GET_VARS['key'],

// Call the remote procedure
if (!$client->query('Encounter.Search', $header, $keyword)){
	
	// 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> PID </TD>
	<TD> Family name </TD>
	<TD> First name </TD>
	<TD> Date of birth </TD>
	<TD> Sex </TD>
	</TR>";
	
	while(list($x,$v) = each($response)){
		echo "<TR>";
		while(list($y, $z) = each($v)){
			echo '<TD>'.$v.'</TD>';
		}
		echo "</TR>";
	}


	echo '</TABLE>';
}
Enter a keyword for searching e.g. family or first name or their first few characters Note: if the search does not find a match, an error message will be returned and displayed.


©2004 HXP All rights reserved