Send medical information (sendMedication)
Prescriptions and medication list is sent to the national systems: Reseptformidleren (RF) which then forwards them to Kjernejournal (KJ) for patients listed there.
NOTE: To be able to process and do necessary consistency check, the latest $getMedication must be within a predefined timeframe, and must include a lookup in Reseptformidleren.
- EPJ sends compiled list of Medication as a Bundle with specified format (Based on a getMedication response)
- SFM validates incoming bundle (See specification and flow chart of validation further down)
- SFM analyses content and creates PLL and prescriptions in national format
- SFM adds signing to the new PLL, M1s and M5s depending on input
- SFM sends one or more M1/prescriptions to RF (in turn also forwarded to KJ)
- SFM sends one or more M5/withdrawals and PLL (M25.1) to RF (in turn also forwardet to KJ)
- SFM returns response to EPJ
- If validation fails SFM returns an OperationOutcome with specific errors on what has failed
Bundle validation (Step 2) Scroll down for further explanation for each SFM validates the $sendMedicationbundle against the last valid $getMedicationbundle. The general validation rules are these:
- The lookup threshold time for the latest RF lookup is 4 hours
- The composition identifier needs to match
- All PLL entries must be present when sending PLL, except for those that are:
- Discontinued over 3 months ago
- Have MedicationStatement.status entered-in-error
- All active RF resepts (Eskpederbar/UnderEkspedering) received in $getMedication response must be included at all times
The lookup threshold time for the latest RF lookup is 4 hours When a $sendMedication is performed it should be based upon a valid lookup in RF, this is done by first triggering a $getMedication call.
The $sendMedication request is based upon the latest valid $getMedicationresponse, where a successful call to RF has been made. The $getMedicationresponse is valid for 4 hours. The user can perform multiple $sendMedicationcalls within that timeframe, as long as a new $getMedicationcall is not made.
When performing multiple $sendMedication requests without a new $getMedication, the $sendMedication bundle will be validated against the previous $sendMedicationbundle. This is done to make sure anything added in the previous $sendMedicationrequest will still be present in the current $sendMedication request.
There are two exceptions of this rule:
- When a $sendMedication is performed by an MD doctor(org), in that case a new $getMedication must be triggered in between each $sendMedication request.
- When a $sendMedication is performed for a patient that does not have a FNR or a DNR SFM does not validate against the time threshold.
The composition identifier needs to match When constructing the $sendMedication request, it needs to target the latest valid $getMedication.
This is done by adding the composition identifier from the $getMedication response in the “RelatesTo” element of the $sendMedication bundle, situated in the composition resource entry in the bundle.
"relatesTo": {
"code": "replaces",
"targetIdentifier": {
"value": "<<GetMedication composition identifier>>"
}
}
This identifier is used to validate against the correct $getMedication bundle.
When performing multiple subsequent $sendMedication request, they should all target the same $getMedicationbundle, as long as a new $getMedication call is not made.
If the composition identifier does not reference a valid $getMedication bundle, the $sendMedication request will fail.
All PLL entries must be present When PLL should be sent in the $sendMedication request (“createPLL: true) all PLL entries returned in the $getMedication response must be included in the $sendMedication request.
Entries not included in the validation and can will not be included in the PLL are:
- Entries that have been discontinued more 3 months ago.
- Entries that have MedicationStatement status entered-in-error (note that PLL validation does not validate vaccines or NIB/FIB, as those are not included in PLL)
All active RF resepts (Eskpederbar/UnderEkspedering) must be included at all times It is important that at all times all ekspederbar and under ekspedering resepts returned in the $getMedication response are included in the $sendMedication request.
This rule must be validated no matter if sending a PLL or not.