# differential.element[].definition
MedicationRequest in the National Swedish Medication List is used for prescriptions for a patient.
A prescription can be made for either a medicine package or for a reimbursed consumable.

# differential.element[].comment
The only time that a resource does not have an id is when it is being submitted to the server using a create operation.
This id is identified by the URI http://electronichealth.se/identifier/nllmedicationrequestid in documentation and external systems.

# differential.element[].short
The treatment reason described for the patient

# differential.element[].definition
The reason for the treatment described in a way that is understood by the patient (behandlingsändamål). 
A text can be selected from "Nationell källa för ordinationsorsak" (NKOO). It is also possible to enter free text. 
NKOO is a code system that is defined by the Swedish National Board of Health and Welfare (Socialstyrelsen). The code system consists of SnomedCT codes for reasons (behandlingsorsak). Each medical product has a selection of valid SnomedCT reason codes, and in connection with the codes are the available patient reasons. The corresponding patient text could be entered here in "nllPatientTreatmentReason", and the SnomedCT reason code (behandlingsorsak) should be entered in "reasonCode".

# differential.element[].definition
Id used to identify all prescriptions in one prescription chain.
A prescription chain is a set of prescriptions that are linked together in chronological order (The attribute priorPrescription is used to find the previos prescription.)
A prescription chain is created ie when a prescription is renewed or replaced. The purpose is to be able to provide a grouping of related prescriptions.
If a Prescription chain id is not provided in a POST of a MedicationRequest, a new prescription chain id is set by the Swedish eHealth Agency when the prescription is created. Prescription chain id is available on all prescriptions.

# differential.element[].definition
Current prescription format can be either "electronic" (Elektroniskt) or "paper" (Papper). If the prescription has been printed out on paper, i.e. the format is "paper" , then the patient needs to bring the print-out with him to the pharmacy to be able to get a dispense.

# differential.element[].definition
Treatment dates as defined by the Swedish law "Lag (2018:1212) om nationell läkemedelslista", chapter 3, 8§, section 5. 
The latest date when the medical treatment should be either reviewed or ended.

# differential.element[].definition
The latest date at which a review of the ongoing treatment must be made.

# differential.element[].mapping[].map
Senaste datum för uppföljning av behandling

# differential.element[].definition
The latest date at which the prescriber orders that the treatment must end.

# differential.element[].short
Format when the prescription was registered

# differential.element[].definition
The format of the basis for the registration of the prescription. A prescriber can only register prescriptions in electronic format in the Swedish National Medication List. A pharmacy can also register a prescription based on  paper prescription, or based on a phone call from a prescriber.
This value is entered when creating the prescription, and is never updated.

# differential.element[].definition
Dates that are used for scheduling the use of the prescribed article.

# differential.element[].short
When the patient should start using the medication.

# differential.element[].definition
The date when the patient should start administering the medication according to the prescription.

# differential.element[].short
When the patient should stop using the medication.

# differential.element[].definition
The date when the patient should stop administering the medication according to current prescription.

# differential.element[].definition
Set by the Swedish eHealth Agency.
Date used in renewed prescriptions whith repeating dosages for calculating the current day in the schedule. Used for repeating dosages with "time of day" or "when" (sv tillfällesdosering) and a UsageStartDate (första doseringsdag).

# differential.element[].comment
Schedule Start Date is a mechanism for calculating the current day in the schedule when a prescription with a repeating schedule has been renewed once or several times. Schedule Start Date is the original Usage Start Date form the first prescription when the schedule was defined. 
Example: The first prescription had a Usage Start Date which was 2020-08-23 and the schedule repeats every second day ("Take every second day"). Then the Schedule Start Date will be set to 2020-08-23 and togehter with the instructions of the schedule it is possible calculate which day of the schedule any given date will correspond to, ie a day when the patient should take the medication or a day when no medication should be administered.

