π fromExtensionsToString
- Human readable text
- Dosage
- Configuration
{
"extension": [
{
"url": "https://www.ehealth.fgov.be/standards/fhir/medication/StructureDefinition/DosageOverride",
"valueBoolean": true
},
{
"url": "https://www.ehealth.fgov.be/standards/fhir/medication/StructureDefinition/DosageOverrideReason",
"valueCodeableConcept": {
"text": "Respect my authority ! - Eric Cartman"
}
}
]
}
{
displayOrder: ["extension"],
fromExtensionsToString: ({extensions, language}) => {
// If no extensions, skip it
if (extensions === undefined || extensions.length === 0) {
return undefined;
}
// Your own logic here ;)
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(" | ");
}
}