MediRecords FHIR Implementation Guide
1.3.0 - release


Encounter

The MediRecords FHIR API supports the following Encounter operations.

GET {API_URL}/v1/Encounter

This API interface enables the client to search Encounter instances from MediRecords repository. This is in compliance with this Encounter profile.

Query Parameters    
_count number Instruct the server regarding how many resources should be returned in a single page
class token Denotes the encounter class.
date date Represents the encounter start date (date gt) and the encounter end date (date lt) in the format YYYY-MM-DD
Example 1:
date=gt2013-01-14T10:00&date=lt2013-01-18T10:00
The above example will display all the encounter records whose start date is greater than 2013-01-14 and whose end date is less than 2013-01-18.
Example 2:
date=2013-01-14
The second example display all the encounter records whose start date and end date are in the range 2013-01-14.
patient reference Patient(id) for whom the encounter record is created
practitioner reference Denotes the practitioner(id) who was involved in the encounter.
reason-code token Denotes the reason (SNOMEDCT code) the encounter takes place.
service-provider reference Practice(id) where the encounter was created.
status token Denotes the status of the encounter.
Allowed values:
in-progress | finished
Request Headers  
X-Request-Id A unique id to for the request/response assigned by either client or server. The expected format is UUID. If the client doesn’t supply this id, it is expected that server SHALL assign one.

Response

The server returns matching Encounter instances in a Bundle that the logged-in user has access to. If no search criteria is provided, then all Encounter instances that the logged-in user has access to will be returned.

By default, only active Encounter’s list will be provided in the search result.

In an error situation, server SHALL return OperationOutcome detailing the error with the appropriate HTTP Error code as follows.

Status Text
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Read

GET {API_URL}/v1/Encounter/{id}

This API interface enables the client to read an Encounter resource from MediRecords repository which is compliant with this Encounter profile.

Request Parameters  
id The logical id of the Encounter resource

Response

In an error situation, server SHALL return OperationOutcome detailing the error with the appropriate HTTP Error code as follows.

Status Text
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Create

POST {API_URL}/v1/Encounter

This API interface enables the client to create a Encounter resource in MediRecords repository which is compliant with this Encounter profile.

Request Parameters  
_format This parameter allows a client to override the accept header value when it is unable to set it correctly due to internal limitations (e.g. XSLT usage). the values xml, text/xml, application/xml, and application/fhir+xml SHALL be interpreted to mean the XML format, the codes json, application/json and application/fhir+json SHALL be interpreted to mean the JSON format. The _format parameter does not override the Content-Type header for the type of the body of a POST request
Request Headers  
Prefer The client can indicate how the response can be returned. return=minimal indicates that the client asks to return no body. return=representation indicates that the client asks to return the full resource. return=OperationOutcome indicates that the client asks server to return an OperationOutcome resource containing hints and warnings about the operation rather than the full resource
X-Request-Id A unique id to for the request/response assigned by either client or server. The expected format is UUID. If the client doesn’t supply this id, it is expected that server SHALL assign one.

Request Body

Request body that creates a new Encounter resource

Response

In an error situation, server SHALL return OperationOutcome detailing the error with the appropriate HTTP Error code as follows.

Status Text  
201 Created The response to this depends on what is specified in “Prefer” header or what is server’s default behaviour. By default this returns the requested Encounter instance with the logical id populated in it.
400 Bad Request Resource could not be parsed or failed basic FHIR validation rules
401 Unauthorized  
403 Forbidden  
404 Not Found Resource type not supported, or not a FHIR end-point
409 Conflict  
422 Unprocessable Entity The proposed resource violated applicable FHIR profiles or server business rules.
500 Internal Server Error  

Update

PUT {API_URL}/v1/Encounter/{id}

This API interface enables the client to update a specific Encounter resource instance existed in MediRecords repository which is compliant with this profile.

Request Parameters  
id The logical id of the Encounter resource
Request Headers  
X-Request-Id A unique id to for the request/response assigned by either client or server. The expected format is UUID. If the client doesn’t supply this id, it is expected that server SHALL assign one.

Request Body

Request body that updates an existing Encounter record details

Response

In an error situation, server SHALL return OperationOutcome detailing the error with the appropriate HTTP Error code as follows.

Status Text
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
409 Conflict
422 Unprocessable Entity
500 Internal Server Error

Delete

DELETE {API_URL}/v1/Encounter/{id}

This API interface enables the client to delete a specific Encounter resource instance from MediRecords repository.

Request Parameters  
id The logical id of the Encounter resource
Request Headers  
X-Request-Id A unique id to for the request/response assigned by either client or server. The expected format is UUID. If the client doesn’t supply this id, it is expected that server SHALL assign one.

Response

In an error situation, server SHALL return OperationOutcome detailing the error with the appropriate HTTP Error code as follows.

Status Text
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Webhook

The following table provides the FHIR Webhook event types generated for the Encounter resource.

Hub Event Application Trigger Event  
encounter.created Occurs whenever a new encounter record is created Example
encounter.updated Occurs whenever an encounter record is updated  
Bundle  
  Encounter (1) 
  Patient (1) 
  PractitionerRole (0..1) 
  Practitioner (0..2) 
  Organization (0..2)