{
  "resourceType": "StructureDefinition",
  "id": "EviPrevObservation",
  "meta": {
    "versionId": "4",
    "lastUpdated": "2018-05-15T10:08:31.002+00:00"
  },
  "url": "https://cdss.eviprev.ch/fhir/StructureDefinition/Observation",
  "version": "1.1",
  "name": "eviprevObservation",
  "title": "EviPrev Observation",
  "status": "draft",
  "date": "2018-01-25T08:59:50.042+00:00",
  "publisher": "Arpage AG",
  "contact": [
    {
      "name": "Patrick Husi",
      "telecom": [
        {
          "system": "email",
          "value": "patrick.husi@arpage.ch"
        }
      ]
    }
  ],
  "description": "EviPrev Observation for all input fields",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "constraint": [
          {
            "key": "eviprev-obs-1",
            "severity": "error",
            "human": "Either dataAbsentReason or Observation.value[x] should be present",
            "expression": "dataAbsentReason.exists() or value.exists()",
            "xpath": "exists(f:dataAbsentReason) or (exists(*[starts-with(local-name(.), 'value')]))"
          }
        ]
      },
      {
        "id": "Observation.status",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint",
            "valueString": "default: final"
          }
        ],
        "path": "Observation.status",
        "fixedCode": "final"
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "description": "Coding must be a valid CDSS in input parameter",
          "valueSetReference": {
            "reference": "https://cdss.eviprev.ch/fhir/ValueSet/cdss-input-parameter"
          }
        }
      },
      {
        "id": "Observation.code.coding.system",
        "path": "Observation.code.coding.system",
        "min": 1
      },
      {
        "id": "Observation.code.coding.code",
        "path": "Observation.code.coding.code",
        "min": 1
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://cdss.eviprev.ch/fhir/StructureDefinition/Patient",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Observation.subject.reference",
        "path": "Observation.subject.reference",
        "min": 1
      },
      {
        "id": "Observation.subject.identifier",
        "path": "Observation.subject.identifier",
        "max": "0"
      },
      {
        "id": "Observation.effective[x]:effectiveDateTime",
        "path": "Observation.effectiveDateTime",
        "sliceName": "effectiveDateTime",
        "min": 1,
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner",
            "aggregation": [
              "referenced"
            ]
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Organization",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "type": [
          {
            "code": "Quantity",
            "profile": "https://cdss.eviprev.ch/fhir/StructureDefinition/observationQuantity"
          },
          {
            "code": "CodeableConcept",
            "profile": "https://cdss.eviprev.ch/fhir/StructureDefinition/observationCodeableConcept"
          },
          {
            "code": "string"
          },
          {
            "code": "boolean"
          }
        ]
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "max": "0"
      }
    ]
  }
}