{
  "resourceType": "StructureDefinition",
  "id": "EPLabObservation-2b3ad220-d87a-4f2a-bf15-74c71069d03e",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Clinical.Diagnostics"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    }
  ],
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation",
  "version": "0.1.0",
  "name": "EPLabObservation",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "sct-concept",
      "uri": "http://snomed.info/conceptdomain",
      "name": "SNOMED CT Concept Domain Binding"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "sct-attr",
      "uri": "http://snomed.org/attributebinding",
      "name": "SNOMED CT Attribute Binding"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "short": "An observation on the patient",
        "definition": "Only the ones described here are authorized"
      },
      {
        "id": "Observation.id",
        "path": "Observation.id",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.\r\nIs assigned by the server, do not provide a value."
      },
      {
        "id": "Observation.meta",
        "path": "Observation.meta",
        "min": 1
      },
      {
        "id": "Observation.meta.id",
        "path": "Observation.meta.id",
        "max": "0"
      },
      {
        "id": "Observation.meta.versionId",
        "path": "Observation.meta.versionId",
        "max": "0"
      },
      {
        "id": "Observation.meta.lastUpdated",
        "path": "Observation.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "Observation.meta.source",
        "path": "Observation.meta.source",
        "max": "0"
      },
      {
        "id": "Observation.meta.profile",
        "path": "Observation.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation"
      },
      {
        "id": "Observation.meta.security",
        "path": "Observation.meta.security",
        "max": "0"
      },
      {
        "id": "Observation.meta.tag",
        "path": "Observation.meta.tag",
        "max": "0"
      },
      {
        "id": "Observation.implicitRules",
        "path": "Observation.implicitRules",
        "max": "0"
      },
      {
        "id": "Observation.language",
        "path": "Observation.language",
        "max": "0"
      },
      {
        "id": "Observation.text",
        "path": "Observation.text",
        "max": "0"
      },
      {
        "id": "Observation.contained",
        "path": "Observation.contained",
        "max": "0"
      },
      {
        "id": "Observation.identifier",
        "path": "Observation.identifier",
        "max": "0"
      },
      {
        "id": "Observation.basedOn",
        "path": "Observation.basedOn",
        "max": "0"
      },
      {
        "id": "Observation.partOf",
        "path": "Observation.partOf",
        "max": "0"
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "fixedCode": "final"
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "max": "0"
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "short": "The code of the observation",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPCodeableConcept"
            ]
          }
        ]
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "min": 1,
        "example": [
          {
            "label": "Date of last period",
            "valueCoding": {
              "code": "159",
              "system": "urn:oid:1.3.182.5.53"
            }
          },
          {
            "label": "Week of pregnancy",
            "valueCoding": {
              "code": "162",
              "system": "urn:oid:1.3.182.5.53"
            }
          },
          {
            "label": "Body weight",
            "valueCoding": {
              "code": "29463-7",
              "system": "http://loinc.org"
            }
          },
          {
            "label": "Body height",
            "valueCoding": {
              "code": "8302-2",
              "system": "http://loinc.org"
            }
          }
        ],
        "condition": [
          "val-obsLabCode"
        ],
        "constraint": [
          {
            "key": "val-obsLabCode",
            "severity": "error",
            "human": "Only the 4 possibilities shown in example are possible",
            "expression": "((code = \"159\" or code = \"162\") and system=\"urn:oid:1.3.182.5.53\") or ((code = \"29463-7\" or code = \"8302-2\") and system=\"http://loinc.org\")",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation"
          }
        ]
      },
      {
        "id": "Observation.code.text",
        "path": "Observation.code.text",
        "max": "0"
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "short": "The patient",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Observation.subject.id",
        "path": "Observation.subject.id",
        "max": "0"
      },
      {
        "id": "Observation.subject.reference",
        "path": "Observation.subject.reference",
        "short": "The patient referenced by its matricule",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "Patient?identifier=urn:oid:1.3.182.4.4|1904112000166"
          }
        ],
        "condition": [
          "val-patByMatricule"
        ],
        "constraint": [
          {
            "key": "val-patByMatricule",
            "severity": "error",
            "human": "The Patient SHALL be referenced by its matricule",
            "expression": "startsWith('Patient?identifier=urn:oid:1.3.182.4.4|') and length()=52",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation"
          }
        ]
      },
      {
        "id": "Observation.subject.type",
        "path": "Observation.subject.type",
        "max": "0"
      },
      {
        "id": "Observation.subject.identifier",
        "path": "Observation.subject.identifier",
        "max": "0"
      },
      {
        "id": "Observation.subject.display",
        "path": "Observation.subject.display",
        "max": "0"
      },
      {
        "id": "Observation.focus",
        "path": "Observation.focus",
        "max": "0"
      },
      {
        "id": "Observation.encounter",
        "path": "Observation.encounter",
        "max": "0"
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "definition": "Normally, this is the same date as the prescription",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "example": [
          {
            "label": "Example",
            "valueDateTime": "2021-11-24"
          }
        ]
      },
      {
        "id": "Observation.issued",
        "path": "Observation.issued",
        "max": "0"
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "short": "The health professional making this observation",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPractitioner"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Observation.performer.id",
        "path": "Observation.performer.id",
        "max": "0"
      },
      {
        "id": "Observation.performer.reference",
        "path": "Observation.performer.reference",
        "short": "A reference to the health professional",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "Practitioner?identifier=urn:oid:1.3.182.4.1|2777777717"
          }
        ],
        "condition": [
          "val-1"
        ],
        "constraint": [
          {
            "key": "val-1",
            "severity": "error",
            "human": "A Practitioner SHALL be referenced by its eHealthID",
            "expression": "startsWith('Practitioner?identifier=urn:oid:1.3.182.4.1|2') and length()=54",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabObservation"
          }
        ]
      },
      {
        "id": "Observation.performer.type",
        "path": "Observation.performer.type",
        "max": "0"
      },
      {
        "id": "Observation.performer.identifier",
        "path": "Observation.performer.identifier",
        "max": "0"
      },
      {
        "id": "Observation.performer.display",
        "path": "Observation.performer.display",
        "max": "0"
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "string"
          },
          {
            "code": "integer"
          },
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "max": "0"
      },
      {
        "id": "Observation.interpretation",
        "path": "Observation.interpretation",
        "max": "0"
      },
      {
        "id": "Observation.note",
        "path": "Observation.note",
        "max": "0"
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "max": "0"
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "max": "0"
      },
      {
        "id": "Observation.specimen",
        "path": "Observation.specimen",
        "max": "0"
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "max": "0"
      },
      {
        "id": "Observation.referenceRange",
        "path": "Observation.referenceRange",
        "max": "0"
      },
      {
        "id": "Observation.hasMember",
        "path": "Observation.hasMember",
        "max": "0"
      },
      {
        "id": "Observation.derivedFrom",
        "path": "Observation.derivedFrom",
        "max": "0"
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "max": "0"
      }
    ]
  }
}