Package org.hl7.fhir.r5.renderers
Class ResourceRenderer
java.lang.Object
org.hl7.fhir.r5.renderers.Renderer
org.hl7.fhir.r5.renderers.DataRenderer
org.hl7.fhir.r5.renderers.ResourceRenderer
- All Implemented Interfaces:
CodeResolver
- Direct Known Subclasses:
ActorDefinitionRenderer
,BundleRenderer
,CapabilityStatementRenderer
,CompartmentDefinitionRenderer
,DiagnosticReportRenderer
,EncounterRenderer
,ImplementationGuideRenderer
,LibraryRenderer
,LiquidRenderer
,ListRenderer
,NamingSystemRenderer
,OperationOutcomeRenderer
,ParametersRenderer
,PatientRenderer
,ProfileDrivenRenderer
,ProvenanceRenderer
,QuestionnaireResponseRenderer
,RequirementsRenderer
,StructureDefinitionRenderer
,SubscriptionTopicRenderer
,TerminologyRenderer
,TestPlanRenderer
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
class
class
Nested classes/interfaces inherited from class org.hl7.fhir.r5.renderers.Renderer
Renderer.RenderingStatus
Nested classes/interfaces inherited from interface org.hl7.fhir.r5.renderers.CodeResolver
CodeResolver.CodeResolution
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
buildNarrative
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper r) org.hl7.fhir.utilities.xhtml.XhtmlNode
Just build the narrative that would go in the resource (per @renderResource()), but don't put it in the resourcevoid
buildSummary
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper r) abstract String
boolean
org.hl7.fhir.utilities.xhtml.XhtmlNode
void
describe
(org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper r) protected String
describeStatus
(String status, String experimental, ResourceWrapper dt, String deprecated) protected String
describeStatus
(Enumerations.PublicationStatus status, boolean experimental) protected String
describeStatus
(Enumerations.PublicationStatus status, boolean experimental, DateTimeType dt, Boolean deprecated) protected String
describeStatus
(Renderer.RenderingStatus status, CanonicalResource cr) protected String
describeStatus
(Renderer.RenderingStatus status, ResourceWrapper cr) protected String
displayCanonical
(ResourceWrapper canonical) displayReference
(Resource res, Reference r) protected String
protected <T extends Resource>
TfindCanonical
(Class<T> class_, String canonical, ResourceWrapper sourceOfReference) protected <T extends Resource>
TfindCanonical
(Class<T> class_, UriType canonical, ResourceWrapper sourceOfReference) Eventually this will be retired if and when there's no more direct renderersprotected void
generateCopyright
(org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper cs) protected void
generateCopyrightTableRow
(org.hl7.fhir.utilities.xhtml.XhtmlNode tbl, ResourceWrapper cs) void
genSummaryTable
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, CanonicalResource cr) void
genSummaryTable
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper cr) protected void
genSummaryTableContent
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode tbl, CanonicalResource cr) protected void
genSummaryTableContent
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode tbl, ResourceWrapper cr) protected String
getNameForResource
(ResourceWrapper resource) protected boolean
hasAnchorName
(org.hl7.fhir.utilities.xhtml.XhtmlNode x, String an) void
inject
(ResourceWrapper r, org.hl7.fhir.utilities.xhtml.XhtmlNode x, Narrative.NarrativeStatus status) boolean
protected String
static String
makeInternalBundleLink
(ResourceWrapper bundle, String fullUrl) void
markLanguage
(org.hl7.fhir.utilities.xhtml.XhtmlNode x) <T extends Resource>
voidrenderCanonical
(Renderer.RenderingStatus status, ResourceWrapper res, org.hl7.fhir.utilities.xhtml.XhtmlNode x, Class<T> class_, CanonicalType canonical) <T extends Resource>
voidrenderCanonical
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, Class<T> class_, ResourceWrapper canonical) protected void
renderCanonical
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper type) protected void
renderCommitteeLink
(org.hl7.fhir.utilities.xhtml.XhtmlNode x, CanonicalResource cr) protected void
renderCommitteeLink
(org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper cr) void
void
renderReference
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper type) this is overriden in ResourceRenderer where a better rendering is performedvoid
renderReference
(ResourceWrapper res, org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator gen, List<org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece> pieces, Reference r, boolean allowLinks) void
renderReference
(ResourceWrapper res, org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator gen, List<org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece> pieces, ResourceWrapper r, boolean allowLinks) void
given a resource, update it's narrative with the best rendering available.protected org.hl7.fhir.utilities.xhtml.XhtmlNode
renderResourceTechDetails
(ResourceWrapper r, org.hl7.fhir.utilities.xhtml.XhtmlNode x) protected org.hl7.fhir.utilities.xhtml.XhtmlNode
renderResourceTechDetails
(ResourceWrapper r, org.hl7.fhir.utilities.xhtml.XhtmlNode x, String desc) void
renderTable
(Renderer.RenderingStatus status, ResourceRenderer.TableData provider, org.hl7.fhir.utilities.xhtml.XhtmlNode x) protected void
renderUri
(Renderer.RenderingStatus status, ResourceWrapper resource, org.hl7.fhir.utilities.xhtml.XhtmlNode x, UriType uri) protected void
renderUri
(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper uri) protected Resolver.ResourceWithReference
resolveReference
(ResourceWrapper reference) protected Resolver.ResourceWithReference
resolveReference
(ResourceWrapper resource, String url, boolean followLinks) setMultiLangMode
(boolean multiLangMode) Methods inherited from class org.hl7.fhir.r5.renderers.DataRenderer
addMarkdown, addMarkdown, addTelecom, canRenderDataType, describeLang, describeVersion, display, displayBase, displayCodeableConcept, displayCoding, displayCoding, displayContactDetail, displayContactPoint, displayContactPoint, displayDataType, displayDataType, displayDateTime, displayHumanName, displayIdentifier, displayPeriod, displayQuantity, displayRange, displaySystem, getContext, getLinkForCode, getLocalizedBigDecimalValue, gt, gt, hasRenderableExtensions, hasRenderableExtensions, hasRenderableExtensions, makeAnchor, makeExceptionXhtml, processRelativeUrls, renderAddress, renderAnnotation, renderBase, renderCodeableConcept, renderCodeableReference, renderCoding, renderCoding, renderCoding, renderCodingWithDetails, renderContactPoint, renderDataRequirement, renderDataType, renderDataType, renderExpression, renderExtensionsInList, renderExtensionsInText, renderHumanName, renderIdentifier, renderMoney, renderPeriod, renderPrimitiveWithNoValue, renderPrimitiveWithNoValue, renderQuantity, renderQuantity, renderQuantity, renderRange, renderSampledData, renderTiming, renderTriggerDefinition, renderUsageContext, resolveCode, resolveCode, resolveCode, resolveCode, smartAddText, systemFromCanonical, versionFromCanonical
Methods inherited from class org.hl7.fhir.r5.renderers.Renderer
egt, formatPhrase, genStandardsStatus, getTranslatedCode, renderStatus, renderStatusDiv, renderStatusRow, renderStatusSummary, toStr, toStr, wrap, wrapNC, wrapWC
-
Field Details
-
xverManager
-
multiLangMode
-
-
Constructor Details
-
ResourceRenderer
-
-
Method Details
-
isMultiLangMode
-
setMultiLangMode
-
buildNarrative
public org.hl7.fhir.utilities.xhtml.XhtmlNode buildNarrative(ResourceWrapper dr) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, org.hl7.fhir.exceptions.FHIRException, IOException, EOperationOutcome Just build the narrative that would go in the resource (per @renderResource()), but don't put it in the resource- Parameters:
dr
-- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
org.hl7.fhir.exceptions.FHIRException
IOException
EOperationOutcome
-
renderResource
public void renderResource(ResourceWrapper r) throws IOException, org.hl7.fhir.exceptions.FHIRException, EOperationOutcome given a resource, update it's narrative with the best rendering available. ResourceWrapper is a facade to either a org.hl7.fhir.r5.model Resource, or to a org.hl7.fhir.r5.elementModel (which might a resource of any version). Note that some resource renderers - only canonical ones - only render native resources, and not element model ones. These may be migrated in the future (only reason not to is the sheer size of the task, though performance might be a factor)- Parameters:
r
- - the domain resource in question- Throws:
IOException
EOperationOutcome
org.hl7.fhir.exceptions.FHIRException
-
checkNarrative
public org.hl7.fhir.utilities.xhtml.XhtmlNode checkNarrative(ResourceWrapper r) throws IOException, org.hl7.fhir.exceptions.FHIRException, EOperationOutcome - Throws:
IOException
org.hl7.fhir.exceptions.FHIRException
EOperationOutcome
-
hasAnchorName
-
buildNarrative
public abstract void buildNarrative(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper r) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException, org.hl7.fhir.exceptions.FHIRException, EOperationOutcome - Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
IOException
org.hl7.fhir.exceptions.FHIRException
EOperationOutcome
-
buildSummary
public abstract String buildSummary(ResourceWrapper r) throws UnsupportedEncodingException, IOException -
buildSummary
public void buildSummary(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper r) throws UnsupportedEncodingException, IOException -
canonicalTitle
-
describe
public void describe(org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper r) throws UnsupportedEncodingException, IOException -
inject
public void inject(ResourceWrapper r, org.hl7.fhir.utilities.xhtml.XhtmlNode x, Narrative.NarrativeStatus status) throws IOException - Throws:
IOException
-
markLanguage
-
renderCanonical
protected void renderCanonical(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper type) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException - Overrides:
renderCanonical
in classDataRenderer
- Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
IOException
-
renderCanonical
public <T extends Resource> void renderCanonical(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, Class<T> class_, ResourceWrapper canonical) throws UnsupportedEncodingException, IOException -
displayCanonical
-
displayReference
- Overrides:
displayReference
in classDataRenderer
-
renderCanonical
public <T extends Resource> void renderCanonical(Renderer.RenderingStatus status, ResourceWrapper res, org.hl7.fhir.utilities.xhtml.XhtmlNode x, Class<T> class_, CanonicalType canonical) throws UnsupportedEncodingException, IOException - Type Parameters:
T
-- Parameters:
status
-res
-x
-class_
- - makes resolution faster, but can just be Resource.classcanonical
-- Throws:
UnsupportedEncodingException
IOException
-
renderReference
public void renderReference(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper type) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException Description copied from class:DataRenderer
this is overriden in ResourceRenderer where a better rendering is performed- Overrides:
renderReference
in classDataRenderer
- Parameters:
status
-x
-type
-- Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
IOException
-
renderReference
public void renderReference(ResourceWrapper res, org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator gen, List<org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece> pieces, Reference r, boolean allowLinks) throws UnsupportedEncodingException, IOException -
renderReference
public void renderReference(ResourceWrapper res, org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator gen, List<org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Piece> pieces, ResourceWrapper r, boolean allowLinks) throws UnsupportedEncodingException, IOException -
getNameForResource
-
renderUri
protected void renderUri(Renderer.RenderingStatus status, ResourceWrapper resource, org.hl7.fhir.utilities.xhtml.XhtmlNode x, UriType uri) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException - Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
IOException
-
renderUri
protected void renderUri(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper uri) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException - Overrides:
renderUri
in classDataRenderer
- Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
IOException
-
findCanonical
protected <T extends Resource> T findCanonical(Class<T> class_, UriType canonical, ResourceWrapper sourceOfReference) Eventually this will be retired if and when there's no more direct renderers- Type Parameters:
T
-
-
findCanonical
protected <T extends Resource> T findCanonical(Class<T> class_, String canonical, ResourceWrapper sourceOfReference) -
resolveReference
protected Resolver.ResourceWithReference resolveReference(ResourceWrapper resource, String url, boolean followLinks) -
resolveReference
-
makeIdFromBundleEntry
-
generateCopyright
-
generateCopyrightTableRow
protected void generateCopyrightTableRow(org.hl7.fhir.utilities.xhtml.XhtmlNode tbl, ResourceWrapper cs) -
displayReference
public String displayReference(Resource res, Reference r) throws UnsupportedEncodingException, IOException -
parseType
-
describeStatus
-
renderCommitteeLink
-
makeInternalBundleLink
-
canRender
-
renderResourceTechDetails
protected org.hl7.fhir.utilities.xhtml.XhtmlNode renderResourceTechDetails(ResourceWrapper r, org.hl7.fhir.utilities.xhtml.XhtmlNode x) throws UnsupportedEncodingException, org.hl7.fhir.exceptions.FHIRException, IOException - Throws:
UnsupportedEncodingException
org.hl7.fhir.exceptions.FHIRException
IOException
-
renderResourceTechDetails
protected org.hl7.fhir.utilities.xhtml.XhtmlNode renderResourceTechDetails(ResourceWrapper r, org.hl7.fhir.utilities.xhtml.XhtmlNode x, String desc) throws UnsupportedEncodingException, org.hl7.fhir.exceptions.FHIRException, IOException - Throws:
UnsupportedEncodingException
org.hl7.fhir.exceptions.FHIRException
IOException
-
getRendererType
-
renderTable
public void renderTable(Renderer.RenderingStatus status, ResourceRenderer.TableData provider, org.hl7.fhir.utilities.xhtml.XhtmlNode x) throws org.hl7.fhir.exceptions.FHIRFormatError, org.hl7.fhir.exceptions.DefinitionException, IOException - Throws:
org.hl7.fhir.exceptions.FHIRFormatError
org.hl7.fhir.exceptions.DefinitionException
IOException
-
renderOrError
- Throws:
IOException
-
genSummaryTable
public void genSummaryTable(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, ResourceWrapper cr) throws IOException - Throws:
IOException
-
genSummaryTableContent
protected void genSummaryTableContent(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode tbl, ResourceWrapper cr) throws IOException - Throws:
IOException
-
genSummaryTable
public void genSummaryTable(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode x, CanonicalResource cr) throws IOException - Throws:
IOException
-
genSummaryTableContent
protected void genSummaryTableContent(Renderer.RenderingStatus status, org.hl7.fhir.utilities.xhtml.XhtmlNode tbl, CanonicalResource cr) throws IOException - Throws:
IOException
-
renderCommitteeLink
-
describeStatus
-
describeStatus
-
describeStatus
protected String describeStatus(Enumerations.PublicationStatus status, boolean experimental, DateTimeType dt, Boolean deprecated) -
describeStatus
protected String describeStatus(String status, String experimental, ResourceWrapper dt, String deprecated)
-