Page Status: Outdated

Prescription - Cancel

Sv: användningsfall - Avsluta förskrivning, Makulera förskrivning

This scenario describes the required interactions when a prescription has been faulty registered and should be cancelled (sv: makulera förskrivning). This can be done only when no dispenses has been done for the MedicationRequest and when it is the first version (sv: första instansen i förskrivningskedjan).

The basic approach to achieve this use case is to use HTTP PUT to change the status of the MedicationRequest resource.

PUT [base]/fhir/MedicationRequest

Sequence diagram

This interactions shows a sequence where the client needs to cancel a medication request. The interaction requires a valid authorization token as an initial step, which is not shown in the diagram.

It includes a step where all medication requests with status active are fetched, but if the logical id of the medication request to cancel is already known, the medication request can be fetched by a direct GET instead.

Note that the requests shown in the diagram doesn't include the full basepath. It only shows the last part of the http request including resource and possible search/query parameters.

Example - Cancel prescription (sv: makulera)

This example shows how to cancel a prescription (sv: makulera förskrivning). The example shows a sequence from a prescription being created, whereafter the practitioner realizes that it should be cancelled.

  1. A prescription is created successfully in the Swedish National Medication List. Only a fraction of the requestbody to create a MedicationRequest is shown below. For a full example of a json structure, see section Prescription - Create
{
  "resourceType": "MedicationRequest",
  "meta": {
    "profile": [
      "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest"
    ]
  },
  
  ...
}
  1. The practitioner realizes that the prescription is faulty and should be cancelled (e.g. due to wrong patient, doublet or similar) and fetches the newly created MedicationRequest from the Swedish National Medication List. If the logical id of the MedicationRequest in the previous step is maintained in the EHR/EMR system, then the resource can be pinpointed directly. Otherwise a search query is required, in order to find the correct MedicationRequest. In this example it is presumed that the logical id is known.
GET [base]/MedicationRequest/adde070b-0194-48f3-a740-9eedd9f0dcb0
  1. The version of the medication list info must be known and provided, in order for the cancellation request to be successful. To get the latest version number, the MedicationListInfo resource needs to be fetched.
GET [base]/MedicationListInfo/1f9502c7-034f-4b0b-9d73-f091b277ced0
  1. As a last step, the MedicationRequest is cancelled by changing the status to cancelled.

Remember to set correct reason and activity in the Provenance. i.e

  "reason": [
    {
      "coding": [
        {
          "system": "http://electronichealth.se/fhir/ValueSet/nll-reason-for-cancellation",
          "code": "FEL_PATIENT"
        }
      ]
    }
  ],
  "activity": {
    "coding": [
      {
        "system": "http://electronichealth.se/fhir/ValueSet/ml-activity-types",
        "code": "MAKULERA_FORSKRIVNING"
      }
    ]
  },

Payload (MedicationRequest)

