Commit ee0c714bf2abefb8c71a57860535de6fec5de81b

Authored by gengxiaokai
1 parent 989cc36b2f

承德公共卫生接口修改

Showing 4 changed files with 266 additions and 19 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdGwInterface.java View file @ ee0c714
... ... @@ -565,6 +565,42 @@
565 565 }
566 566  
567 567  
  568 + //冠鑫孕产登记(智业WOMAN_PREGNANCY_DIAG)
  569 + String inSqlDiag = "insert into WOMAN_PREGNANCY_DIAG(LAST_UPDATE_DTIME,ORG_CODE,PATIENT_ID,ORG_FORM_NO," +
  570 + "NAME,PRESENT_VILLAGE,TEL_NO,EMPLOYER_NAME,WEIGHT,MENSES_LAST_DATE,EXPECTED_TIEM,GRAVIDITY," +
  571 + "PARITY,SPONTANEOUS_ABORTION,INDUCED_ABORTION,HUSBAND_NAME,DIAGNOSIS_DATE,CREATE_DATE,create_OrgId," +
  572 + "orgName,creator,creator_Id) " +
  573 + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  574 + ps = conn.prepareStatement(inSqlDiag);
  575 + ps.setDate(1, new Date(antExChuModel.getModified().getTime()));
  576 + ps.setString(2, code);
  577 + ps.setString(3, id);
  578 + ps.setString(4, antExChuModel.getId());
  579 + ps.setString(5, patients.getUsername());
  580 + ps.setString(6, jQquan);
  581 + ps.setString(7, patients.getPhone());
  582 + ps.setString(8, patients.getPworkUnit());
  583 + if(antExChuModel.getWeight() != null){
  584 + ps.setDouble(9, Double.parseDouble(antExChuModel.getWeight()));
  585 + }else{
  586 + ps.setNull(9, Types.DOUBLE);
  587 + }
  588 + ps.setDate(10,new Date(antExChuModel.getLastMenses().getTime()));
  589 + ps.setDate(11,new Date(patients.getDueDate().getTime()));
  590 + ps.setInt(12, antExChuModel.getPregnancyTimes());
  591 + ps.setInt(13, antExChuModel.getProdTime());
  592 + ps.setInt(14, antExChuModel.getAbortionZR());
  593 + ps.setInt(15, antExChuModel.getAbortionRG());
  594 + ps.setString(16, patients.getHusbandName());
  595 + ps.setDate(17, new Date(antExChuModel.getCheckTime().getTime()));
  596 + ps.setDate(18,new Date(antExChuModel.getCreated().getTime()));
  597 + ps.setString(19,createOrgId);
  598 + ps.setString(20,orgName);
  599 + ps.setString(21,creator);
  600 + ps.setString(22,creatorId);
  601 + ps.executeUpdate();
  602 +
  603 +
568 604 String inSql = "insert into WOMAN_PREFIRSTVISIT(LAST_UPDATE_DTIME,ORG_CODE,PATIENT_ID,PREN_VISIT_FORM_NO,\n" +
569 605 "HEALTH_RECORD_NO,NAME,FILL_IN_DATE,GEST_WEEKS,BIRTH_DATE,HUSBAND_NAME,HUSBAND_TEL_NO,HUSBAND_BIRTH_DATE,\n" +
570 606 "GRAVIDITY,PARITY,VAGINAL_DELIVERY_TIMES,C_SECT_DELIVERY_TIMES,LAST_MENSES_MARK,MENSES_LAST_DATE,\n" +
571 607  
... ... @@ -629,9 +665,9 @@
629 665 ps.setNull(28, Types.INTEGER);
630 666 }
631 667 if(antExChuModel.getWeight() != null){
632   - ps.setInt(29, Integer.parseInt(antExChuModel.getWeight()));
  668 + ps.setDouble(29, Double.parseDouble(antExChuModel.getWeight()));
633 669 }else{
634   - ps.setNull(29, Types.INTEGER);
  670 + ps.setNull(29, Types.DOUBLE);
635 671 }
636 672 //体质指数(体重除以身高的平方(米的平方))
637 673 //身高米的平方
... ... @@ -3023,7 +3059,7 @@
3023 3059 if(babyModel.getFbirth() != null){
3024 3060 ps.setDate(12, new Date(babyModel.getFbirth().getTime()));
3025 3061 }else{
3026   - ps.setNull(12,Types.DATE);
  3062 + ps.setNull(12, Types.DATE);
3027 3063 }
3028 3064 ps.setString(13,babyModel.getFphone());
3029 3065 ps.setString(14,null);
... ... @@ -3056,7 +3092,7 @@
3056 3092 ps.setString(31,null);
3057 3093 ps.setString(32,null);
3058 3094 ps.setString(33,null);
3059   - ps.setString(34,null);
  3095 + ps.setString(34, null);
