Patient
Patients are an essential part of Atticus. On this page, we'll dive into the different patient endpoints you can use to manage patients programmatically. We'll look at how to query, create, update, and delete patients.
The Patient model
The Patient model contains all the basic demographic information about a patient, including their name, birth date, gender and identifiers.
Properties
The Patient model conforms to the FHIR Patient resource. The following properties are available:
- Name
resourceType
*- Type
- 'Patient'
- Description
The FHIR resource type. This must be set to
'Patient'
.
- Name
identifier
- Type
- Identifier[]
- Description
An array of
Identifier
objects for this patient (e.g. MRN, SSN). This is the place to store EHR identifiers or hospital identifiers for the patient. More information about identifiers in Atticus can be found here.
- Name
birthDate
- Type
- date
- Description
The patient's date of birth.
- Name
gender
- Type
- code
- Description
Administrative gender. Possible values are:
male
female
other
unknown
Create a new Patient
This endpoint allows you to create a new Patient.
Request
curl -X POST https://reports.tiro.health/fhir/r5/Patient \
-H "Authorization: Basic {{apikey}}" \
-H "Content-Type: application/fhir+json" \
-d '{
"resourceType": "Patient",
"name": [{
"given": ["John"],
"family": "Smith"
}],
"birthDate": "1970-01-01",
"gender": "male",
"identifier": [{
"system": "http://hospital.example.org/identifiers/mrn",
"value": "12345"
}]
}'
Response
{
"resourceType": "Patient",
"id": "1",
"name": [{
"given": ["John"],
"family": "Smith"
}],
"birthDate": "1970-01-01",
"gender": "male",
"identifier": [{
"system": "http://hospital.example.org/identifiers/mrn",
"value": "12345"
}]
}
Conditionally update a Patient
This endpoint allows you to update a Patient by matching on specific criteria. The search criteria are provided as query parameters, and the updated Patient data is provided in the request body. When no Patient is found that matches the search criteria, a new Patient is created.
Request
curl -X PUT "https://reports.tiro.health/fhir/r5/Patient?identifier=http://hospital.example.org/identifiers/mrn|12345" \
-H "Authorization: Basic {{apikey}}" \
-H "Content-Type: application/fhir+json" \
-d '{
"resourceType": "Patient",
"name": [{
"given": ["John"],
"family": "Smith"
}],
"birthDate": "1970-01-01",
"gender": "male",
"identifier": [{
"system": "http://hospital.example.org/identifiers/mrn",
"value": "12345"
}]
}'
Response
{
"resourceType": "Patient",
"id": "1",
"name": [{
"given": ["John"],
"family": "Smith"
}],
"birthDate": "1970-01-01",
"gender": "male",
"identifier": [{
"system": "http://hospital.example.org/identifiers/mrn",
"value": "12345"
}]
}
Update a new Patient
This endpoint allows you to update an existing Patient by providing both the Patient id and the updated Patient data. The entire Patient resource must be included in the request.
Request
curl -X PUT https://reports.tiro.health/fhir/r5/Patient/1 \
-H "Authorization: Basic {{apikey}}" \
-H "Content-Type: application/fhir+json" \
-d '{
"resourceType": "Patient",
"id": "1",
"name": [{
"given": ["John"],
"family": "Smith"
}],
"birthDate": "1970-01-01",
"gender": "male",
"identifier": [{
"system": "http://hospital.example.org/identifiers/mrn",
"value": "12345"
}]
}'
Response
{
"resourceType": "Patient",
"id": "1",
"name": [{
"given": ["John"],
"family": "Smith"
}],
"birthDate": "1970-01-01",
"gender": "male",
"identifier": [{
"system": "http://hospital.example.org/identifiers/mrn",
"value": "12345"
}]
}
Get an existing Patient
This endpoint allows you to retrieve an existing Patient by providing the Patient id.
Request
curl -G https://reports.tiro.health/fhir/r5/Patient/1 \
-H "Authorization: Basic {{apikey}}" \
-H "Content-Type: application/fhir+json" \
Delete an existing Patient
This endpoint allows you to delete an existing Patient by providing the Patient id. Once a Patient is deleted, it cannot be recovered.
Request
curl -X DELETE https://reports.tiro.health/fhir/r5/Patient/1 \
-H "Authorization: Basic {{apikey}}" \
-H "Content-Type: application/fhir+json" \
Response
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "information",
"code": "informational",
"diagnostics": "Successfully deleted Patient/1"
}
]
}