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 4, 2022
1 parent 22e4bd8 commit a03a6fc
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 a03a6fc

Please sign in to comment.