private void populateLabelsFromEmergencyAttendance() { EmergencyAttendanceForEventHistoryVo emergencyAttendance = domain.getEmergencyAttendance(form.getGlobalContext().Core.getCurrentCareContext()); if (emergencyAttendance == null) { engine.showMessage("Patient doesn't have an EmergencyAttendance, fields will not be populated"); return; } for (int i = 0; i < emergencyAttendance.getPatient().getIdentifiers().size(); i++) { if (emergencyAttendance.getPatient().getIdentifiers().get(i).getType().equals(ims.core.vo.lookups.PatIdType.HOSPNUM)) { form.lblHospitalNumber().setValue(emergencyAttendance.getPatient().getIdentifiers().get(i).getValue()); } } //WDEV-17482 form.lblPatientName().setValue(emergencyAttendance.getPatient().getName().getSurname().toUpperCase() + (emergencyAttendance.getPatient().getName().getForename() != null ? ", " + emergencyAttendance.getPatient().getName().getForename() : "")); form.lblAttendanceID().setValue(emergencyAttendance.getID_EmergencyAttendance().toString()); if (emergencyAttendance.getEpisode().getPresentingComplaintIsNotNull()) { form.lblPresentingComplaint().setValue(emergencyAttendance.getEpisode().getPresentingComplaint().getText()); } if (emergencyAttendance.getEpisode().getCategoryIsNotNull()) { form.lblPatientCategory().setValue(emergencyAttendance.getEpisode().getCategory().getText()); } if (emergencyAttendance.getEpisode().getSourceOfReferralIsNotNull()) { form.lblSourceOfReferral().setValue(emergencyAttendance.getEpisode().getSourceOfReferral().getText()); } if (emergencyAttendance.getEpisode().getInjuryDateTimeIsNotNull()) { form.lblInjuryDateTime().setValue(emergencyAttendance.getEpisode().getInjuryDateTime().toString()); } if (emergencyAttendance.getArrivalDateTimeIsNotNull()) { form.lblArrivalDateAndTime().setValue(emergencyAttendance.getArrivalDateTime().toString()); } if (emergencyAttendance.getRegistrationDateTimeIsNotNull()) { form.lblRegistrationDateAndTime().setValue(emergencyAttendance.getRegistrationDateTime().toString()); } if (emergencyAttendance.getDischargeDateTimeIsNotNull()) { form.lblDischargeDateAndTime().setValue(emergencyAttendance.getDischargeDateTime().toString()); } //WDEV-17038 if (emergencyAttendance.getDischargeDateTime()!=null && AttendanceOutcome.ADMISSIONS.equals(emergencyAttendance.getOutcome())) { AdmissionDetailForEventHistoryVo admDetails = domain.getAdmissionDetail(form.getGlobalContext().Core.getPatientShort(), emergencyAttendance.getDischargeDateTime()); form.lblWard().setVisible(admDetails!=null && admDetails.getWardIsNotNull()); form.lblWardValue().setValue(admDetails!=null && admDetails.getWardIsNotNull() ? admDetails.getWard().getName():null); } }
public AdmissionDetailForEventHistoryVo getAdmissionDetail(PatientRefVo patientRef, DateTime dischargeDate) { if (patientRef == null || patientRef.getID_Patient() == null) throw new CodingRuntimeException("Cannot get AdmissionDetails value on null patientRef."); DateTime dischargeDateClone=(DateTime)dischargeDate.clone(); DateTime dischargeDatePlus24 = dischargeDateClone.addHours(ims.configuration.gen.ConfigFlag.UI.ED_SHOW_DISCHARGED_TRACKING_RECORDS_PERIOD.getValue()); StringBuffer hql = new StringBuffer("select admDetail from AdmissionDetail as admDetail left join admDetail.pasEvent as pasEvent where pasEvent.patient.id = :patID and admDetail.admissionDateTime >= :DischDate and admDetail.admissionDateTime < :DischDate24 order by admDetail.systemInformation.creationDateTime desc "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] { "patID","DischDate", "DischDate24" }, new Object[] {patientRef.getID_Patient(),dischargeDate.getJavaDate(),dischargeDatePlus24.getJavaDate() }); if (list != null && list.size() > 0) return AdmissionDetailForEventHistoryVoAssembler.create((AdmissionDetail) list.get(0)); return null; }
private void populateLabelsFromEmergencyAttendance() { EmergencyAttendanceForEventHistoryVo emergencyAttendance = domain.getEmergencyAttendance(form.getGlobalContext().Core.getCurrentCareContext()); if (emergencyAttendance == null) { engine.showMessage("Patient doesn't have an EmergencyAttendance, fields will not be populated"); return; } for (int i = 0; i < emergencyAttendance.getPatient().getIdentifiers().size(); i++) { if (emergencyAttendance.getPatient().getIdentifiers().get(i).getType().equals(ims.core.vo.lookups.PatIdType.HOSPNUM)) { form.lblHospitalNumber().setValue(emergencyAttendance.getPatient().getIdentifiers().get(i).getValue()); } } //WDEV-17482 form.lblPatientName().setValue(emergencyAttendance.getPatient().getName().getSurname().toUpperCase() + (emergencyAttendance.getPatient().getName().getForename() != null ? ", " + emergencyAttendance.getPatient().getName().getForename() : "")); String emergencyAttendanceNumber = ConfigFlag.GEN.ED_USE_CUSTOM_ATTENDANCE_ID.getValue() ? emergencyAttendance.getCustomID() : emergencyAttendance.getID_EmergencyAttendance().toString(); form.lblAttendanceID().setValue(emergencyAttendanceNumber); if (emergencyAttendance.getEpisode().getPresentingComplaintIsNotNull()) { //WDEV-19159 -------------starts here String tooltip = null; String text = emergencyAttendance.getEpisode().getPresentingComplaint().getText(); if (emergencyAttendance.getEpisode().getPresentingComplaint().getText().length() > 36) { text = text.substring(0, 33) + "..."; tooltip = emergencyAttendance.getEpisode().getPresentingComplaint().getText(); } form.lblPresentingComplaint().setValue(text); form.lblPresentingComplaint().setTooltip(tooltip); //WDEV-19159 -------------starts here } if (emergencyAttendance.getEpisode().getCategoryIsNotNull()) { form.lblPatientCategory().setValue(emergencyAttendance.getEpisode().getCategory().getText()); } if (emergencyAttendance.getEpisode().getSourceOfReferralIsNotNull()) { form.lblSourceOfReferral().setValue(emergencyAttendance.getEpisode().getSourceOfReferral().getText()); } if (emergencyAttendance.getEpisode().getInjuryDateTimeIsNotNull()) { form.lblInjuryDateTime().setValue(emergencyAttendance.getEpisode().getInjuryDateTime().toString()); } if (emergencyAttendance.getArrivalDateTimeIsNotNull()) { form.lblArrivalDateAndTime().setValue(emergencyAttendance.getArrivalDateTime().toString()); } if (emergencyAttendance.getRegistrationDateTimeIsNotNull()) { form.lblRegistrationDateAndTime().setValue(emergencyAttendance.getRegistrationDateTime().toString()); } if (emergencyAttendance.getDischargeDateTimeIsNotNull()) { form.lblDischargeDateAndTime().setValue(emergencyAttendance.getDischargeDateTime().toString()); } //WDEV-17038 if (emergencyAttendance.getDischargeDateTime()!=null && AttendanceOutcome.ADMISSIONS.equals(emergencyAttendance.getOutcome())) { AdmissionDetailForEventHistoryVo admDetails = domain.getAdmissionDetail(form.getGlobalContext().Core.getPatientShort(), emergencyAttendance.getDischargeDateTime()); form.lblWard().setVisible(admDetails!=null && admDetails.getWardIsNotNull()); form.lblWardValue().setValue(admDetails!=null && admDetails.getWardIsNotNull() ? admDetails.getWard().getName():null); } }