Package ca.uhn.fhir.narrative2
Class BaseNarrativeGenerator
- java.lang.Object
-
- ca.uhn.fhir.narrative2.BaseNarrativeGenerator
-
- All Implemented Interfaces:
INarrativeGenerator
- Direct Known Subclasses:
ThymeleafNarrativeGenerator
public abstract class BaseNarrativeGenerator extends Object implements INarrativeGenerator
-
-
Constructor Summary
Constructors Constructor Description BaseNarrativeGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringapplyTemplate(FhirContext theFhirContext, INarrativeTemplate theTemplate, IBase theTargetContext)static StringcleanWhitespace(String theResult)Trims the superfluous whitespace out of an HTML blockINarrativeTemplateManifestgetManifest()protected abstract EnumSet<TemplateTypeEnum>getStyle()booleanpopulateResourceNarrative(FhirContext theFhirContext, IBaseResource theResource)Generate any narratives for the given resource that have applicable templates, and populates the appropriate field(s).voidsetManifest(INarrativeTemplateManifest theManifest)
-
-
-
Constructor Detail
-
BaseNarrativeGenerator
public BaseNarrativeGenerator()
-
-
Method Detail
-
getManifest
public INarrativeTemplateManifest getManifest()
-
setManifest
public void setManifest(INarrativeTemplateManifest theManifest)
-
populateResourceNarrative
public boolean populateResourceNarrative(FhirContext theFhirContext, IBaseResource theResource)
Description copied from interface:INarrativeGeneratorGenerate any narratives for the given resource that have applicable templates, and populates the appropriate field(s). This almost always means theResource.text.narrativefield, but for some resource types it can mean other fields (e.g.Composition.- Specified by:
populateResourceNarrativein interfaceINarrativeGenerator- Returns:
- Returns
trueif a narrative was actually generated
-
applyTemplate
protected abstract String applyTemplate(FhirContext theFhirContext, INarrativeTemplate theTemplate, IBase theTargetContext)
-
getStyle
protected abstract EnumSet<TemplateTypeEnum> getStyle()
-
cleanWhitespace
public static String cleanWhitespace(String theResult)
Trims the superfluous whitespace out of an HTML block
-
-