use crate::category::Root;
use crate::crosswalk::Crosswalk;
use crate::crosswalk::EhnElement;
use crate::crosswalk::Populate;
use crate::crosswalk::Row;
pub const MPD_MEDICATION_DISPENSE: &str =
"http://hl7.eu/fhir/mpd/StructureDefinition/MedicationDispense-eu-mpd";
pub static DISPENSATION: Crosswalk<'static> = Crosswalk {
root: Root {
model: "http://www.xt-ehr.eu/fhir/models/StructureDefinition/EHDSMedicationDispense",
obligations: "http://www.xt-ehr.eu/fhir/models/StructureDefinition/EHDSMedicationDispenseObligations",
},
profile: MPD_MEDICATION_DISPENSE,
companions: &[],
sliced: "MedicationDispense.extension",
ehn: EHN,
rows: ROWS,
gaps: &[],
};
const EHN: &[EhnElement] = &[
ehn(
"B.1",
"Dispensation information (provided by the dispensing pharmacy)",
),
ehn("B.1.1", "Identifier of the dispenser"),
ehn("B.1.4", "Identifier of the pharmacy"),
ehn("B.1.5", "Address of the pharmacy"),
ehn("B.1.7", "Identifier of the prescription"),
ehn("B.1.8", "Medicinal product"),
ehn("B.1.9", "Dispensed quantity"),
ehn("B.1.10", "Dispensation date"),
ehn("B.1.11", "Substitution"),
];
const fn ehn(id: &'static str, name: &'static str) -> EhnElement {
EhnElement { id, name }
}
const fn row(
path: &'static str,
ehn: &'static [&'static str],
producer: Option<Populate>,
eps: &'static str,
) -> Row {
Row {
path,
ehn,
producer,
eps,
contexts: &[],
}
}
const SHALL: Option<Populate> = Some(Populate::Shall);
const SHOULD: Option<Populate> = Some(Populate::Should);
const ROWS: &[Row] = &[
row(
"EHDSMedicationDispense.header.subject",
&[],
SHALL,
"MedicationDispense.subject",
),
row(
"EHDSMedicationDispense.header.identifier",
&[],
None,
"MedicationDispense.identifier",
),
row(
"EHDSMedicationDispense.header.author[x]",
&["B.1.1", "B.1.4"],
SHALL,
"MedicationDispense.performer.actor",
),
row(
"EHDSMedicationDispense.header.date",
&[],
SHALL,
"MedicationDispense.extension:recorded",
),
row(
"EHDSMedicationDispense.header.status",
&[],
SHALL,
"MedicationDispense.status",
),
row(
"EHDSMedicationDispense.header.language",
&[],
None,
"MedicationDispense.language",
),
row(
"EHDSMedicationDispense.dispenseLocation",
&["B.1.5"],
None,
"MedicationDispense.location",
),
row(
"EHDSMedicationDispense.receiver[x]",
&[],
None,
"MedicationDispense.receiver",
),
row(
"EHDSMedicationDispense.relatedRequest",
&["B.1.7"],
SHALL,
"MedicationDispense.authorizingPrescription",
),
row(
"EHDSMedicationDispense.medication",
&["B.1.8"],
SHALL,
"MedicationDispense.medication[x]",
),
row(
"EHDSMedicationDispense.dispensedQuantity",
&["B.1.9"],
SHALL,
"MedicationDispense.quantity",
),
row(
"EHDSMedicationDispense.timeOfDispensation",
&["B.1.10"],
None,
"MedicationDispense.whenHandedOver",
),
row(
"EHDSMedicationDispense.substitutionOccurred",
&["B.1.11"],
None,
"MedicationDispense.substitution.wasSubstituted",
),
row(
"EHDSMedicationDispense.dosageInstructions",
&[],
SHOULD,
"MedicationDispense.dosageInstruction",
),
row(
"EHDSMedicationDispense.note",
&[],
None,
"MedicationDispense.note",
),
];