{
  "resourceType": "StructureDefinition",
  "id": "biobankcy-sd-medicationsummary",
  "url": "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-medicationsummary",
  "name": "BIOBANKCYSDMedicationSummary",
  "title": "Profile: Medication Summary (biobank.cy)",
  "status": "draft",
  "publisher": "biobank.cy",
  "contact": [
    {
      "name": "Molecular Medicine Research Center (MMRC)",
      "telecom": [
        {
          "system": "email",
          "value": "biobank@ucy.ac.cy",
          "use": "work"
        }
      ]
    }
  ],
  "description": "Represents a statement on historic or current prescription of medications for a a donor (research subject) of the biobank.cy. These medication statements can be self-reported by the patient or reported by a medical doctor or nurse.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationStatement",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationStatement",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationStatement.status",
        "path": "MedicationStatement.status",
        "comment": "For medication statements reported to biobank.cy officers (e.g. nurses) use status = \"unknown\". \r\nFor medication statements drawn from the national EHR use the status reported in the EHR."
      },
      {
        "id": "MedicationStatement.medication[x]",
        "path": "MedicationStatement.medication[x]",
        "comment": "Need to update the value set with the biobank.cy reported medication list (in a new slice in Coding).",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.medication[x].coding",
        "path": "MedicationStatement.medication[x].coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationStatement.medication[x].coding:absentOrUnknownMedication",
        "path": "MedicationStatement.medication[x].coding",
        "sliceName": "absentOrUnknownMedication",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "description": "eHDSI Absent or Unknown Medication",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiabsentorunknownallergy"
        }
      },
      {
        "id": "MedicationStatement.medication[x].coding:absentOrUnknownMedication.system",
        "path": "MedicationStatement.medication[x].coding.system",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication[x].coding:absentOrUnknownMedication.code",
        "path": "MedicationStatement.medication[x].coding.code",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication[x].coding:absentOrUnknownMedication.display",
        "path": "MedicationStatement.medication[x].coding.display",
        "min": 1
      },
      {
        "id": "MedicationStatement.subject",
        "path": "MedicationStatement.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-donor",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-citizen"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.subject.reference",
        "path": "MedicationStatement.subject.reference",
        "min": 1
      },
      {
        "id": "MedicationStatement.context",
        "path": "MedicationStatement.context",
        "definition": "The encounter or episode of care that establishes the context for this MedicationStatement. The encounter shall be provided if the medication statement is created in the cotnext of a visit of a donor (or patient) in the biobnak.cy. Can be omitted when the profile is used to describe a medication summary pulled by the national EHR or other eHealth system.",
        "comment": "Can be omitted when the profile is used to describe a medication summary pulled by the national EHR or other eHealth system.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Encounter",
              "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-visit"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.context.reference",
        "path": "MedicationStatement.context.reference",
        "min": 1
      },
      {
        "id": "MedicationStatement.effective[x]",
        "path": "MedicationStatement.effective[x]",
        "definition": "The interval of time during which it is being asserted that the patient is/was/will be taking the medication .",
        "comment": "Use period to describe the interval of time during which the patient is/was/will be taking the medication. In case of pulling this info from the national EHR in a dateTime format, assign the dateTime to effectivePeriod.start and calculate the effectivePeriod.end by adding the national EHR's MedicationStatement.dosage.timing.repeat.bounds[x]:boundsDuration to the start date.",
        "type": [
          {
            "code": "Period"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.effective[x].start",
        "path": "MedicationStatement.effective[x].start",
        "min": 1
      },
      {
        "id": "MedicationStatement.dateAsserted",
        "path": "MedicationStatement.dateAsserted",
        "comment": "Report when this data resource was recorded in the data warehouse of the biobank.cy.",
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.informationSource",
        "path": "MedicationStatement.informationSource",
        "comment": "(1) If the medication statement is created based on Patient's input, reference to Patient (citizen or donor). (2) If the medication statement is pulled by the national EHR reference to Organization (NeHA).",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-citizen",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-donor"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.informationSource.reference",
        "path": "MedicationStatement.informationSource.reference",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage",
        "path": "MedicationStatement.dosage",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.dosage.timing",
        "path": "MedicationStatement.dosage.timing",
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.bounds[x]",
        "path": "MedicationStatement.dosage.timing.repeat.bounds[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.bounds[x]:boundsDuration",
        "path": "MedicationStatement.dosage.timing.repeat.bounds[x]",
        "sliceName": "boundsDuration",
        "type": [
          {
            "code": "Duration"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.bounds[x]:boundsDuration.value",
        "path": "MedicationStatement.dosage.timing.repeat.bounds[x].value",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.bounds[x]:boundsDuration.unit",
        "path": "MedicationStatement.dosage.timing.repeat.bounds[x].unit",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.bounds[x]:boundsDuration.system",
        "path": "MedicationStatement.dosage.timing.repeat.bounds[x].system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.bounds[x]:boundsDuration.code",
        "path": "MedicationStatement.dosage.timing.repeat.bounds[x].code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.frequency",
        "path": "MedicationStatement.dosage.timing.repeat.frequency",
        "comment": "How many times in the selected period/periodUnit the medication is/was/will be administrated. (e.g. frequency = 2 per period = 1 and periodUnit =\"d\"  means 2 times per day in the specified boundsPeriod or boundsDuration)."
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.period",
        "path": "MedicationStatement.dosage.timing.repeat.period",
        "comment": "How many times in the selected period/periodUnit the medication is/was/will be administrated. (e.g. frequency = 2 per period = 1 and periodUnit =\"d\"  means 2 times per day in the specified boundsPeriod or boundsDuration)."
      },
      {
        "id": "MedicationStatement.dosage.timing.repeat.periodUnit",
        "path": "MedicationStatement.dosage.timing.repeat.periodUnit",
        "comment": "How many times in the selected period/periodUnit the medication is/was/will be administrated. (e.g. frequency = 2 per period = 1 and periodUnit =\"d\"  means 2 times per day in the specified boundsPeriod or boundsDuration)."
      },
      {
        "id": "MedicationStatement.dosage.route",
        "path": "MedicationStatement.dosage.route",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationStatement.dosage.route.coding",
        "path": "MedicationStatement.dosage.route.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.route.coding.system",
        "path": "MedicationStatement.dosage.route.coding.system",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.route.coding.code",
        "path": "MedicationStatement.dosage.route.coding.code",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.route.coding.display",
        "path": "MedicationStatement.dosage.route.coding.display",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.route.coding:edqmRouteOfAdministration",
        "path": "MedicationStatement.dosage.route.coding",
        "sliceName": "edqmRouteOfAdministration",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsirouteofadministration"
        }
      },
      {
        "id": "MedicationStatement.dosage.route.coding:edqmRouteOfAdministration.system",
        "path": "MedicationStatement.dosage.route.coding.system",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.route.coding:edqmRouteOfAdministration.code",
        "path": "MedicationStatement.dosage.route.coding.code",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.route.coding:edqmRouteOfAdministration.display",
        "path": "MedicationStatement.dosage.route.coding.display",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]:doseQuantity",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "sliceName": "doseQuantity",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]:doseQuantity.value",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].value",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]:doseQuantity.unit",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].unit",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]:doseQuantity.system",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].system",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]:doseQuantity.code",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].code",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "description": "UCUM value set with units",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiunit"
        }
      }
    ]
  }
}