Skip to content

Commit

Permalink
FM2-648 fix NPE when querying deceased patient with openmrsPatients n…
Browse files Browse the repository at this point in the history
…amed query
  • Loading branch information
chibongho committed Oct 27, 2024
1 parent 983b724 commit 0fe95f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public SearchParameterMap toSearchParameterMap() {
.addParameter(FhirConstants.GENDER_SEARCH_HANDLER, "gender", getGender())
.addParameter(FhirConstants.DATE_RANGE_SEARCH_HANDLER, "birthdate", getBirthDate())
.addParameter(FhirConstants.DATE_RANGE_SEARCH_HANDLER, "deathDate", getDeathDate())
.addParameter(FhirConstants.BOOLEAN_SEARCH_HANDLER, getDeceased())
.addParameter(FhirConstants.BOOLEAN_SEARCH_HANDLER, "dead", getDeceased())
.addParameter(FhirConstants.ADDRESS_SEARCH_HANDLER, FhirConstants.CITY_PROPERTY, getCity())
.addParameter(FhirConstants.ADDRESS_SEARCH_HANDLER, FhirConstants.STATE_PROPERTY, getState())
.addParameter(FhirConstants.ADDRESS_SEARCH_HANDLER, FhirConstants.POSTAL_CODE_PROPERTY, getPostalCode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public void shouldReturnSortedAndFilteredSearchResultsForPatientsAsJson() throws

@Test
public void shouldAllowNamedQueryForPatientsAsJson() throws Exception {
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given")
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given&deceased=false")
.accept(FhirMediaTypes.JSON).go();

assertThat(response, isOk());
Expand Down Expand Up @@ -563,7 +563,7 @@ public void shouldReturnSortedAndFilteredSearchResultsForPatientsAsXML() throws

@Test
public void shouldAllowNamedQueryForPatientsAsXml() throws Exception {
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given")
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given&deceased=false")
.accept(FhirMediaTypes.XML).go();

assertThat(response, isOk());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public void shouldReturnSortedAndFilteredSearchResultsForPatientsAsJson() throws

@Test
public void shouldAllowNamedQueryForPatientsAsJson() throws Exception {
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given")
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given&deceased=false")
.accept(FhirMediaTypes.JSON).go();

assertThat(response, isOk());
Expand Down Expand Up @@ -647,7 +647,7 @@ public void shouldReturnSortedAndFilteredSearchResultsForPatientsAsXML() throws

@Test
public void shouldAllowNamedQueryForPatientsAsXml() throws Exception {
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given")
MockHttpServletResponse response = get("/Patient?_query=openmrsPatients&q=Doe&_sort=given&deceased=false")
.accept(FhirMediaTypes.XML).go();

assertThat(response, isOk());
Expand Down

0 comments on commit 0fe95f3

Please sign in to comment.