format: "0.2.0"
version: "0.0.1"

fhirConfig:
  # For this Resource: https://www.hl7.org/fhir/observation-example.json.html
  resource: "Observation"
  condition:
    - targetRoot: "$fhirResource"
      targetAttribute: "category.coding.code"
      operator: "one of"
      criteria: "[bmi]"
openEhrConfig:
  archetype: "openEHR-EHR-OBSERVATION.body_mass_index.v2"

mappings:
  - name: "bmi"
    with:
      fhir: "$fhirResource.value"
      openehr: "$openEhrArchetype.body_mass_index.any_event.body_mass_index"
      type: "QUANTITY"
    condition:
      targetRoot: "$fhirResource"
      targetAttribute: "code.coding.code"
      operator: "one of"
      criteria: "[$loinc.39156-5]"
  - name: "time"
    with:
      fhir: "$fhirResource.effective"
      openehr: "$openEhrArchetype.body_mass_index.any_event.time"
      type: "DATETIME"