Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Visit getVisitFor(Patient patient, String visitTypeForNewVisit, Date orderDate, Date visitStartDate, Date visitEndDate, String locationUuid) {
- //String visitLocationUuid = bahmniVisitLocationService.getVisitLocationUuid(locationUuid);
- Date nextDate = getEndOfTheDay(orderDate);
- List<Visit> visits = visitService.getVisits(null, Collections.singletonList(patient), null, null, null, nextDate, orderDate, null, null, true, false);
- List<Visit> matchingVisits = getMatchingVisitsFromLocation(visits, "c5854fd7-3f12-11e4-adec-0800271c1b75");
- if (!matchingVisits.isEmpty()) {
- Visit matchingVisit = getVisitMatchingOrderDate(orderDate, matchingVisits);
- return stretchVisits(orderDate, matchingVisit);
- }
- return createNewVisit(patient, orderDate, visitTypeForNewVisit, visitStartDate, visitEndDate, "c5854fd7-3f12-11e4-adec-0800271c1b75");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement