Skip to content

Commit

Permalink
Handle unknown tenant/measure (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
smailliwcs committed Mar 1, 2024
1 parent 18ac853 commit f15bc22
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ public void savePatientList(@RequestBody String patientList,
@RequestParam String periodStart,
@RequestParam String periodEnd) {
TenantService tenantService = TenantService.create(this.sharedService, tenantId);

if (tenantService == null) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Tenant not found");
}
if (!this.sharedService.measureDefinitionExists(measureId)) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Measure not found");
}

List<String> patientIds = Arrays.asList(patientList.replace("\r", "").split("\n"));
PatientList list = new PatientList();
list.setMeasureId(measureId);
Expand Down

0 comments on commit f15bc22

Please sign in to comment.