import ims.core.vo.CommunityServiceVo; //导入方法依赖的package包/类
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
{
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);
}
}
}