{
  "resourceType": "MedicationRequest",
  "id": "21a8fb35-f695-4fbf-9bb1-cbc2e9a4ab80",
  "meta": {
    "versionId": "1",
    "profile": [
      "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest"
    ]
  },
  "contained": [
    {
      "resourceType": "Practitioner",
      "id": "1",
      "meta": {
        "profile": [
          "http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner"
        ]
      },
      "extension": [
        {
          "extension": [
            {
              "url": "workplaceIdentifier",
              "valueString": "abc123"
            },
            {
              "url": "workplaceName",
              "valueString": "Min avdelning"
            },
            {
              "url": "workplaceType",
              "valueCode": "HEALTHCARE"
            },
            {
              "url": "workplaceIdType",
              "valueCode": "HSA"
            }
          ],
          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLWorkplaceSummary"
        }
      ],
      "identifier": [
        {
          "system": "http://electronichealth.se/identifier/forskrivarkod",
          "value": "9001025"
        }
      ],
      "name": [
        {
          "family": "Läkarsson",
          "given": [
            "Kim"
          ]
        }
      ],
      "telecom": [
        {
          "extension": [
            {
              "url": "http://electronichealth.se/fhir/StructureDefinition/NLLAvailableToPatient",
              "valueBoolean": false
            },
            {
              "url": "http://electronichealth.se/fhir/StructureDefinition/NLLContactPointType",
              "valueCode": "P"
            }
          ],
          "value": "011-400000",
          "rank": 1
        },
        {
          "extension": [
            {
              "url": "http://electronichealth.se/fhir/StructureDefinition/NLLAvailableToPatient",
              "valueBoolean": true
            },
            {
              "url": "http://electronichealth.se/fhir/StructureDefinition/NLLContactPointType",
              "valueCode": "W"
            }
          ],
          "value": "011-400001",
          "rank": 1
        }
      ],
      "address": [
        {
          "type": "physical",
          "line": [
            "Vårdgatan 1"
          ],
          "city": "Kalmar",
          "postalCode": "39322"
        }
      ],
      "qualification": [
        {
          "code": {
            "coding": [
              {
                "system": "http://electronichealth.se/fhir/ValueSet/nll-hosp-yrkeskod",
                "code": "LK"
              }
            ]
          }
        }
      ]
    }
  ],
  "extension": [
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionChain",
      "valueUuid": "39c9a5a0-086f-4e4d-a040-971b316b3ee4"
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPatientTreatmentReason",
      "valueString": "värk"
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLRegistrationBasis",
      "valueCoding": {
        "system": "http://ehalsomyndigheten.se/fhir/CodeSystem/library",
        "code": "ELECTRONIC"
      }
    },
    {
      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionFormat",
      "valueCoding": {
        "system": "http://ehalsomyndigheten.se/fhir/CodeSystem/library",
        "code": "ELEKTRONISKT"
      }
    }
  ],
  "identifier": [
    {
      "extension": [
        {
          "url": "PrescriptionSetId",
          "valueString": "d1c1c65f-f6fa-4b67-a586-fba4020666f5"
        }
      ],
      "system": "http://electronichealth.se/fhir/CodeSystem/NEFId",
      "value": "d1c1c65f-f6fa-4b67-a586-fba4020666f5"
    }
  ],

"status": "cancelled",

  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://electronichealth.se/fhir/NamingSystem/nplid",
        "code": "19851206000039"
      },
      {
        "system": "http://electronichealth.se/fhir/NamingSystem/nplpackid",
        "code": "10010101108564"
      }
    ]
  },
  "subject": {
    "reference": "Patient/21e495cf-aab6-482e-b630-cdd87b437cab"
  },
  "authoredOn": "2020-11-11T14:26:37+01:00",
  "requester": {
    "reference": "#1"
  },
  "reasonCode": [
    {
      "coding": [
        {
          "system": "http://electronichealth.se/fhir/ValueSet/nll-snomed-behandlingsorsak",
          "code": "OTH"
        }
      ],
      "text": "OTH"
    }
  ],
  "dosageInstruction": [
    {
      "extension": [
        {
          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLObservandumDose",
          "valueBoolean": false
        },
        {
          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLAdministeringInstruction",
          "valueString": "svälj"
        },
        {
          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDosageType",
          "valueCode": "INTERVALLSDOSERING"
        }
      ],
      "sequence": 1,
      "patientInstruction": "ta vid behov",
      "timing": {
        "repeat": {
          "frequency": 1,
          "period": 12,
          "periodUnit": "h"
        }
      },
      "asNeededBoolean": false,
      "method": {
        "coding": [
          {
            "system": "http://electronichealth.se/fhir/ValueSet/nll-snomed-method",
            "code": "738995006"
          }
        ]
      },
      "doseAndRate": [
        {
          "doseQuantity": {
            "value": 2.0,
            "system": "http://electronichealth.se/fhir/ValueSet/nll-ucum-unit",
            "code": "{tbl}"
          }
        }
      ]
    }
  ],
  "dispenseRequest": {
    "extension": [
      {
        "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfPackagesPrescribed",
        "valuePositiveInt": 1
      },
      {
        "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfFillsRemaining",
        "valueDecimal": 2
      },
      {
        "extension": [
          {
            "url": "prescribed",
            "valueQuantity": {
              "value": 60.0
            }
          },
          {
            "url": "remaining",
            "valueQuantity": {
              "value": 60.0
            }
          }
        ],
        "url": "http://electronichealth.se/fhir/StructureDefinition/NLLTotalQuantity"
      },
      {
        "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriberCostCenter",
        "valueCode": "4000000000000"
      },
      {
        "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionCommunicableDiseasesAct",
        "valueBoolean": false
      },
      {
        "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPatientPharmaceuticalBenefitsAct",
        "valueBoolean": false
      }
    ],
    "validityPeriod": {
      "end": "2021-11-11T14:26:37+01:00"
    },
    "numberOfRepeatsAllowed": 1,
    "quantity": {
      "value": 30.0
    }
  }
}