MediRecords FHIR Implementation Guide
20221128 - ci-build


Condition

The MediRecords FHIR API supports the following Condition operations.

GET {API_URL}/v1/Condition

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

Query Parameters    
_count number Instruct the server regarding how many resources should be returned in a single page
abatement-date date Resolved Date of the condition in the format YYYY-MM-DD.
asserter reference Practitioner (id) or Patient (id) who has recorded the condition.
clinical-status token It denotes the clinical status of the condition. The acceptable values are active, inactive and resolved.
code token A valid SNOMED CT code that indicates a medical condition.
onset-date date Onset date of the condition in the format YYYY-MM-DD.
patient reference Patient(id) for whom the condition record is created
severity token It denotes the condition severity. The acceptable values are Mild, Moderate and Severe.
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 Condition instances in a Bundle that the logged-in user has access to. If no search criteria is provided, then all Condition instances that the logged-in user has access to will be returned.

By default, only active Conditions 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
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Read

GET {API_URL}/v1/Condition/{id}

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

Request Parameters  
id The logical id of the Condition 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/Condition

This API interface enables the client to create a Condition resource in MediRecords repository which is compliant with the MediRecords Condition 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 Condition 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 Condition 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/Condition/{id}

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

Request Parameters  
id The logical id of the Condition 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 Condition 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/Condition/{id}

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

Request Parameters  
id The logical id of the Condition 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 Condition resource.

Hub Event Application Trigger Event  
condition.created Occurs whenever a new condition record is created Example
condition.updated Occurs whenever a condition record is updated  
Bundle 
  Condition (1)
  Encounter (0..1)
  Patient (1)
  PractitionerRole (0..1)
  Practitioner (0..2)
  Organization (0..2)
   
condition.deleted Occurs whenever a condition record is deleted
Bundle 
  request (1) 
    url: DELETE Condition/{id}