use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class UserSearchQueryTest method searchForUsers_shouldReturnEmptyCollectionByWrongPostalCode.
@Test
public void searchForUsers_shouldReturnEmptyCollectionByWrongPostalCode() {
StringAndListParam postalCode = new StringAndListParam().addAnd(new StringParam(WRONG_POSTAL_CODE));
SearchParameterMap theParams = new SearchParameterMap().addParameter(FhirConstants.ADDRESS_SEARCH_HANDLER, FhirConstants.POSTAL_CODE_PROPERTY, postalCode);
IBundleProvider results = search(theParams);
assertThat(results, notNullValue());
assertThat(results.size(), equalTo(0));
List<Practitioner> resultList = get(results);
assertThat(resultList, empty());
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class UserSearchQueryTest method searchForUsers_shouldReturnEmptyCollectionForWrongFamilyName.
@Test
public void searchForUsers_shouldReturnEmptyCollectionForWrongFamilyName() {
StringAndListParam familyName = new StringAndListParam().addAnd(new StringParam(WRONG_FAMILY_NAME));
SearchParameterMap theParams = new SearchParameterMap().addParameter(FhirConstants.NAME_SEARCH_HANDLER, FhirConstants.FAMILY_PROPERTY, familyName);
IBundleProvider results = search(theParams);
assertThat(results, notNullValue());
assertThat(results.size(), equalTo(0));
List<Practitioner> resultList = get(results);
assertThat(resultList, empty());
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class UserSearchQueryTest method searchForUsers_shouldReturnEmptyCollectionByWrongCountry.
@Test
public void searchForUsers_shouldReturnEmptyCollectionByWrongCountry() {
StringAndListParam country = new StringAndListParam().addAnd(new StringParam(WRONG_COUNTRY));
SearchParameterMap theParams = new SearchParameterMap().addParameter(FhirConstants.ADDRESS_SEARCH_HANDLER, FhirConstants.COUNTRY_PROPERTY, country);
IBundleProvider results = search(theParams);
assertThat(results, notNullValue());
assertThat(results.size(), equalTo(0));
List<Practitioner> resultList = get(results);
assertThat(resultList, empty());
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class UserSearchQueryTest method searchForUsers_shouldReturnEmptyCollectionForWrongGivenName.
@Test
public void searchForUsers_shouldReturnEmptyCollectionForWrongGivenName() {
StringAndListParam givenName = new StringAndListParam().addAnd(new StringParam(WRONG_GIVEN_NAME));
SearchParameterMap theParams = new SearchParameterMap().addParameter(FhirConstants.NAME_SEARCH_HANDLER, FhirConstants.GIVEN_PROPERTY, givenName);
IBundleProvider results = search(theParams);
assertThat(results, notNullValue());
assertThat(results.size(), equalTo(0));
List<Practitioner> resultList = get(results);
assertThat(resultList, empty());
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class UserSearchQueryTest method searchForUsers_shouldReturnUsersByIdentifier.
@Test
public void searchForUsers_shouldReturnUsersByIdentifier() {
TokenAndListParam identifier = new TokenAndListParam().addAnd(new TokenOrListParam().add(USER_NAME));
SearchParameterMap theParams = new SearchParameterMap().addParameter(IDENTIFIER_SEARCH_HANDLER, identifier);
IBundleProvider results = search(theParams);
assertThat(results, notNullValue());
assertThat(results.size(), greaterThanOrEqualTo(1));
List<Practitioner> resultList = get(results);
assertThat(resultList, hasSize(greaterThanOrEqualTo(1)));
assertThat(resultList.get(0).getIdElement().getIdPart(), equalTo(USER_UUID));
}
Aggregations