Skip to content

Instantly share code, notes, and snippets.

@jmandel
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmandel/3f5fa196295ac3799325 to your computer and use it in GitHub Desktop.
Save jmandel/3f5fa196295ac3799325 to your computer and use it in GitHub Desktop.
Create a new Observation (and possibly a new Patient, if needed)

Goal of the transaction below: "Always create a new lab Observation, and also -- if needed -- create a new Patient to serve as the subject of that observation".

{
"resourceType": "Bundle",
"id": "bundle-transaction",
"type": "transaction",
"base": "http://client-specific-namespace.org/base",
"entry": [
{
"resource": {
"resourceType": "Patient",
"id": "temporary-id-one",
"identifier": {
"system": "http://hospital.org/mrn",
"value": "123456"
}
"gender": ...
},
"transaction": {
"method": "POST",
"url": "Patient?identifier=http://hospital.org/mrn|123456"
}
},
{
"resource": {
"resourceType": "Observation",
"subject": {
"reference": "Patient/temporary-id-one"
}
"appliesDateTime": ...
},
"transaction": {
"method": "POST",
"url": "Observation"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment