Page Status: updated 2023-11-22

NLLMedicationDispense (MedicationDispense)

Page index

Introduction

The MedicationDispense resource, shown in the profile NLLMedicationDispense, represents a dispense of medication or medical consumable at a pharmacy. The profile NLLMedicationDispense represents the normal scenario, in which the prescription has been registered in the Swedish National Medication List prior to dispensing.

Overview

idS Σ0..1string
id0..1string
extensionI0..*Extension
versionIdS Σ0..1id
lastUpdatedΣ0..1instant
sourceΣ0..1uri
profileΣ0..*canonical(StructureDefinition)
securityΣ0..*CodingBinding
tagΣ0..*Coding
implicitRulesΣ ?!0..1uri
language0..1codeBinding
text0..1Narrative
contained0..*Resource
nllNumberOfPackagesDispensedS I0..1Extension(positiveInt)
nllActorDispatchIdS I1..1Extension(string)
nllDispatchIdS I0..1Extension(string)
nllBenefitChoiceCodeS I1..1Extension(code)Binding
nllDispatchRowNoS I1..1Extension(decimal)
nllDeductedQuantityS I0..1Extension(decimal)
nllCompletePrescriptionChoiceS I0..1Extension(code)Binding
id0..1string
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueDateTimedateTime
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueStringstring
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueBase64Binarybase64Binary
valueBooleanboolean
valueCanonicalcanonical()
valueCodecode
valueDatedate
valueDateTimedateTime
valueDecimaldecimal
valueIdid
valueInstantinstant
valueIntegerinteger
valueMarkdownmarkdown
valueOidoid
valuePositiveIntpositiveInt
valueStringstring
valueTimetime
valueUnsignedIntunsignedInt
valueUriuri
valueUrlurl
valueUuiduuid
valueAddressAddress
valueAgeAge
valueAnnotationAnnotation
valueAttachmentAttachment
valueCodeableConceptCodeableConcept
valueCodingCoding
valueContactPointContactPoint
valueCountCount
valueDistanceDistance
valueDurationDuration
valueHumanNameHumanName
valueIdentifierIdentifier
valueMoneyMoney
valuePeriodPeriod
valueQuantityQuantity
valueRangeRange
valueRatioRatio
valueSampledDataSampledData
valueSignatureSignature
valueTimingTiming
valueContactDetailContactDetail
valueContributorContributor
valueDataRequirementDataRequirement
valueExpressionExpression
valueParameterDefinitionParameterDefinition
valueRelatedArtifactRelatedArtifact
valueTriggerDefinitionTriggerDefinition
valueUsageContextUsageContext
valueDosageDosage
valueMetaMeta
valueReferenceReference()
url1..1uriFixed Value
modifierExtension?! I0..*Extension
identifier0..*Identifier
partOfI0..*Reference(Procedure)
statusS Σ ?!1..1codeBinding
statusReasonCodeableConceptCodeableConcept
statusReasonReferenceReference(DetectedIssue)
category0..1CodeableConceptBinding
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemS Σ1..1uriFixed Value
versionΣ0..1string
codeS Σ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
id0..1string
extensionI0..*Extension
systemS Σ1..1uriFixed Value
versionΣ0..1string
codeS Σ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
id0..1string
extensionI0..*Extension
systemS Σ1..1uriFixed Value
versionΣ0..1string
codeS Σ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
subjectΣ I0..1Reference(Patient | Group)
contextI0..1Reference(Encounter | EpisodeOfCare)
supportingInformationI0..*Reference(Resource)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
function0..1CodeableConcept
actorI1..1Reference(Practitioner | PractitionerRole | Organization | Patient | Device | RelatedPerson)
locationI0..1Reference(Location)
authorizingPrescriptionS I1..1Reference(NLLMedicationRequest)
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemS Σ0..1uri
versionS Σ0..1string
codeS Σ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
id0..1string
extensionI0..*Extension
valueS Σ1..1decimal
comparatorΣ ?!0..0codeBinding
unitΣ0..1string
systemΣ I0..1uri
codeΣ0..1code
daysSupplyI0..1SimpleQuantity
whenPreparedΣ0..1dateTime
whenHandedOverS0..1dateTime
destinationI0..1Reference(Location)
receiverI0..*Reference(Patient | Practitioner)
id0..1string
extensionI0..*Extension
authorStringstring
authorReferenceReference(Practitioner | Patient | RelatedPerson | Organization)
timeΣ0..1dateTime
textS Σ1..1markdown
dosageInstructionS0..*NLLDosage
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
wasSubstitutedS1..1boolean
type0..1CodeableConcept
reason0..*CodeableConcept
responsiblePartyI0..*Reference(Practitioner | PractitionerRole)
detectedIssueS I0..*Reference(NLLDetectedIssue)
eventHistoryI0..*Reference(Provenance)

Details

Description of all elements can be found here, Element descriptions.

Mapping of FHIR element names to the National Medication List names can be found here, Element language mappings.

Dosage

The dosageInstruction on a MedicationDispense authorized by a MedicationRequest in electronic format, should only be used if the dosageInstruction on the MedicationDispense differs from the dosageInstruction on the MedicationRequest. Otherwise the dosageInstruction on the MedicationDispense must be empty, which means that the dosageInstruction on the MedicationRequest will be used.

How to use the elements in dosageInstruction (the BackBoneElement Dosage) is described on the page Dosage and in the Handbok för vård- och apotekstjänster. Message examples for dosages are available on the page Dosage - Create

Medication dispense statuses

The following statuses are used within NLL for dispenses.

ValueSet medication-dispense-status

Parameter Comment
Completed The dispensed product has been picked up (sv: Expedierat).
Cancelled The dispensed product is not picked up by the patient (sv: Borttaget).

