{
  "resourceType": "StructureDefinition",
  "url": "https://aiss-fhir.salut.gencat.cat/StructureDefinition/AISS-MedicationStatement",
  "name": "AISS-MedicationStatement",
  "status": "draft",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationStatement",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationStatement",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationStatement.medication",
        "path": "MedicationStatement.medication",
        "short": "Refèrencia a la medicació",
        "type": [
          {
            "code": "CodeableReference",
            "targetProfile": [
              "https://aiss-fhir.salut.gencat.cat/StructureDefinition/AISS-Medication"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.medication.concept",
        "path": "MedicationStatement.medication.concept",
        "binding": {
          "strength": "required",
          "valueSet": "https://aiss-fhir.salut.gencat.cat/ValueSet/AISS-ValueSet-Farmacs"
        }
      },
      {
        "id": "MedicationStatement.medication.concept.coding.system",
        "path": "MedicationStatement.medication.concept.coding.system",
        "short": "URL de SNOMED | OID del ATC | OID del DCSA",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication.concept.coding.code",
        "path": "MedicationStatement.medication.concept.coding.code",
        "short": "Codi del medicament",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication.concept.coding.display",
        "path": "MedicationStatement.medication.concept.coding.display",
        "short": "Descripció del medicament",
        "min": 1
      },
      {
        "id": "MedicationStatement.medication.concept.text",
        "path": "MedicationStatement.medication.concept.text",
        "short": "Nom comercial del fàrmac"
      },
      {
        "id": "MedicationStatement.medication.reference",
        "path": "MedicationStatement.medication.reference",
        "short": "Referència al fàrmac"
      },
      {
        "id": "MedicationStatement.subject",
        "path": "MedicationStatement.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://aiss-fhir.salut.gencat.cat/StructureDefinition/AISS-Patient"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.subject.identifier.type",
        "path": "MedicationStatement.subject.identifier.type",
        "binding": {
          "strength": "extensible",
          "description": "ValueSet de identificadors de persona AISS",
          "valueSet": "https://aiss-fhir.salut.gencat.cat/ValueSet/AISS-TiposDocumentosIdentificacionPersona"
        }
      },
      {
        "id": "MedicationStatement.subject.identifier.type.coding.system",
        "path": "MedicationStatement.subject.identifier.type.coding.system",
        "short": "URL de l'identificador"
      },
      {
        "id": "MedicationStatement.subject.identifier.type.coding.code",
        "path": "MedicationStatement.subject.identifier.type.coding.code",
        "short": "Codi de l'identificador"
      },
      {
        "id": "MedicationStatement.subject.identifier.type.coding.display",
        "path": "MedicationStatement.subject.identifier.type.coding.display",
        "short": "Descripció de l'identificador"
      },
      {
        "id": "MedicationStatement.subject.identifier.system",
        "path": "MedicationStatement.subject.identifier.system",
        "short": "OID del identificador",
        "min": 1
      },
      {
        "id": "MedicationStatement.subject.identifier.value",
        "path": "MedicationStatement.subject.identifier.value",
        "short": "Valor de l'identificdaodr",
        "min": 1
      },
      {
        "id": "MedicationStatement.effective[x]",
        "path": "MedicationStatement.effective[x]",
        "short": "Temps en que el medicament s'ha de prendre",
        "type": [
          {
            "code": "Period"
          }
        ]
      },
      {
        "id": "MedicationStatement.effective[x].start",
        "path": "MedicationStatement.effective[x].start",
        "short": "Data d'inici de la presa del medicament",
        "min": 1
      },
      {
        "id": "MedicationStatement.effective[x].end",
        "path": "MedicationStatement.effective[x].end",
        "short": "Data del final de la presa del medicament, en cas que existeixi"
      },
      {
        "id": "MedicationStatement.dateAsserted",
        "path": "MedicationStatement.dateAsserted",
        "short": "Data de la prescripció"
      },
      {
        "id": "MedicationStatement.dosage",
        "path": "MedicationStatement.dosage",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.text",
        "path": "MedicationStatement.dosage.text",
        "short": "Comentaris per el farmaceutic"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate",
        "path": "MedicationStatement.dosage.doseAndRate",
        "min": 1
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x]",
        "short": "Quantitat de medicament a prendre",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x].value",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].value",
        "short": "Número de dosi"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x].unit",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].unit",
        "short": "Unitat de dosi"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x].system",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].system",
        "short": "URL catàleg UCUM"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.dose[x].code",
        "path": "MedicationStatement.dosage.doseAndRate.dose[x].code",
        "short": "Unitat UCUM"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.rate[x]",
        "path": "MedicationStatement.dosage.doseAndRate.rate[x]",
        "short": "Freqüencia de la presa del medicament (posologia)",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.rate[x].value",
        "path": "MedicationStatement.dosage.doseAndRate.rate[x].value",
        "short": "Freqüència de la presa durant el periode"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.rate[x].unit",
        "path": "MedicationStatement.dosage.doseAndRate.rate[x].unit",
        "short": "Unitat de freqüència de la presa"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.rate[x].system",
        "path": "MedicationStatement.dosage.doseAndRate.rate[x].system",
        "short": "URL de UCUM"
      },
      {
        "id": "MedicationStatement.dosage.doseAndRate.rate[x].code",
        "path": "MedicationStatement.dosage.doseAndRate.rate[x].code",
        "short": "Unitat UCUM"
      }
    ]
  }
}