# differential.element[].definition
Only used for input.
When 12% or less of the total quantity of the prescribed medication is left, the prescription will automatically be set to status "Completed". 
A pharmacist can make a descision to overrule the automatic rules by either choosing to set the prescription status to "Completed" or to keep the status "Active".

# differential.element[].short
OrdinationsId from OR (Receptdepå human)

# differential.element[].definition
Calculated by the Swedish eHealth Agency. Not used for input.
Legacy id used for identifying prescriptions which is used in the OR (Receptdepå human) API.
In OR this corresponds to ordinationsId, which is unique for each version of the prescription.
This attribute will be removed after the end of the transition period.

# differential.element[].short
Tidigare OrdinationsId OR (Receptdepå human)

# differential.element[].definition
Calculated by the Swedish eHealth Agency. Not used for input.
Legacy id used for identifying prescriptions which is used in the OR (Receptdepå human) API.
"Tidigare OrdinationsId" is used for identifying a prior prescription originally created in OR (Receptdepå Human) .
In OR this corresponds to tidigareOrdinationsId.
This attribute will be removed after the end of the transition period.

# differential.element[].definition
Ids used for identifying prescriptions originally created in NEF or OR.
In OR this corresponds to originalOrdinationsId, which is the same as PrescriptionSetId in NEF. In OR a originalOrdinationsId/PrescriptionSetId always correspons to one unique prescription.
In NEF the combination of PrescriptionSetId-PrescriptionItemId corresponds to one unique prescription.
PrescriptionItemId is made up from RowId-ProductRowId.
originalOrdinationsId/PrescriptionSetId is in the form of a UUID.
RowId and ProductRowId are counters.
These attributes will be removed after the end of the transition period.

# differential.element[].definition
NEF: PrescriptionSetId, OR: Originalordinationsid is a legacy identifier used by NEF/PIRR and OR. Every prescription created by systems connected before Swedish National Medication List will have a PrescriptionSetId/orignalordinationsid. However, it does not allways identify a unique prescription. To search for a unique prescriptions the RowId/radnummer and ProductRowId/produktradnummer may be needed as well.

# differential.element[].definition
Calculated by the Swedish eHealth Agency.
The complete NEFid for the specific prescribed article, i.e. a combination of PrescriptionSetId and PrescriptionItemId where applicable. 
PrescriptionItemId is made up from RowId-ProductRowId.
In OR only PrescriptionSetId/originalOrdinationsId is used.
originalOrdinationsId/PrescriptionSetId is in the form of a UUID.
RowId and ProductRowId are counters.
The format is "PrescriptionSetId/Originalordinationsid - PrescriptionItemid/RadnummerNEF",  i.e. UUID-x-y. Example 123e4567-e89b-12d3-a456-426655440000-2-1, where the ending "2-1" are RowId-ProductRowId.

# differential.element[].short
active | on-hold | cancelled | completed | stopped

# differential.element[].definition
The status of the prescription. The following statuses will be used: active, cancelled, on-hold (suspended), completed and stopped. The following statuses will not be used: entered-in-error, draft and unknown.

# differential.element[].definition
Set by the Swedish E-health Agency.
Reason for the current status of the prescription.

# differential.element[].definition
Shall only be used for dose dispensed prescriptions. Indicates that actions may need to be taken before next ordinary production date.

# differential.element[].definition
Identifies the medical product or medical consumable being prescribed. 
Medical products are prescribed using both NPL-id (medical product) and NPL-pack-id (packaged medical product).
Medical consumables are prescribed using item number (sv varunummer).

# differential.element[].definition
A unique identifier of a medical product according to "Nationellt produktregister för läkemedel" provided by the Swedish Medical Products Agency (sv Läkemedelsverket)

# differential.element[].comment
The naming system http://electronichealth.se/fhir/NamingSystem/nplid includes both NPL ID defined by Läkemedelsverket and SB ID defined by E-hälsomyndigheten

# differential.element[].definition
A unique identifier of a medical product package according to "Nationellt produktregister för läkemedel" provided by the Swedish Medical Products Agency (sv Läkemedelsverket)

