Copy of Retrieve Patient Encounters

Patient encounters, such as registrations or identifications, can be searched for and retrieved using the MHD Profile. The following transactions can be used:

  • ITI-67 Find Document Dossiers
  • ITI-68 Get Document

See the MHD Technical Framework for full details around these transactions, although they are briefly described here.

Find Document Dossiers

The Find Document Dossiers transaction can be used to search for any encounters that a patient may have. The transaction takes the form of a GET request to https://{him-server}/ws/rest/v1/registration/net.ihe/DocumentDossier/search?PatientID=${pid}. The server will respond with a message containing a list of matching document entries.

The response will take the form

{
  "updated": <query time>,
  "self": "https://{him-server}/ws/rest/v1/registration/net.ihe/DocumentDossier/search?PatientID=${pid}",
  "entries": [
    {
      "id": <entryUUID>,
      "self": "https://{him-server}/ws/rest/v1/registration/net.ihe/DocumentDossier/${entryUUID}/?PatientID=${pid}",
      "related": "https://{him-server}/ws/rest/v1/registration/net.ihe/Document/${entryUUID}/?PatientID=${pid}",
      "updated": <document created time>
    },
    ...
  ]
}

Each entry returned (entries) lists a single encounter. The related field contains a url that can be used to retrieve the document contents using the Get Document transaction (next section).

Note that the patientID has to be url encoded. See Save Encounter (MHD section) for details on this.

As an example, to query all encounters for patient 7612241234567^^^ZAF^NI with two encounters, a GET is sent to https://{him-server}/ws/rest/v1/registration/net.ihe/DocumentDossier/search?PatientID=7612241234567%5e%5e%5eZAF%5eNI and the response could be:

{
  "updated": "2014-10-09T12:34:28Z",
  "self": "https://him-server/ws/rest/v1/registration/net.ihe/DocumentDossier/search?PatientID=7612241234567%5e%5e%5eZAF%5eNI",
  "entries": [
    {
      "id": "urn:uuid:d1329e63-0408-4f45-b5ba-35f9afa72a94",
      "self": "https://him-server/ws/rest/v1/registration/net.ihe/DocumentDossier/d1329e63-0408-4f45-b5ba-35f9afa72a94/?PatientID=7612241234567%5e%5e%5eZAF%5eNI",
      "related": "https://him-server/ws/rest/v1/registration/net.ihe/Document/d1329e63-0408-4f45-b5ba-35f9afa72a94/?PatientID=7612241234567%5e%5e%5eZAF%5eNI",
      "updated": "2014-04-12T15:00:11Z"
    },
    {
      "id": "urn:uuid:c0f1c318-7dd9-4338-af3f-4fc36d1bcce4",
      "self": "https://him-server/ws/rest/v1/registration/net.ihe/DocumentDossier/c0f1c318-7dd9-4338-af3f-4fc36d1bcce4/?PatientID=7612241234567%5e%5e%5eZAF%5eNI",
      "related": "https://him-server/ws/rest/v1/registration/net.ihe/Document/c0f1c318-7dd9-4338-af3f-4fc36d1bcce4/?PatientID=7612241234567%5e%5e%5eZAF%5eNI",
      "updated": "2014-07-24T11:32:26Z"
    }
  ]
}

Get Document

The Get Document transaction can be used to retrieve a specific encounter using their entryUUID as a reference. In addition the patientID also needs to be specified, and a document will not be returned if the patientID does not match the id linked to the document. See Save Encounter for reference on where the entryUUID comes from, as well as for details on how the patientID needs to be specified (see the MHD section).

To retrieve a document, a GET request is sent to https://{him-server}/ws/rest/v1/registration/net.ihe/Document/${entryUUID}/?PatientID=${pid}. The entryUUID is specified without the urn:uuid: prefix and the patientID needs to be url encoded. If found, the CDA document will be returned.

For example, to retrieve the document with the entryUUID urn:uuid:d1329e63-0408-4f45-b5ba-35f9afa72a94 for the patient with id 7612241234567^^^ZAF^NI, the following request is sent: https://{him-server}/ws/rest/v1/registration/net.ihe/Document/d1329e63-0408-4f45-b5ba-35f9afa72a94/?PatientID=7612241234567%5e%5e%5eZAF%5eNI