CDA Section-level Narrative Generation
The CDA Exchange+ module provides several methods of populating the <text>
element of each section in the document.
If the field Composition.section.text
is populated in the provided or generated Composition
, the contents of that field will be transcribed into the <text>
element of the corresponding section of the CDA document. This is the only means of populating the <text>
element if the section
does not contain any entries.
If the field Composition.section.text
is not populated for a given FHIR section, the module will attempt to generate a <text>
element for the corresponding CDA section from the entries of the section.
This generated narrative will take the form of a simple tabular summary of the most relevant fields of the entries. The specific format of these tables will vary from section to section.
If the default generated narrative does not meet your business needs, it is possible to override the default narrative templates using the Narrative Generator module.
In order to generate a single, cohesive narrative block for the whole section, the CDA Exchange+ module copies the entries from the
Composition.section
into a Bundle
resource and passes this
Bundle
to the Narrative Generator. Therefore, your custom template must be written to accept a Bundle
as its input and iterate over the entries of that Bundle
to find the individual resources.
In order to disambiguate which template file to apply to each
Bundle
, CDA Exchange+ uses Composition.section.code
as a discriminator. Your manifest file will need to include these codes to facilitate filtering. The value of Composition.section.code
must be placed in a property my_section.tag
as shown in the example below.
allergyIntolerance.resourceType=Bundle
allergyIntolerance.tag=http://loinc.org|48765-2
allergyIntolerance.narrative=file:my_file_path/allergy_intolerance_template.html
encounter.resourceType=Bundle
encounter.tag=http://loinc.org|46240-8
encounter.narrative=file:my_file_path/encounter_template.html
A Composition.section
may have nested section
s to group the entries. Since a Bundle
does not provide such a nested structure,
all the entries in the section will be flattened into a single list in the Bundle
provided to the template.
If any section does not have a specific template defined for its
Composition.section.code
, default text will be added that simply states that no narrative template exists for the section.
You are about to leave the Smile Digital Health documentation and navigate to the Open Source HAPI-FHIR Documentation.