{
  "resourceType": "MedicationDispense",
  "id": "8bee14db-df04-4b3b-8cae-1304d624f0a3",
  "meta": {
    "versionId": "2",
    "profile": [
      "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationDispense"
    ],
    "tag": [
      {
        "display": "Close MedicationDispense reverse dispense"
      },
      {
        "display": "An instance of MedicationDispense"
      },
      {
        "display": "close-medicationdispense-example-1"
      }
    ]
  },
  "extension": [
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLBenefitChoiceCode",
      "valueCode": "R"
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfPackagesDispensed",
      "valuePositiveInt": 2
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDeductedQuantity",
      "valueDecimal": 100.0
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLActorDispatchId",
      "valueString": "10431431715"
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDispatchId",
      "valueString": "10431431716"
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDispatchRowNo",
      "valueDecimal": 1
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDispenseCrediting",
      "extension": [
        {
          "url": "creditDate",
          "valueDateTime": "2022-04-27T13:07:35+00:00"
        }
      ]
    }
  ],
  "status": "cancelled",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://electronichealth.se/fhir/NamingSystem/nplpackid",
        "code": "20080507100681"
      }
    ]
  },
  "authorizingPrescription": [
    {
      "reference": "MedicationRequest/c7005500-a251-4135-aa27-f2d808b729b6/_history/2"
    }
  ],
  "type": {
    "coding": [
      {
        "system": "http://ehalsomyndigheten.se/fhir/CodeSystem/library",
        "code": "SP"
      }
    ]
  },
  "quantity": {
    "value": 200.0
  },
  "whenHandedOver": "2022-04-25T13:07:30+00:00",
  "note": [
    {
      "text": "Expedierat 10 mg pga. rest."
    }
  ],
  "dosageInstruction": [
    {
      "extension": [
        {
          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDosageType",
          "valueCode": "TILLFALLESDOSERING"
        }
      ],
      "sequence": 1,
      "patientInstruction": "2 tabletter på kvällen.",
      "timing": {
        "repeat": {
          "when": [
            "EVE"
          ]
        }
      },
      "asNeededBoolean": false,
      "doseAndRate": [
        {
          "doseQuantity": {
            "value": 2.0,
            "system": "http://ehalsomyndigheten.se/fhir/CodeSystem/ehm-ucum-annotations",
            "code": "{tbl}"
          }
        }
      ]
    }
  ],
  "substitution": {
    "wasSubstituted": true
  }
}