{
  "resourceType": "StructureDefinition",
  "url": "http://resepti.kanta.fi/fhir/StructureDefinition/MedicationListDocumentReference",
  "version": "0.1",
  "name": "MedicationListDocumentReference",
  "title": "MedicationListDocumentReference",
  "status": "draft",
  "description": "Lääkityslistan tulostehakujen palautuksessa käytettävä MedicationListDocumentReference-profiili.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DocumentReference",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference.meta",
        "path": "DocumentReference.meta"
      },
      {
        "id": "DocumentReference.meta.profile",
        "path": "DocumentReference.meta.profile",
        "fixedCanonical": "http://resepti.kanta.fi/fhir/StructureDefinition/MedicationListDocumentReference"
      },
      {
        "id": "DocumentReference.masterIdentifier",
        "path": "DocumentReference.masterIdentifier",
        "max": "0"
      },
      {
        "id": "DocumentReference.identifier",
        "path": "DocumentReference.identifier",
        "max": "0"
      },
      {
        "id": "DocumentReference.status",
        "path": "DocumentReference.status",
        "definition": "Käytetään vakiona arvoa: current",
        "fixedCode": "current"
      },
      {
        "id": "DocumentReference.docStatus",
        "path": "DocumentReference.docStatus",
        "max": "0"
      },
      {
        "id": "DocumentReference.type",
        "path": "DocumentReference.type",
        "max": "0"
      },
      {
        "id": "DocumentReference.category",
        "path": "DocumentReference.category",
        "max": "0"
      },
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "short": "Viittaus MedicationListPatient resurssiin",
        "definition": "Viittaus sen potilaan tietoihin, mitä tuloste koskee. Potilaan tiedoista palautuu henkilötunnus tai syntymäaika, suku- ja etunimet.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://resepti.kanta.fi/fhir/StructureDefinition/MedicationListPatient"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "DocumentReference.date",
        "path": "DocumentReference.date",
        "max": "0"
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "max": "0"
      },
      {
        "id": "DocumentReference.authenticator",
        "path": "DocumentReference.authenticator",
        "max": "0"
      },
      {
        "id": "DocumentReference.custodian",
        "path": "DocumentReference.custodian",
        "max": "0"
      },
      {
        "id": "DocumentReference.relatesTo",
        "path": "DocumentReference.relatesTo",
        "max": "0"
      },
      {
        "id": "DocumentReference.description",
        "path": "DocumentReference.description",
        "max": "0"
      },
      {
        "id": "DocumentReference.securityLabel",
        "path": "DocumentReference.securityLabel",
        "max": "0"
      },
      {
        "id": "DocumentReference.content",
        "path": "DocumentReference.content",
        "short": "Palautuva tuloste pdf tiedostona",
        "definition": "Palautuva tuloste pdf tiedostona.",
        "max": "1"
      },
      {
        "id": "DocumentReference.content.attachment",
        "path": "DocumentReference.content.attachment",
        "short": "Palautuva tuloste",
        "definition": "Palautuva tuloste on PDF tiedosto ja timestamp milloin tiedosto on luotu."
      },
      {
        "id": "DocumentReference.content.attachment.contentType",
        "path": "DocumentReference.content.attachment.contentType",
        "short": "Muotona PDF tiedosto",
        "definition": "Pdf tiedostomuoto.",
        "min": 1,
        "fixedCode": "application/pdf"
      },
      {
        "id": "DocumentReference.content.attachment.data",
        "path": "DocumentReference.content.attachment.data",
        "short": "Base64 koodattuna palautuva pdf tuloste",
        "definition": "Base64 koodattuna, sisältää pdf tiedostona palautuvan Lääkityslistan koosteen, Potilasohjeen, Ulkomaan matkaa varten annettavan jäljennöksen tai Ulkomailla ostoa varten annettavan jäljennöksen tiedot.",
        "min": 1
      },
      {
        "id": "DocumentReference.content.attachment.creation",
        "path": "DocumentReference.content.attachment.creation",
        "short": "Tulosteen luontiaika",
        "definition": "Tulosteen luontiaika.",
        "min": 1
      },
      {
        "id": "DocumentReference.context",
        "path": "DocumentReference.context",
        "max": "0"
      }
    ]
  }
}