Description prescription request

The prescription request is based on the official Recip-e KMEHR format (Recip-e_contents-guidelines-2017-01-31.pdf), where specifications for the request have been added (see below).  

XML example: prescription_request.xml
X
ML example for preparation: prescription_request_magistral.xml

XSD: 

Description:

When sending the message via eHealthBox a functional type is mandatory. For the prescription request, acceptance, denial and error this is PRESCRIPTION_REQUEST.

The kmehr message associated with the prescription request is a typical pharmaceuticalprescription transaction with following adjustments and additions:

  • The sender will be the elderly care institution or pharmacy (in case a pharmacy manages the medications of the institution) requesting the prescription.
  • The recipient is the treating doctor (via his/her EMD).
  • A custom transaction type indicating that this is a prescription request.
    • <cd S="LOCAL" SV="1.0" SL="CD-TRANSACTION-TYPE">prescriptionrequest</cd>
    • A Globally Unique Identifier (GUID) specified by the requestor. This ID will also be used to identify the accept or deny notification messages of a prescription request.
      • <id S="LOCAL" SV="1.0" SL="ID-PRESCR-REQUEST">f9ec57c7-f3f8-4946-9131-1b2773da43df</id>
      • The author of the prescription proposal is an employee of the institution
      • A free text value specifying a comment from the institution to the doctor
        • <ns4:text L="nl">Comment</ns4:text>

 

The complete set of rules for the prescription request can be found in the form of xpath queries below.


xquery version "1.0";

declare default element namespace "http://www.ehealth.fgov.be/standards/kmehr/schema/v1";

(:Kmehr versions supported: 1.19 (20161201):)
1,boolean(/kmehrmessage/header/standard/cd[@S='CD-STANDARD' and @SV='1.20' and (text()='20161201')]),'&#xa;',

(:2 header IDs must be present: first one with "S" attribute = ID-KMEHR, the second one with "S" attribute = LOCAL:)
2,boolean (count(/kmehrmessage/header/id)=2),'&#xa;',
3,boolean(/kmehrmessage/header/id[1][@S='ID-KMEHR' and @SV='1.0']),'&#xa;',
4,boolean(/kmehrmessage/header/id[2][@S='LOCAL']),'&#xa;',

