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; }
private boolean isCommChannelInCollection(CommChannelVo commChannel,CommChannelVoCollection coll) { if(coll==null||coll.size()<1||commChannel==null) { return false; } for (CommChannelVo vo : coll) { if(commChannel.getChannelTypeIsNotNull()&& vo.getChannelTypeIsNotNull()&& commChannel.getChannelType().equals(vo.getChannelType())&& commChannel.getCommValueIsNotNull()&& vo.getCommValueIsNotNull()&& commChannel.getCommValue().equals(vo.getCommValue())) { return true; } } return false; }
private void populateScreenFromCommChannels(CommChannelVoCollection voCommChannels) { if(voCommChannels == null) return; for (int i = 0; i < voCommChannels.size(); i++) { CommChannelVo voCommChannel = voCommChannels.get(i); if (voCommChannel != null && voCommChannel.getChannelTypeIsNotNull()) { grdCommChannelsRow rowCommChannel = form.ctnDetails().grdCommChannels().getRows().newRow(); rowCommChannel.setcolType(voCommChannel.getChannelType()); rowCommChannel.setcolContactValue(voCommChannel.getCommValue()); rowCommChannel.setValue(voCommChannel); } } }
/** * Returns a collection of all comms channels populated on screen. * @param null * @return CommChannelVoCollection */ private CommChannelVoCollection getCommChannels() { CommChannelVoCollection coll = new CommChannelVoCollection(); for (int i = 0; i < form.ctnGPDetails().lyrGPDetails().tabGPDetails().grdContacts().getRows().size(); i++) { grdContactsRow row = form.ctnGPDetails().lyrGPDetails().tabGPDetails().grdContacts().getRows().get(i); if (row.getcolContactType() != null && row.getcolContactValue() != null) { CommChannelVo comm = new CommChannelVo(); comm.setChannelType(row.getcolContactType()); comm.setCommValue(row.getcolContactValue()); coll.add(comm); } } return coll; }
/** * Populates the comms channels grid using the given CommChannelVoCollection * @param CommChannelVoCollection */ private void populateContactsGrid(CommChannelVoCollection coll) { form.ctnGPDetails().lyrGPDetails().tabGPDetails().grdContacts().getRows().clear(); if (coll != null) { for (int i = 0; i < coll.size(); i++) { CommChannelVo chan = coll.get(i); grdContactsRow row = form.ctnGPDetails().lyrGPDetails().tabGPDetails().grdContacts().getRows().newRow(); row.setcolContactType(chan.getChannelType()); row.setcolContactValue(chan.getCommValue()); row.setTooltipForcolContactValue(chan.getCommValue()); row.setValue(chan); } } }
private CommChannelVoCollection getCommChannels() { CommChannelVoCollection coll = new CommChannelVoCollection(); for (int i = 0; i < form.grdContacts().getRows().size(); i++) { grdContactsRow row = form.grdContacts().getRows().get(i); if (row.getcolType() != null && row.getcolContactValue() != null) { CommChannelVo comm = new CommChannelVo(); comm.setChannelType(row.getcolType()); comm.setCommValue(row.getcolContactValue()); coll.add(comm); } } return coll; }
private void populateContactsGrid(CommChannelVoCollection coll) { form.grdContacts().getRows().clear(); if (coll == null) return; for (int i = 0; i < coll.size(); i++) { CommChannelVo chan = coll.get(i); grdContactsRow row = form.grdContacts().getRows().newRow(); row.setcolType(chan.getChannelType()); row.setcolContactValue(chan.getCommValue()); row.setTooltipForcolContactValue(chan.getCommValue()); row.setValue(chan); } }
public void populatePersonCommChannels(CommChannelVoCollection coll, COCTMT000202UK02PartOfWhole[] commChannels) { for(COCTMT000202UK02PartOfWhole commChannel : commChannels) { if(commChannel.getTelecom() != null) { TELNPFITUseRequired telecom = commChannel.getTelecom(); CommChannelVo commChannelVo = buildCommChannel(telecom); if(commChannelVo != null) { coll.add(commChannelVo); } } } }
private CommChannelVoCollection getChannelsFromContactGrid() { CommChannelVoCollection coll = new CommChannelVoCollection(); for(int i=0; i<form.grdContact().getRows().size(); i++) { grdContactRow row = form.grdContact().getRows().get(i); if (row.getcolType() != null && row.getcolContactValue() != null) { CommChannelVo comm = new CommChannelVo(); comm.setChannelType(row.getcolType()); comm.setCommValue(row.getcolContactValue()); coll.add(comm); } } return coll.size() > 0 ? coll : null; }
private void populateContactsGrid(CommChannelVoCollection coll) { form.grdContact().getRows().clear(); if (coll == null) return; for (int i = 0; i < coll.size(); i++) { CommChannelVo chan = coll.get(i); grdContactRow row = form.grdContact().getRows().newRow(); row.setcolType(chan.getChannelType()); row.setcolContactValue(chan.getCommValue()); row.setTooltipForcolContactValue(chan.getCommValue()); row.setValue(chan); } }
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; }
private Boolean populateCommChannels(ClientVo client, CommChannelVoCollection commChannel) { if(client == null || commChannel == null) return false; if(!client.getCommChannelsIsNotNull()) { client.setCommChannels(commChannel); return true; } Boolean isChanged = false; for(int i=0; i<commChannel.size(); i++) { Boolean isChangedTemp = populateClientWithCommChannel(client,commChannel.get(i)); if(!isChanged) isChanged = isChangedTemp; } return isChanged; }
public Integer saveClient(PatientShort client, ClientAddressVo newAddress, PatientShort parent, CommChannelVoCollection commChannel) throws StaleObjectException, UniqueKeyViolationException { if(client == null || newAddress == null || (newAddress !=null && !newAddress.getPersonAddressIsNotNull())) throw new DomainRuntimeException("Cannot save client."); ClientDemographics impl = (ClientDemographics) getDomainImpl(ClientDemographicsImpl.class); ClientVo clientFull = impl.getClientFull(client); Boolean isAddressUpdated = updateClientAddress(clientFull, newAddress, commChannel); if(parent != null) { clientFull.setClientParent(parent); } clientFull.validate(); clientFull = impl.saveClient(clientFull); if(isAddressUpdated) return 1; return 0; }
public Integer saveFamilyAddress(PatientShortCollection clients, ClientAddressVo newAddress, CommChannelVoCollection commChannel) throws StaleObjectException, UniqueKeyViolationException { if(clients == null || newAddress == null || (newAddress !=null && !newAddress.getPersonAddressIsNotNull())) throw new CodingRuntimeException("Cannot save client in saveFamilyAddress method."); FamilyRecords impl = (FamilyRecords) getDomainImpl(FamilyRecordsImpl.class); Integer numberOfAddressChanged = 0; for(int i=0; i<clients.size(); i++) { if(clients.get(i) != null) { numberOfAddressChanged += impl.saveClient(clients.get(i), newAddress, null, commChannel); } } return numberOfAddressChanged; }
private void populateScreenFromData(PatientShort pat) { CommChannelVoCollection voCommChannelColl = pat.getCommChannels(); ims.clinical.forms.patientcontactdlg.GenForm.grdCommChannelsRow rowCommChannel; if (voCommChannelColl != null) { for (int i = 0; i < voCommChannelColl.size(); i++) { CommChannelVo voCommChannel = voCommChannelColl.get(i); if (voCommChannel.getChannelTypeIsNotNull()) { rowCommChannel = form.grdCommChannels().getRows().newRow(); rowCommChannel.setcolType(voCommChannel.getChannelType()); rowCommChannel.setcolContactValue(voCommChannel.getCommValue()); rowCommChannel.setValue(voCommChannel); } } } }
private String getPracticePhoneNumber(CommChannelVoCollection commChannels) { String value = ""; if (commChannels == null) return ""; if (commChannels != null) { for (int i = 0; i < commChannels.size(); i++) { CommChannelVo row = commChannels.get(i); if (row != null) { if (row.getChannelTypeIsNotNull()) if (row.getChannelType().equals(ChannelType.GEN_PHONE)) { value = row.getCommValue(); break; } } } } return value; }
private void populateScreenFromData(ExternalPersonShortVo extPerVo) { clearDetailControls(); if (extPerVo.getNameIsNotNull()) { form.txtSurname().setValue(extPerVo.getName().getSurname()); form.txtForeName().setValue(extPerVo.getName().getForename()); form.txtMiddleName().setValue(extPerVo.getName().getMiddleName()); form.cmbTitle().setValue(extPerVo.getName().getTitle()); CommChannelVoCollection voCommChannelColl = extPerVo.getCommChannels(); GenForm.grdContactRow rowCommChannel; if (voCommChannelColl != null) { for (int i = 0; i < voCommChannelColl.size(); i++) { CommChannelVo voCommChannel = voCommChannelColl.get(i); if (voCommChannel.getChannelTypeIsNotNull()) { rowCommChannel = form.grdContact().getRows().newRow(); rowCommChannel.setcolType(voCommChannel.getChannelType()); rowCommChannel.setcolContactValue(voCommChannel.getCommValue()); rowCommChannel.setValue(voCommChannel); } } } } }
private CommChannelVoCollection listCommChannels() { CommChannelVoCollection voCommChannelColl = new CommChannelVoCollection(); grdCommChannelsRow rowComm; for (int i = 0; i < form.grdCommChannels().getRows().size(); i++) { rowComm = form.grdCommChannels().getRows().get(i); CommChannelVo voCommChannel = rowComm.getValue(); boolean existCommChannels = false; // WDEV-2496 if (rowComm.getcolType() != null && (rowComm.getcolContactValue() != null && rowComm.getcolContactValue().trim().length() != 0)) { voCommChannel.setChannelType(rowComm.getcolType()); voCommChannel.setCommValue(rowComm.getcolContactValue()); for (int k = 0; k < voCommChannelColl.size(); k++) { if (voCommChannelColl.get(k).getChannelType().equals(rowComm.getcolType()) && voCommChannelColl.get(k).getCommValue().equals(rowComm.getcolContactValue())) { existCommChannels = true; break; } } if (!existCommChannels) voCommChannelColl.add(voCommChannel); } } return voCommChannelColl; }
private void checkIfThereAreSameChannels(CommChannelVoCollection channelColl, DynamicGridRow parentRow, DynamicGridColumn column) { if(channelColl == null || channelColl.size() == 0 || parentRow == null) return; for(int j = channelColl.size() - 1; j>=0; j--) { if(channelColl.get(j) == null) continue; for(int i=0; i<parentRow.getRows().size(); i++) { if(parentRow.getRows().get(i).getValue().equals(channelColl.get(j).getChannelType())) { DynamicGridCell sourceChannelValue = parentRow.getRows().get(i).getCells().get(getColumn(COL_SOURCE_PATIENT)); if(sourceChannelValue != null && sourceChannelValue.getValue() != null && sourceChannelValue.getValue().equals(channelColl.get(j).getCommValue())) { DynamicGridCell cellNew = parentRow.getRows().get(i).getCells().newCell(column, DynamicCellType.STRING); cellNew.setValue(channelColl.get(j).getCommValue()); cellNew.setReadOnly(true); createMoveButtons(parentRow.getRows().get(i)); removeMoveButtons(parentRow.getRows().get(i)); channelColl.remove(j); break; } } } } }