.where(Patient.BIRTHDATE.beforeOrEquals().day("2011-01-01")) .and(Patient.CAREPROVIDER.hasChainedProperty(Organization.NAME.matches().value("Health"))) .returnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class) .forResource(Patient.class) .encodedJson() .where(Patient.BIRTHDATE.beforeOrEquals().day("2012-01-22")) .and(Patient.BIRTHDATE.after().day("2011-01-01")) .withTag("http://acme.org/codes", "needs-review")
query.where(DocumentReference.PERIOD.beforeOrEquals().day(endDate));
@Override public void buildQuery(EncounterSearchCriteria criteria, IQuery<Bundle> query) { super.buildQuery(criteria, query); if (criteria.getPatient() != null) { query.where(Encounter.PATIENT.hasId(criteria.getPatient().getId())); } if (criteria.getPeriod() != null) { Date start = criteria.getPeriod().getStart(); Date end = criteria.getPeriod().getEnd(); if (start != null) { if (end == null) { query.where(Encounter.LOCATION_PERIOD.exactly().day(start)); } else { query.where(Encounter.LOCATION_PERIOD.afterOrEquals().day(start)); query.where(Encounter.LOCATION_PERIOD.beforeOrEquals().day(end)); } } else if (end != null) { query.where(Encounter.LOCATION_PERIOD.exactly().day(end)); } } if (criteria.getType() != null) { query.where(Encounter.TYPE.exactly().code(criteria.getType())); } }
@Override public void buildQuery(EncounterSearchCriteria criteria, IQuery<?> query) { super.buildQuery(criteria, query); if (criteria.getPatient() != null) { query.where(Encounter.PATIENT.hasId(criteria.getPatient().getId())); } if (criteria.getPeriod() != null) { Date start = criteria.getPeriod().getStart(); Date end = criteria.getPeriod().getEnd(); if (start != null) { if (end == null) { query.where(Encounter.LOCATION_PERIOD.exactly().day(start)); } else { query.where(Encounter.LOCATION_PERIOD.afterOrEquals().day(start)); query.where(Encounter.LOCATION_PERIOD.beforeOrEquals().day(end)); } } else if (end != null) { query.where(Encounter.LOCATION_PERIOD.exactly().day(end)); } } if (criteria.getType() != null) { query.where(Encounter.TYPE.exactly().code(criteria.getType())); } }