Class HapiConfigGenerator
application.yaml and application-test.yaml from a
PackageClassifier.ClassificationResult.
The generated files configure:
- Spring datasource pointing to the Docker Compose postgres service
hapi.fhir.implementationguideswith one entry per R4-compatible packagedependencyExcludeson each guide entry listing R5 packages to skiphapi.fhir.logical_urlswith standard Australian terminology server patternshapi.fhir.expunge_enabled: truefor server-reset between tests
The bootstrap file (application.yaml) includes packageUrl: entries for
any package whose container URL is provided in the packageUrls map, pointing HAPI
to local tgz files instead of the registry. The test file (application-test.yaml)
is generated without those entries — HAPI v8 fetches packageUrl before checking
reloadExisting, so the test container (which has no packages volume) would crash
if the entries were present.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HapiConfigGenerator
public HapiConfigGenerator()
-
-
Method Details
-
generate
public void generate(PackageClassifier.ClassificationResult result, Map<String, String> packageUrls, Map<String, throws IOExceptionString> resolvedVersions, Path outputDir) Writesapplication.yamlandapplication-test.yamltooutputDir.Both files are generated directly from
resultandpackageUrls— no post-processing or file patching is performed.The bootstrap file uses the declared package versions and includes
packageUrl:entries so HAPI loads local tgz files instead of the registry. The test file omitspackageUrl:entries (HAPI v8 fetches them before checkingreloadExisting, which would crash the test container) and substitutesresolvedVersionsfor anydev/currentpackages so HAPI finds them in the restored postgres dump without hitting the network.- Parameters:
result- the classification result fromPackageClassifierpackageUrls- map from package name to container-local file URL; entries only emitted when presentresolvedVersions- map from package name to the actual installed version (e.g."fhir.ph.core" → "current"); used in the test config to replace pseudo-versions likedevoutputDir- directory to write files into (created if absent)- Throws:
IOException
-