Skip to content

3abdel3ali/fhirNarrativeGenerator

Repository files navigation

fhirNarrativeGenerator

A narrative generator for fhir resources using HAPI-FHIR and Thymeleaf.

Quick overview

  • 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

Important structure

  • Example input JSON: target/input/namingSystem_IheRoleCode.json
  • Example generated outputs:
    • target/output/namingSystem_ADICAP_withNarrativeGenerated.json
    • target/output/namingSystem_UCUM_withNarrativeGenerated.json
    • other files under target/output/
  • Unit tests: src/test/java/fr/gouv/esante/fhirNarrativeGenerator/AppTest.java — reports in target/surefire-reports/

Build and run

  1. Build:
    mvn clean package
    
  2. 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.

Template customization

  • Edit the Thymeleaf template: src/main/resources/NamingSystem.html
  • If you move the template, update src/main/resources/narrative.properties and rebuild.

Logs

Log4j configuration: src/main/resources/log4j2.properties (also copied to target/classes/).

Troubleshooting pointers

  • Invalid input / JSON parsing: logic in App.java
  • File writing: JsonFileCreator.java
  • Missing properties: PropertiesUtil.java and configuration.properties

Tests

  • 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.

About

A narrative generator for fhir resources using HAPI-FHIR and Thymeleaf.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published