public PatientRelevantPMHVoCollection getAllRelevantPMH(PatientRefVo patientRefVo) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (patientRefVo == null || patientRefVo.getID_Patient() == null) { throw new CodingRuntimeException("Cannot get patientRefVo on null Id "); } StringBuffer hql = new StringBuffer(); hql.append(" select pmh from PatientRelevantPMH as pmh left join pmh.patient as pat where pat.id = :patientID"); hql.append(" order by pmh.attendance.startDateTime desc"); markers.add("patientID"); values.add(patientRefVo.getID_Patient()); return PatientRelevantPMHVoAssembler.createPatientRelevantPMHVoCollectionFromPatientRelevantPMH(factory.find(hql.toString(), markers, values)); }
private void PopulateRecordBrowser()//WDEV-17602 { PatientRelevantPMHVoCollection allRelevantPHM = domain.getAllRelevantPMH(form.getLocalContext().getSelectedPatientRef()); form.recbrPMH().clear(); for (int i = 0; i < allRelevantPHM.size(); i++) { PatientRelevantPMHVo PatientRelevantPMH = allRelevantPHM.get(i); if (PatientRelevantPMH == null) return; StringBuffer text = new StringBuffer(); CareContextRefVo voCareContexPMH = PatientRelevantPMH.getAttendance(); TriageForRelvantPMHVo triage = domain.getTriageByCareContext(PatientRelevantPMH.getAttendance()); PatientProblemForRelevantPMHVo voPatientProblem = (triage!=null ? triage.getMainPresentingProblem() : null); text.append(getTextToDisplayFromEmergencyAttendance(PatientRelevantPMH.getAttendance())); //WDEV-17127 PatientRelevantPMHVo voPatientProblemPMH = domain.getRelevantPMH(voCareContexPMH); if (voPatientProblemPMH!=null && voPatientProblemPMH.getAuthoringInformationIsNotNull()) { if (voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTimeIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTime()); text.append(" - "); } if (voPatientProblemPMH.getAuthoringInformation().getAuthoringHcpIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringHcp().getName()); text.append(" - "); } } if (voPatientProblem != null) { if (voPatientProblem.getPatientProblemIsNotNull()) { text.append(" - "); text.append(voPatientProblem.getPatientProblem()); } } if (voCareContexPMH.equals(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(i,PatientRelevantPMH.getAttendance(), text.toString(),Color.Green); continue; } form.recbrPMH().newRow(i, PatientRelevantPMH.getAttendance(), text.toString()); } //WDEV-17602 ArrayList collRecBrowser = form.recbrPMH().getValues(); if (!collRecBrowser.contains(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(form.getLocalContext().getCurrentCareContextRef(), getTextToDisplayFromEmergencyAttendance(form.getLocalContext().getCurrentCareContextRef()).toString(), Color.Green); } form.recbrPMH().setValue(form.getLocalContext().getCurrentCareContextRef()); }
private void PopulateRecordBrowser()//WDEV-17602 { PatientRelevantPMHVoCollection allRelevantPHM = domain.getAllRelevantPMH(form.getLocalContext().getSelectedPatientRef()); form.recbrPMH().clear(); for (int i = 0; i < allRelevantPHM.size(); i++) { PatientRelevantPMHVo PatientRelevantPMH = allRelevantPHM.get(i); if (PatientRelevantPMH == null) return; StringBuffer text = new StringBuffer(); CareContextRefVo voCareContexPMH = PatientRelevantPMH.getAttendance(); TriageForRelvantPMHVo triage = domain.getTriageByCareContext(PatientRelevantPMH.getAttendance()); PatientProblemForRelevantPMHVo voPatientProblem = (triage!=null ? triage.getMainPresentingProblem() : null); text.append(getTextToDisplayFromEmergencyAttendance(PatientRelevantPMH.getAttendance())); //WDEV-17127 PatientRelevantPMHVo voPatientProblemPMH = domain.getRelevantPMH(voCareContexPMH); if (voPatientProblemPMH!=null && voPatientProblemPMH.getAuthoringInformationIsNotNull()) { text.append(" - "); //WDEV-19534 if (voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTimeIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringDateTime()); text.append(" - "); } if (voPatientProblemPMH.getAuthoringInformation().getAuthoringHcpIsNotNull()) { text.append(voPatientProblemPMH.getAuthoringInformation().getAuthoringHcp().getName()); //text.append(" - "); //WDEV-19534 } } if (voPatientProblem != null) { if (voPatientProblem.getPatientProblemIsNotNull()) { text.append(" - "); text.append(voPatientProblem.getPatientProblem()); } } if (voCareContexPMH.equals(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(i,PatientRelevantPMH.getAttendance(), text.toString(),Color.Green); continue; } form.recbrPMH().newRow(i, PatientRelevantPMH.getAttendance(), text.toString()); } //WDEV-17602 ArrayList collRecBrowser = form.recbrPMH().getValues(); if (!collRecBrowser.contains(form.getLocalContext().getCurrentCareContextRef())) { form.recbrPMH().newRow(form.getLocalContext().getCurrentCareContextRef(), getTextToDisplayFromEmergencyAttendance(form.getLocalContext().getCurrentCareContextRef()).toString(), Color.Green); } form.recbrPMH().setValue(form.getLocalContext().getCurrentCareContextRef()); }