GSoC Journey: Week 6

Rushi Chaudhari
Jul 9 · 1 min read

In the last week, I created a controller and resource for a patient search criteria module. This week, I added a web service search handler for patient search criteria resource. The search handler provides the different custom search capability for any resource.

With the help of search handler, module supports the following REST endpoints for patient search :

  1. byNameOrId: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}
  2. byGender: GET /ws/rest/v1/patientsearch/patient?gender={M/F}
  3. byBirthdate: GET /ws/rest/v1/patientsearch/patient?birthdate={long int value of birthdate}
  4. byRangeOfAge: GET /ws/rest/v1/patientsearch/patient?from={min age}&to={max age}
  5. byNameOrIdAndGender: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}&gender={M/F}
  6. byNameOrIdAndBirthdate: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}&birthdate={long int value of birthdate}
  7. byNameOrIdAndRangeOfAge: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}&from={min age}&to={max age}
  8. byNameOrIdAndGenderAndBirthdate: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}&gender={M/F}&birthdate={long int value of birthdate}
  9. byNameOrIdAndGenderAndRangeOfAge: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}&gender={M/F}&from={min age}&to={max age}
  10. byGenderAndBirthdate: GET /ws/rest/v1/patientsearch/patient?gender={M/F}&birthdate={long int value of birthdate}
  11. byGenderAndRangeOfAge: GET /ws/rest/v1/patientsearch/patient?q={NameOrId}gender={M/F}&from={min age}&to={max age}

Also I created unit test cases for the patient search handler. For this, PatientSearchHandlerTest extends MainResourceControllerTest. MainResourceControllerTest provides prerequests for the test cases design for testing the REST API endpoints.

Reference: Adding Web Service Search Handler

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade