Stream: hapi
Topic: Narrative auto-generation issue
Fei Yan (Oct 16 2019 at 21:13):
Hi all,
I am using HAPI's built-in narrative generator by calling setNarrativeGenerator as below:
FhirContext ctx = FhirContext.forR4();
ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
Later I put couple of resources (including Patient, Specimen, Organization, DiagnosticReport) into a bundle and sent to a JPA server. After the resources were created, only Patient and DiagnosticReport's narrative were generated as HTML format, the other 2 resources were not.
For Specimen and DiagnosticReport I am using different profiles (http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/diagnosticreport or specimen), and for Patient and Organization I am using original FHIR resource type.
Any help is appreciated. Thanks in advance.
Fei
Patrick Werner (Oct 17 2019 at 10:21):
The Thymleaf narrative generation is based on Templates: https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative
Patrick Werner (Oct 17 2019 at 10:22):
Only some resources have a template, but fell free to create templates for other resources.
PRs are welcome!
Fei Yan (Oct 17 2019 at 14:48):
@Patrick Werner Thank you
Last updated: Apr 12 2022 at 19:14 UTC