Source:
<code>public Result indexPopulatedGet(int patientId) { CurrentUser currentUser = sessionService.retrieveCurrentUserSession(); ServiceResponse<List<VitalItem>> vitalServiceResponse = vitalService.retrieveAllVitalItems(); if (vitalServiceResponse.hasErrors()) { throw new RuntimeException(); } ServiceResponse<PatientEncounterItem> patientEncounterItemServiceResponse = searchService.retrieveRecentPatientEncounterItemByPatientId(patientId); if(patientEncounterItemServiceResponse.hasErrors()){ throw new RuntimeException(); } PatientEncounterItem patientEncounter = patientEncounterItemServiceResponse.getResponseObject(); ServiceResponse<PatientItem> patientItemServiceResponse = searchService.retrievePatientItemByPatientId(patientId); if (patientItemServiceResponse.hasErrors()) { throw new RuntimeException(); } PatientItem patient = patientItemServiceResponse.getResponseObject(); ServiceResponse<SettingItem> settingItemServiceResponse = searchService.retrieveSystemSettings(); if (settingItemServiceResponse.hasErrors()) { throw new RuntimeException(); } ServiceResponse<Map<String, String>> patientAgeClassificationsResponse = patientService.retrieveAgeClassifications(); if (patientAgeClassificationsResponse.hasErrors()) { throw new RuntimeException(); } IndexViewModelGet viewModelGet = new IndexViewModelGet(); viewModelGet.setSettings(settingItemServiceResponse.getResponseObject()); viewModelGet.setPatient(patient); viewModelGet.setVitalNames(vitalServiceResponse.getResponseObject()); viewModelGet.setPossibleAgeClassifications(patientAgeClassificationsResponse.getResponseObject()); <START> if(patientEncounter.getMedicalDateOfVisit() == null){ <END> viewModelGet.setLinkToMedical(true); } else{ viewModelGet.setLinkToMedical(false); } return ok(index.render(currentUser, viewModelGet)); }</code><technical_language>AJ, encounter a time limit of 2 days set close if medical date of visit is null. Try 'patientEncounter.getIsClosed()' instead of 'patientEncounter.getMedicalDateOfVisit()'. :) logic for a closed encounter here: <LINK_0> -Kevin</technical_language>

Target:
public Result indexPopulatedGet(int patientId) { CurrentUser currentUser = sessionService.retrieveCurrentUserSession(); ServiceResponse<List<VitalItem>> vitalServiceResponse = vitalService.retrieveAllVitalItems(); if (vitalServiceResponse.hasErrors()) { throw new RuntimeException(); } ServiceResponse<PatientEncounterItem> patientEncounterItemServiceResponse = searchService.retrieveRecentPatientEncounterItemByPatientId(patientId); if(patientEncounterItemServiceResponse.hasErrors()){ throw new RuntimeException(); } PatientEncounterItem patientEncounter = patientEncounterItemServiceResponse.getResponseObject(); ServiceResponse<PatientItem> patientItemServiceResponse = searchService.retrievePatientItemByPatientId(patientId); if (patientItemServiceResponse.hasErrors()) { throw new RuntimeException(); } PatientItem patient = patientItemServiceResponse.getResponseObject(); ServiceResponse<SettingItem> settingItemServiceResponse = searchService.retrieveSystemSettings(); if (settingItemServiceResponse.hasErrors()) { throw new RuntimeException(); } ServiceResponse<Map<String, String>> patientAgeClassificationsResponse = patientService.retrieveAgeClassifications(); if (patientAgeClassificationsResponse.hasErrors()) { throw new RuntimeException(); } IndexViewModelGet viewModelGet = new IndexViewModelGet(); viewModelGet.setSettings(settingItemServiceResponse.getResponseObject()); viewModelGet.setPatient(patient); viewModelGet.setVitalNames(vitalServiceResponse.getResponseObject()); viewModelGet.setPossibleAgeClassifications(patientAgeClassificationsResponse.getResponseObject()); if(patientEncounter.getIsClosed() == false){ viewModelGet.setLinkToMedical(true); } else{ viewModelGet.setLinkToMedical(false); } return ok(index.render(currentUser, viewModelGet)); }