protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException { if(form.cmbEpisode().getValues().size() < 1) { engine.showMessage("No previous episodes to copy from."); engine.close(DialogResult.CANCEL); return; } SupportNetworkServicesVoCollection voColl = new SupportNetworkServicesVoCollection(); if(form.grdServices().getRows() != null) { GenForm.grdServicesRow row = null; for(int i=0;i<form.grdServices().getRows().size();i++) { row = form.grdServices().getRows().get(i); if(row.getSelect() == true) { voColl.add(row.getValue()); } } } if(voColl.size() > 0) { form.getGlobalContext().COE.setSupportNetworkServiceCollection(voColl); engine.close(DialogResult.OK); } else engine.showMessage("Please select at least one service."); }
public SupportNetworkServicesVoCollection listSupportNetworkServicesByPatient(Boolean activeOnly, PatientRefVo patient) { DomainFactory factory = getDomainFactory(); String hql = "select snw.services from SupportNetwork as snw where snw.patient.id = :idPatient"; if (activeOnly) hql = "select serv from SupportNetwork as snw left join snw.services as serv where (serv.isCurrentlyActive = true and snw.patient.id = :idPatient)"; List supportNetworkServices = factory.find(hql, new String[]{"idPatient"}, new Object[]{patient.getID_Patient()}); return SupportNetworkServicesVoAssembler.createSupportNetworkServicesVoCollectionFromSupportNetworkServices(supportNetworkServices); }
private void listSupportCommunityServices() { ServiceCategoryCollection excludedColl = new ServiceCategoryCollection(); excludedColl.add(ServiceCategory.PATHOLOGY_DISCIPLINE); excludedColl.add(ServiceCategory.RADIOLOGY_MODALITY); //WDEV-1913 ServiceVoCollection voCollService = domain.listService(excludedColl); form.ctnServiceDetail().cmbService().clear(); for (int i = 0; i < voCollService.size(); i++) form.ctnServiceDetail().cmbService().newRow(voCollService.get(i), voCollService.get(i).getServiceName()); form.grdDetails().getRows().clear(); CommunityServiceVoCollection voColl = domain.listCommunityServicesByCareContext(form.getGlobalContext().Core.getCurrentCareContext(),Boolean.TRUE); CommunityServiceVo vo = null; GenForm.grdDetailsRow row = null; if(voColl == null || voColl.size() == 0) { SupportNetworkServicesVoCollection voCollSns = domain.listSupportNetworkServiceByPatient(form.getGlobalContext().Core.getPatientShort(),Boolean.TRUE); if (voCollSns != null && voCollSns.size()>0) { //ask user if they want to copy in existing support network services records. form.getGlobalContext().Core.setYesNoDialogMessage("Do you want to copy the Support Network Services ?"); engine.open(form.getForms().Core.YesNoDialog); return; } } for(int i=0;i<voColl.size();i++) { vo = voColl.get(i); row = form.grdDetails().getRows().newRow(); if (vo.getServiceIsNotNull()) row.setComunityService(vo.getService().getServiceName()); row.setCurrentFrequency(vo.getCurrentFrequency()); row.setRequested(vo.getIsDischargeServiceIsNotNull()?vo.getIsDischargeService().booleanValue():false); row.setDischargeFrequency(vo.getDischargeFrequency()); row.setInPlace(vo.getIsServiceInPlaceIsNotNull()?vo.getIsServiceInPlace().booleanValue():false); row.setConfirmDate(vo.getConfirmedDate()); row.setValue(vo); } //set selection back if (form.getLocalContext().getSelectedRecordIsNotNull()) { //need to get timestamp from record retrieved from List call. GenForm.grdDetailsRow row1 = form.grdDetails().getRowByValue(form.getLocalContext().getSelectedRecord()); if (row1 != null && row1.getValue() != null) { form.grdDetails().setValue(form.getLocalContext().getSelectedRecord()); populateInstanceControl(form.grdDetails().getValue()); } else clearInstanceControls(); form.getLocalContext().setSelectedRecord(form.grdDetails().getValue()); updateControlsState(); } else form.ctnServiceDetail().setCollapsed(true); }
private void insertServices() { form.grdDetails().getRows().clear(); Boolean bActiveOnly = Boolean.TRUE; SupportNetworkServicesVoCollection voColl = domain.listSupportNetworkServiceByPatient(form.getGlobalContext().Core.getPatientShort(),bActiveOnly); if (voColl != null && voColl.size()>0) { SupportNetworkServicesVo vo = null; GenForm.grdDetailsRow row = null; for(int i=0;i<voColl.size();i++) { vo = voColl.get(i); row = form.grdDetails().getRows().newRow(); if (vo.getSuppliedServiceIsNotNull()) row.setComunityService(vo.getSuppliedService().getName()); else if (vo.getServiceIsNotNull()) row.setComunityService(vo.getService().getServiceName()); row.setCurrentFrequency(vo.getFrequencyOfService()); //create Community Service vo CommunityServiceVo voComSer = new CommunityServiceVo(); voComSer.setCurrentFrequency(vo.getFrequencyOfService()); //copy if supplied if (vo.getSuppliedServiceIsNotNull()) { SuppNetworkServiceProfessionDetailVo voSerProfDet = new SuppNetworkServiceProfessionDetailVo(); voSerProfDet.setAddress(vo.getSuppliedService().getAddress()); voSerProfDet.setEmailAddress(vo.getSuppliedService().getEmailAddress()); voSerProfDet.setMobilePhone(vo.getSuppliedService().getMobilePhone()); voSerProfDet.setName(vo.getSuppliedService().getName()); voSerProfDet.setServiceLocation(vo.getSuppliedService().getServiceLocation()); voSerProfDet.setWorkPhone(vo.getSuppliedService().getWorkPhone()); voComSer.setSuppliedService(voSerProfDet); } voComSer.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voComSer.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voComSer.setService(vo.getService()); voComSer.setLocationService(vo.getLocationService()); voComSer.setIsCurrentlyActive(new Boolean(true)); voComSer.setComments(vo.getComments()); String[] arrErrors = voComSer.validate(); if(arrErrors != null) { engine.showErrors(arrErrors); } try { domain.saveCommunitService(voComSer); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return; } row.setValue(voComSer); } } }
protected void onCmbEpisodeValueChanged() throws ims.framework.exceptions.PresentationLogicException { form.grdServices().getRows().clear(); //09/09/2005 - check for null CareContextShortVo voCareContext = form.cmbEpisode().getValue(); if(voCareContext == null) return; SupportNetworkServicesVoCollection voColl = domain.listSupportNetworkServiceByCareContext(voCareContext, Boolean.TRUE); SupportNetworkServicesVo voService = null; GenForm.grdServicesRow row = null; if(voColl == null) return; for(int i=0;i<voColl.size();i++) { voService = voColl.get(i); row = form.grdServices().getRows().newRow(); if(voService.getLocationService() != null) { if(voService.getLocationService().getService() != null) row.setServiceType(voService.getLocationService().getService().getServiceName()); if(voService.getLocationService().getContact() != null) { row.setPhone(voService.getLocationService().getContact().getContactNumber()); if(voService.getLocationService().getContact().getName() != null) { row.setContact(voService.getLocationService().getContact().getName().toString()); } } } row.setFrequency(voService.getFrequencyOfService()); row.setSelect(true); row.setValue(voService); } }
public SupportNetworkServicesVoCollection listSupportNetworkServiceByPatient(PatientShort voPatientShort, Boolean activeOnly) { SupportNetworkProfessionalServices supnetProf = (SupportNetworkProfessionalServices)getDomainImpl(SupportNetworkProfessionalServicesImpl.class); return supnetProf.listSupportNetworkServicesByPatient(activeOnly,voPatientShort); }
public SupportNetworkServicesVoCollection listSupportNetworkServiceByCareContext(CareContextRefVo voCareContextRef, Boolean activeOnly) { if (voCareContextRef == null) throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument"); DomainFactory factory = getDomainFactory(); String hqlQuery = " from SupportNetwork snw "; StringBuffer condStr = new StringBuffer(); ArrayList markerNames = new ArrayList(); ArrayList markerValues = new ArrayList(); condStr.append(" where "); if (voCareContextRef != null) { condStr.append(" snw.careContext.id = :careContext"); markerNames.add("careContext"); markerValues.add(voCareContextRef.getID_CareContext()); } hqlQuery += condStr.toString(); java.util.List lst = factory.find(hqlQuery, markerNames, markerValues); // Should be only one / none Support Network in the list for the // CLinical Contact if (lst.size() > 0) { SupportNetwork snw = (SupportNetwork) lst.get(0); if (activeOnly.booleanValue() == false) return SupportNetworkServicesVoAssembler.createSupportNetworkServicesVoCollectionFromSupportNetworkServices(snw.getServices()).sort(); else { if (snw != null) { java.util.List lst2 = factory.find(snw.getServices(), " where this.isCurrentlyActive = :active", new String[]{"active"}, new Object[]{Boolean.TRUE}); return SupportNetworkServicesVoAssembler.createSupportNetworkServicesVoCollectionFromSupportNetworkServices(lst2); } return null; } } else return null; }
private boolean saveService(SupportNetworkServicesVo supportNetworkServices) { if (form.getLocalContext().getSelectedRecord() == null) populateBaseDischargeServices(); ArrayList<String> screenErrors = new ArrayList<String>(); if (form.lyrSupportServices().tabPageServices().cmbService().getValue() == null) screenErrors.add("Please select a Service Type"); if ((!form.lyrSupportServices().tabPageServices().chkSupplyServiceDetail().getValue()) && form.lyrSupportServices().tabPageServices().cmbLocationServices().getValue() == null) screenErrors.add("Please select a Location"); if ((form.lyrSupportServices().tabPageServices().chkSupplyServiceDetail().getValue()) && form.lyrSupportServices().tabPageServices().txtAreaLoc().getValue() == null) screenErrors.add("Please state a Location"); String[] sScreenErrors = screenErrors(screenErrors); if(sScreenErrors.length > 0) { engine.showErrors(sScreenErrors); return false; } SupportNetworkServicesVo voSupportServices = null; if (supportNetworkServices == null) voSupportServices = populateServicesInstanceData(); else voSupportServices = supportNetworkServices; //WDEV-14594 String[] arrErrorsProf = voSupportServices.validate(); if(arrErrorsProf != null) { engine.showErrors(arrErrorsProf); return false; } if (form.getLocalContext().getSelectedRecord().getSupportNetworkServices() == null) form.getLocalContext().getSelectedRecord().setSupportNetworkServices(new SupportNetworkServicesVoCollection()); if (form.getLocalContext().getSelectedRecord().getSupportNetworkServices().indexOf(voSupportServices) >= 0) form.getLocalContext().getSelectedRecord().getSupportNetworkServices().set(form.getLocalContext().getSelectedRecord().getSupportNetworkServices().indexOf(voSupportServices), voSupportServices); else form.getLocalContext().getSelectedRecord().getSupportNetworkServices().add(voSupportServices); String[] arrErrors = form.getLocalContext().getSelectedRecord().validate(); if(arrErrors != null) { engine.showErrors(arrErrors); return false; } try { form.getLocalContext().setSelectedRecord(domain.saveSupportServices(form.getLocalContext().getSelectedRecord())); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); openSupportServices(); return false; } savePatientNoSupportNetworkServicesInfo(false); return true; }