Class HtmlNarrativeGenerator

java.lang.Object
org.projecthusky.fhir.emed.ch.epr.narrative.html.HtmlNarrativeGenerator

public class HtmlNarrativeGenerator extends Object
A generator of narrative as HTML content.

The template engine is Thymeleaf. Templates are stored in '/resources/narrative/templates'.

Author:
Quentin Ligier
  • Field Details

    • fhirContext

      protected final ca.uhn.fhir.context.FhirContext fhirContext
      The FHIR context.
    • templateEngine

      protected final org.thymeleaf.TemplateEngine templateEngine
      The Thymeleaf template engine.
    • bundles

      The resource bundle that contains the translations.
    • valueSetEnumNarrativeForPatientService

      protected final ValueSetEnumNarrativeForPatientService valueSetEnumNarrativeForPatientService
      A provider of better display name for enums, targeted at patients.
    • medicationImageProvider

      protected MedicationImageProvider medicationImageProvider
      A provider of images for medications.
  • Constructor Details

  • Method Details

    • generate

      public String generate(ChEmedEprDocumentPmlc document, NarrativeLanguage lang)
      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

      public String generate(ChEmedEprDocumentPre document, NarrativeLanguage lang)
      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

      public void setMedicationImageProvider(@Nullable MedicationImageProvider medicationImageProvider)
      Sets the medication images provider.
      Parameters:
      medicationImageProvider - The medication images provider to use, or null.