Skip to content

Commit

Permalink
Being more explicit about failing if config prohibits finding a provider
Browse files Browse the repository at this point in the history
  • Loading branch information
eedrummer committed May 3, 2022
1 parent 0bf7816 commit c2cf64a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public Provider startNewRelationship(Person person, HealthRecord.EncounterType t
provider = Provider.findService(person, HealthRecord.EncounterType.INPATIENT, speciality,
time);
}
if (provider == null) {
throw new IllegalStateException(
String.format("Unable to find provider for encounter type '%s' and specialty '%s'",
type, speciality));
}

relationships.put(type, blankSafeSpecialty(speciality), provider);

Expand Down

0 comments on commit c2cf64a

Please sign in to comment.