.where(Patient.FAMILY.matches().values("Smith", "Smyth")) .returnBundle(Bundle.class) .execute(); .where(Patient.ADDRESS.matches().values("Toronto")) .and(Patient.ADDRESS.matches().values("Ontario")) .and(Patient.ADDRESS.matches().values("Canada")) .returnBundle(Bundle.class) .execute(); .forResource(Patient.class) .withIdAndCompartment("123", "condition") .where(Patient.ADDRESS.matches().values("Toronto")) .returnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class) .execute(); .where(Patient.ADDRESS.matches().values("Toronto")) .returnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class) .summaryMode(SummaryEnum.TRUE) .where(Patient.ADDRESS.matches().values("Toronto")) .returnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class) .elementsSubset("identifier", "name") // only include the identifier and name
/** * Fetch multiple instances of the domain class from the data store. */ @Override public <T extends BaseResource> List<T> fetchObjects(Class<T> clazz, String[] ids) { if (ids == null || ids.length == 0) { return Collections.emptyList(); } StringClientParam param = new StringClientParam(BaseResource.SP_RES_ID); Bundle results = fhirClient.search().forResource(clazz).where(param.matches().values(ids)).execute(); return FhirUtil.getEntries(results, clazz); }
/** * Fetch multiple instances of the domain class from the data store. */ @Override public <T extends BaseResource> List<T> fetchObjects(Class<T> clazz, String[] ids) { if (ids == null || ids.length == 0) { return Collections.emptyList(); } StringClientParam param = new StringClientParam(BaseResource.SP_RES_ID); Bundle results = fhirClient.search().forResource(clazz).where(param.matches().values(ids)).returnBundle(Bundle.class) .execute(); return FhirUtil.getEntries(results, clazz); }
query.where(Patient.GIVEN.matches().values(FhirUtil.toStringList(name.getGiven())));
query.where(Practitioner.GIVEN.matches().values(FhirUtil.toStringList(name.getGiven())));
@Override public void buildQuery(PractitionerSearchCriteria criteria, IQuery<Bundle> query) { super.buildQuery(criteria, query); if (criteria.getDEA() != null) { query.where(Practitioner.IDENTIFIER.exactly().identifier(criteria.getDEA())); } if (criteria.getSSN() != null) { query.where(Practitioner.IDENTIFIER.exactly().identifier(criteria.getSSN())); } if (criteria.getGender() != null) { query.where(Practitioner.GENDER.exactly().code(criteria.getGender())); } if (criteria.getName() != null) { HumanNameDt name = criteria.getName(); if (!name.getFamily().isEmpty()) { query.where(Practitioner.FAMILY.matches().values(FhirUtil.toStringList(name.getFamily()))); } if (!name.getGiven().isEmpty()) { query.where(Practitioner.GIVEN.matches().values(FhirUtil.toStringList(name.getGiven()))); } } }