) {
JSONObject jsonResult = new JSONObject();
JSONArray jsonPatients = new JSONArray();
try {
// TODO: Need to refactor how service locator and instantiation is handled. DI?
RpmsService rpmsService = new RpmsService(resourceId);
List<FMPatient> patients = rpmsService.getPatientList(value);
logger.debug("patients size: {}", patients.size());
for (FMPatient patient : patients) {
if(value.equalsIgnoreCase(patient.getID())) {
JSONObject jsonPatient = new JSONObject();
jsonPatient.put("hrn", patient.getID());