/** * Function used to compare two records after estimated discharge date */ public int compare(STHKCurrentInpatientListVo o1, STHKCurrentInpatientListVo o2) { if (o1.getEstDischargeDateIsNotNull() && o2.getEstDischargeDateIsNotNull()) { return o1.getEstDischargeDate().compareTo(o2.getEstDischargeDate()) * direction; } if (o1.getEstDischargeDateIsNotNull() && !o2.getEstDischargeDateIsNotNull()) { return direction; } if (o2.getEstDischargeDateIsNotNull() && !o1.getEstDischargeDateIsNotNull()) { return -1 * direction; } return 0; }
/** * Function used to compare two records after age */ public int compare(STHKCurrentInpatientListVo o1, STHKCurrentInpatientListVo o2) { if (o1.getPasEventIsNotNull() && o1.getPasEvent().getPatientIsNotNull() && o1.getPasEvent().getPatient().getAgeIsNotNull() && o2.getPasEventIsNotNull() && o2.getPasEvent().getPatientIsNotNull() && o2.getPasEvent().getPatient().getAgeIsNotNull()) { return o1.getPasEvent().getPatient().getAge().compareTo(o2.getPasEvent().getPatient().getAge()) * direction; } if (o1.getPasEventIsNotNull() && o1.getPasEvent().getPatientIsNotNull() && o1.getPasEvent().getPatient().getAgeIsNotNull() && (!o2.getPasEventIsNotNull() || !o2.getPasEvent().getPatientIsNotNull() || !o2.getPasEvent().getPatient().getAgeIsNotNull()) ) { return direction; } if (o1.getPasEventIsNotNull() && o1.getPasEvent().getPatientIsNotNull() && o1.getPasEvent().getPatient().getAgeIsNotNull() && (!o2.getPasEventIsNotNull() || !o2.getPasEvent().getPatientIsNotNull() || !o2.getPasEvent().getPatient().getAgeIsNotNull()) ) { return -1 * direction; } return 0; }
/** * WDEV-13136 * Function used to retrieve records from grid */ private STHKCurrentInpatientListVoCollection populateRecordsFromGrid() { // Create collection to return STHKCurrentInpatientListVoCollection gridValues = new STHKCurrentInpatientListVoCollection(); // Add each record from grid to collection for (int i = 0; i < form.dyngrdCurrIP().getRows().size(); i++) { DynamicGridRow row = form.dyngrdCurrIP().getRows().get(i); if (row.getValue() instanceof STHKCurrentInpatientListVo) gridValues.add((STHKCurrentInpatientListVo) row.getValue()); } // Return collection grid return gridValues; }
/** * WDEV-13136 * Function used to update global context for PatientShort and PatientToBeDisplayed when * grid selection changes */ private void updatePatientGlobalContextOnSelection(Object value) { form.getGlobalContext().Core.setSelectingPatientForm(null); form.getGlobalContext().Core.setPatientToBeDisplayed(null); form.getGlobalContext().Core.setPatientShort(null); if (value == null) return; if ((value instanceof STHKCurrentInpatientListVo) && ((STHKCurrentInpatientListVo) value).getPasEventIsNotNull() && ((STHKCurrentInpatientListVo) value).getPasEvent().getPatientIsNotNull()) { PatientShort patient = domain.getPatientShort(((STHKCurrentInpatientListVo) value).getPasEvent().getPatient()); form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName()); form.getGlobalContext().Core.setPatientToBeDisplayed(patient); form.getGlobalContext().Core.setPatientShort(patient); } }
public STHKCurrentInpatientListVo saveIP(STHKCurrentInpatientListVo voIP) throws DomainInterfaceException, StaleObjectException { if(voIP == null) throw new CodingRuntimeException("Cannot save null STHKCurrentInpatientListVo"); if (!voIP.isValidated()) throw new CodingRuntimeException("Inpatient Record has not been validated"); DomainFactory factory = getDomainFactory(); InpatientEpisode doIP = STHKCurrentInpatientListVoAssembler.extractInpatientEpisode(factory, voIP); //WDEV-18059 patient was discharged form another session. if (doIP == null) throw new StaleObjectException(doIP); factory.save(doIP); return (STHKCurrentInpatientListVoAssembler.create(doIP)); }
public int compare(Object o1, Object o2) { PartialDate pdate1 = null; PartialDate pdate2 = null; if (o1 instanceof STHKCurrentInpatientListVo && o2 instanceof STHKCurrentInpatientListVo) { STHKCurrentInpatientListVo ps1 = (STHKCurrentInpatientListVo)o1; pdate1 = ps1.getPasEvent() != null && ps1.getPasEvent().getPatientIsNotNull() ? ps1.getPasEvent().getPatient().getDob() : null; STHKCurrentInpatientListVo ps2 = (STHKCurrentInpatientListVo)o2; pdate2 = ps2.getPasEvent() != null && ps2.getPasEvent().getPatientIsNotNull() ? ps2.getPasEvent().getPatient().getDob() : null; } if (pdate1 != null && pdate2 != null) return pdate1.compareTo(pdate2)*direction; if (pdate1 != null) return direction; if (pdate2 != null) return -1*direction; return 0; }
public int compare(STHKCurrentInpatientListVo c1, STHKCurrentInpatientListVo c2) { if (c1.getComments()!= null || c2.getComments() != null) { Integer val1 = (c1.getComments() != null) ? 1 : 0; Integer val2 = (c2.getComments() != null) ? 1 : 0; if (val1 != 0 && val2 != 0) { return val1.compareTo(val2) * direction; } if (val1 != 0 && val2 == 0) { return direction; } if (val2 != 0 && val1 == 0) { return -1 * direction; } } return 0; }
public int compare(STHKCurrentInpatientListVo c1, STHKCurrentInpatientListVo c2) { if (c1.getHealthyLodgerDetails()!= null || c2.getHealthyLodgerDetails() != null) { Integer val1 = (c1.getHealthyLodgerDetails() != null) ? 1 : 0; Integer val2 = (c2.getHealthyLodgerDetails() != null) ? 1 : 0; if (val1 != 0 && val2 != 0) { return val1.compareTo(val2) * direction; } if (val1 != 0 && val2 == 0) { return direction; } if (val2 != 0 && val1 == 0) { return -1 * direction; } } return 0; }
private void addEditComment(DynamicGridCell cell) { if (cell != null) form.dyngrdCurrIP().setSelectedRow(cell.getRow()); if (form.dyngrdCurrIP().getSelectedRow() != null && form.dyngrdCurrIP().getSelectedRow().getValue() != null) { STHKCurrentInpatientListVo voIP = domain.getCurrentIPRecord(((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue())); form.getGlobalContext().Core.setCommentDialogString(voIP.getComments()); form.dyngrdCurrIP().getSelectedRow().setValue(voIP); if( !form.getGlobalContext().Core.getPatientShortIsNotNull() || !(voIP != null && voIP.getPasEventIsNotNull() && voIP.getPasEvent().getPatientIsNotNull() && form.getGlobalContext().Core.getPatientShort().getID_Patient().equals(voIP.getPasEvent().getPatient().getID_Patient()) )) //wdev-22250 updatePatientGlobalContextOnSelection(voIP); //WDEV-18065 engine.open(form.getForms().Core.CommentDialog); } }
private Color getTextColor(STHKCurrentInpatientListVo voCurrInpat) { if (voCurrInpat == null || voCurrInpat.getEstDischargeDate() == null || ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS")) return null; if (voCurrInpat.getPasEventIsNotNull() && voCurrInpat.getPasEvent().getPatientIsNotNull()) { if(voCurrInpat.getPasEvent().getPatient().getAssociatedPatientIsNotNull() || voCurrInpat.getPasEvent().getPatient().getDodIsNotNull()) { ColorBean darkOrangeBean = new ColorBean(); darkOrangeBean.setName("Dark Orange"); darkOrangeBean.setValue(INTENSE_ORANGE_COLOR_HEXA_CODE); Color darkOrange = new Color(darkOrangeBean); return darkOrange; } } return null; }
/** * Function used to compare two records after alert image */ public int compare(STHKCurrentInpatientListVo o1, STHKCurrentInpatientListVo o2) { if (o1.getPasEvent()!= null && o1.getPasEvent().getPatient() != null && o2.getPasEvent() != null && o2.getPasEvent().getPatient() != null) { Integer val1 = Boolean.TRUE.equals(o1.getActiveAlerts()) ? 1 : 0; Integer val2 = Boolean.TRUE.equals(o2.getActiveAlerts()) ? 1 : 0; if (val1 != 0 && val2 != 0) { return val1.compareTo(val2) * direction; } if (val1 != 0 && val2 == 0) { return direction; } if (val2 != 0 && val1 == 0) { return -1 * direction; } } return 0; }
private void viewWard() { if (((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue()).getPasEventIsNotNull() ) form.getGlobalContext().Core.setCurrentInPatientListWard(((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue()).getPasEvent().getLocation()); engine.open(form.getForms().Core.WardViewDialog); }
private void addEditComment(DynamicGridCell cell) { if (cell != null) form.dyngrdCurrIP().setSelectedRow(cell.getRow()); if (form.dyngrdCurrIP().getSelectedRow() != null && form.dyngrdCurrIP().getSelectedRow().getValue() != null) { STHKCurrentInpatientListVo voIP = domain.getCurrentIPRecord(((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue())); form.getGlobalContext().Core.setCommentDialogString(voIP.getComments()); form.dyngrdCurrIP().getSelectedRow().setValue(voIP); updatePatientGlobalContextOnSelection(voIP); //WDEV-18065 engine.open(form.getForms().Core.CommentDialog); } }
public int compare(STHKCurrentInpatientListVo c1, STHKCurrentInpatientListVo c2) { if (Boolean.TRUE.equals(c1.getIsOnHomeLeave()) && (c2 == null || !Boolean.TRUE.equals(c2.getIsOnHomeLeave()))) { return direction; } if ((c1 == null || !Boolean.TRUE.equals(c1.getIsOnHomeLeave())) && Boolean.TRUE.equals(c2.getIsOnHomeLeave())) { return -1 * direction; } if (Boolean.TRUE.equals(c1.getIsOnHomeLeave()) && Boolean.TRUE.equals(c2.getIsOnHomeLeave())) { Integer val1 = c1.getBedIsNotNull() ? 1 : 0; Integer val2 = c2.getBedIsNotNull() ? 1 : 0; if (val1 != 0 && val2 != 0) { return val1.compareTo(val2) * direction; } if (val1 != 0 && val2 == 0) { return direction; } if (val2 != 0 && val1 == 0) { return -1 * direction; } } return 0; }
private void viewWard() { if (((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue()).getPasEventIsNotNull()) form.getGlobalContext().Core.setCurrentInPatientListWard(((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue()).getPasEvent().getLocation()); //WDEV-21168 if (((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue()).getBedIsNotNull()) form.getGlobalContext().Core.setSelectedBay(((STHKCurrentInpatientListVo)form.dyngrdCurrIP().getSelectedRow().getValue()).getBed().getBay()); engine.open(form.getForms().Core.WardViewDialog); }
private Image getHomeLeaveImageDisplay(STHKCurrentInpatientListVo voCurrInpat) { if (voCurrInpat != null && Boolean.TRUE.equals(voCurrInpat.getIsOnHomeLeave())) { return voCurrInpat.getBedIsNotNull() ? form.getImages().Core.homeleavebed : form.getImages().Core.homeleavenobed16x16; } return null; }
private boolean isPatientOnTrackingMove(STHKCurrentInpatientListVo record) { if (record == null || record.getCurrentTrackingMovement() == null) return false; if (Boolean.TRUE.equals(record.getCurrentTrackingMovement().getPatientReturned())) return false; return true; }
/** * WDEV-13136 * Function used to update global context for PatientShort and PatientToBeDisplayed when * grid selection changes */ private void updatePatientGlobalContextOnSelection(Object value) { form.getGlobalContext().Core.setSelectingPatientForm(null); form.getGlobalContext().Core.setPatientToBeDisplayed(null); form.getGlobalContext().Core.setPatientShort(null); form.getGlobalContext().Core.setCurrentCareContext(null); if (value == null) return; if ((value instanceof STHKCurrentInpatientListVo) //WDEV-22236 && ((STHKCurrentInpatientListVo) value).getPasEventIsNotNull()) { form.getGlobalContext().Core.setCurrentCareContext(domain.getCurrentCareContext(((STHKCurrentInpatientListVo) value).getPasEvent())); if (form.getGlobalContext().Core.getCurrentCareContext() == null && ((STHKCurrentInpatientListVo) value).getPasEvent().getPatientIsNotNull()) { PatientShort patient = domain.getPatientShort(((STHKCurrentInpatientListVo) value).getPasEvent().getPatient()); form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName()); form.getGlobalContext().Core.setPatientToBeDisplayed(patient); form.getGlobalContext().Core.setPatientShort(patient); } else if (form.getGlobalContext().Core.getCurrentCareContext() != null) { form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName()); form.getGlobalContext().Core.setPatientToBeDisplayed(form.getGlobalContext().Core.getPatientShort()); } } }
public STHKCurrentInpatientListVo getCurrentIPRecord(InpatientEpisodeRefVo ipRefVo) { DomainFactory factory = getDomainFactory(); return STHKCurrentInpatientListVoAssembler.create((InpatientEpisode) factory.getDomainObject(InpatientEpisode.class, ipRefVo.getID_InpatientEpisode())); }