A narrative generator for fhir resources using HAPI-FHIR and Thymeleaf.
- Entry point:
src/main/java/fr/gouv/esante/fhirNarrativeGenerator/App.java - JSON output writer:
src/main/java/fr/gouv/esante/fhirNarrativeGenerator/JsonFileCreator.java - Properties loader:
src/main/java/fr/gouv/esante/fhirNarrativeGenerator/PropertiesUtil.java - Runtime version helper:
src/main/java/fr/gouv/esante/fhirNarrativeGenerator/VersionUtil.java - Thymeleaf narrative template:
src/main/resources/NamingSystem.html - Template configuration:
src/main/resources/narrative.properties - Execution configuration (input/output paths):
configuration.properties - Build:
pom.xml
- Example input JSON:
target/input/namingSystem_IheRoleCode.json - Example generated outputs:
target/output/namingSystem_ADICAP_withNarrativeGenerated.jsontarget/output/namingSystem_UCUM_withNarrativeGenerated.json- other files under
target/output/
- Unit tests:
src/test/java/fr/gouv/esante/fhirNarrativeGenerator/AppTest.java— reports intarget/surefire-reports/
- Build:
mvn clean package - Run:
mvn org.codehaus.mojo:exec-maven-plugin:3.1.0:java -Dexec.mainClass="fr.gouv.esante.fhirNarrativeGenerator.App"
The application reads JSON files from the directory configured in configuration.properties (inputFileDirectory) and writes results to outputFileDirectory.
- Edit the Thymeleaf template:
src/main/resources/NamingSystem.html - If you move the template, update
src/main/resources/narrative.propertiesand rebuild.
Log4j configuration: src/main/resources/log4j2.properties (also copied to target/classes/).
- Invalid input / JSON parsing: logic in
App.java - File writing:
JsonFileCreator.java - Missing properties:
PropertiesUtil.javaandconfiguration.properties
- Unit tests:
src/test/java/fr/gouv/esante/fhirNarrativeGenerator/AppTest.java - Test reports:
target/surefire-reports/
Edit the referenced files to modify behavior or templates.