public int compare(PendingTransfersVo o1, PendingTransfersVo o2) { if (o1.getTransferRequestDateTimeIsNotNull() && o2.getTransferRequestDateTimeIsNotNull()) { return o1.getTransferRequestDateTime().compareTo(o2.getTransferRequestDateTime()) * direction; } if (o1.getTransferRequestDateTimeIsNotNull() && !o2.getTransferRequestDateTimeIsNotNull()) { return direction; } if (!o1.getTransferRequestDateTimeIsNotNull() && o2.getTransferRequestDateTimeIsNotNull()) { return -1 * direction; } return 0; }
/** * WDEV-13136 * Function used to retrieve records (PatientTransfers) from grid */ private PendingTransfersVoCollection populatePendingTransferRecordsFromGrid() { // Create collection to return PendingTransfersVoCollection records = new PendingTransfersVoCollection(); // Add each record from grid to collection for (int i = 0; i < form.dyngrdPatients().getRows().size(); i++) { DynamicGridRow row = form.dyngrdPatients().getRows().get(i); if (row.getValue() instanceof PendingTransfersVo) records.add((PendingTransfersVo) row.getValue()); } // Return populated records return records; }
private void addEditComment(DynamicGridCell cell) { if (cell != null) form.dyngrdPatients().setSelectedRow(cell.getRow()); if (form.dyngrdPatients().getSelectedRow() != null && form.dyngrdPatients().getSelectedRow().getValue() != null) { if (form.dyngrdPatients().getSelectedRow().getValue() instanceof PendingTransfersVo) { PendingTransfersVo voTrans = domain.getCurrentTransferRecord((PendingTransfersVo) form.dyngrdPatients().getSelectedRow().getValue()); form.getGlobalContext().Core.setCommentDialogString(voTrans.getInpatientEpisodeIsNotNull() ? voTrans.getInpatientEpisode().getComments() : ""); form.dyngrdPatients().getSelectedRow().setValue(voTrans); updateGlobalContextPatientSelection(voTrans);//WDEV-18065 engine.open(form.getForms().Core.CommentDialog); } else if (form.dyngrdPatients().getSelectedRow().getValue() instanceof InpatientEpisodeVo) { InpatientEpisodeVo voEpis = (InpatientEpisodeVo) form.dyngrdPatients().getSelectedRow().getValue(); form.getGlobalContext().Core.setCommentDialogString(voEpis.getComments()); updateGlobalContextPatientSelection(voEpis);//WDEV-18065 engine.open(form.getForms().Core.CommentDialog); } } }
public int compare(PendingTransfersVo o1, PendingTransfersVo o2) { if (o1.getInpatientEpisode()!= null && o1.getInpatientEpisode().getPasEvent()!= null && o1.getInpatientEpisode().getPasEvent().getPatient() != null && o2.getInpatientEpisode()!= null && o2.getInpatientEpisode().getPasEvent()!= null && o2.getInpatientEpisode().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; }
public PendingTransfersVo saveTransfer(PendingTransfersVo voTransfer) throws DomainInterfaceException, StaleObjectException { if (!voTransfer.isValidated()) throw new CodingRuntimeException("Transfer Record has not been validated"); if(voTransfer == null) throw new CodingRuntimeException("Cannot save null PendingTransfersVo"); DomainFactory factory = getDomainFactory(); PendingTransfers doTrans = PendingTransfersVoAssembler.extractPendingTransfers(factory, voTransfer); factory.save(doTrans); return (PendingTransfersVoAssembler.create(doTrans)); }
public int compare(Object c1, Object c2) { PendingTransfersVo o1 = c1 instanceof PendingTransfersVo ? (PendingTransfersVo) c1 : null; PendingTransfersVo o2 = c2 instanceof PendingTransfersVo ? (PendingTransfersVo) c2 : null; InpatientEpisodeVo i1 = c1 instanceof InpatientEpisodeVo ? (InpatientEpisodeVo) c1 : null; InpatientEpisodeVo i2 = c1 instanceof InpatientEpisodeVo ? (InpatientEpisodeVo) c2 : null; Integer val1 = 0; Integer val2 = 0; if (o1 != null && o2 != null && (o1.getInpatientEpisode().getComments() != null || o2.getInpatientEpisode().getComments() != null || o1.getTransferComment() != null || o2.getTransferComment() != null)) { val1 = (o1.getInpatientEpisode().getComments() != null || o1.getTransferComment() != null) ? 1 : 0; val2 = (o2.getInpatientEpisode().getComments() != null || o2.getTransferComment() != null) ? 1 : 0; } else if (i1 != null && i2 != null && (i1.getComments() != null || i2.getComments() != null || i1.getTransferComment() != null || i2.getTransferComment() != null)) { val1 = (i1.getComments() != null || i1.getTransferComment() != null) ? 1 : 0; val2 = (i2.getComments() != null || i2.getTransferComment() != 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 editTransferDetails() { if (!isNotMosUser("Logged-in user is not associated with a Member of Staff. Cannot Edit Transfer.")) { PendingTransfersVo selTransfer = (PendingTransfersVo) form.dyngrdPatients().getValue(); if (selTransfer == null) return; engine.open(form.getForms().Core.ADTEditTransferDetailsDialog, new Object[]{selTransfer.toPendingTransfersRefVo()}); } }
private void recordBedReadyDetails() { if (!(form.dyngrdPatients().getValue() instanceof PendingTransfersVo)) return; PendingTransferForBedReadyDetailsVo voBedReadyTransf = (PendingTransferForBedReadyDetailsVo)form.dyngrdPatients().getValue(); engine.open(form.getForms().Core.BedReadyDetailsDialog, new Object[]{voBedReadyTransf, FormMode.EDIT}); }
private void addEditComment(DynamicGridCell cell) { if (cell != null) form.dyngrdPatients().setSelectedRow(cell.getRow()); if (form.dyngrdPatients().getSelectedRow() != null && form.dyngrdPatients().getSelectedRow().getValue() != null) { if (form.dyngrdPatients().getSelectedRow().getValue() instanceof PendingTransfersVo) { PendingTransfersVo voTrans = domain.getCurrentTransferRecord((PendingTransfersVo) form.dyngrdPatients().getSelectedRow().getValue()); form.getGlobalContext().Core.setCommentDialogString(voTrans.getInpatientEpisodeIsNotNull() ? voTrans.getInpatientEpisode().getComments() : ""); form.dyngrdPatients().getSelectedRow().setValue(voTrans); if( !form.getGlobalContext().Core.getPatientShortIsNotNull() || !( voTrans != null && voTrans.getInpatientEpisodeIsNotNull() && voTrans.getInpatientEpisode().getPasEventIsNotNull() && voTrans.getInpatientEpisode().getPasEvent().getPatientIsNotNull() && form.getGlobalContext().Core.getPatientShort().getID_Patient().equals(voTrans.getInpatientEpisode().getPasEvent().getPatient().getID_Patient()))) //wdev-22250 updateGlobalContextPatientSelection(voTrans);//WDEV-18065 engine.open(form.getForms().Core.CommentDialog); } else if (form.dyngrdPatients().getSelectedRow().getValue() instanceof InpatientEpisodeVo) { InpatientEpisodeVo voEpis = (InpatientEpisodeVo) form.dyngrdPatients().getSelectedRow().getValue(); form.getGlobalContext().Core.setCommentDialogString(voEpis.getComments()); if( !form.getGlobalContext().Core.getPatientShortIsNotNull() || !( voEpis != null && voEpis.getPasEventIsNotNull() && voEpis.getPasEvent().getPatientIsNotNull() && form.getGlobalContext().Core.getPatientShort().getID_Patient().equals(voEpis.getPasEvent().getPatient().getID_Patient()))) //wdev-22250 updateGlobalContextPatientSelection(voEpis);//WDEV-18065 engine.open(form.getForms().Core.CommentDialog); } } }
private void updateContextMenusState() { form.getContextMenus().Core.hideAllTransfersMenuItems(); boolean nonHeartsFunct = ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS"); //WDEV-22681 form.getContextMenus().Core.getTransfersADDItem().setVisible(form.dyngrdPatients().getValue() != null); //WDEV-18011 form.getContextMenus().Core.getTransfersBED_READYItem().setVisible(nonHeartsFunct && form.dyngrdPatients().getValue() instanceof PendingTransfersVo); form.getContextMenus().Core.getTransfersEDIT_TRANSFERItem().setVisible(nonHeartsFunct && form.dyngrdPatients().getValue() instanceof PendingTransfersVo); }
public PendingTransfersVo saveTransfer(PendingTransfersVo voTransfer) throws DomainInterfaceException, StaleObjectException { if(voTransfer == null) throw new CodingRuntimeException("Cannot save null PendingTransfersVo"); if (!voTransfer.isValidated()) throw new CodingRuntimeException("Transfer Record has not been validated"); DomainFactory factory = getDomainFactory(); PendingTransfers doTrans = PendingTransfersVoAssembler.extractPendingTransfers(factory, voTransfer); factory.save(doTrans); return (PendingTransfersVoAssembler.create(doTrans)); }
public PendingTransfersVo getCurrentTransferRecord(PendingTransfersRefVo transferRefVo) { DomainFactory factory = getDomainFactory(); return PendingTransfersVoAssembler.create((PendingTransfers) factory.getDomainObject(PendingTransfers.class, transferRefVo.getID_PendingTransfers())); }