Testing fixes for instance generation

This commit is contained in:
Grahame Grieve 2024-12-25 06:51:54 +11:00
parent 79e1f5cc67
commit 6ba38a031a
3 changed files with 8 additions and 2 deletions

View File

@ -1014,7 +1014,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
}
if (!noLimits) {
if (!noLimits && !p.hasParameter("count")) {
p.addParameter("count", expandCodesLimit);
p.addParameter("offset", 0);
}

View File

@ -430,6 +430,11 @@ public class ProfileBasedFactory {
ValueSetExpansionOutcome vse = fpe.getWorker().expandVS(vs, true, false, 100);
if (vse.isOk()) {
ls.others.add("ValueSet "+vs.getVersionedUrl()+" "+ValueSetUtilities.countExpansion(vse.getValueset().getExpansion().getContains())+" concepts");
if (testing) {
for (ValueSetExpansionContainsComponent cc : vse.getValueset().getExpansion().getContains()) {
ls.others.add(cc.getSystem()+"#"+cc.getCode()+" : \""+cc.getDisplay()+"\" ("+cc.hasContains()+")");
}
}
return pickRandomConcept(vse.getValueset().getExpansion().getContains());
} else {
ls.others.add("ValueSet "+vs.getVersionedUrl()+": error = "+vse.getError());

View File

@ -84,6 +84,7 @@ public class TestInstanceGenerationTester {
tdf.setTesting(true); // no randomness
System.out.println("Execute Test Data Factory '"+tdf.getName()+"'. Log in "+tdf.statedLog());
tdf.execute();
System.out.println(TextFile.fileToString(Utilities.path(log, tdf.statedLog())));
}
// now, check output
@ -96,7 +97,7 @@ public class TestInstanceGenerationTester {
}
for (String name : Utilities.strings("Patient-1.json", "Encounter-1.json", "MedicationStatement-1.json", "Observation-bp-1.json", "Observation-weight-1.json")) {
String diff = new CompareUtilities(null, null).checkJsonSrcIsSame(name, TextFile.fileToString(Utilities.path(output, name)), TextFile.fileToString(Utilities.path(expected, name)), false);
String diff = new CompareUtilities(null, null).checkJsonSrcIsSame(name, TextFile.fileToString(Utilities.path(expected, name)), TextFile.fileToString(Utilities.path(output, name)), false);
Assertions.assertNull(diff, "unexpected difference for "+name);
}
}