Patient create
Patient creation API definition
In order to create a Patient it is required to send a Bundle Resource composed by Patient and Condition Resource.
Method | Endpoint | URI Parameters | Request Headers | Request Body | Response Body | Security |
---|---|---|---|---|---|---|
POST | https://[host]/partners/fhir/stu3/api/[Resource] | Resource: Bundle | org_id : Organization OID x-origin-request-id: Request unique id, generated by EMR middleware client_id : Public identifier for organizations generated by Roche DC client_secret : Client related secret known only to the EMR and Roche DC Content-Type: Default value application/json |
Bundle Resource - Please check Request Definition | Please check Response Definition | Mutual TLS Authentication (mTLS) |
Complete FHIR API Specification here
Request Definition
- Please find Patient Resource Schema Overview here
- Please find Condition Resource Schema Overview here
- Please find Sample Bundle here
- Please find Bundle Example cURL Request here
- Please find FHIR STU3 Schema here
Response Definition
Success response: On successful creation of Patient through API will return HTTP 200 Status Code and Roche internal ID is returned for Bundle ID and Patient ID in the response body.
- Please find Example Response here
Error response: Please check error codes in validation section below.
Data Validation
Validation | Error code |
---|---|
A required element is missing. | required |
A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax | structure |
An internal timeout has occurred. | timeout |
An unexpected internal error has occurred. | exception |
Content invalid against the specification or a profile. | invalid |
Provided content is too long (typically, this is a denial of service protection type of error). | too-long |
Please find Error handling details here
Response Time
The average and the worst case scenario response time for the patient creation API are:
Response Time (ms) | |
---|---|
Average | 1507.17 |
Worst case scenario | 10000 |
Sample Bundle
Scenario: A patient creation request is sent with the following details:
- Type-1 diabetes
- Other details like name, phone number etc as mentioned in the sample below
Example Request
Example cURL Request:
curl -L -X POST 'https://api-services-demo.rochedcplatform-sandbox.com/partners/fhir/stu3/api/Patient' -H 'client_id: {CLIENT_ID}' -H 'client_secret: {CLIENT_SECRET}' -H 'content-type: application/json' -H 'org_id: {ORG_ID}' -H 'x-request-id: 12345678' -H 'Accept: application/json' --data-raw '{
"resourceType": "Bundle",
"id": "99b4cdb5-1f5d-4cff-8199-84e7b56ee679",
"type": "message",
"entry": [
{
"resource": {
"resourceType": "MessageHeader",
"id": "88a37162-3d7c-41c3-89ab-6e25fd68ba00",
"event": {
"code": "new-bundle",
"system": "http://roche.com/fhir/rdc/message-type",
"display": "New bundle generated"
},
"source": {
"endpoint": "<Organization OID>",
"software": "EMR middleware",
"version": "1.0.0"
},
"timestamp": "2020-03-27T12:21:39.471Z",
"meta": {
"profile": [
"http://roche.com/fhir/rdc/StructureDefinition/message-header"
]
}
}
},
{
"resource": {
"id": "abdca832-a616-454b-b5c7-f1ed1fb45d4e",
"resourceType": "Patient",
"meta": {
"profile": [
"http://roche.com/fhir/rdc/StructureDefinition/patient-v2"
]
},
"identifier": [
{
"system": "urn:oid:2.16.724.4.41",
"value": "AAAA1234567890"
}
],
"active": "true",
"name": [
{
"family": "Pérez Fuster",
"given": [
"Manolo"
]
}
],
"telecom": [
{
"system": "phone",
"use": "home",
"value": "123456789"
}
],
"gender": "male",
"birthDate": "1975-06-16"
}
},
{
"resource": {
"resourceType": "Condition",
"id": "abdca832-a616-454b-b5c7-f1ed1fb4ght",
"meta": {
"profile": [
"http://roche.com/fhir/rdc/StructureDefinition/condition"
]
},
"clinicalStatus": "active",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "46635009",
"display": "Diabetes mellitus type 1"
}
]
},
"subject": {
"reference": "Patient/abdca832-a616-454b-b5c7-f1ed1fb45d4e"
}
}
}
]
}'
Example Response
On successful creation of Patient through API will return HTTP 200 Status Code and Roche internal ID is returned for Bundle ID and Patient ID in the response body.
{
"resourceType": "Bundle",
"id": "AAAA1234567890",
"type": "message",
"entry": [
{
"resource": {
"resourceType": "MessageHeader",
"id": "88a37162-3d7c-41c3-89ab-6e25fd68ba00",
"meta": {
"profile": [
"http://roche.com/fhir/rdc/StructureDefinition/message-header"
]
},
"event": {
"system": "http://roche.com/fhir/rdc/message-type",
"code": "new-bundle",
"display": "New bundle generated"
},
"timestamp": "2020-03-27T12:21:39.471Z",
"source": {
"name": "