Fix cacheing for large valuesets
This commit is contained in:
parent
e5976307f4
commit
394452b747
|
@ -148,7 +148,12 @@ public class TerminologyCache {
|
|||
public String extracted(JsonParser json, ValueSet vsc) throws IOException {
|
||||
String s = null;
|
||||
if (vsc.getExpansion().getContains().size() > 1000 || vsc.getCompose().getIncludeFirstRep().getConcept().size() > 1000) {
|
||||
s = Integer.toString(vsc.hashCode()); // turn caching off - hack efficiency optimisation
|
||||
int hashCode = (vsc.getExpansion().getContains().toString() + vsc.getCompose().getIncludeFirstRep().getConcept().toString()).hashCode();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (ValueSet.ConceptReferenceComponent c : vsc.getCompose().getIncludeFirstRep().getConcept()) {
|
||||
sb.append(c.getCode());
|
||||
}
|
||||
s = Integer.toString((vsc.getExpansion().getContains().toString() + sb.toString()).hashCode()); // turn caching off - hack efficiency optimisation
|
||||
} else {
|
||||
s = json.composeString(vsc);
|
||||
}
|
||||
|
@ -380,6 +385,7 @@ public class TerminologyCache {
|
|||
}
|
||||
|
||||
private void load() throws FHIRException {
|
||||
synchronized (lock) {
|
||||
for (String fn : new File(folder).list()) {
|
||||
if (fn.endsWith(".cache") && !fn.equals("validation.cache")) {
|
||||
int c = 0;
|
||||
|
@ -434,6 +440,7 @@ public class TerminologyCache {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String loadJS(JsonElement e) {
|
||||
if (e == null)
|
||||
|
|
|
@ -148,6 +148,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe
|
|||
if (cs == null) {
|
||||
cs = findSpecialCodeSystem(system);
|
||||
}
|
||||
System.out.print("");
|
||||
if (cs == null) {
|
||||
warningMessage = "Unable to resolve system "+system;
|
||||
if (!inExpansion) {
|
||||
|
|
|
@ -5,15 +5,16 @@ import org.hl7.fhir.validation.ValidationEngine;
|
|||
|
||||
public class TestingUtilities {
|
||||
public static final ValidationEngine getValidationEngine(java.lang.String src, java.lang.String txsrvr, java.lang.String txLog, FhirPublication version, boolean canRunWithoutTerminologyServer, java.lang.String vString, java.lang.String userAgent) throws Exception {
|
||||
txLog = TestConstants.TX_CACHE + "/tx.log.html";
|
||||
final ValidationEngine validationEngine = new ValidationEngine(src, txsrvr, txLog, version, canRunWithoutTerminologyServer, vString, userAgent);
|
||||
validationEngine.getContext().initTS(TestConstants.TX_CACHE);
|
||||
validationEngine.getContext().initTS(TestConstants.TX_CACHE + "/" + version.toString());
|
||||
validationEngine.getContext().setUserAgent("fhir/test-cases");
|
||||
return validationEngine;
|
||||
}
|
||||
|
||||
public static ValidationEngine getValidationEngine(java.lang.String src, java.lang.String txsrvr, java.lang.String txLog, FhirPublication version, java.lang.String vString, java.lang.String userAgent) throws Exception {
|
||||
final ValidationEngine validationEngine = new ValidationEngine(src, txsrvr, txLog, version, vString, userAgent);
|
||||
validationEngine.getContext().initTS(TestConstants.TX_CACHE);
|
||||
validationEngine.getContext().initTS(TestConstants.TX_CACHE + "/" + version.toString());
|
||||
validationEngine.getContext().setUserAgent("fhir/test-cases");
|
||||
return validationEngine;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
|
|||
|
||||
List<Object[]> objects = new ArrayList<Object[]>(examples.size());
|
||||
for (String id : names) {
|
||||
//if ("dr-eh".equals(id))
|
||||
objects.add(new Object[]{id, examples.get(id)});
|
||||
}
|
||||
return objects;
|
||||
|
|
Loading…
Reference in New Issue