{
  "resourceType": "StructureDefinition",
  "id": "mp-ReplyProposalDispenseRequest",
  "url": "http://nictiz.nl/fhir/StructureDefinition/mp-ReplyProposalDispenseRequest",
  "version": "2.0.0-rc.7",
  "name": "MpReplyProposalDispenseRequest",
  "title": "mp ReplyProposalDispenseRequest",
  "status": "active",
  "publisher": "Nictiz",
  "contact": [
    {
      "name": "Nictiz",
      "telecom": [
        {
          "system": "url",
          "value": "https://www.nictiz.nl",
          "use": "work"
        }
      ]
    }
  ],
  "description": "The reply proposal dispense request is a response from the prescriber to the proposal dispense request. In this response, the prescriber indicates whether they agree (after which a dispensing request will follow) or disagree (and the reason for this).",
  "purpose": "To define the reply proposal dispense request as stated in the information standard Medication Process.",
  "copyright": "Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "mp-dataset-mp9-300-rc1-20250522",
      "uri": "https://decor.nictiz.nl/pub/medicatieproces/mp-html-20250522T132618/ds-2.16.840.1.113883.2.4.3.11.60.20.77.1.4-2022-06-30T000000.html",
      "name": "ART-DECOR Dataset MP9 3.0.0-rc.1 20250522"
    },
    {
      "identity": "mp-dataset-mp9-300-rc2-20260213",
      "uri": "https://decor.nictiz.nl/pub/medicatieproces/mp-html-20260213T112547/ds-2.16.840.1.113883.2.4.3.11.60.20.77.1.4-2022-06-30T000000.html",
      "name": "ART-DECOR Dataset MP9 3.0.0-rc.2 20260213"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Communication",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Communication",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Communication",
        "path": "Communication",
        "short": "Response",
        "definition": "Response to the proposal dispense request.",
        "alias": [
          "Antwoord"
        ],
        "constraint": [
          {
            "key": "mp-2033-vv-1",
            "severity": "error",
            "human": "If the decision is 'accepted' (11) or 'accepted with changes' (12), the relation to the new DispenseRequest SHALL be present; otherwise it SHALL be absent.",
            "expression": "(payload.content.extension.value.ofType(CodeableConcept).coding.code.intersect({'11','12'}).exists()) = extension.where(url='http://nictiz.nl/fhir/StructureDefinition/ext-Communication.RelationToNewDispenseRequest').exists()"
          }
        ],
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-539",
            "comment": "Response"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-539",
            "comment": "Response"
          }
        ]
      },
      {
        "id": "Communication.meta",
        "path": "Communication.meta"
      },
      {
        "id": "Communication.meta.tag",
        "path": "Communication.meta.tag",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Communication.meta.tag:actionable",
        "path": "Communication.meta.tag",
        "sliceName": "actionable",
        "min": 1,
        "max": "1",
        "patternCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/common-tags",
          "code": "actionable"
        }
      },
      {
        "id": "Communication.identifier",
        "path": "Communication.identifier",
        "short": "Identification",
        "definition": "The identification of the response to the proposal. This identification is generated by the system of the person who registers the response and is globally unique and eternally persistent.",
        "comment": "Leading business identifier for the response.",
        "alias": [
          "Identificatie"
        ],
        "min": 1,
        "max": "1",
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-540",
            "comment": "Identification"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-540",
            "comment": "Identification"
          }
        ]
      },
      {
        "id": "Communication.basedOn",
        "path": "Communication.basedOn",
        "short": "RelationToProposalData",
        "definition": "Relation to proposal data.",
        "comment": "Preferred: reference the proposal transaction (Bundle) using an identifier-based reference that matches Proposal Bundle.identifier. Backwards compatibility: a direct reference to the proposed mp-DispenseRequest MAY be used during transition.",
        "alias": [
          "RelatieVoorstelGegevens"
        ],
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Resource",
              "http://hl7.org/fhir/StructureDefinition/Bundle",
              "http://nictiz.nl/fhir/StructureDefinition/mp-ProposalDispenseRequest-Bundle",
              "http://nictiz.nl/fhir/StructureDefinition/mp-DispenseRequest"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-544",
            "comment": "RelationToProposalData"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-544",
            "comment": "RelationToProposalData"
          }
        ]
      },
      {
        "id": "Communication.subject",
        "path": "Communication.subject",
        "short": "Patient",
        "alias": [
          "Patient"
        ],
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Group",
              "http://nictiz.nl/fhir/StructureDefinition/nl-core-Patient"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-1",
            "comment": "Patient"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-1",
            "comment": "Patient"
          }
        ]
      },
      {
        "id": "Communication.sent",
        "path": "Communication.sent",
        "short": "ResponseDate",
        "definition": "Date of the response to the proposal.",
        "alias": [
          "AntwoordDatum"
        ],
        "min": 1,
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-541",
            "comment": "ResponseDate"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-541",
            "comment": "ResponseDate"
          }
        ]
      },
      {
        "id": "Communication.sender",
        "path": "Communication.sender",
        "short": "Author",
        "definition": "Author of the response to the proposal.",
        "alias": [
          "Auteur"
        ],
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "http://nictiz.nl/fhir/StructureDefinition/pattern-NlCoreHealthProfessionalReference"
            ],
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Device",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/HealthcareService",
              "http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthProfessional-PractitionerRole"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-542",
            "comment": "Author"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-542",
            "comment": "Author"
          }
        ]
      },
      {
        "id": "Communication.extension",
        "path": "Communication.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Communication.extension:relationToNewDispenseRequest",
        "path": "Communication.extension",
        "sliceName": "relationToNewDispenseRequest",
        "short": "RelationToNewDispenseRequest",
        "definition": "Relation from this reply to the new dispense request building block that is accepted (possibly with changes).",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "id": "Communication.extension:relationToNewDispenseRequest.url",
        "path": "Communication.extension.url",
        "fixedUri": "http://nictiz.nl/fhir/StructureDefinition/ext-Communication.RelationToNewDispenseRequest"
      },
      {
        "id": "Communication.extension:relationToNewDispenseRequest.value[x]",
        "path": "Communication.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://nictiz.nl/fhir/StructureDefinition/mp-DispenseRequest"
            ]
          }
        ]
      },
      {
        "id": "Communication.payload",
        "path": "Communication.payload",
        "min": 1
      },
      {
        "id": "Communication.payload.content[x]",
        "path": "Communication.payload.content[x]",
        "short": "ResponseDispenseRequestExplanation",
        "definition": "Explanation (free text) for the response to the proposed dispense request.",
        "alias": [
          "AntwoordVerstrekkingsverzoekToelichting"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Communication.payload.content[x].extension",
        "path": "Communication.payload.content[x].extension",
        "min": 1
      },
      {
        "id": "Communication.payload.content[x].extension:contentCodeableConcept",
        "path": "Communication.payload.content[x].extension",
        "sliceName": "contentCodeableConcept",
        "comment": "This is a pre-adopt of R5 in which the string data type of `.payload.content` is changed to a CodeableConcept.",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nictiz.nl/fhir/StructureDefinition/ext-Communication.Payload.ContentCodeableConcept"
            ]
          }
        ]
      },
      {
        "id": "Communication.payload.content[x].extension:contentCodeableConcept.value[x]",
        "path": "Communication.payload.content[x].extension.value[x]",
        "short": "ResponseDispenseRequestDecision",
        "definition": "Decision for the response to the proposed dispense request.",
        "alias": [
          "AntwoordVerstrekkingsverzoekBesluit"
        ],
        "min": 1,
        "binding": {
          "strength": "required",
          "description": "Decision for the response to the proposed dispense request.",
          "valueSet": "http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.20.77.11.36--20251217150952"
        },
        "mapping": [
          {
            "identity": "mp-dataset-mp9-300-rc1-20250522",
            "map": "mp-dataelement9x-546",
            "comment": "ResponseDispenseRequest"
          },
          {
            "identity": "mp-dataset-mp9-300-rc2-20260213",
            "map": "mp-dataelement9x-546",
            "comment": "ResponseDispenseRequest"
          }
        ]
      }
    ]
  }
}