FHIR API: Practitioner Creation v2
Pre-requisites
Resource:
POST /partners/fhir/stu3/api/v2/Practitioner
Authentication:
Endpoint is secured with mutual TLS. More information can be found here: API Authentication
API Request
Request Headers
| Name | Description | Type | Required | Example |
|---|---|---|---|---|
| org_id | Organization OID | String | Yes | 2.16.724.4.2 |
| x-origin-request-id | String | Request Unique ID generated by EMR middleware (UUID) | Yes | 5109d51b-421e-4746-b673-16e3fe2b3442 |
| client_id | Public identifier for organizations generated by Roche DC | String | Yes | 1234567890 |
| client_secret | Client related secret known only to the EMR and Roche DC | String | Yes | 1234567890 |
| Content-Type | json or fhir+json | String | Yes | application/json or application/fhir+json |
Profile overview
The list of profiles used in practitioner Creation:
- practitioner-v2 (mandatory)
Note
While creating a practitioner, the practitioner identifier value and the email must be unique.
Request Example
- Patient Request example with Type-1 diabetes condition:
curl --location --request POST 'https://api-services-eu.rochedcplatform.com/partners/fhir/stu3/api/v2/Practitioner' \ --header 'Content-Type: application/json' \ --header 'client_id: 1234567890' \ --header 'client_secret: 1234567890' \ --header 'org_id: 2.16.724.4.2' \ --data-raw '{ "resourceType": "Practitioner", "meta": { "profile": [ "http://roche.com/fhir/rdc/StructureDefinition/practitioner-v2" ] }, "identifier": [ { "system": "urn:oid:2.16.724.4.305", "value": "11111111H" } ], "name": [ { "family": "Smith", "given": [ "James" ] } ], "telecom": [ { "system": "email", "value": "jamessmith111@email.com" } ] }'
API Response
API code response
| HTTP Response Code | Description | Response Body | FHIR error code | FHIR error code description |
|---|---|---|---|---|
| 201 | Practitioner created | Practitioner | NA | NA |
| 400 | Request failed because of incorrect parameters, returns no data | OperationOutcome | required | Request failed because of incorrect parameters, returns no data |
| 400 | Request failed because of incorrect parameters, returns no data | OperationOutcome | structure | A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax. |
| 400 | Request failed because of incorrect parameters, returns no data | OperationOutcome | invalid | Content invalid against the specification or a profile. |
| 401 | Request failed with unauthorized access, returns no data | Empty | NA | NA |
| 405 | Method Not Allowed | Empty | NA | NA |
| 415 | Unsupported Media Type. | OperationOutcome | not-supported | Content-Type is not one of (application/json, application/fhir+json) |
| 422 | Conflict / User already exists | OperationOutcome | duplicate | The resource already exists. Please retrieve the fhir-id from the field details.text and use it to request an update to the existing resource. Note: the error response object also includes the expression field and practitioner.id in the details.text field. |
| 500 | Request failed with internal exception | OperationOutcome | exception | Internal server error. |
| 501 | Not implemented | Empty | NA | NA |
API Payload response
Successful response object:
{
"identifier": [
{
"system": "urn:oid:2.16.724.4.305",
"value": "11111111H"
}
],
"meta": {
"profile": [
"http://roche.com/fhir/rdc/StructureDefinition/practitioner-v2"
]
},
"name": [
{
"given": [
"James"
],
"family": "Smith"
}
],
"telecom": [
{
"system": "email",
"value": "jamessmith111@email.com"
}
],
"id": "sZX6uQW-VOH-0868",
"resourceType": "Practitioner"
}
Error response object:
As an example, If we try to create a record that already existis in Roche Diabetes Care (RDC), a 422 HTTP error status code is returned together the following response:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "duplicate",
"details": {
"text": "sZX6uQW-VOH-0868"
},
"diagnostics": "The resource already exists. Please retrieve the fhir-id from the field details.text and use it to request an update to the existing resource",
"expression": [
"Practitioner.identifier[0].value"
]
}
]
}
Note
issue.details.text returns the practitioner FHIR ID that is already created.