(:Sender: At least 2 hcparty's: individual healthcareprovider (or hospital) and "application" (softwareprovider). Name or combination firstname + familyname should always be present:)
5,boolean (count(/kmehrmessage/header/sender/hcparty)>=2),'&#xa;',
6,boolean(/kmehrmessage/header/sender/hcparty[1]/id[@S='ID-HCPARTY' and @SV='1.0']),'&#xa;',
7,boolean(/kmehrmessage/header/sender/hcparty[1]/cd[@S='LOCAL' and @SV='1.0' and (text()='orgRetirementHome')] or /kmehrmessage/header/sender/hcparty[1]/cd[@S='CD-HCPARTY' and @SV='1.11' and (text()='deptpharmacy' or text()='perspharmacist')]),'&#xa;',
8,boolean(/kmehrmessage/header/sender/hcparty[2]/cd[@S='CD-HCPARTY' and @SV='1.11' and text()='application']),'&#xa;',
9,boolean (count(/kmehrmessage/header/sender/hcparty[not(name or familyname)])=0),'&#xa;',

(:For sender "application", both telephone and email need to be present, and cannot be empty:)
10,boolean(count(/kmehrmessage/header/sender/hcparty[2]/telecom/cd[@S='CD-ADDRESS' and @SV='1.1']/text())>=1),'&#xa;',
11,boolean(count(/kmehrmessage/header/sender/hcparty[2]/telecom/cd[@S='CD-TELECOM' and @SV='1.0']/text())>=1),'&#xa;',
12,boolean(/kmehrmessage/header/sender/hcparty[2]/telecom/cd[@S='CD-TELECOM' and text()='phone'] or /kmehrmessage/header/sender/hcparty[2]/telecom/cd[@S='CD-TELECOM' and text()='email']),'&#xa;',
13,boolean (count(/kmehrmessage/header/sender/hcparty[2]/telecom/telecomnumber[string-length(text())=0])=0),'&#xa;',

(:Recipient: only 1 hcparty with recipe data:)
14,boolean(count(/kmehrmessage/header/recipient/hcparty)=1),'&#xa;',
15,boolean(/kmehrmessage/header/recipient/hcparty/id[@S='ID-HCPARTY' and @SV='1.0' and string-length(text())>0]),'&#xa;',
16,boolean(/kmehrmessage/header/recipient/hcparty/cd[@S='CD-HCPARTY' and @SV='1.11' and text()='persphysician']),'&#xa;',
17,boolean (count(/kmehrmessage/header/recipient/hcparty[not(name or familyname)])=0),'&#xa;',

(:Folder: exactly 1 folder, with exactly 1 ID, with value "1":)
18,boolean(count(/kmehrmessage/folder)=1),'&#xa;',
19,boolean(count(/kmehrmessage/folder/id)=1),'&#xa;',
20,boolean(/kmehrmessage/folder/id[@S='ID-KMEHR' and @SV='1.0' and text()='1']),'&#xa;',

(:Patient: exactly 1 patient, with exactly 1 ID (= INSZ/NISS number in 11 positions):)
21,boolean(count(/kmehrmessage/folder/patient)=1),'&#xa;',
22,boolean(count(/kmehrmessage/folder/patient/id)=1),'&#xa;',
23,boolean(/kmehrmessage/folder/patient/id[@S='ID-PATIENT' and @SV='1.0' and (string-length(text())=11)]),'&#xa;',

(:Patient: presence of firstname, familyname, sex and birthdate:)
24,boolean(/kmehrmessage/folder/patient/firstname),'&#xa;',
25,boolean(/kmehrmessage/folder/patient/familyname),'&#xa;',
26,boolean(/kmehrmessage/folder/patient/birthdate/date),'&#xa;',
27,boolean(/kmehrmessage/folder/patient/sex/cd[@S='CD-SEX' and @SV='1.1']),'&#xa;',

(:Transaction: Exactly 1 transaction, with 1 ID and 1 CD (CD-TRANSACTION with value pharmaceuticalprescription):)
28,boolean(count(/kmehrmessage/folder/transaction)=1),'&#xa;',
29,boolean(count(/kmehrmessage/folder/transaction/id)=2),'&#xa;',
30,boolean(/kmehrmessage/folder/transaction/id[1][@S='ID-KMEHR' and @SV='1.0' and text()='1']),'&#xa;',
31,boolean(/kmehrmessage/folder/transaction/id[2][@S='LOCAL' and @SV='1.0' and @SL="ID-PRESCR-REQUEST" and string-length(text())>0]),'&#xa;',
32,boolean(count(/kmehrmessage/folder/transaction/cd)=2),'&#xa;',
33,boolean(/kmehrmessage/folder/transaction/cd[@S='CD-TRANSACTION' and @SV='1.10' and text()='pharmaceuticalprescription']),'&#xa;',
34,boolean(/kmehrmessage/folder/transaction/cd[@S='LOCAL' and @SV='1.0' and text()='prescriptionrequest']),'&#xa;',


(:Author: Exactly 1 hcparty, with 1 ID and 1 CD-HCPARTY:)
35,boolean(count(/kmehrmessage/folder/transaction/author/hcparty)=1),'&#xa;',
36,boolean(count(/kmehrmessage/folder/transaction/author/hcparty/id)=1),'&#xa;',
37,boolean(/kmehrmessage/folder/transaction/author/hcparty/id[@S='ID-HCPARTY' and @SV='1.0' and (string-length(text())>0),'&#xa;',
38,boolean(count(/kmehrmessage/folder/transaction/author/hcparty/cd)=1),'&#xa;',
39,boolean(/kmehrmessage/folder/transaction/author/hcparty/cd[@S='CD-HCPARTY' and @SV= '1.11' and (string-length(text())>0)]),'&#xa;',

(:Author: presence of name or combination firstname + familyname:)
40,boolean (count(/kmehrmessage/folder/transaction/author/hcparty[not(name or familyname)])=0),'&#xa;',

(:Transaction: "iscomplete" and "isvalidated" are both true, no expirationdate should be defined:)
41,boolean(/kmehrmessage/folder/transaction/iscomplete[text()='true']),'&#xa;',
42,boolean(/kmehrmessage/folder/transaction/isvalidated[text()='true']),'&#xa;',
43,boolean(count(/kmehrmessage/folder/transaction/expirationdate)=0),'&#xa;',

(:Transaction: contains exactly 1 heading, and cannot contain any items:)
44,boolean(count(/kmehrmessage/folder/transaction/heading)=1),'&#xa;',
45,boolean(count(/kmehrmessage/folder/transaction/item)=0),'&#xa;',

(:Heading: exactly 1 ID and 1 CD (CD-HEADING) with value 'prescription':)
46,boolean(count(/kmehrmessage/folder/transaction/heading/id[@S='ID-KMEHR' and @SV='1.0' and text()='1'])=1),'&#xa;',
47,boolean(count(/kmehrmessage/folder/transaction/heading/cd[@S='CD-HEADING' and @SV='1.2' and text()='prescription'])=1),'&#xa;',

(:Heading: cannot contain any other headings or text:)
48,boolean(count(/kmehrmessage/folder/transaction/heading/heading)=0),'&#xa;',
49,boolean(count(/kmehrmessage/folder/transaction/heading/text)=0),'&#xa;',

(:Items: at least 1 and no more than 10, with correct ID en CD specifications:)
50,boolean(count(/kmehrmessage/folder/transaction/heading/item)>0),'&#xa;',
51,boolean(count(/kmehrmessage/folder/transaction/heading/item)<=10),'&#xa;',
52,boolean(count(/kmehrmessage/folder/transaction/heading/item/id[@S!='ID-KMEHR'])=0),'&#xa;',
53,boolean(count(/kmehrmessage/folder/transaction/heading/item/id[@SV!='1.0'])=0),'&#xa;',
54,boolean(count(/kmehrmessage/folder/transaction/heading/item/cd[@S!='CD-ITEM'])=0),'&#xa;',
55,boolean(count(/kmehrmessage/folder/transaction/heading/item/cd[@SV!='1.11'])=0),'&#xa;',
56,boolean(count(/kmehrmessage/folder/transaction/heading/item/cd[text()!='medication'])=0),'&#xa;',

(:Content: only once per item:)
57,boolean(count(/kmehrmessage/folder/transaction/heading/item/content)=(count(/kmehrmessage/folder/transaction/heading/item))),'&#xa;',

(:Medicinalproduct: should always contain intendedcd (CNK). In case no CNK is known, intendedcd equals '0000000'. SV attribute is WSSAMv2 (in case the webservice SAMv2 is used), otherwise it defaults to LOCALDB:)
58,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/medicinalproduct/intendedcd[@S!='CD-DRUG-CNK'])=0),'&#xa;',
59,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/medicinalproduct/intendedcd[@SV!='LOCALDB' and @SV!='WSSAMv2'])=0),'&#xa;',

