Search in sources :

Example 1 with Series

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.
}
Also used : Series(org.mitre.synthea.world.concepts.HealthRecord.ImagingStudy.Series) State(org.mitre.synthea.engine.State) Encounter(org.mitre.synthea.world.concepts.HealthRecord.Encounter) ImagingStudy(org.mitre.synthea.world.concepts.HealthRecord.ImagingStudy) Module(org.mitre.synthea.engine.Module) Person(org.mitre.synthea.world.agents.Person) Test(org.junit.Test) ProviderTest(org.mitre.synthea.world.agents.ProviderTest)

Aggregations

Test (org.junit.Test)1 Module (org.mitre.synthea.engine.Module)1 State (org.mitre.synthea.engine.State)1 Person (org.mitre.synthea.world.agents.Person)1 ProviderTest (org.mitre.synthea.world.agents.ProviderTest)1 Encounter (org.mitre.synthea.world.concepts.HealthRecord.Encounter)1 ImagingStudy (org.mitre.synthea.world.concepts.HealthRecord.ImagingStudy)1 Series (org.mitre.synthea.world.concepts.HealthRecord.ImagingStudy.Series)1