use of org.mitre.synthea.world.concepts.HealthRecord.ImagingStudy.Series in project synthea by synthetichealth.
the class ValueSetCodeResolverTest method resolveCodesInImagingStudy.
@Test
public void resolveCodesInImagingStudy() throws Exception {
// We load the imaging study from a module fixture, as there doesn't seem to be
// a way to
// instantiate it programmatically.
Module module = TestHelper.getFixture("imaging_study_with_valueset.json");
person.history = new ArrayList<>();
State encounterState = module.getState("ED_Visit");
assertTrue(encounterState.process(person, time));
person.history.add(encounterState);
State mri = module.getState("Knee_MRI");
assertTrue(mri.process(person, time));
ValueSetCodeResolver valueSetCodeResolver = new ValueSetCodeResolver(person);
Person resolvedPerson = valueSetCodeResolver.resolve();
// assertEquals(2, resolvedPerson.record.encounters.size());
Encounter resolvedEncounter = resolvedPerson.record.encounters.get(resolvedPerson.record.encounters.size() - 1);
assertEquals(1, resolvedEncounter.imagingStudies.size());
ImagingStudy resolvedImagingStudy = resolvedEncounter.imagingStudies.get(0);
assertEquals(1, resolvedImagingStudy.series.size());
Series series = resolvedImagingStudy.series.get(0);
assertEquals(SNOMED_URI, series.bodySite.system);
assertEquals("762879008", series.bodySite.code);
assertEquals("Structure of right common peroneal nerve in popliteal region", series.bodySite.display);
// Modality and SOP class are not really good candidates for ValueSet-based
// selection, so we do
// not currently have a sensible test case for these.
}
Aggregations