Observation
Semantical type
The “code” field of the resource is used to determine the semantical type of the resource. It is mandantory. Look at the List of registered codes for a complete list of codes registered in MIDATA. Include the required codes into your applications access filter if you need to use this resource.
Resource owner
If the resource contains a subject which is a Patient or Practitioner that user is the owner of the resource. Otherwise the creator of the resource is the owner.
Default value for “subject”
If a resource with no subject field is send to MIDATA, the backend will set the subject to the current user.
Example resource
Here is an example Observation that could be created on MIDATA. If the resource has no “subject” field (like in this example) the current user will be set as subject.
{
"resourceType": "Observation",
"status": "preliminary",
"category": [
{
"coding": [
{
"system": "http://hl7.org/fhir/observation-category",
"code": "fitness",
"display": "Fitness Data"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "29463-7",
"display": "Weight"
}
]
},
"effectiveDateTime": "2019-07-01",
"valueQuantity": {
"value": 81,
"unit": "kg",
"system": "http://unitsofmeasure.org",
"code": "kg"
}
}
When the resource is read back from the server it might look like this:
{
"resourceType":"Observation",
"id":"5d1abaabcf569327b13359b2",
"meta":{
"extension":[
{
"url":"http://midata.coop/extensions/metadata",
"extension":[
{
"url":"app",
"valueCoding":{
"system":"http://midata.coop/codesystems/app",
"code":"fitbit",
"display":"Fitbit"
}
},
{
"url":"creator",
"valueReference":{
"reference":"Patient/57ded6c179c7212042b29984",
"display":"Egon Mueller"
}
}
]
}
],
"versionId":"0",
"lastUpdated":"2019-07-02T04:00:11.000+02:00"
},
"status":"preliminary",
"category":[
{
"coding":[
{
"system":"http://hl7.org/fhir/observation-category",
"code":"fitness",
"display":"Fitness Data"
}
]
}
],
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"29463-7",
"display":"Weight"
}
]
},
"subject":{
"reference":"Patient/57ded6c179c7212042b29984",
"display":"Egon Mueller"
},
"effectiveDateTime":"2019-07-01",
"valueQuantity":{
"value":81,
"unit":"kg",
"system":"http://unitsofmeasure.org",
"code":"kg"
}
}
Read
Read a single Observation by id.
Request:
[GET] /fhir/Observation/<id>
Read specific version
Read a specific version of a single Observation by id.
Request:
[GET] /fhir/Observation/<id>/_history/<version>
Retrieve history
Retrieve all versions of a single resource.
Request:
[GET] /fhir/Observation/<id>/_history
Search
Search for resources of type Observation
Request:
[GET] /fhir/Observation?searchParams
List of supported search parameters:
Supported query parameters:
Name | Type | Description |
---|---|---|
_id | string | The resource identity |
_lastUpdated | date | Only return resources which were last updated as specified by the given range |
_page | string | |
based-on | reference | Reference to the service request. |
category | token | The classification of the type of observation |
code | token | The code of the observation type |
code-value-concept | composite | Code and coded value parameter pair |
code-value-date | composite | Code and date/time value parameter pair |
code-value-quantity | composite | Code and quantity value parameter pair |
code-value-string | composite | Code and string value parameter pair |
combo-code | token | The code of the observation type or component type |
combo-code-value-concept | composite | Code and coded value parameter pair, including in components |
combo-code-value-quantity | composite | Code and quantity value parameter pair, including in components |
combo-data-absent-reason | token | The reason why the expected value in the element Observation.value[x] or Observation.component.value[x] is missing. |
combo-value-concept | token | The value or component value of the observation, if the value is a CodeableConcept |
combo-value-quantity | quantity | The value or component value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data) |
component-code | token | The component code of the observation type |
component-code-value-concept | composite | Component code and component coded value parameter pair |
component-code-value-quantity | composite | Component code and component quantity value parameter pair |
component-data-absent-reason | token | The reason why the expected value in the element Observation.component.value[x] is missing. |
component-value-concept | token | The value of the component observation, if the value is a CodeableConcept |
component-value-quantity | quantity | The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data) |
data-absent-reason | token | The reason why the expected value in the element Observation.value[x] is missing. |
date | date | Obtained date/time. If the obtained element is a period, a date that falls in the period |
derived-from | reference | Related measurements the observation is made from |
device | reference | The Device that generated the observation data. |
encounter | reference | Encounter related to the observation |
focus | reference | The focus of an observation when the focus is not the patient of record. |
has-member | reference | Related resource that belongs to the Observation group |
identifier | token | The unique id for a particular observation |
method | token | The method used for the observation |
part-of | reference | Part of referenced event |
patient | reference | The subject that the observation is about (if patient) |
performer | reference | Who performed the observation |
specimen | reference | Specimen used for this observation |
status | token | The status of the observation |
subject | reference | The subject that the observation is about |
value-concept | token | The value of the observation, if the value is a CodeableConcept |
value-date | date | The value of the observation, if the value is a date or period of time |
value-quantity | quantity | The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data) |
value-string | string | The value of the observation, if the value is a string, and also searches in CodeableConcept.text |
Create
Create a new resource of type Observation.
Request:
[POST] /fhir/Observation
Update
Updates a resource of type Observation.
Request:
[PUT] /fhir/Observation/<id>
Operations
The resource suppports the $lastn operation. View spec. for $lastn