{
  "resourceType": "StructureDefinition",
  "id": "fiphr-sd-medicationstatement-r4",
  "url": "http://phr.kanta.fi/StructureDefinition/fiphr-sd-medicationstatement-r4",
  "version": "0.2",
  "name": "FIPHRSDMedicationStatementR4",
  "title": "Finnish PHR Medication Statement Profile",
  "status": "draft",
  "experimental": true,
  "date": "2020-02-04",
  "description": "Finnish PHR profile for MedicationStatement Resource. Record of medication being taken by a patient.",
  "purpose": "Finnish PHR profile for MedicationStatement Resource. Record of medication being taken by a patient.",
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationStatement",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationStatement",
  "derivation": "constraint",
  "snapshot": {},
  "differential": {
    "element": [
      {
        "id": "MedicationStatement",
        "path": "MedicationStatement",
        "short": "Finnish PHR Medication Statement profile",
        "definition": "Finnish PHR profile for MedicationStatement Resource. Record of medication being taken by a patient.",
        "comment": "."
      },
      {
        "id": "MedicationStatement.meta.profile",
        "path": "MedicationStatement.meta.profile",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "MedicationStatement.meta.profile:fiphrProfile",
        "path": "MedicationStatement.meta.profile",
        "sliceName": "fiphrProfile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "http://phr.kanta.fi/StructureDefinition/fiphr-sd-medicationstatement-r4"
      },
      {
        "id": "MedicationStatement.language",
        "path": "MedicationStatement.language",
        "definition": "The base language in which the resource is written. FinnishPHR: codes from the code system urn:ietf:bcp:47",
        "min": 1,
        "binding": {
          "strength": "required",
          "description": "A code of human language."
        }
      },
      {
        "id": "MedicationStatement.text",
        "path": "MedicationStatement.text",
        "min": 1
      },
      {
        "id": "MedicationStatement.extension",
        "path": "MedicationStatement.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationStatement.extension:creatingApplication",
        "path": "MedicationStatement.extension",
        "sliceName": "creatingApplication",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-ext-creatingapplication"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.identifier",
        "path": "MedicationStatement.identifier",
        "definition": "A unique identifier assigned to this observation. \r\nFinnish PHR: At least one of the identifiers SHALL be globally unique (e.g. an uuid as the value and 'urn:ietf:rfc:3986' as the system).",
        "min": 1
      },
      {
        "id": "MedicationStatement.identifier.use",
        "path": "MedicationStatement.identifier.use",
        "definition": "The purpose of this identifier. \r\nFinnish PHR: The code 'official' SHALL be only used if the given identifier value is truly globally unique (e.g. an uuid as the value and 'urn:ietf:rfc:3986' as the system)."
      },
      {
        "id": "MedicationStatement.identifier.system",
        "path": "MedicationStatement.identifier.system",
        "min": 1
      },
      {
        "id": "MedicationStatement.identifier.value",
        "path": "MedicationStatement.identifier.value",
        "min": 1
      },
      {
        "id": "MedicationStatement.basedOn",
        "path": "MedicationStatement.basedOn",
        "max": "0"
      },
      {
        "id": "MedicationStatement.partOf",
        "path": "MedicationStatement.partOf",
        "max": "0"
      },
      {
        "id": "MedicationStatement.status",
        "path": "MedicationStatement.status",
        "short": "FinnishPHR: A code representing the patient or other source's judgment about the state of the medication used that this statement is about",
        "definition": "FinnishPHR: A code representing the patient or other source's judgment about the state of the medication used that this statement is about.",
        "comment": "FinnishPHR: Either \"active\", \"intended\" or \"not-taken\"",
        "requirements": "FinnishPHR: only \"active\" , \"intended\" or \"not-taken\" SHALL be used in Finnish PHR"
      },
      {
        "id": "MedicationStatement.statusReason",
        "path": "MedicationStatement.statusReason",
        "short": "Reason why medication was not given",
        "definition": "A code or text indicating why the medication was not taken.",
        "comment": "FinnishPHR: StatusReason is used only with satus \"not-taken\". Code preferred.",
        "max": "1"
      },
      {
        "id": "MedicationStatement.statusReason.coding",
        "path": "MedicationStatement.statusReason.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "definition": "FinnishPHR: fiphrStatusReason SHALL be used. Other reason codes MAY be used. \r\nA reference to a code defined by a terminology system."
      },
      {
        "id": "MedicationStatement.statusReason.coding:fiphrStatusReason",
        "path": "MedicationStatement.statusReason.coding",
        "sliceName": "fiphrStatusReason",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "description": "A coded concept indicating the reason for the status of the statement.",
          "valueSet": "http://phr.kanta.fi/ValueSet/fiphr-vs-reasonnottaken"
        }
      },
      {
        "id": "MedicationStatement.statusReason.coding:fiphrStatusReason.system",
        "path": "MedicationStatement.statusReason.coding.system",
        "min": 1,
        "fixedUri": "urn:oid:1.2.246.537.6.600"
      },
      {
        "id": "MedicationStatement.statusReason.coding:fiphrStatusReason.code",
        "path": "MedicationStatement.statusReason.coding.code",
        "min": 1
      },
      {
        "id": "MedicationStatement.statusReason.coding:fiphrStatusReason.display",
        "path": "MedicationStatement.statusReason.coding.display",
        "min": 1
      },
      {
        "id": "MedicationStatement.category",
        "path": "MedicationStatement.category",
        "max": "0"
      },
      {
        "id": "MedicationStatement.medication[x]",
        "path": "MedicationStatement.medication[x]",
        "short": "Finnish PHR: What medication was taken",
        "definition": "FinnishPHR: Identifies the medication being taken. Code and name of the medication.",
        "comment": "Finnish PHR: There are two options for using this field. Option 1: when the medication can be uniquely identified, SHALL be given the VNR code of the medication and the brand name of the medication which SHALL matct match the name in the pharmaceutical database, Option 2: when the medication can not be uniquely identified SHALL be given a text field, entered in medicationCodeableConcept.text.",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "MedicationStatement.medication[x].coding",
        "path": "MedicationStatement.medication[x].coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "short": "Finnish PHR: VNR coded medication",
        "definition": "Finnish PHR: VNR coded medication. FiphrMedication SHALL be used. Other medication codes MAY be used.",
        "comment": "Finnish PHR: There are two options for using this field. Option 1: when the medication can be uniquely identified, SHALL be given the VNR code of the medication and the brand name of the medication which SHALL matct match the name in the pharmaceutical database, Option 2: when the medication can not be uniquely identified SHALL be given a text field, entered in medicationCodeableConcept.text.",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication[x].coding:fiphrMedication",
        "path": "MedicationStatement.medication[x].coding",
        "sliceName": "fiphrMedication",
        "min": 1,
        "max": "1"
      },
      {
        "id": "MedicationStatement.medication[x].coding:fiphrMedication.system",
        "path": "MedicationStatement.medication[x].coding.system",
        "short": "Finnish PHR: VNR code system",
        "definition": "Finnish PHR: VNR code system",
        "min": 1,
        "fixedUri": "urn:oid:1.2.246.537.6.55"
      },
      {
        "id": "MedicationStatement.medication[x].coding:fiphrMedication.code",
        "path": "MedicationStatement.medication[x].coding.code",
        "short": "Finnish PHR: VNR code defined by VNR code system",
        "definition": "Finnish PHR: VNR code defined by VNR code system",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication[x].coding:fiphrMedication.display",
        "path": "MedicationStatement.medication[x].coding.display",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication[x].text",
        "path": "MedicationStatement.medication[x].text",
        "short": "Finnish PHR: Name of the medication",
        "definition": "Finnish PHR: Name of the medication",
        "min": 1
      },
      {
        "id": "MedicationStatement.subject",
        "path": "MedicationStatement.subject",
        "short": "FinnishPHR: The person who is/was taking the medication.",
        "definition": "FinnishPHR: The person who is/was taking the medication.",
        "comment": "FinnishPHR: Who this information is about. Usually the same person as the application user, but if the user is storing information on behalf of someone else, the reference to the actual person who is taking the medication.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-sd-patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.subject.reference",
        "path": "MedicationStatement.subject.reference",
        "min": 1
      },
      {
        "id": "MedicationStatement.context",
        "path": "MedicationStatement.context",
        "max": "0"
      },
      {
        "id": "MedicationStatement.effective[x]",
        "path": "MedicationStatement.effective[x]",
        "short": "The date/time period when the medication was taken",
        "comment": "This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the Medication Statements. If the medication is still being taken at the time the statement is recorded, the \"end\" date will be omitted.",
        "min": 1
      },
      {
        "id": "MedicationStatement.dateAsserted",
        "path": "MedicationStatement.dateAsserted",
        "min": 1
      },
      {
        "id": "MedicationStatement.informationSource",
        "path": "MedicationStatement.informationSource",
        "definition": "The person who provided the information about the taking of this medication.",
        "comment": "Usually the same person as the application user.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://phr.kanta.fi/StructureDefinition/fiphr-sd-patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.informationSource.reference",
        "path": "MedicationStatement.informationSource.reference",
        "min": 1
      },
      {
        "id": "MedicationStatement.derivedFrom",
        "path": "MedicationStatement.derivedFrom",
        "max": "0"
      },
      {
        "id": "MedicationStatement.reasonCode",
        "path": "MedicationStatement.reasonCode",
        "definition": "FinnishPHR: If there is need to give details of the reason why medication is being/was taken, the details MAY be given in the MedicationStatement.reasonCode.text in text format (ie. stored in text element of codeableConcept). MedicationStatement.reasonCode.coding SHALL NOT be used.",
        "comment": "FinnishPHR: If there is need to give details of the reason why medication is being/was taken, the details MAY be given in the MedicationStatement.reasonCode.text in text format (ie. stored in text element of codeableConcept). MedicationStatement.reasonCode.coding SHALL NOT be used."
      },
      {
        "id": "MedicationStatement.reasonReference",
        "path": "MedicationStatement.reasonReference",
        "max": "0"
      },
      {
        "id": "MedicationStatement.note",
        "path": "MedicationStatement.note",
        "definition": "Extra information about the medication statement that is not conveyed by the other attributes."
      },
      {
        "id": "MedicationStatement.dosage.additionalInstruction",
        "path": "MedicationStatement.dosage.additionalInstruction",
        "comment": "Finnis PHR: use text element."
      },
      {
        "id": "MedicationStatement.dosage.additionalInstruction.coding",
        "path": "MedicationStatement.dosage.additionalInstruction.coding",
        "max": "0"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate",
        "path": "MedicationStatement.dosage.doseAndRate",
        "min": 1,
        "max": "1"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "min": 1
      }
    ]
  }
}