3060 3096 ps.setString(35,null);
3061 3097 ps.setString(36,null);
3062 3098 ps.setString(37,null);
... ... @@ -3274,7 +3310,7 @@
3274 3310 ps = conn.prepareStatement(inSql);
3275 3311 ps.setDate(1, new Date(newbornVisit.getCreated().getTime()));
3276 3312 ps.setString(2, code);
3277   - ps.setString(3, id);
  3313 + ps.setString(3, model.getId());
3278 3314 ps.setString(4,newbornVisit.getId());
3279 3315 if(StringUtils.isNotBlank(newbornVisit.getWeightNow())){
3280 3316 ps.setDouble(5, Double.parseDouble(newbornVisit.getWeightNow()));
... ... @@ -3719,7 +3755,7 @@
3719 3755 ps = conn.prepareStatement(inSql);
3720 3756 ps.setTimestamp(1, new Timestamp(babyCheckModel.getCreated().getTime()));
3721 3757 ps.setString(2, code);
3722   - ps.setString(3, id);
  3758 + ps.setString(3, babyModel.getId());
3723 3759 ps.setString(4,babyCheckModel.getId());
3724 3760 ps.setString(5,babyCheckModel.getId());
3725 3761 ps.setString(6, babyModel.getName());
3726 3762  
... ... @@ -4063,13 +4099,14 @@
4063 4099  
4064 4100  
4065 4101 /**
4066   - * 根据身份证号查询在公共卫生的ID
  4102 + * 根据身份证号查询在公共卫生的ID是否存在
4067 4103 * @param JSONstr
4068 4104 * @return
4069 4105 */
4070 4106 public String findPersonInfoId(String JSONstr){
4071 4107  
4072   - String url = "http://gxgg.greatsoft.net:8082/maternal/maternalFollowup/findPersonIsExist";
  4108 + //String url = "http://gxgg.greatsoft.net:8082/maternal/maternalFollowup/findPersonIsExist";
  4109 + String url = "http://222.223.187.132:7076/maternal/test/findPersonIsExist";
4073 4110 DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager());
4074 4111 if(JSONstr != null){
4075 4112 try{
... ... @@ -4117,7 +4154,8 @@
4117 4154 */
4118 4155 public String saveMaternalInfo(String JSONstr){
4119 4156  
4120   - String url = "http://gxgg.greatsoft.net:8082/ph-s-report/fyPerson/savePersonInfo";
  4157 + //String url = "http://gxgg.greatsoft.net:8082/ph-s-report/fyPerson/savePersonInfo";
  4158 + String url = "http://222.223.187.132:7076/maternal/personInfo/savePersonInfo";
4121 4159 DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager());
4122 4160 if(JSONstr != null){
4123 4161  
... ... @@ -4244,7 +4282,13 @@
4244 4282 List<Patients> list = patientsService.queryPatient(patientsQuery);
4245 4283 if(list != null && list.size()>0){
4246 4284 for(Patients patients : list){
4247   - br = saveBaseInfo(patients);
  4285 + try{
  4286 + br = saveBaseInfo(patients);
  4287 + }catch (Exception e){
  4288 + e.printStackTrace();
  4289 + continue;
  4290 + }
  4291 +
4248 4292 }
4249 4293 }
4250 4294 return br;
... ... @@ -4267,7 +4311,13 @@
4267 4311 List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery);
4268 4312 if(list != null && list.size()>0){
4269 4313 for(AntExChuModel antExChuModel : list){
4270   - br = saveWoman_Prefirstvisit(antExChuModel);
  4314 + try{
  4315 + br = saveWoman_Prefirstvisit(antExChuModel);
  4316 + }catch (Exception e){
  4317 + e.printStackTrace();
  4318 + continue;
  4319 + }
  4320 +
4271 4321 }
4272 4322 }
4273 4323 return br;
... ... @@ -4289,7 +4339,13 @@
4289 4339 List<AntenatalExaminationModel> list = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
4290 4340 if(list != null && list.size()>0){
4291 4341 for(AntenatalExaminationModel antenatalExaminationModel : list){
4292   - br = saveWoman_Preothervisit(antenatalExaminationModel);
  4342 + try{
  4343 + br = saveWoman_Preothervisit(antenatalExaminationModel);
  4344 + }catch (Exception e){
  4345 + e.printStackTrace();
  4346 + continue;
  4347 + }
  4348 +
4293 4349 }
4294 4350 }
4295 4351  
4296 4352  
... ... @@ -4311,7 +4367,12 @@
4311 4367 List<MaternalDeliverModel> list = matDeliverService.query(deliverQuery);
4312 4368 if(null != list && list.size() > 0){
4313 4369 for(MaternalDeliverModel maternalDeliverModel : list){
  4370 + try{
4314 4371 br = saveWomen_Delivery(maternalDeliverModel);
  4372 + }catch (Exception e){
  4373 + e.printStackTrace();
  4374 + }
  4375 +
4315 4376 }
4316 4377 }
4317 4378 return br;
... ... @@ -4333,7 +4394,13 @@
4333 4394 List<MatdeliverFollowModel> list = matDeliverFollowService.query(deliverQuery);
4334 4395 if(null != list && list.size() > 0){
4335 4396 for(MatdeliverFollowModel matdeliverFollowModel : list){
4336   - br = saveWoman_Postvisit(matdeliverFollowModel);
  4397 + try{
  4398 + br = saveWoman_Postvisit(matdeliverFollowModel);
  4399 + }catch (Exception e){
  4400 + e.printStackTrace();
  4401 + continue;
  4402 + }
  4403 +
4337 4404 }
4338 4405 }
4339 4406 return br;
... ... @@ -4354,7 +4421,13 @@
4354 4421 List<PostReviewModel> list = postReviewService.findWithList(mongoQuery);
4355 4422 if(list != null && list.size() > 0){
4356 4423 for(PostReviewModel postReviewModel : list){
4357   - br = saveWoman_Post42Exam(postReviewModel);
  4424 + try{
  4425 + br = saveWoman_Post42Exam(postReviewModel);
  4426 + }catch (Exception e){
  4427 + e.printStackTrace();
  4428 + continue;
  4429 + }
  4430 +
4358 4431 }
4359 4432 }
4360 4433 return br;
... ... @@ -4376,7 +4449,13 @@
4376 4449 List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
4377 4450 if(models != null && models.size() > 0){
4378 4451 for(BabyModel babyModel : models){
4379   - br = saveChild_Info(babyModel);
  4452 + try{
  4453 + br = saveChild_Info(babyModel);
  4454 + }catch (Exception e){
  4455 + e.printStackTrace();
  4456 + continue;
  4457 + }
  4458 +
4380 4459 }
4381 4460 }
4382 4461 return br;
... ... @@ -4397,7 +4476,13 @@
4397 4476 List<NewbornVisit> visit = mongoTemplate.find(Query.query(c), NewbornVisit.class);
4398 4477 if(visit != null && visit.size() > 0){
4399 4478 for(NewbornVisit newbornVisit : visit){
4400   - br = saveChild_HomeVisit_Memo(newbornVisit);
  4479 + try{
  4480 + br = saveChild_HomeVisit_Memo(newbornVisit);
  4481 + }catch (Exception e){
  4482 + e.printStackTrace();
  4483 + continue;
  4484 + }
  4485 +
4401 4486 }
4402 4487 }
4403 4488 return br;
... ... @@ -4418,7 +4503,13 @@
4418 4503 List<BabyCheckModel> list = babyCheckService.queryBabyCheckRecord(babyQuery);
4419 4504 if(list != null && list.size() > 0){
4420 4505 for(BabyCheckModel babyCheckModel : list){
4421   - br = saveChild_HealthExam(babyCheckModel);
  4506 + try{
  4507 + br = saveChild_HealthExam(babyCheckModel);
  4508 + }catch (Exception e){
  4509 + e.printStackTrace();
  4510 + continue;
  4511 + }
  4512 +
4422 4513 }
4423 4514 }
4424 4515 return br;
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java View file @ ee0c714
... ... @@ -3,6 +3,7 @@
3 3 import com.lyms.platform.biz.dal.IAntExChuDao;
4 4 import com.lyms.platform.biz.dal.impl.AntExChuDaoImpl;
5 5 import com.lyms.platform.biz.service.AntenatalExaminationService;
  6 +import com.lyms.platform.biz.service.BasicConfigService;
6 7 import com.lyms.platform.biz.service.PatientsService;
7 8 import com.lyms.platform.common.constants.ErrorCodeConstants;
8 9 import com.lyms.platform.common.dao.BaseMongoDAO;
9 10  
... ... @@ -11,11 +12,13 @@
11 12 import com.lyms.platform.common.utils.DateUtil;
12 13 import com.lyms.platform.common.utils.ExceptionUtils;
13 14 import com.lyms.platform.operate.web.facade.ViewFacade;
  15 +import com.lyms.platform.operate.web.utils.CommonsHelper;
14 16 import com.lyms.platform.pojo.AntExChuModel;
15 17 import com.lyms.platform.pojo.AntenatalExaminationModel;
16 18 import com.lyms.platform.pojo.Patients;
17 19 import com.lyms.platform.query.AntExChuQuery;
18 20 import com.lyms.platform.query.AntExQuery;
  21 +import com.lyms.platform.query.PatientsQuery;
19 22 import org.apache.commons.lang.StringUtils;
20 23 import org.springframework.data.domain.Sort;
21 24 import org.springframework.beans.factory.annotation.Autowired;
22 25  
... ... @@ -41,7 +44,99 @@
41 44 private ViewFacade viewFacade;
42 45 @Autowired
43 46 private AntenatalExaminationService antExService;
  47 + @Autowired
  48 + private BasicConfigService basicConfigService;
44 49  
  50 +
  51 + //孕妇基本信息
  52 + public BaseObjectResponse savePatient(Patients patient){
  53 + BaseObjectResponse br = new BaseObjectResponse();
  54 + PreparedStatement ps = null;
  55 + ResultSet rs = null;
  56 + Connection conn = ConnTools.makeCzConnection();
  57 + int count = 0;
  58 + try{
  59 +
  60 + if(patient != null){
  61 +
  62 + String hjSheng = CommonsHelper.getName1(patient.getProvinceId(), basicConfigService);
  63 + String hjShi = CommonsHelper.getName1(patient.getCityId(), basicConfigService);
  64 + String hjXian = CommonsHelper.getName1(patient.getAreaId(), basicConfigService);
  65 + String hjXiang = CommonsHelper.getName1(patient.getStreetId(), basicConfigService);
  66 + String hQuan = hjSheng+hjShi+hjXian+hjXiang;
  67 +
  68 +
  69 + String fhQuan = CommonsHelper.getResidence(patient.getHprovinceRegisterId(), patient.getHcityRegisterId(),
  70 + patient.getHareaRegisterId(), patient.getHstreetRegisterId(), patient.getHaddressRegister(),
  71 + basicConfigService);
  72 +
  73 + if(patient.getId() != null){
  74 + String selSql = "select count(*) from lyms_yf where id = '"+patient.getId()+"'";
  75 + ps = conn.prepareStatement(selSql);
  76 + rs = ps.executeQuery();
  77 + while(rs.next()){
  78 + count = rs.getInt(1);
  79 + }
  80 + if(count > 0){
  81 + String delSql = "delete from lyms_yf where id = '"+patient.getId()+"'";
  82 + ps = conn.prepareStatement(delSql);
  83 + int delCount = ps.executeUpdate();
  84 + if(delCount > 0){
  85 + System.out.print("孕妇基本信息删除成功!");
  86 + }
  87 + }
  88 +
  89 + //数据新增
  90 + String inSql = "insert into lyms_yf(id,name,idcard,mhjdz,mcyj,created,hname,fidcard,fhjdz) " +
  91 + "values(?,?,?,?,?,?,?,?,?)";
  92 + ps = conn.prepareStatement(inSql);
  93 + ps.setString(1,patient.getId());
  94 + ps.setString(2,patient.getUsername());
  95 + ps.setString(3,patient.getCardNo());
  96 + ps.setString(4, hQuan);
  97 + ps.setDate(5, new java.sql.Date(patient.getLastMenses().getTime()));
  98 + ps.setDate(6, new java.sql.Date(patient.getCreated().getTime()));
  99 + ps.setString(7, patient.getHusbandName());
  100 + ps.setString(8,patient.getHcertificateNum());
  101 + ps.setString(9, fhQuan);
  102 + int result = ps.executeUpdate();
  103 + if(result > 0){
  104 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  105 + br.setErrormsg("成功");
  106 + return br;
  107 + }
  108 + }
  109 +
  110 + }
  111 +
  112 + }catch (Exception e){
  113 + e.printStackTrace();
  114 + }finally {
  115 + try{
  116 + if (ps != null)
  117 + {
  118 + ps.close();
  119 + }
  120 +
  121 + if (rs != null)
  122 + {
  123 + rs.close();
  124 + }
  125 +
  126 + if (conn != null)
  127 + {
  128 + conn.close();
  129 + }
  130 + }catch (Exception e){
  131 + e.printStackTrace();
  132 + }
  133 + }
  134 +
  135 +
  136 + return null;
  137 + }
  138 +
  139 +
45 140 //初诊
46 141 public BaseObjectResponse saveAntexChu(AntExChuModel antExChuModel) {
47 142  
... ... @@ -1061,6 +1156,28 @@
1061 1156  
1062 1157  
1063 1158 /**
  1159 + * 诸城孕妇基本信息
  1160 + * @param startDate
  1161 + * @param endDate
  1162 + * @return
  1163 + */
  1164 + public BaseObjectResponse saveYf(String startDate,String endDate){
  1165 + BaseObjectResponse br = null;
  1166 + PatientsQuery patientsQuery = new PatientsQuery();
  1167 + patientsQuery.setCreatedTimeStart(DateUtil.parseYMDHMS(startDate));
  1168 + patientsQuery.setCreatedTimeEnd(DateUtil.parseYMDHMS(endDate));
  1169 + List<Patients> list = patientsService.queryPatient(patientsQuery);
  1170 + if(list != null && list.size()>0){
  1171 + for(Patients patients : list){
  1172 + br = savePatient(patients);
  1173 + }
  1174 + }
  1175 + return br;
  1176 + }
  1177 +
  1178 +
  1179 +
  1180 + /**
1064 1181 * 诸城初诊暂时调用方法
1065 1182 * @param startDate
1066 1183 * @param endDate
... ... @@ -1110,6 +1227,7 @@
1110 1227 String startDate = DateUtil.getyyyy_MM_dd_hms(start);
1111 1228 String endDate = DateUtil.getyyyy_MM_dd_hms(end);
1112 1229 System.out.println("start=" + startDate + "end=" + endDate);
  1230 + saveYf(startDate, endDate);
1113 1231 saveChuZhen(startDate, endDate);
1114 1232 saveFuZhen(startDate,endDate);
1115 1233 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ ee0c714
... ... @@ -62,6 +62,8 @@
62 62 import javax.validation.Valid;
63 63 import java.io.File;
64 64 import java.io.IOException;
  65 +import java.net.URLDecoder;
  66 +import java.net.URLEncoder;
65 67 import java.util.*;
66 68  
67 69 /**
... ... @@ -1928,6 +1930,19 @@
1928 1930  
1929 1931  
1930 1932 /**
  1933 + * 诸城孕妇基本信息测试
  1934 + * @param id
  1935 + * @return
  1936 + */
  1937 + @RequestMapping(value = "/zc/patient")
  1938 + @ResponseBody
  1939 + public BaseObjectResponse getzcPatient(@RequestParam("id") String id){
  1940 + Patients patients = patientsService.findOnePatientById(id);
  1941 + return zcPrenatalService.savePatient(patients);
  1942 + }
  1943 +
  1944 +
  1945 + /**
1931 1946 * 诸城初诊测试
1932 1947 *
1933 1948 * @return
... ... @@ -2225,6 +2240,29 @@
2225 2240 map.put("xt3","3");//血糖3
2226 2241 return map;
2227 2242 }
  2243 +
  2244 +
  2245 + /**
  2246 + * 查询冠新ID
  2247 + * @param name
  2248 + * @param idCard
  2249 + * @return
  2250 + */
  2251 + @RequestMapping(value="/cd/id")
  2252 + @ResponseBody
  2253 + public String getId(@RequestParam("name")String name,@RequestParam("idCard")String idCard){
  2254 + try{
  2255 + String skiName = new String(name.getBytes("ISO-8859-1"),"UTF-8");
  2256 + String str = "{\"name\":\""+skiName+"\",\"idNo\":\""+idCard+"\",\"parentIdNo\":\"\"}";
  2257 + return cdGwInterface.findPersonInfoId(str);
  2258 + }catch (Exception e){
  2259 + e.printStackTrace();
  2260 + }
  2261 +
  2262 + return null;
  2263 + }
  2264 +
  2265 +
2228 2266  
2229 2267 @Autowired
2230 2268 private PatientServiceService patientServiceService;
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml View file @ ee0c714
... ... @@ -278,7 +278,7 @@
278 278  
279 279 <bean id="cdGongWeiTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
280 280 <property name="jobDetail" ref="cdGongWeiWorker"></property>
281   - <property name="cronExpression" value="0 0 21 * * ?"></property>
  281 + <property name="cronExpression" value="0 0 20 * * ?"></property>
282 282 </bean>
283 283  
284 284  
... ... @@ -299,7 +299,7 @@
299 299 <!--处理产后复查、产后追访数据显示及自动流转-->
300 300 <ref bean="firstDandleAutoReachDueTrigger" />
301 301 <!-- 承德公共卫生接口-->
302   - <ref bean="cdGongWeiTrigger"/>
  302 + <!--<ref bean="cdGongWeiTrigger"/>-->
303 303 <!--乐陵住院系统同步-->
304 304 <!--<ref bean="synLlHisDataTrigger"/>-->
305 305 <!--乐陵住院启动时执行一次-->