(:Medicinalproduct: if value of intendedcd (CNK) equals '0000000' (default value when no CNK is known), SV attribute always equals 'LOCALDB':)
60,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/medicinalproduct/intendedcd[@SV!='LOCALDB' and text()='0000000'])=0),'&#xa;',

(:Medicinalproduct: intendedname cannot be empty (a product name should always be provided):)
61,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/medicinalproduct/intendedname[string-length (text())=0])=0),'&#xa;',

(:Substanceproduct (INN): correct use of attributes and intendedname should not be empty (a cluster description/name should always be provided):)
62,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/substanceproduct/intendedcd[@S!='CD-INNCLUSTER' and @S!='CD-VMPGROUP'])=0),'&#xa;',
63,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/substanceproduct/intendedcd[@SV!='LOCALDB' and @SV!='WSSAMv2'])=0),'&#xa;',
64,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/substanceproduct/intendedname[string-length (text())=0])=0),'&#xa;',

(:Substanceproduct: If substancecode/cd element contains the cluster code, duration should be specified, in order to let the pharmacist choose the correct package size for the intended treatment duration. In case the INN prescription is provided as text (value cd='0000000', duration is optional:)
(:Desactivated at 27/01/2017 based on feedback
68,boolean(count(kmehrmessage/folder/transaction/heading/item[(content/substanceproduct/intendedcd[text()!='0000000'])]/duration)=(count(kmehrmessage/folder/transaction/heading/item/content/substanceproduct/intendedcd[text()!='0000000']))),'&#xa;',:)

(:Compoundprescription: Formularyreference: at least 1 cd, including S attribute =CD-FORMULARYREFERENCE should be present:)
65,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/compoundprescription/formularyreference/cd[@S='CD-FORMULARYREFERENCE' and @SV='1.0' and (@L='fr' or @L='nl') and (string-length(@DN)!=0) and (string-length(text())!=0) and starts-with(text(),'05') and (string-length(text())=7)])=count(/kmehrmessage/folder/transaction/heading/item/content/compoundprescription/formularyreference)),'&#xa;',

