diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoConfig.java index a3e93390c8e..4e40f1f67bd 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/DaoConfig.java @@ -149,7 +149,7 @@ public class DaoConfig { /** * EXPERIMENTAL - Do not use in production! Do not change default of {@code false}! */ - private boolean myPreExpandValueSetsExperimental = false; + private boolean myPreExpandValueSetsExperimental = true; // FIXME: DM 2019-09-03 - Return to false. private boolean myFilterParameterEnabled = false; private StoreMetaSourceInformationEnum myStoreMetaSourceInformation = StoreMetaSourceInformationEnum.SOURCE_URI_AND_REQUEST_ID; /** diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetConceptDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetConceptDao.java index 37d236fa484..202947e833f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetConceptDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/ITermValueSetConceptDao.java @@ -40,7 +40,11 @@ public interface ITermValueSetConceptDao extends JpaRepository findByTermValueSetIdAndPreFetchDesignations(Pageable thePage, @Param("pid") Long theValueSetId); + + @Query("SELECT vsc from TermValueSetConcept vsc LEFT OUTER JOIN FETCH vsc.myDesignations WHERE vsc.myValueSetPid = :pid ORDER BY vsc.myOrder") Slice findByTermValueSetIdAndPreFetchDesignations(Pageable thePage, @Param("pid") Long theValueSetId); @Query("SELECT vsc FROM TermValueSetConcept vsc WHERE vsc.myValueSetPid = :pid AND vsc.mySystem = :system_url AND vsc.myCode = :codeval") diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java index 9e7a901e31f..9c8a9440436 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvcImpl.java @@ -541,6 +541,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, containsComponent.setDisplay(concept.getDisplay()); // TODO: DM 2019-08-17 - Implement includeDesignations parameter for $expand operation to make this optional. + // FIXME: DM 2019-09-05 - Let's try removing the pre-fetch and the code in BaseHapiTerminologySvcImpl that handles designations so we can compare the processing time. 2/2 expandDesignations(theTermValueSet, concept, containsComponent); if (++conceptsExpanded % 250 == 0) { @@ -553,6 +554,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, private void logConceptsExpanded(TermValueSet theTermValueSet, int theConceptsExpanded) { if (theConceptsExpanded > 0) { + // FIXME: DM 2019-09-05 - Account for in progress vs. total. ourLog.info("Have expanded {} concepts in ValueSet[{}]", theConceptsExpanded, theTermValueSet.getUrl()); } } @@ -578,7 +580,9 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, private void logDesignationsExpanded(TermValueSet theValueSet, TermValueSetConcept theConcept, int theDesignationsExpanded) { if (theDesignationsExpanded > 0) { - ourLog.debug("Have expanded {} designations for Concept[{}|{}] in ValueSet[{}]", theDesignationsExpanded, theConcept.getSystem(), theConcept.getCode(), theValueSet.getUrl()); + // FIXME: DM 2019-09-05 - Account for in progress vs. total. + // FIXME: DM 2019-09-06 - Change to debug. + ourLog.info("Have expanded {} designations for Concept[{}|{}] in ValueSet[{}]", theDesignationsExpanded, theConcept.getSystem(), theConcept.getCode(), theValueSet.getUrl()); } } @@ -1818,6 +1822,7 @@ public abstract class BaseHapiTerminologySvcImpl implements IHapiTerminologySvc, ourLog.info("Done storing TermConceptMap[{}]", termConceptMap.getId()); } + // FIXME: DM 2019-09-05 - Return to 600000 @Scheduled(fixedDelay = 600000) // 10 minutes. @Override public synchronized void preExpandDeferredValueSetsToTerminologyTables() {