# differential.element[].comment
The naming system http://electronichealth.se/fhir/NamingSystem/nplpackid includes both NPL-Pack ID defined by Läkemedelsverket and SB-Pack ID defined by E-hälsomyndigheten

# differential.element[].definition
A unique identifier of a medical consumable according to "Nationellt produktregister för läkemedel" provided by the Swedish Medical Products Agency (sv Läkemedelsverket)
Also a non-unique identifier of a medical product package.

# differential.element[].comment
Minimum string length: 6
Maximum string length: 6

# differential.element[].short
Information about the prescribed article

# differential.element[].definition
FOR FUTURE USE, SHOULD NOT BE USED!
Used to provide information about the prescribed article when a specified article isn´t available. For example when prescribing extemporaneous preparations.

# differential.element[].definition
Patient resource representing the person to whom the medical product will be given.
When the patient has a Swedish personal identity number (personnummer) the patient shall be provided as a referenced Patient resorce. If the patient does not have a Swedish personal identity number the Patient resource should be contained in the MedicationRequest resource.

# differential.element[].short
When prescription was initially authored

# differential.element[].definition
The date and time when the prescription was authored.

# differential.element[].comment
The time part is not mandatory, only a date may be provided.

# differential.element[].short
The practitioner who prescribed the article

# differential.element[].definition
The practitioner who prescribed the article

# differential.element[].definition
The reason stated by the practitioner for ordering a medical product (behandlingsorsak). A code from "Nationell källa för ordinationsorsak" which is a code system that is defined by the Swedish National Board of Health and Welfare (Socialstyrelsen). The code system consists of SnomedCT codes for reasons. Each medical product has of a selection of valid SnomedCT reason codes.
The reason shall also be expressed in a way that can be easily understood by the patient (behandlingsändamål). This should be entered in nllPatientTreatmentReason.
If there is no available code that describes the reason, then the code "OTH" (Other) shall be used. In that case a text describing the reason must be provided in reasonCode.text.

# differential.element[].definition
Marks masked data, ie why data is missing.

# differential.element[].definition
If no code could be chosen from "Nationell källa för ordinationsorsak" an other reason may be entered here.

# differential.element[].definition
Prescriptions in the Swedish National Medication List can contain 4 different kinds of notes:
pre=Prescribers comment (Förskrivarens kommentar, read/write)
pha=Pharmacists comment (Apotekets kommentar, read/write)
not=Prescribers note (Notat förskrivare, read only, will be deprecated)
dli=Delivery message (Leveransmeddelande, read only, will be deprecated)

# differential.element[].comment
Maximum string length prescribers comment (Förskrivarens kommentar): 35
Maximum string length pharmacists comment (Apotekets kommentar): 512
Maximum string length prescribers note (Notat förskrivare): 255
Maximum string length delivery message (Leveransmeddelande): 35

# differential.element[].definition
Mandatory for medications and technical spirit

# differential.element[].definition
Dosage instructions in terms that are understood by the patient.

# differential.element[].short
Number of packages prescribed per dispense

# differential.element[].definition
The number of packages prescribed per dispense. Not used for dose dispensed prescriptions.

# differential.element[].definition
Indicates if the prescription should be dose dispensed.

# differential.element[].short
Prescription according to the Communicable Diseases Act

# differential.element[].definition
Indicates of the prescription is created according to the Communicable Diseases Act (Smittskyddslagen)

# differential.element[].definition
Indicates if the patient is eligible to benefits according to the Pharmaceutical Benefits Act (Lag (2002:160) om läkemedelsförmån)

# differential.element[].definition
Only relevant if the medication has restrictions for reimbursement.
Indicates if the patient fulfills the conditions for the prescribed medication.

# differential.element[].definition
Amount of medication to supply in total for this prescription. Calculated be the Swedish E-health Agency.

