Logic.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:AvoinApotti 作者:
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);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号