OpenMRS FHIR module support for adding custom narratives which can define through Thymeleaf HTML based syntax[1]
Configuring FHIR Module to support custom narratives
We have define two global properties within the module to enable custom narratives. Once they have cconfigured. servelet container need to be restarted.
Global Property | Detailss |
---|---|
fhir.isCustomerNarrativesEnabled | To enable custom narratives, this value need to be set to true. By default custom narratives generation is disabled in the server. |
fhir.customNarrativePropertiesPath | Once custom narratives enabled, the path of the narratives property file should be specified in here. |
Sample global property configuration screenshot
Sample custom narratives property file(narratives.properties) content
Patient.class=ca.uhn.fhir.model.dstu2.resource.Patient patient.narrative=file:/home/harsha/development/applications/Patient.html
Sample Patient narrative generator file defined using Thymeleaf HTML based syntax
<!--/* This top section is not exported as a part of the Narrative, it is only present so that this template can be viewed in a browser. --> <html> <head> <link rel="stylesheet" type="text/css" href="narrative.css"/> </head> <body> <!--*/--> <div> <div class="hapiHeaderText" th:if="${not resource.nameFirstRep.empty}" th:narrative="${resource.nameFirstRep}"/> <table class="hapiPropertyTable"> <tbody> </tbody> </table> </div> <!--/*--> </body> </html> <!--*/-->
(1) - http://jamesagnew.github.io/hapi-fhir/doc_narrative.html