{
displayOrder: ["extension", "timingExtension", "timingRepeatExtension"],
fromExtensionsToString: ({extensions, language}) => {
if (extensions === undefined || extensions.length === 0) {
return undefined;
}
const parts = extensions.map(extension => {
switch(extension.url) {
case "https://www.ehealth.fgov.be/standards/fhir/medication/StructureDefinition/DosageOverride":
let dosageOverride = extension.valueBoolean;
return `[${language} translation of "dosageOverride" set to "${dosageOverride}"]`;
case "https://www.ehealth.fgov.be/standards/fhir/medication/StructureDefinition/DosageOverrideReason":
return extension.valueCodeableConcept.text;
default:
return `[${language} translation of "${JSON.stringify(extension)}"]`;
}
});
return parts.join(" | ");
}
}