private void updateControlsState() { form.ctnTimes().btnEdit().setVisible(form.recbrEmergencyAttendance().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsPatientStatusMenuEDIT_PATIENT_STATUS_TIMESItem().setVisible(form.ctnTimes().grdPatientStatus().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsPatientStatusMenuMARK_AS_RIEItem().setVisible(form.ctnTimes().grdPatientStatus().getValue() != null && form.ctnTimes().grdPatientStatus().getRows().size() > 1); form.getContextMenus().Emergency.getTimeAmendmentsSeenByHCPMenuEDI_SEEN_BY_HCP_TIMEItem().setVisible(form.ctnTimes().grdSeenHCP().getValue() instanceof SeenByHcpForEventHistoryVo); //form.getContextMenus().Emergency.getTimeAmendmentsSeenByHCPMenuSEEN_COMPLETE_HCPItem().setVisible(true); //form.getContextMenus().Emergency.getTimeAmendmentsSeenByHCPMenuREFER_TOItem().setVisible(true); form.getContextMenus().Emergency.getTimeAmendmentsSeenByHCPMenuEDIT_REFERRAL_TO_SPECIALTY_TIMEItem().setVisible(form.ctnTimes().grdSeenHCP().getValue() instanceof ReferralToSpecialtyTeamForEventHistoryVo); form.getContextMenus().Emergency.getTimeAmendmentsMovementTimesMenuEDIT_MOVOMENT_TIMEItem().setVisible(form.ctnTimes().grdMovementTimes().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsCubicleAllocationMenuEDIT_CUBICLE_ALLOCATION_TIMEItem().setVisible(form.ctnTimes().grdCubicleAllocation().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsDNWTimesMenuEDIT_DNW_TIMEItem().setVisible(form.ctnTimes().grdDNW().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsSentToXrayMenuEDIT_SENT_TO_XRAY_TIMEItem().setVisible(form.ctnTimes().grdSentToXray().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsTransferMenuEDIT_TRANSFER_TIMEItem().setVisible(form.ctnTimes().grdTransfer().getValue() != null); form.getContextMenus().Emergency.getTimeAmendmentsBedAvailabilityMenuEDIT_BED_AVAILABILITY_TIMEItem().setVisible(form.ctnTimes().grdBed().getValue() != null); }
@Override protected void onGrdSeenHCPSelectionChanged() throws PresentationLogicException { form.getGlobalContext().Emergency.setAmendAttendanceSeenByTimes(null); form.getGlobalContext().Emergency.setAmendAttendanceReferralToSpecialtyTimes(null); if(form.ctnTimes().grdSeenHCP().getValue() instanceof SeenByHcpForEventHistoryVo) { form.getGlobalContext().Emergency.setAmendAttendanceSeenByTimes((SeenByHcpForEventHistoryVo) form.ctnTimes().grdSeenHCP().getValue()); } else if(form.ctnTimes().grdSeenHCP().getValue() instanceof ReferralToSpecialtyTeamForEventHistoryVo) { form.getGlobalContext().Emergency.setAmendAttendanceReferralToSpecialtyTimes((ReferralToSpecialtyTeamForEventHistoryVo) form.ctnTimes().grdSeenHCP().getValue()); } updateControlsState(); }
private void populateScreenFromData(SeenByHcpForEventHistoryVo seenByCurrentRecord, ReferralToSpecialtyTeamForEventHistoryVo referralToSpecialtyCurrentRecord) { clearScreen(); if(seenByCurrentRecord == null && referralToSpecialtyCurrentRecord == null) return; if(seenByCurrentRecord != null) { form.txtSeenBy().setValue(getHCPName(seenByCurrentRecord)); form.dtimAllocatedOn().setValue(seenByCurrentRecord.getAllocatedDateTime()); form.dtimSeenTime().setValue(seenByCurrentRecord.getSeenDateTime()); form.dtimCompletedTime().setValue(seenByCurrentRecord.getCompletedDateTime()); } else if(referralToSpecialtyCurrentRecord != null) { form.txtSeenBy().setValue(getReferralToSpecialty(referralToSpecialtyCurrentRecord)); form.dtimAllocatedOn().setValue(referralToSpecialtyCurrentRecord.getReferredDateTime()); form.dtimSeenTime().setValue(referralToSpecialtyCurrentRecord.getSeenDateTime()); form.dtimCompletedTime().setValue(referralToSpecialtyCurrentRecord.getCompletionDateTime()); } }
private String getHCPName(SeenByHcpForEventHistoryVo currentRecord) { if(currentRecord == null) return null; if (currentRecord.getAllocatedMedic()!=null && currentRecord.getAllocatedMedic().getMos()!=null && currentRecord.getAllocatedMedic().getMos().getName()!=null) { return currentRecord.getAllocatedMedic().getMos().getName().toString(); } else if (currentRecord.getAllocatedNurse()!=null && currentRecord.getAllocatedNurse().getMos()!=null && currentRecord.getAllocatedNurse().getMos().getName()!=null) { return currentRecord.getAllocatedNurse().getMos().getName().toString(); } return null; }
public void save(SeenByHcpForEventHistoryVo seenBy, ReferralToSpecialtyTeamForEventHistoryVo referralToSpecialty) throws ims.domain.exceptions.StaleObjectException { if(seenBy != null && !seenBy.isValidated()) throw new CodingRuntimeException("SeenByHcpForEventHistoryVo is not validated."); if(referralToSpecialty != null && !referralToSpecialty.isValidated()) throw new CodingRuntimeException("ReferralToSpecialtyTeamForEventHistoryVo is not validated."); DomainFactory factory = getDomainFactory(); if(seenBy != null) { SeenByHCP doSeenBy = SeenByHcpForEventHistoryVoAssembler.extractSeenByHCP(factory, seenBy); factory.save(doSeenBy); } if(referralToSpecialty != null) { ReferralToSpecTeam doReferralToSpecialty = ReferralToSpecialtyTeamForEventHistoryVoAssembler.extractReferralToSpecTeam(factory, referralToSpecialty); factory.save(doReferralToSpecialty); } }
private void addSeenByHCPRowToGrid(SeenByHcpForEventHistoryVo seenByHcp) { if (seenByHcp==null) return; grdAllocatedMedicRow newrow = form.grdAllocatedMedic().getRows().newRow(); if (seenByHcp.getAllocatedMedic()!=null && seenByHcp.getAllocatedMedic().getMos()!=null && seenByHcp.getAllocatedMedic().getMos().getName()!=null) { newrow.setColNurse((seenByHcp.getAllocatedMedic().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedMedic().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getForename():"")); } else if (seenByHcp.getAllocatedNurse()!=null && seenByHcp.getAllocatedNurse().getMos()!=null && seenByHcp.getAllocatedNurse().getMos().getName()!=null) { newrow.setColNurse((seenByHcp.getAllocatedNurse().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedNurse().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getForename():null)); } if (seenByHcp.getAllocatedDateTimeIsNotNull()) { newrow.setColAllocated(seenByHcp.getAllocatedDateTime().toString()); } if (seenByHcp.getSeenDateTimeIsNotNull()) { newrow.setColSeen(seenByHcp.getSeenDateTime().toString()); } if (seenByHcp.getCompletedDateTimeIsNotNull()) { newrow.setColCompleted(seenByHcp.getCompletedDateTime().toString()); } }
private void populateSeenByHCPGrid() { form.ctnTimes().grdSeenHCP().getRows().clear(); if(form.recbrEmergencyAttendance().getValue() == null) return; SeenByHcpForEventHistoryVoCollection seenByHcp = domain.listSeenByHcp(form.recbrEmergencyAttendance().getValue().getCareContext()); ReferralToSpecialtyTeamForEventHistoryVoCollection referralsToSpecialty = domain.listReferralsToSpecialty(form.recbrEmergencyAttendance().getValue().getCareContext()); List<ValueObject> values = new ArrayList<ValueObject>(); for (int i = 0; i < seenByHcp.size(); i++) { values.add(seenByHcp.get(i)); } for (int i = 0; i < referralsToSpecialty.size(); i++) { values.add(referralsToSpecialty.get(i)); } Collections.sort(values, new SeenByAndReferralToSpecialtyDateComparator(SortOrder.DESCENDING)); for(int i = 0; i < values.size(); i++) { if(values.get(i) instanceof SeenByHcpForEventHistoryVo) { addSeenByHCPRowToGrid((SeenByHcpForEventHistoryVo) values.get(i)); } else if(values.get(i) instanceof ReferralToSpecialtyTeamForEventHistoryVo) { addReferralRowToGrid((ReferralToSpecialtyTeamForEventHistoryVo) values.get(i)); } } }
public int compare(ValueObject o1, ValueObject o2) { DateTime date1 = null; DateTime date2 = null; if(o1 instanceof SeenByHcpForEventHistoryVo) { date1 = ((SeenByHcpForEventHistoryVo) o1).getSystemInformation().getCreationDateTime(); } else if(o1 instanceof ReferralToSpecialtyTeamForEventHistoryVo) { date1 = ((ReferralToSpecialtyTeamForEventHistoryVo) o1).getSystemInformation().getCreationDateTime(); } if(o2 instanceof SeenByHcpForEventHistoryVo) { date2 = ((SeenByHcpForEventHistoryVo) o2).getSystemInformation().getCreationDateTime(); } else if(o2 instanceof ReferralToSpecialtyTeamForEventHistoryVo) { date2 = ((ReferralToSpecialtyTeamForEventHistoryVo) o2).getSystemInformation().getCreationDateTime(); } if (date1 != null && date2 != null ) { return order * date1.compareTo(date2); } if (date1 == null) return -1 * order; if (date2 == null) return order; return 0; }
private void addSeenByHCPRowToGrid(SeenByHcpForEventHistoryVo seenByHcp) { if (seenByHcp==null) return; grdSeenHCPRow newrow = form.ctnTimes().grdSeenHCP().getRows().newRow(); if (seenByHcp.getAllocatedMedic()!=null && seenByHcp.getAllocatedMedic().getMos()!=null && seenByHcp.getAllocatedMedic().getMos().getName()!=null) { newrow.setColNurse((seenByHcp.getAllocatedMedic().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedMedic().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getForename():"")); } else if (seenByHcp.getAllocatedNurse()!=null && seenByHcp.getAllocatedNurse().getMos()!=null && seenByHcp.getAllocatedNurse().getMos().getName()!=null) { newrow.setColNurse((seenByHcp.getAllocatedNurse().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedNurse().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getForename():null)); } if (seenByHcp.getAllocatedDateTimeIsNotNull()) { newrow.setColAllocated(seenByHcp.getAllocatedDateTime().toString()); } if (seenByHcp.getSeenDateTimeIsNotNull()) { newrow.setColSeen(seenByHcp.getSeenDateTime().toString()); } if (seenByHcp.getCompletedDateTimeIsNotNull()) { newrow.setColCompleted(seenByHcp.getCompletedDateTime().toString()); } newrow.setValue(seenByHcp); }
private SeenByHcpForEventHistoryVo populateSeenByDataFromScreen(SeenByHcpForEventHistoryVo currentRecord) { if(currentRecord == null) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); engine.close(DialogResult.ABORT); } currentRecord.setAllocatedDateTime(form.dtimAllocatedOn().getValue()); currentRecord.setSeenDateTime(form.dtimSeenTime().getValue()); currentRecord.setCompletedDateTime(form.dtimCompletedTime().getValue()); return currentRecord; }
public ims.emergency.vo.SeenByHcpForEventHistoryVo getSeenBy(ims.emergency.vo.SeenByHCPRefVo seenByRef) { if(seenByRef == null || seenByRef.getID_SeenByHCP() == null) return null; SeenByHCP doSeenBy = (SeenByHCP) getDomainFactory().getDomainObject(SeenByHCP.class, seenByRef.getID_SeenByHCP()); return SeenByHcpForEventHistoryVoAssembler.create(doSeenBy); }
private void addSeenByHCPRowToGrid(SeenByHcpForEventHistoryVo seenByHcp) { if (seenByHcp==null) return; grdAllocatedMedicRow newrow = form.grdAllocatedMedic().getRows().newRow(); if (seenByHcp.getAllocatedMedic()!=null && seenByHcp.getAllocatedMedic().getMos()!=null && seenByHcp.getAllocatedMedic().getMos().getName()!=null) { newrow.setColNurse((seenByHcp.getAllocatedMedic().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedMedic().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getForename():"")); newrow.setTooltipForColNurse((seenByHcp.getAllocatedMedic().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedMedic().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedMedic().getMos().getName().getForename():"")); } else if (seenByHcp.getAllocatedNurse()!=null && seenByHcp.getAllocatedNurse().getMos()!=null && seenByHcp.getAllocatedNurse().getMos().getName()!=null) { newrow.setColNurse((seenByHcp.getAllocatedNurse().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedNurse().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getForename():null)); newrow.setTooltipForColNurse((seenByHcp.getAllocatedNurse().getMos().getName().getSurname()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getSurname():"") + ", " + (seenByHcp.getAllocatedNurse().getMos().getName().getForename()!=null ? seenByHcp.getAllocatedNurse().getMos().getName().getForename():null)); } if (seenByHcp.getAllocatedDateTimeIsNotNull()) { newrow.setColAllocated(seenByHcp.getAllocatedDateTime().toString()); newrow.setTooltipForColAllocated(seenByHcp.getAllocatedDateTime().toString()); } if (seenByHcp.getSeenDateTimeIsNotNull()) { newrow.setColSeen(seenByHcp.getSeenDateTime().toString()); newrow.setTooltipForColSeen(seenByHcp.getSeenDateTime().toString()); } if (seenByHcp.getCompletedDateTimeIsNotNull()) { newrow.setColCompleted(seenByHcp.getCompletedDateTime().toString()); newrow.setTooltipForColCompleted(seenByHcp.getCompletedDateTime().toString()); } if (Boolean.TRUE.equals(seenByHcp.getSignOff())) //WDEV-19293 { newrow.setColSignOff(form.getImages().Emergency.SignedOff16); newrow.setTooltipForColSignOff("Signed Off"); } }
private boolean save() { SeenByHcpForEventHistoryVo seenBy = null; ReferralToSpecialtyTeamForEventHistoryVo referralToSpecialty = null; if(form.getLocalContext().getSeenByCurrentRecord() != null) { seenBy = populateSeenByDataFromScreen(form.getLocalContext().getSeenByCurrentRecord()); } else if(form.getLocalContext().getReferralToSpecialtyCurrentRecord() != null) { referralToSpecialty = populateReferralToSpecialtyDataFromScreen(form.getLocalContext().getReferralToSpecialtyCurrentRecord()); } String[] errors = validateUIRules(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } if(seenBy != null) { errors = seenBy.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } } if(referralToSpecialty != null) { errors = referralToSpecialty.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } } try { domain.save(seenBy, referralToSpecialty); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); engine.close(DialogResult.ABORT); return false; } return true; }