Package ca.uhn.fhir.narrative2
Class BaseNarrativeGenerator
java.lang.Object
ca.uhn.fhir.narrative2.BaseNarrativeGenerator
- All Implemented Interfaces:
INarrativeGenerator
- Direct Known Subclasses:
BaseThymeleafNarrativeGenerator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
applyTemplate
(FhirContext theFhirContext, INarrativeTemplate theTemplate, IBase theTargetContext) static String
cleanWhitespace
(String theResult) Trims the superfluous whitespace out of an HTML blockgenerateResourceNarrative
(FhirContext theFhirContext, IBaseResource theResource) Generates the narrative for the given resource and returns it as a stringprotected abstract NarrativeTemplateManifest
protected abstract EnumSet<TemplateTypeEnum>
getStyle()
protected List<INarrativeTemplate>
getTemplateForElement
(FhirContext theFhirContext, IBase theElement) boolean
populateResourceNarrative
(FhirContext theFhirContext, IBaseResource theResource) Generate any narratives for the given resource that have applicable templates, and populates the appropriate field(s).
-
Constructor Details
-
BaseNarrativeGenerator
public BaseNarrativeGenerator()
-
-
Method Details
-
populateResourceNarrative
Description copied from interface:INarrativeGenerator
Generate any narratives for the given resource that have applicable templates, and populates the appropriate field(s). This almost always means theResource.text.narrative
field, but for some resource types it can mean other fields (e.g.Composition.
- Specified by:
populateResourceNarrative
in interfaceINarrativeGenerator
- Returns:
- Returns
true
if a narrative was actually generated
-
generateResourceNarrative
Description copied from interface:INarrativeGenerator
Generates the narrative for the given resource and returns it as a string- Specified by:
generateResourceNarrative
in interfaceINarrativeGenerator
-
getTemplateForElement
protected List<INarrativeTemplate> getTemplateForElement(FhirContext theFhirContext, IBase theElement) -
applyTemplate
protected abstract String applyTemplate(FhirContext theFhirContext, INarrativeTemplate theTemplate, IBase theTargetContext) -
getStyle
-
cleanWhitespace
Trims the superfluous whitespace out of an HTML block -
getManifest
-