Query for patients

Queries for a number of client based on certain criteria.

Transaction Specification

URL: GET /ws/rest/v1/patients?$<queryParams>

Description: Queries for clients in the client registry. This transaction returns a list of all clients that match the criteria specified by the query parameters. Otherwise, if an error occurs then an error is returned.

Request

The GET request may contain any combination of the query parameters.

Parameters

$<queryParams>

given_name

The client’s given name.
family_name

The clients family name.
dob

The date of birth of the client. This date can be partial, both the day and month may be left off if required. This should be specified in the following format:
yyyy-MM-dd

Eg. ?dob=1986-06-04- or ?dob=1986-06 or ?dob=1986
gender

The gender of the client. ‘m’ or ‘f’ are valid arguments.
addr_province

The province where the client lives.
See Rwanda_Administrative_Structure_ISO_codes.ods for codes to use with this parameter.
addr_district

The district where the client lives.
See Rwanda_Administrative_Structure_ISO_codes.ods for codes to use with this parameter.
addr_sector

The sector where the client lives.
See Rwanda_Administrative_Structure_ISO_codes.ods for codes to use with this parameter.
addr_village

The village where the client lives.
See Rwanda_Administrative_Structure_ISO_codes.ods for codes to use with this parameter.
addr_cell

The cell where the client lives.
See Rwanda_Administrative_Structure_ISO_codes.ods for codes to use with this parameter.
mother_name

The full name of the client’s mother.
father_name

The full name of the client’s mother.
tel_number

This client’s telephone number.

Response

HTTP 200 - OK

The HTTP response body will contain a list of HL7 messages that each represent a client. This list will be using the RSS feed XML format. Each item of the RSS XML format will represent a single client.

Data

See UC01.002 Maintain Client Registry for the latest data structure for this section.

Messaging Specification

The response will be an RSS feed with the following format and will contain multiple HL7 v2.5 messages:
See QueryClientRSS.xml

Each of the HL7 messages will be a HL7 v2.5 ADT_A28 message with the following structure:
See Register-or-Query-Client

Error

HTTP 500 - Server Error - If the server encountered an error.

HTTP 400 - Bad Request - If the parameters are malformed.

Orchestration

This section describes how this transaction is orchestrated through the HIM (interoperability layer) in order to complete this transaction.

  1. Call Query for clients

Sample Messaging Implementation

Scenario 1

Queries for a number of client based on certain criteria

User Interface

TODO

Sample Request Message

GET https://hie.jembi.org:5000/ws/rest/v1/patients HTTP/1.1

Sample Response Message

<rss version="2.0" xmlns:rhea="http://rw.moh.gov/rhea/1.0">
   <channel>
      <title>ADT_A28 Feed</title>
      <link>http://rw.moh.gov/rhea/1.0</link>
      <description>RHEA HIE ADT_A28 Feed</description>
      <item>
         <title>ADT_A28</title>
         <link/>
         <description/>
         <rhea:content>
            <ADT_A05 xmlns="urn:hl7-org:v2xml">
               <MSH>
                  <MSH.1>|</MSH.1>
                  <MSH.2>^~\&amp;</MSH.2>
                  <MSH.7>
                     <TS.1>20120322120032.479+0200</TS.1>
                  </MSH.7>
                  <MSH.9>
                     <MSG.1>ADT</MSG.1>
                     <MSG.2>A28</MSG.2>
                     <MSG.3>ADT_A05</MSG.3>
                  </MSH.9>
                  <MSH.10>2</MSH.10>
                  <MSH.11>
                     <PT.1>T</PT.1>
                  </MSH.11>
                  <MSH.12>
                     <VID.1>2.5</VID.1>
                  </MSH.12>
               </MSH>
            </ADT_A05>
         </rhea:content>
      </item>
      <item>
         <title>ADT_A28</title>
         <link/>
         <description/>
         <rhea:content>
            <ADT_A05 xmlns="urn:hl7-org:v2xml">
               <MSH>
                  <MSH.1>|</MSH.1>
                  <MSH.2>^~\&amp;</MSH.2>
                  <MSH.7>
                     <TS.1>20120322120032.479+0200</TS.1>
                  </MSH.7>
                  <MSH.9>
                     <MSG.1>ADT</MSG.1>
                     <MSG.2>A28</MSG.2>
                     <MSG.3>ADT_A05</MSG.3>
                  </MSH.9>
                  <MSH.10>2</MSH.10>
                  <MSH.11>
                     <PT.1>T</PT.1>
                  </MSH.11>
                  <MSH.12>
                     <VID.1>2.5</VID.1>
                  </MSH.12>
               </MSH>
            </ADT_A05>
         </rhea:content>
      </item>
      <item>
         <title>ADT_A28</title>
         <link/>
         <description/>
         <rhea:content>
            <ADT_A05 xmlns="urn:hl7-org:v2xml">
               <MSH>
                  <MSH.1>|</MSH.1>
                  <MSH.2>^~\&amp;</MSH.2>
                  <MSH.7>
                     <TS.1>20120322120032.479+0200</TS.1>
                  </MSH.7>
                  <MSH.9>
                     <MSG.1>ADT</MSG.1>
                     <MSG.2>A28</MSG.2>
                     <MSG.3>ADT_A05</MSG.3>
                  </MSH.9>
                  <MSH.10>2</MSH.10>
                  <MSH.11>
                     <PT.1>T</PT.1>
                  </MSH.11>
                  <MSH.12>
                     <VID.1>2.5</VID.1>
                  </MSH.12>
               </MSH>
            </ADT_A05>
         </rhea:content>
      </item>
   </channel>
</rss>