Page Status: Outdated

Cancel consent for dose dispensing

This section describes how to cancel a consent for a patient that no longer should have dose dispensing (sv: avregistrera dospatient).

The scenario is based on changing a Consent resource of the correct category.

PUT [base]/fhir/Consent

All POST and PUT interaction should be accompanied with a NLLProvenance in the X-Provenance header.

Interaction diagram

This interaction shows a sequence where a client wants to perform an update that cancels the consent for dose dispensing for a patient. The interactions are initiated with the client fetching the logical id of the patient in question, in order to be able to search for the consent of type 'consent-dose-disp'. The sequence is finalized with a PUT request, changing (end dating) the period of the consent.

Example

This example shows how to cancel a consent, meaning that a patient should stop receiving medication in multi dose dispense bags (sv: avsluta dossamtycke). It is required to first find the applicable consent to cancel by searching for it with the logical id of the patient.

Header: required authorization and provenance information

Parameter Mandatory Comment
Authorization Yes Bearer [valid OAuth2 token]
X-Access N/A -
X-Purpose N/A -
X-Provenance Yes Must be provided with information as described below
activity.coding.code : AVREGISTRERA_DOSSAMTYCKE
agent.type : enterer .
agent.who : NLLPractitioner At least name, identifier must be defined. Make sure that the individual is the same as in the authorization ticket.

An example of a full provenance json structure can be seen in General information about Use Cases

PUT [base]/fhir/Consent

{
  "resourceType": "Consent",
  "id": "60d7dd9a-fc36-48bb-8aff-2d61c092e23b",
    "meta": {
    "profile": [
      "http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent"
    ]
  },
  "category": [
    {
      "coding": [
        {
          "code": "consent-dose-disp",
          "system": "http://electronichealth.se/fhir/ValueSet/consent-types-1"
        }
      ]
    }
  ],
  "patient": {
    "reference": "Patient/1f9502c7-034f-4b0b-9d73-f091b277ced0"
  },
  "dateTime": "2019-10-02T15:28:59",
  "provision": {
    "dataPeriod": {
      "end": "2019-12-02"
    }
  }
}