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());
}
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());
}
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());
}
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;
}
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;
}
Aggregations