Skip to content

Commit

Permalink
LNK-1871: Moved fetching all structure definitions to a static initia…
Browse files Browse the repository at this point in the history
…lization block per the PR.
  • Loading branch information
ajagann1 committed Mar 14, 2024
1 parent 71b5e67 commit 5bb567b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/com/lantanagroup/link/FhirHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class FhirHelper {
private static final DefaultProfileValidationSupport validationSupport =
new DefaultProfileValidationSupport(FhirContextProvider.getFhirContext());

static {
validationSupport.fetchAllStructureDefinitions();
}

public static org.hl7.fhir.r4.model.Address getFHIRAddress(Address address) {
org.hl7.fhir.r4.model.Address ret = new org.hl7.fhir.r4.model.Address();

Expand Down Expand Up @@ -346,7 +350,6 @@ private static void addEventNotesToDevice(Device device, String eventCategory, L
}

public static FHIRPathEngine getFhirPathEngine() {
validationSupport.fetchAllStructureDefinitions();
HapiWorkerContext workerContext = new HapiWorkerContext(FhirContextProvider.getFhirContext(), validationSupport);
return new FHIRPathEngine(workerContext);
}
Expand Down

0 comments on commit 5bb567b

Please sign in to comment.