public static PatientProgram getPatientProgramByProgramOnDate(Patient patient, Program program, Date date) {
List<PatientProgram> patientPrograms = Context.getProgramWorkflowService().getPatientPrograms(patient, program, null, date, date, null, false);
if (patientPrograms.size() > 1) {
throw new APIException("Simultaneous program enrollments in same program not supported");
}
if (patientPrograms.size() == 1) {
return patientPrograms.get(0);
}