# differential.element[].definition
Total amount prescribed in this prescription. Calculated by the Swedish e-health Agency. Not used for dose dispensed prescriptions.
The unit used is the unit specified in VARA (the Swedish national registry for medical products) for the prescribed medical product.

# differential.element[].definition
The remaining quantity that may be dispensed for this prescription. Calculated by the Swedish e-health Agency.  Not used for dose dispensed prescriptions.
The unit used is the unit specified in VARA (the Swedish national registry for medical products) for the prescribed medical product.

# differential.element[].definition
Information needed for calculating benefit

# differential.element[].short
Indication if daily quantity can't be calculated

# differential.element[].definition
The number of fills this prescriptions has remaining. Calculated by the Swedish E-health Agency. Not used for dose dispensed prescriptions.

# differential.element[].definition
Receiving Pharmacy is used when the patient does not have a Swedish national identification number ("personnummer"). The patient has to pick up his/her medication at the receiving pharmacy where he/she is identified through name, birthdate and sex.
The receiving pharmacy is tied to the physical adress. This means that if the premises are taken over by a different organization, the prescription will still be available at the same physical adress,

# differential.element[].definition
The prescribers cost center code when making the prescription. Used for benefit billing within the regions.

# differential.element[].comment
Minimum string length: 3
Maximum string length: 13

# differential.element[].definition
Only used for dose dispensed prescriptions.
Substitution is opposed (sv: bytes ej) by either the pharmacist or the patient. This information can be saved on the prescription as the patient isn't present when the dispensing takes place.

# differential.element[].definition
Number of dispenses allowed (sv. förskrivet antal uttag) is the common way in Sweden of communicating the total number of dispenses that can be performed. The standard field number of repeats allowed is similar but does not include the first dispense. The two terms are related by the formula numberOfRepeatsAllowed +1 = numberOfDispensesAllowed.

# differential.element[].definition
Used for indicating "Trial Fill". May only be one package, usually the smallest package available. Not used for dose dispensed prescriptions.

# differential.element[].definition
The minimum period of time that must occur between dispenses of the medical product. Not used for dose dispensed prescriptions.

# differential.element[].definition
This indicates the validity period of a prescription (stale dating the Prescription). I no validityPeriod.end is provided, then it will be calculated by the Swedish E-health Agency. The validity period may not be longer than one year.

# differential.element[].definition
Not used for dose dispensed prescriptions
The first dispense must occur before this date. If not, the prescription will be invalidated.

# differential.element[].definition
Last date when dispensing is allowed. If no date is provided it will be calculated by the Swedish E-health Agency.
NB! This is only handled as a date, the time part of the dateTime is not used.

# differential.element[].definition
Not used for dose dispensed prescriptions.
An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.  A prescriber may explicitly say that zero refills are permitted after the initial dispense.

# differential.element[].comment
If using this as basis for displaying "total number of authorized fills", add 1 to this number. This is because the total number of dispenses is the original dispense + additional dispenses stipulated by "number of repeats allowed".

# differential.element[].definition
The amount that is to be dispensed for one fill.
The unit used is the unit specified in VARA (the Swedish national registry for medical products) for the prescribed medical product.
Calculated by the Swedish E-health Agency based on nllNumberOfPackagesPrescibed and the quantity of medication in the package.
Not used for dose dispensed prescriptions.

# differential.element[].comment
This element is labeled as a modifier because whether substitution is allow or not, it cannot be ignored.
A missing value is the same as substitution allowed

# differential.element[].meaningWhenMissing
A missing value is the same as substitution allowed

# differential.element[].short
A prescription that is being/has been replaced/renewed

# differential.element[].definition
When replacing or renewing a prescription, the version of the replaced/renewed prescription must be provided in the POST operation.
When reading a prescription, the reference to the replaced/renewed prescription will not be version specific.

# differential.element[].short
Automatic Format and Constitution Control warning (AFF-varning)

# differential.element[].definition
Read only for MedicationRequest.
Automatic Format and Constitution Control (AFF) warning generated by the Swedish eHealth Agency according to the current conditions.