API - Create Patient
This API creates the patient record and his/her assigned care programme
Scope
This transaction involves the requestor sending a POST request to the FHIR service to submit a Bundle containing a Patient and CarePlan resources. The request is received by the FHIR Service that extracts and assemble the patient and care programme record as per the RCM HL7 FHIR Implementation Guide specification and creates the record.
Upon successful creation, the FHIR Service returns an HTTP response code (i.e 2xx) and the same Bundle with the Patient and CarePlan resources, together with the patient id.
For unsuccessful creation, the FHIR Service returns an HTTP response code (i.e 4xx or 5xx) and an OperationOutcome resource.
Interaction Diagram
Specification
The Create Patient and assigned CarePlan FHIR specification is based on the HL7 FHIR R5 extended operation. (Ref: https://www.hl7.org/fhir/operations.html)
Create Patient Request
The Create Patient Request will create a new patient and assigned clinical programme record,if one does not already exist in the repository. If there is already an existing record, the newly submitted version will replace the existing version in the repository.
The Patient-CarePlan Bundle Create Request creates a new resource in a server-assigned location. The create interaction is performed by an HTTP POST command as shown:
POST [baseURL]/$create-patient-careplan
Example Create Bundle Message
HTTP Method:
POST
Headers:
Content-Type: application/fhir+json
Address:
[baseURL]/$create-patient-careplan
Message Body:
Create Patient Response
Depending on the HTTP Status Code, the following resources will be sent back to the requestor.
HTTP Status Code | Resource | Example |
---|---|---|
201 Created | BundlePatientCarePlan | Bundle Patient CarePlan response |
4xx, 5xx | OperationOutcome | OperationOutcome |
Business Level Errors
This section details the business level errors exposed by OperationOutcome resource for this operation. Refer to API Error Handling for framework level errors.
For illustration only
http status code | code | details.coding.code | details.text |
---|---|---|---|
404 | not-found | E-10000 | No matching patient found based on NRIC, Date of Birth and Gender |
404 | not-found | E-10001 | Institution code for group organization is not found |
404 | not-found | E-10002 | Group Organization code is not found |
400 | business-rule | E-10003 | Patient is not currently enrolled to the organization |
400 | duplicate | E-10004 | An attempt was made to create a duplicate record |