Exercise Solution: Create a Transaction and POST it
- Open Postman, Create a new POST request with this URL - https://fhir-bootcamp.medblocks.com/fhir/Patient

- In the
Body Tab, Make sure you select raw and JSON, and add the following Transaction payload. You are encouranged to make changes and play around with request payload and see how the server reacts to it.
{
"resourceType": "Bundle",
"type":"transaction",
"entry":[
{
"resource":{
"resourceType": "Patient",
"name":[{
"given": ["Johnathan Wick"],
"family": "Doe"
}],
"identifier":[{
"system":"Doggy",
"value": "dont-kill-my-dog"
}]
},
"request": {
"method": "PUT",
"url":"Patient?identifier=dont-kill-my-dog"
},
"fullUrl": "urn:uuid:f9b53a03-cdea-4d61-8ec3-99fffd5cc6ab"
},
{
"resource":{
"resourceType": "Observation",
"status": "final",
"code": {
"text": "Heart Rate"
},
"valueQuantity": {
"value": 72,
"unit": "beats/minute"
},
"subject": {
"reference": "Patient/urn:uuid:f9b53a03-cdea-4d61-8ec3-99fffd5cc6ab"
}
},
"request": {
"method": "POST"
}
},
{
"request":{
"method":"GET",
"url":"Patient?identifier=dont-kill-my-dog"
}
}
]
}

- In the given Payload the Patient
Johnathan Wick with Identifier dont-kill-my-dog will be created if he does not exist along with the Observation referenced to him. If he already exists in the database, only the Observation will be created referenced to him.