Observation Resource

Observation is a FHIR resource that is "used to support diagnosis, monitor progress, determine baselines and patterns and even capture demographic characteristics." As such, Observations have a wide range of uses and show up in a wide range of places. FHIR Observations are mapped to OpenMRS Obs objects.

Supported Elements

The following properties are supported by the OpenMRS FHIR Module:

  • Observation.id
  • Observation.code
  • Observation.category
  • Observation.status
  • Observation.interpretation
  • Observation.issued
  • Observation.encounter
  • Observation.basedOn
  • Observation.subject
  • Observation.value[x]

OpenMRS ↔ FHIR Mapping

OpenMRS Data ModelFHIR Resource Element
Obs.uuid
Observation.id
Obs.concept
Observation.code
Obs.concept
Observation.category
Obs.status
Observation.status
Obs.interpretation
Observation.interpretation
Obs.dateCreated
Observation.issued
Obs.encounter
Observation.encounter
Obs.order
Observation.basedOn
Obs.person
Observation.subject
Obs.value[x]
Observation.value[x]

1 category is determined by a simple mapping table (fhir_observation_category_map) that maps between the FHIR observation category value-set (if possible) and a particular conceptClass. By default, the following categories will be mapped if the expected versions of them exist in the concept dictionary:

CategoryConcept Class
laboratory
Test
procedure
Procedure
exam
Finding

2 value[x] mappings between OMRS and Observation are largely one-to-one where possible. Numeric values are generally mapped to valueQuantity; coded observations are mapped to valueCodeableConcept, etc.

Code System Mapping

The FHIR2 module has a fairly generic system for mapping between OpenMRS concepts and observation codes. The FHIR2 module will send and accept codes from any coding system it knows about. A few of the common ones (note that these should usually be available by default):

URLCode System
http://loinc.orgLOINC
http://snomed.info/sctSNOMED CT
https://openconceptlab.org/orgs/CIEL/sources/CIELCIEL

In addition, the FHIR module will send and accept the concept UUID without any system as a reference to that concept. The FHIR module can be instructed to use other systems as well. Mappings between system URLs and the underlying OpenMRS concept sources are maintained in a simple mapping table (fhir_concept_source). Adding a new entry to the table will add a newly supported concept system.

Available RESTful Endpoints

Note: placeholder "{release}" below must be replaced by the FHIR Release - currently "R3" and "R4" are implemented. See more on the  FHIR Release support  page.

GET

URLDescription
/ws/fhir2/{release}/Observation
Gets all observations
/ws/fhir2/{release}/Observation/{uuid}
Gets a specific observation
/ws/fhir2/{release}/Observation?{query}
Searches for observations matching the provided criteria

Supported Search Parameters

ParameterValue TypeDescription
date
dateSearches for observations by the observation date and time
code
tokenSearches for observations with particular codes (concepts)
category
tokenSearches for observations by the observation category
encounter
reference

Searches the encounter in which this observation was recorded

subject
referenceSearches for observations by a given patient
subject.identifier
tokenSearches for observations by the patient identifier
subject.given
stringSearches for observations based on the patient's given name(s)
subject.family
stringSearches for observations based on the patient's family name
subject.name
stringSearches for observations based on the patient's full or partial name
patient
referenceSearches for observations by a given patient
patient.identifier
tokenSearches for observations by the patient identifier
patient.given
stringSearches for observations based on the patient's given name(s)
patient.family
stringSearches for observations based on the patient's family name
patient.name
stringSearches for observations based on the patient's full or partial name
has-member
referenceSearches for an observation group that contains a given observation
has-member.code
tokenSearches for an observation group that contains an observation with the provided code
value-concept
tokenSearches for an observation whose value is a concept that matches the provided concept code
value-date
dateSearches for an observation whose value is a date by the specified date range.
_id

Searches based on the exact UUID of the person record
_lastUpdated
dateSearches based on the the dateCreated field for the observation record

1 See the notes on category mapping above

Supported _includes

IncludeDescription
Observation:encounter
Includes the encounter for any observations in the result set
Observation:patient

Includes the patient for any observations in the result set

Observation:has-member
Includes the observation group members for any observation group in the result set

Supported _revincludes

IncludeDescription
Observation:has-member
Includes the observation group observation for any searches that match an observation group memeber
DiagnosticReport:result

Includes the diagnostic report (if any) for which this observation is a result

POST

URLDescription
/ws/fhir2/{release}/Observation
Creates a new observation

DELETE

URLDescription
/ws/fhir2/{release}/Observation/{uuid}
Deletes (voids) the specified observation