private CommChannelVo getCommChannel(ChannelType channelType, Object channelValue, CommChannelVoCollection commChannelVoCollection) { if(commChannelVoCollection == null) return null; if(channelType == null || channelValue == null) return null; for(CommChannelVo channel : commChannelVoCollection) { if(channel == null) continue; if(channel.getChannelType().equals(channelType) && channel.getCommValue().equals(channelValue)) return channel; } return null; }
public void populateScreenFromData(PersonAddress pa) { if (pa != null) { pa.setPhone(pa.getPhone()); if (form.getGlobalContext().Core.getPatientShortIsNotNull() && form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull() && form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null) pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue()); form.ccAddress().setValue(pa); form.txtOtherPhone().setValue(pa.getOtherphone()); form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null); form.getLocalContext().setpersonAddress(pa); } form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex()); }
private void doCopy() { clearAddressControls(); if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull()) { PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone(); //start WDEV-14370 if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK")) { personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null); } //end form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432 populateScreenFromData(personAddress); displayPhoneNumbers(); form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432 } }
private String getTelephone(GpLiteVo gp) { if (gp == null) return null; if (!gp.getCommChannelsIsNotNull()) return null; for (int i = 0 ; i < gp.getCommChannels().size() ; i++) { CommChannelVo commChannelVo = gp.getCommChannels().get(i); if (ChannelType.GEN_PHONE.equals(commChannelVo.getChannelType()) || ChannelType.HOME_PHONE.equals(commChannelVo.getChannelType()) || ChannelType.WORK_PHONE.equals(commChannelVo.getChannelType()) || ChannelType.MOBILE.equals(commChannelVo.getChannelType())) return commChannelVo.getCommValue(); } return null; }
private String getGpMailAddress(GpLiteVo patientGp) { if (patientGp == null) return null; String mail = null; if (patientGp.getCommChannelsIsNotNull()) { for (int i = 0; i < patientGp.getCommChannels().size(); i++) { if (patientGp.getCommChannels().get(i) == null) continue; if (ChannelType.EMAIL.equals(patientGp.getCommChannels().get(i).getChannelType()) && patientGp.getCommChannels().get(i).getCommValue() != null) { mail = patientGp.getCommChannels().get(i).getCommValue(); } } } return mail; }
protected void onBtnUpdateClick() throws PresentationLogicException { // AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue()); // form.getLocalContext().setAppUserVo(user); form.setMode(FormMode.EDIT); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.btnUpdate().setEnabled(false); if (form.getLocalContext().getAppUserVoIsNotNull()) if (form.getLocalContext().getAppUserVo().getMosIsNotNull()) if (form.getLocalContext().getAppUserVo().getMos().getCommChannelsIsNotNull()) for (int i=0;i<form.getLocalContext().getAppUserVo().getMos().getCommChannels().size();i++) { if (form.getLocalContext().getAppUserVo().getMos().getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL)) { form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo())); } } }
@Override protected void onQmbMosValueChanged() throws PresentationLogicException { if (form.qmbMos().getValue()!=null) { MemberOfStaffShortVo mos = form.qmbMos().getValue(); if (mos.getCommChannelsIsNotNull()) for (int i=0;i<mos.getCommChannels().size();i++) { if (mos.getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL)) { form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo())); } } form.lnkEmailAccountInfo().setEnabled(true); } }
private void checkIfCheckBoxShouldBeDisplayedAnyway(DischargeReadyToLeaveVo voReady) { GP voGP = domain.getPatientsGP(form.getGlobalContext().Core.getPatientShort()); boolean hasEmail = false; if (voGP != null && voGP.getCommChannel(ChannelType.EMAIL) != null) hasEmail = true; DischargeDetailsVo volocalDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setCurrentDischargeDetailsVo(volocalDD); if ( !hasEmail && volocalDD != null && volocalDD.getDischargeLetterStatusIsNotNull() && volocalDD.getDischargeLetterStatus().equals(DischargeLetterStatus.GENERATED) && (voReady.getHasPatientReceivedCopyOfDischarge() == null || (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull() && ! voReady.getHasPatientReceivedCopyOfDischarge()) ) ) { form.chkLetterGiven().setVisible(true); form.lblLetterGiven().setVisible(true); if (form.getMode().equals(FormMode.EDIT)) form.chkLetterGiven().setEnabled(true); } }
public String getDisplayStringAfterSave(SummaryRefVo summaryId) { //Get number of incomplete sections String hql = "select count (detail.id) from Summary as summa left join summa.summaryDetails as detail where " + "(summa.id = :summaryId and detail.progressStatus.id <> :progressId and summa.isRIE is null and detail.isRIE is null)"; DomainFactory df = getDomainFactory(); long noOfNotCompleted = df.countWithHQL(hql, new String[] {"summaryId","progressId"}, new Object[]{summaryId.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID()}); if (noOfNotCompleted > 0) return null; //Get GP's email hql = "select comm.commValue from Summary as summary left join summary.careContext as cc left join cc.episodeOfCare as eoc " + "left join eoc.careSpell as cs left join cs.patient as pat left join pat.gp as gp " + "left join gp.commChannels as comm left join comm.channelType as chanType where (summary.id = :summId and chanType.id = :emailId)"; List<?> find = df.find(hql,new String[]{"summId","emailId"},new Object[]{summaryId.getID_Summary(),ChannelType.EMAIL.getID()}); if (find!=null && find.size() > 0) { if (find.get(0) instanceof String) { String email = (String) find.get(0); if (email.trim().length()>0) return "Discharge Summary Sent to GP"; } } return "Discharge Summary Sent to Print"; }
private String getGpMail(GPLiteWithCommChannelsVo gp) { if(gp == null || gp.getCommChannels() == null) return null; for(CommChannelVo channel : gp.getCommChannels()) { if(channel == null) continue; if(ChannelType.EMAIL.equals(channel.getChannelType())) return channel.getCommValue(); } return null; }
public void populateScreenFromData(PersonAddress pa) { if (pa != null) { pa.setPhone(pa.getPhone()); if (form.getGlobalContext().Core.getPatientShortIsNotNull() && form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull() && form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null) pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue()); form.ccAddress().setValue(pa); form.txtOtherPhone().setValue(pa.getOtherphone()); form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null); form.getLocalContext().setpersonAddress(pa); form.ccEffectiveDates().setEffectiveDates(pa.getBeffdate(), pa.getBetdate()); } form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex()); }
private void doCopy() { clearAddressControls(); if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull()) { PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone(); //start WDEV-14370 //if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK")) { personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null); } //end form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432 populateScreenFromData(personAddress); //displayPhoneNumbers(); form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432 } }
private void prePopulateCommChannels() { //WDEV-22806 - only for SVUH - IMS pre-populate three phone numbers Home (Mandatory), Mobile (Mandatory), Work (SVUH to confirm) if (form.getMode().equals(FormMode.EDIT) && ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("IRISH") && form.grdCommChannels().getRows().size() == 0) { grdCommChannelsRow rowCommChannel = form.grdCommChannels().getRows().newRow(); rowCommChannel.setcolType(ChannelType.MOBILE); rowCommChannel.setValue(new CommChannelVo()); rowCommChannel = form.grdCommChannels().getRows().newRow(); rowCommChannel.setcolType(ChannelType.HOME_PHONE); rowCommChannel.setValue(new CommChannelVo()); rowCommChannel = form.grdCommChannels().getRows().newRow(); rowCommChannel.setcolType(ChannelType.WORK_PHONE); rowCommChannel.setValue(new CommChannelVo()); } }
private void addChannel() { DynamicGridRow parent = form.dyngrdComTypeUsage().getSelectedRow(); if (parent.getValue() instanceof ChannelType) parent = parent.getParent(); if(remainingChannelsType(parent) == 0) { engine.showMessage("No Channel Type available.", "Warning", MessageButtons.OK, MessageIcon.WARNING); return; } DynamicGridRow newRow = addContactTypeToGrid(parent); newRow.setValue(new ChannelType()); form.dyngrdComTypeUsage().setSelectedRow(newRow); form.getLocalContext().setCurrentEditUsage(getUsageParent(parent)); form.getLocalContext().getCurrentEditUsage().setExpanded(true,true); rebindAllGridComboBoxes(parent); form.dyngrdComTypeUsage().setValue(null); updateControlsStatus(); }
@Override protected void onDyngrdComTypeUsageCellValueChanged(DynamicGridCell cell) { form.dyngrdComTypeUsage().setValue(null); if(Boolean.TRUE.equals(cell.getValue())) { selectDefaultChannelType(cell.getRow().getParent()); cell.setValue(true); } if (cell.getRow().getValue() instanceof ChannelType) { rebindAllGridComboBoxes(cell.getRow().getParent()); updateControlsStatus(); } }
protected void onBtnUpdateClick() throws PresentationLogicException { // AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue()); // form.getLocalContext().setAppUserVo(user); form.setMode(FormMode.EDIT); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); form.getContextMenus().getGenericGridReplaceItem().setVisible(false); if (form.getLocalContext().getAppUserVoIsNotNull()) if (form.getLocalContext().getAppUserVo().getMosIsNotNull()) if (form.getLocalContext().getAppUserVo().getMos().getCommChannelsIsNotNull()) for (int i=0;i<form.getLocalContext().getAppUserVo().getMos().getCommChannels().size();i++) { if (form.getLocalContext().getAppUserVo().getMos().getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL)) { form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo())); } } }
private String populatePhoneNumbers(PatientShort clientParent, ChannelType channelType) { if(clientParent == null || !clientParent.getCommChannelsIsNotNull()) return null; for(int i=0; i<clientParent.getCommChannels().size(); i++) { if(clientParent.getCommChannels().get(i) != null && clientParent.getCommChannels().get(i).getChannelTypeIsNotNull() && clientParent.getCommChannels().get(i).getChannelType().equals(channelType)) { return clientParent.getCommChannels().get(i).getCommValue(); } } return null; }
private CommChannelVoCollection getCommChannels() { if(!form.chkHome().getValue() && !form.chkMobile().getValue()) return null; CommChannelVoCollection clientCommChannels = new CommChannelVoCollection(); if(form.chkHome().getValue() && form.txtHomePhone().getValue() != null && this.form.txtHomePhone().getValue().trim().length() > 0) { CommChannelVo clientHomePhone = new CommChannelVo(); clientHomePhone.setChannelType(ChannelType.HOME_PHONE); clientHomePhone.setCommValue(this.form.txtHomePhone().getValue()); clientCommChannels.add(clientHomePhone); } if(form.chkMobile().getValue() && this.form.txtMobilePhone().getValue() != null && this.form.txtMobilePhone().getValue().trim().length() > 0) { CommChannelVo clientMobilePhone = new CommChannelVo(); clientMobilePhone.setChannelType(ChannelType.MOBILE); clientMobilePhone.setCommValue(this.form.txtMobilePhone().getValue()); clientCommChannels.add(clientMobilePhone); } return clientCommChannels; }