Class HtmlNarrativeGenerator
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.narrative.html.HtmlNarrativeGenerator
A generator of narrative as HTML content.
The template engine is Thymeleaf. Templates are stored in '/resources/narrative/templates'.
- Author:
- Quentin Ligier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EnumMap<NarrativeLanguage,
PropertyResourceBundle> The resource bundle that contains the translations.protected final ca.uhn.fhir.context.FhirContext
The FHIR context.protected MedicationImageProvider
A provider of images for medications.protected final NarrativeFormat
protected final org.thymeleaf.TemplateEngine
The Thymeleaf template engine.protected final ValueSetEnumNarrativeForPatientService
A provider of better display name for enums, targeted at patients. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate
(ChEmedEprDocumentPmlc document, NarrativeLanguage lang) Generates the narrative for a medication card and return it as HTML content.generate
(ChEmedEprDocumentPre document, NarrativeLanguage lang) Generates the narrative for a prescription and return it as HTML content.void
setMedicationImageProvider
(@Nullable MedicationImageProvider medicationImageProvider) Sets the medication images provider.
-
Field Details
-
fhirContext
protected final ca.uhn.fhir.context.FhirContext fhirContextThe FHIR context. -
templateEngine
protected final org.thymeleaf.TemplateEngine templateEngineThe Thymeleaf template engine. -
narrativeFormat
-
bundles
The resource bundle that contains the translations. -
valueSetEnumNarrativeForPatientService
A provider of better display name for enums, targeted at patients. -
medicationImageProvider
A provider of images for medications.
-
-
Constructor Details
-
HtmlNarrativeGenerator
- Throws:
IOException
-
-
Method Details
-
generate
Generates the narrative for a medication card and return it as HTML content.- Parameters:
document
- The medication card document.lang
- The language of the narrative.- Returns:
- The HTML content of the narrative.
-
generate
Generates the narrative for a prescription and return it as HTML content.- Parameters:
document
- The prescription document.lang
- The language of the narrative.- Returns:
- The HTML content of the narrative.
-
setMedicationImageProvider
Sets the medication images provider.- Parameters:
medicationImageProvider
- The medication images provider to use, ornull
.
-