(:Lifecycle: every item should contain a lifecycle element with cd and corresponding attributes. cd value = prescribed:)
66,boolean(count(/kmehrmessage/folder/transaction/heading/item/lifecycle/cd[@S='CD-LIFECYCLE' and @SV='1.9' and text()='prescribed'])=count(/kmehrmessage/folder/transaction/heading/item)),'&#xa;',

(:Temporality: optional, but if present, correct usage of S and SV attributes:)
67,boolean(count(/kmehrmessage/folder/transaction/heading/item/temporality/cd[not (@S='CD-TEMPORALITY') or not(@SV='1.0')])=0),'&#xa;',

(:Quantity: if prescription contains a medicinalproduct or compoundprescription, quantity should be specified:)
68,boolean(count(/kmehrmessage/folder/transaction/heading/item[(content/compoundprescription)]/quantity)=count(/kmehrmessage/folder/transaction/heading/item/content/compoundprescription)),'&#xa;',
69,boolean(count(/kmehrmessage/folder/transaction/heading/item[(content/medicinalproduct)]/quantity)=count(/kmehrmessage/folder/transaction/heading/item/content/medicinalproduct)),'&#xa;',

(:Quantity: If substancecode/cd element contains the cluster code, no quantity should be present (duration should be specified):)
70,boolean(count(/kmehrmessage/folder/transaction/heading/item[(quantity)]/content/substanceproduct/intendedcd[text()!='0000000'])=0),'&#xa;',

(:Posology: posology is a mandatory element, and should be encoded as text (it should exactly correspond to the posology as printed on the proof of electronic prescription). Supplementary a regimen can be specified according to Vitalink-specifications. In case a posology is not relevant, please use the string 'niet van toepassing' or 'pas d'application'. In case the posology is known by the patient (en thus there is no need to further specify it), please use the string 'usage connu' or 'gebruik gekend'.:)
71,boolean(count(/kmehrmessage/folder/transaction/heading/item/posology/text)=count(/kmehrmessage/folder/transaction/heading/item)),'&#xa;',
72,boolean(count(/kmehrmessage/folder/transaction/heading/item/posology/text[string-length(text())=0])=0),'&#xa;',

(:Vitalink Medication scheme rule:
Beginmoment should be present for every item::)
73,boolean(count(/kmehrmessage/folder/transaction/heading/item/beginmoment/date)=count(kmehrmessage/folder/transaction/heading/item)),'&#xa;',

(:Vitalink Medication scheme rule:
Frequency (optional), can only contain periodicity, with correct SV attribute (1.1), and cannot contain following values: UQ, US, UN, UX en UE:)
74,boolean(count(/kmehrmessage/folder/transaction/heading/item/frequency/periodicity/cd[text()='UQ' or text()='US' or text()='UN' or text()='UX' or text()='UE'])=0),'&#xa;',
75,boolean(count(/kmehrmessage/folder/transaction/heading/item/frequency/periodicity/cd[@S='CD-PERIODICITY' and @SV='1.1'])=count(/kmehrmessage/folder/transaction/heading/item/frequency)),'&#xa;',

(:Substanceproduct (INN): supplementary rules for correct usage of the INN-cluster codes:)
76,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/substanceproduct/intendedcd[string-length (text())!=7])=0),'&#xa;',
77,boolean(count(/kmehrmessage/folder/transaction/heading/item/content/substanceproduct/intendedcd[@S='CD-INNCLUSTER' and not (starts-with(text(),'8')) and not (starts-with(text(),'0'))])=0)