Medication dispense types

The following types are used within NLL for dispenses.

ValueSet dispense-types

Code Display
DD Dose dispensed fill (sv: Dosdispenserat uttag).
SP Standard packing fill (sv: Helförpackningsuttag).
TF Trial fill (sv: Startförpackning).

Supported operations

HTTP methods

Operation Supported Comment
Search (GET, POST) yes See below for supported search options.
Insert (POST) yes Create a new dispense. NB! When dispatching more than one dispense at the same occasion, a Bundle conforming to the NLLDispatch profile must be used.
Update (PUT) yes Change a dispense by either adjusting quantity, medication or reversing previous dispense.
Delete (DEL) no
Operation (GET, POST) yes See below for supported extended operations.

When interacting with this resource a set of HTTP-headers must be included in the request, see HTTP Header and Authorization.

Query operations

Supported queries

The following query alternatives are available for this resource.

  1. ../MedicationDispense/[id]

  2. ../MedicationDispense/[id]/_history{/[vid]}

  3. ../MedicationDispense?[parameters]
    Parameter chains:

    Chain 1
    patient._id=[id]
    {&hasAuthorizingPrescription=true}
    {&nllDispatchId=[string]}
    {&whenhandedover=ge[date]}

    Chain 2
    medicationrequest._id=[id]
    {&whenhandedover=ge[date]}

    Chain 3
    authorizingPrescriptions=[id]{,[id]...}

Compartment searches

Supported searches on a compartment. This kind of search returns a bundle with the related resources.

  1. ../MedicationDispense/[id]/Provenance returns all related provenances.
  2. ../MedicationRequest/[id]/MedicationDispense returns all related medication dispenses (NLLMedicationDispenses).

Include & reverse includes

Supported usage of include and revinclude. This kind of search returns a bundle of both the base resource and the related resources specified in the parameter.

  1. ../MedicationDispense?[parameters]&_revinclude=Provenance:target:MedicationDispense returns one or more MedicationDispenses together with their Provenances. The Provenance returned is the one pointing at the returned version of the MedicationDispense. See above for a list of valid parameters.

Example: ../MedicationDispense?patient._id=<uuid>&whenhandedover=ge[date]&_revinclude=Provenance:target:MedicationDispense returns the patient's medication dispenses made on or after the selected date including one provenance per medication dispense.

For generic information about how to search in FHIR look here.

Search parameters

The table below shows all supported search parameters.

Search parameter Description Comment
MedicationDispense/[id] A read based on the logical ID (UUID) of a medication dispense
../MedicationDispense/<uuid>
_history A vread to get all versions of a medication dispense
../MedicationDispense/<uuid>/_history
_history/[vid] A vread to get a specific version of a medication dispense
../MedicationDispense/<uuid>/_history/3
patient._id UUID of the patient. Either patient reference or medication request reference must be part of the query and they are mutually exclusive
..?patient._id=<uuid>
medicationrequest._id UUID of the authorizing prescription (MedicationRequest). Either prescription reference or patient reference must be part of the query and they are mutually exclusive.
..?medicationrequest._id=<uuid>
hasAuthorizingPrescription Dispenses related to an electronic prescription
..&hasAuthorizingPrescription=true
If not specified all type of dispenses are returned
nllDispatchId Id of a dispatch
..&nllDispatchId=123
whenhandedover Date, greater than or equal, when the medication was dispensed at the pharmacy
..&whenhandedover=ge2021-08-31
Required prefix: ge
authorizingPrescriptions A list of UUIDs of authorizing prescriptions (MedicationRequests)
..?authorizingPrescriptions=4f0a61d5-c3d9-4803-b4c2-ea53732b086b,05b21687-fe0a-4311-b32f-a42108477b8f

Other operations

Operation Comment
$verify
NLLVerify

Invocations

URL: [base]/$verify

URL: [base]/MedicationRequest/$verify URL: [base]/MedicationDispense/$verify

This operation does NOT change content

Parameters (In)

NameCardinalityTypeDocumentation
resource0..1MedicationRequest(NLLMedicationRequest)

The MedicationRequest to be verified. This type of verification must be directed to the medication request end-point [base]/MedicationRequest/$verify.

resource0..1MedicationDispense(NLLMedicationDispense)

The MedicationDispense to be verified. This type of verification must be directed to the medication dispense end-point [base]/MedicationDispense/$verify.

resource0..1MedicationDispense(NLLDispensePaperPrescription)

The MedicationDispense to be verified. This type of verification must be directed to the medication dispense end-point [base]/MedicationDispense/$verify.

resource0..1Bundle(NLLDispatch)

A Bundle containing the MedicationDispenses to be verified. This type of verification must be directed to the service base end-point [base]/$verify.

Return Values (Out)

NameCardinalityTypeDocumentation
detectedIssues1..1boolean

Has the value 'true' if any AFF errors or warnings are detected, otherwise 'false'

issues0..1OperationOutcome(NLLOperationOutcome)

If the Automatic Format and Constitution Control (sv. Automatiska format- och författningskontroller AFF-kontroller) returns any errors or warnings, these are displayed as DetectedIssues in an OperationOutcome. No OperationOutcome will be returened if there are no issues.

Must be invoked with a HTTP POST. This operation is invoked on MedicationDispense and MedicationRequest resources to verify them according to the Automatic Format and Constitution Control (sv. Automatiska format- och författningskontroller AFF-kontroller). It is also possible to verify a set of MedicationDispenses by using $verify on the service base and providing a NLLDispatch. It is important that the content of the resource parameter matches the end-point of the request.

A Provenance object must be included in the HTTP header X-Provenance.