Search in sources :

Example 11 with CURRENT

use of org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT in project cqf-ruler by DBCG.

the class DataOperationsProvider method fetchDependencyLibraries.

private List<Library> fetchDependencyLibraries(Library library, RequestDetails theRequestDetails) {
    Map<String, Library> resources = new HashMap<>();
    List<Library> queue = new ArrayList<>();
    queue.add(library);
    while (!queue.isEmpty()) {
        Library current = queue.get(0);
        queue.remove(0);
        visitLibrary(current, queue, resources, theRequestDetails);
    }
    return new ArrayList<>(resources.values());
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Library(org.hl7.fhir.dstu3.model.Library)

Example 12 with CURRENT

use of org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT in project ab2d by CMSgov.

the class CoverageMappingCallableTest method testNullMbi.

@Test
void testNullMbi() {
    ContractDTO contract = new ContractDTO("TESTING", "TESTING", null, null);
    CoveragePeriod period = new CoveragePeriod();
    period.setContractNumber(contract.getContractNumber());
    period.setYear(2020);
    period.setMonth(1);
    CoverageSearchEvent cse = new CoverageSearchEvent();
    cse.setCoveragePeriod(period);
    CoverageSearch search = new CoverageSearch();
    search.setPeriod(period);
    CoverageMapping mapping = new CoverageMapping(cse, search);
    CoverageMappingCallable callable = new CoverageMappingCallable(STU3, mapping, bfdClient, mapping.getPeriod().getYear());
    Patient patient = new Patient();
    Identifiers ids = callable.extractPatientId(patient);
    assertNull(ids);
    Identifier beneId = new Identifier();
    beneId.setSystem(BENEFICIARY_ID);
    beneId.setValue("1");
    patient.getIdentifier().add(beneId);
    ids = callable.extractPatientId(patient);
    assertEquals(1L, ids.getBeneficiaryId());
    assertNull(ids.getCurrentMbi());
    assertEquals(0, ids.getHistoricMbis().size());
    Identifier mbiHist = new Identifier();
    mbiHist.setSystem(MBI_ID);
    mbiHist.setValue("HIST_MBI");
    Extension extension = new Extension();
    extension.setUrl(CURRENCY_IDENTIFIER);
    Coding code1 = new Coding();
    code1.setCode("historic");
    extension.setValue(code1);
    mbiHist.getExtension().add(extension);
    patient.getIdentifier().add(mbiHist);
    ids = callable.extractPatientId(patient);
    assertEquals(1L, ids.getBeneficiaryId());
    assertNull(ids.getCurrentMbi());
    assertEquals(1, ids.getHistoricMbis().size());
    assertEquals("HIST_MBI", ids.getHistoricMbis().stream().findAny().get());
    Identifier mbiCurrent = new Identifier();
    mbiCurrent.setSystem(MBI_ID);
    mbiCurrent.setValue("CURR_MBI");
    Extension extension2 = new Extension();
    extension2.setUrl(CURRENCY_IDENTIFIER);
    Coding code2 = new Coding();
    code2.setCode("current");
    extension2.setValue(code2);
    mbiCurrent.getExtension().add(extension2);
    patient.getIdentifier().add(mbiCurrent);
    ids = callable.extractPatientId(patient);
    assertEquals(1L, ids.getBeneficiaryId());
    assertEquals(1, ids.getHistoricMbis().size());
    assertEquals("CURR_MBI", ids.getCurrentMbi());
    assertEquals(1, ids.getHistoricMbis().size());
    assertEquals("HIST_MBI", ids.getHistoricMbis().stream().findAny().get());
}
Also used : Extension(org.hl7.fhir.dstu3.model.Extension) Identifier(org.hl7.fhir.dstu3.model.Identifier) ContractDTO(gov.cms.ab2d.common.dto.ContractDTO) Coding(org.hl7.fhir.dstu3.model.Coding) ContractToContractCoverageMapping(gov.cms.ab2d.worker.config.ContractToContractCoverageMapping) CoverageMapping(gov.cms.ab2d.coverage.model.CoverageMapping) CoveragePeriod(gov.cms.ab2d.coverage.model.CoveragePeriod) CoverageSearch(gov.cms.ab2d.coverage.model.CoverageSearch) Patient(org.hl7.fhir.dstu3.model.Patient) BundleUtils.createPatient(gov.cms.ab2d.worker.processor.BundleUtils.createPatient) CoverageSearchEvent(gov.cms.ab2d.coverage.model.CoverageSearchEvent) Identifiers(gov.cms.ab2d.coverage.model.Identifiers) Test(org.junit.jupiter.api.Test)

Example 13 with CURRENT

use of org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT in project integration-adaptor-111 by nhsconnect.

the class ListMapperTest method shouldMapList.

@Test
public void shouldMapList() {
    ListResource listResource = listMapper.mapList(clinicalDocument, encounter, resourcesCreated, deviceRef);
    assertThat(listResource.getStatus()).isEqualTo(CURRENT);
    assertThat(listResource.getTitle()).isEqualTo("111 Report List");
    assertThat(listResource.getMode()).isEqualTo(WORKING);
    Coding orderByCode = listResource.getOrderedBy().getCodingFirstRep();
    assertThat(orderByCode.getSystem()).isEqualTo("http://hl7.org/fhir/list-order");
    assertThat(orderByCode.getCode()).isEqualTo("event-date");
    assertThat(orderByCode.getDisplay()).isEqualTo("Sorted by Event Date");
    Coding code = listResource.getCode().getCodingFirstRep();
    assertThat(code.getSystem()).isEqualTo("http://snomed.info/sct");
    assertThat(code.getCode()).isEqualTo("225390008");
    assertThat(code.getDisplay()).isEqualTo("Triage");
    assertThat(listResource.getEntry().size()).isEqualTo(1);
    assertThat(listResource.getIdElement().getValue()).isEqualTo(RANDOM_UUID);
    assertThat(deviceRef).isEqualTo(listResource.getSource());
    assertThat(listResource.getDateElement().getValue()).isEqualTo(DateUtil.parse(effectiveTime.getValue()).getValue());
}
Also used : Coding(org.hl7.fhir.dstu3.model.Coding) ListResource(org.hl7.fhir.dstu3.model.ListResource) Test(org.junit.jupiter.api.Test)

Example 14 with CURRENT

use of org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT in project org.hl7.fhir.core by hapifhir.

the class FHIRPathEngine method funcDescendants.

private List<Base> funcDescendants(ExecutionContext context, List<Base> focus, ExpressionNode exp) {
    List<Base> result = new ArrayList<Base>();
    List<Base> current = new ArrayList<Base>();
    current.addAll(focus);
    List<Base> added = new ArrayList<Base>();
    boolean more = true;
    while (more) {
        added.clear();
        for (Base item : current) {
            getChildrenByName(item, "*", added);
        }
        more = !added.isEmpty();
        result.addAll(added);
        current.clear();
        current.addAll(added);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) Base(org.hl7.fhir.dstu2.model.Base)

Example 15 with CURRENT

use of org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT in project org.hl7.fhir.core by hapifhir.

the class FHIRPathEngine method funcDescendents.

private List<Base> funcDescendents(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
    List<Base> result = new ArrayList<Base>();
    List<Base> current = new ArrayList<Base>();
    current.addAll(focus);
    List<Base> added = new ArrayList<Base>();
    boolean more = true;
    while (more) {
        added.clear();
        for (Base item : current) {
            getChildrenByName(item, "*", added);
        }
        more = !added.isEmpty();
        result.addAll(added);
        current.clear();
        current.addAll(added);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ParserBase(org.hl7.fhir.dstu2016may.metamodel.ParserBase) Base(org.hl7.fhir.dstu2016may.model.Base)

Aggregations

ArrayList (java.util.ArrayList)38 Date (java.util.Date)31 Code (org.mitre.synthea.world.concepts.HealthRecord.Code)24 Coding (org.hl7.fhir.r4.model.Coding)21 Reference (org.hl7.fhir.r4.model.Reference)21 DocumentReference (org.hl7.fhir.r4.model.DocumentReference)20 Encounter (org.mitre.synthea.world.concepts.HealthRecord.Encounter)17 Reference (org.hl7.fhir.dstu3.model.Reference)16 HashMap (java.util.HashMap)15 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)15 Coding (org.hl7.fhir.dstu3.model.Coding)14 Identifier (org.hl7.fhir.r4.model.Identifier)14 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)13 JsonObject (com.google.gson.JsonObject)12 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)12 Meta (org.hl7.fhir.r4.model.Meta)12 List (java.util.List)11 Period (org.hl7.fhir.r4.model.Period)11 Test (org.junit.jupiter.api.Test)11 Extension (org.hl7.fhir.r4.model.Extension)10