org.hl7.fhir.core/org.hl7.fhir.core.generator
dotasek 0afea8dc1d
CLI Task to preload package cache (#1508)
* WIP start building preload task

* Slightly refactor exceptions

* sleep between each query

* WIP - FilesystemPackageCacheManager refactor

* Finish refactor

* Customize PackageVisitor

* Remove unused code

* Remove unused code 2

* Add debug logging for failing test

* Point withCacheFolder if to correct param

* Remove console chatter

* Rename to FilesystemPackageCacheManager.Builder

* Move logic to PackageCacheDownloader for re-use in other projects

* Fix spacing
2023-12-13 11:27:15 -05:00
..
configuration #1472 - delete empty files 2023-11-09 16:49:39 +11:00
src/org/hl7/fhir/core/generator CLI Task to preload package cache (#1508) 2023-12-13 11:27:15 -05:00
.classpath Remove wrong id from generated value sets + fix bug generating enumerated value sets 2023-04-21 12:23:31 +08:00
.project Change from Error to FHIRException when wrong value type is wrong on polymorphic element 2023-03-10 16:12:59 +11:00
readme.md Ensure that CVX uses tx.fhir.org, not UTG definitions which are wrong + Fix problems with Bundle validation for ids in collections and add additional search related validation + Remove check on ElementDefinition.id for R2B 2021-04-22 13:27:32 +10:00

readme.md

The Java Core Code Generator

Note: This code only generates the R5 java code. Older generated models are now maintained by hand.

To run this code, run the class JavaCoreGenerator with 3 parameters:

  • 1: fhir version to generate from (e.g. 4.1.0 or 'current'
  • 2: project directory to read configuration and templates from - e.g. C:\work\org.hl7.fhir\org.hl7.fhir.core\org.hl7.fhir.core.generator\configuration
  • 3: project directory to generate code into - e.g. C:\work\org.hl7.fhir\org.hl7.fhir.core\org.hl7.fhir.r5.new

The generation process depends on the code it generates - do not regenerate the master R5 code until you have tested that it generates correctly.

To test the generation:

  • create a new project, copy the existing R5 code into it, and get it compiling
  • make sure that project is not in the build path for the generator itself, which depends on the production R5 code
  • run the generation
  • refresh etc and make sure that the compiler is happy
  • copy the JUnit tests RoundTripTests into the copy project, update the constants, and execute it
  • check all the tests pass, and inspect a sampling of the results for consistency

Configuring the Generation Output

The most common reason to alter the generation is to add additional utility routines/enhanceements to the generated classes. To do this, edit on the one of the templates in the configuration directory - xx.java, where xx is the class name (may include containing class). You may also need to add to the imports in the configuration.ini file.