Package org.hl7.fhir.r4.utils
Class NarrativeGenerator
- java.lang.Object
-
- org.hl7.fhir.r4.utils.NarrativeGenerator
-
- All Implemented Interfaces:
INarrativeGenerator
public class NarrativeGenerator extends Object implements INarrativeGenerator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classNarrativeGenerator.ConceptMapRenderInstructionsstatic interfaceNarrativeGenerator.ILiquidTemplateProviderstatic interfaceNarrativeGenerator.IReferenceResolverstatic interfaceNarrativeGenerator.ITypeParserclassNarrativeGenerator.ObservationNodestatic classNarrativeGenerator.ResourceContextstatic classNarrativeGenerator.ResourceWithReferenceclassNarrativeGenerator.ResourceWrapperDirectclassNarrativeGenerator.ResourceWrapperMetaElementclassNarrativeGenerator.UsedConceptMap
-
Constructor Summary
Constructors Constructor Description NarrativeGenerator(String prefix, String basePath, IWorkerContext context)NarrativeGenerator(String prefix, String basePath, IWorkerContext context, NarrativeGenerator.IReferenceResolver resolver)
-
Method Summary
-
-
-
Constructor Detail
-
NarrativeGenerator
public NarrativeGenerator(String prefix, String basePath, IWorkerContext context)
-
NarrativeGenerator
public NarrativeGenerator(String prefix, String basePath, IWorkerContext context, NarrativeGenerator.IReferenceResolver resolver)
-
-
Method Detail
-
generate
public boolean generate(Bundle b, boolean evenIfAlreadyHasNarrative, Set<String> outputTracker) throws EOperationOutcome, org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
EOperationOutcomeorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
generate
public boolean generate(DomainResource r, Set<String> outputTracker) throws EOperationOutcome, org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
EOperationOutcomeorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, DomainResource r, Set<String> outputTracker) throws EOperationOutcome, org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
EOperationOutcomeorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
setLiquidServices
public NarrativeGenerator setLiquidServices(NarrativeGenerator.ILiquidTemplateProvider templateProvider, FHIRPathEngine.IEvaluationContext services)
-
parseType
public Base parseType(String xml, String type) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
getRenderingMaps
public List<NarrativeGenerator.ConceptMapRenderInstructions> getRenderingMaps()
-
getHeaderLevelContext
public int getHeaderLevelContext()
-
setHeaderLevelContext
public NarrativeGenerator setHeaderLevelContext(int headerLevelContext)
-
getTooCostlyNoteEmpty
public String getTooCostlyNoteEmpty()
-
setTooCostlyNoteEmpty
public NarrativeGenerator setTooCostlyNoteEmpty(String tooCostlyNoteEmpty)
-
getTooCostlyNoteNotEmpty
public String getTooCostlyNoteNotEmpty()
-
setTooCostlyNoteNotEmpty
public NarrativeGenerator setTooCostlyNoteNotEmpty(String tooCostlyNoteNotEmpty)
-
generate
public String generate(Element doc) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
generate
public String generate(NarrativeGenerator.ResourceContext rcontext, Element doc) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
generate
public String generate(Element er, boolean showCodeDetails, NarrativeGenerator.ITypeParser parser) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
generate
public String generate(NarrativeGenerator.ResourceContext rcontext, Element er, boolean showCodeDetails, NarrativeGenerator.ITypeParser parser) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
displayPeriod
public static String displayPeriod(Period p)
-
describeSystem
public static String describeSystem(String system)
-
displayCodeableConcept
public String displayCodeableConcept(CodeableConcept cc)
-
displayRange
public String displayRange(Range q)
-
displayHumanName
public static String displayHumanName(HumanName name)
-
displayContactPoint
public static String displayContactPoint(ContactPoint contact)
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, ConceptMap cm) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException
- Throws:
org.hl7.fhir.exceptions.FHIRFormatErrororg.hl7.fhir.exceptions.DefinitionExceptionIOException
-
renderCSDetailsLink
public void renderCSDetailsLink(org.hl7.fhir.utilities.xhtml.XhtmlNode tr, String url)
-
getNarrative
public Element getNarrative(Element er)
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, CodeSystem cs, boolean header, String lang) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException
This generate is optimised for the FHIR build process itself in as much as it generates hyperlinks in the narrative that are only going to be correct for the purposes of the build. This is to be reviewed in the future.- Parameters:
vs-codeSystems-- Throws:
IOExceptionorg.hl7.fhir.exceptions.DefinitionExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorException
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, ValueSet vs, boolean header) throws org.hl7.fhir.exceptions.FHIRException, IOException
This generate is optimised for the FHIR build process itself in as much as it generates hyperlinks in the narrative that are only going to be correct for the purposes of the build. This is to be reviewed in the future.- Parameters:
vs-codeSystems-- Throws:
org.hl7.fhir.exceptions.FHIRExceptionIOExceptionException
-
generate
public void generate(NarrativeGenerator.ResourceContext rcontext, ValueSet vs, ValueSet src, boolean header) throws org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
org.hl7.fhir.exceptions.FHIRExceptionIOException
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, OperationOutcome op) throws org.hl7.fhir.exceptions.DefinitionException
This generate is optimised for the build tool in that it tracks the source extension. But it can be used for any other use.- Parameters:
vs-codeSystems-- Throws:
org.hl7.fhir.exceptions.DefinitionExceptionException
-
genType
public String genType(Type type) throws org.hl7.fhir.exceptions.DefinitionException
- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
gen
public String gen(CodeableConcept code)
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, StructureDefinition sd, Set<String> outputTracker) throws EOperationOutcome, org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
EOperationOutcomeorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, ImplementationGuide ig) throws EOperationOutcome, org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
EOperationOutcomeorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, OperationDefinition opd) throws EOperationOutcome, org.hl7.fhir.exceptions.FHIRException, IOException
- Throws:
EOperationOutcomeorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, CompartmentDefinition cpd)
-
generate
public boolean generate(NarrativeGenerator.ResourceContext rcontext, CapabilityStatement conf) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException
- Throws:
org.hl7.fhir.exceptions.FHIRFormatErrororg.hl7.fhir.exceptions.DefinitionExceptionIOException
-
generateDocumentNarrative
public org.hl7.fhir.utilities.xhtml.XhtmlNode generateDocumentNarrative(Bundle feed)
-
generateDiagnosticReport
public org.hl7.fhir.utilities.xhtml.XhtmlNode generateDiagnosticReport(org.hl7.fhir.r4.utils.NarrativeGenerator.ResourceWrapper dr)
-
renderBundle
public org.hl7.fhir.utilities.xhtml.XhtmlNode renderBundle(Bundle b) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
renderBundle
public org.hl7.fhir.utilities.xhtml.XhtmlNode renderBundle(Element element) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getDefinitionsTarget
public String getDefinitionsTarget()
-
setDefinitionsTarget
public void setDefinitionsTarget(String definitionsTarget)
-
getCorePath
public String getCorePath()
-
setCorePath
public void setCorePath(String corePath)
-
getDestDir
public String getDestDir()
-
setDestDir
public void setDestDir(String destDir)
-
getPkp
public ProfileUtilities.ProfileKnowledgeProvider getPkp()
-
setPkp
public NarrativeGenerator setPkp(ProfileUtilities.ProfileKnowledgeProvider pkp)
-
isPretty
public boolean isPretty()
-
setPretty
public NarrativeGenerator setPretty(boolean pretty)
-
isCanonicalUrlsAsLinks
public boolean isCanonicalUrlsAsLinks()
-
setCanonicalUrlsAsLinks
public void setCanonicalUrlsAsLinks(boolean canonicalUrlsAsLinks)
- Specified by:
setCanonicalUrlsAsLinksin interfaceINarrativeGenerator
-
getSnomedEdition
public String getSnomedEdition()
-
setSnomedEdition
public NarrativeGenerator setSnomedEdition(String snomedEdition)
-
getTerminologyServiceOptions
public org.hl7.fhir.utilities.TerminologyServiceOptions getTerminologyServiceOptions()
-
setTerminologyServiceOptions
public void setTerminologyServiceOptions(org.hl7.fhir.utilities.TerminologyServiceOptions terminologyServiceOptions)
-
-