Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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 PropertyDetailss

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>
			<tr th:if="${not resource.identifierFirstRep.empty}">
                       <td>Identifier</td>
                       <td th:narrative="${resource.identifierFirstRep}"></td>
            </tr>
            <tr th:if="${not resource.addressFirstRep.empty}">
                      <td>Address</td>
                      <td th:narrative="${resource.addressFirstRep}"></td>
             </tr>
			 
		</tbody>
		</table>
</div>

<!--/*-->
        </body>
</html>
<!--*/-->


(1) - http://jamesagnew.github.io/hapi-fhir/doc_narrative.html

  • No labels