Commit 174cb5211993b8271678e5a3097ce8728abe9cd0

Authored by gengxiaokai
1 parent b529919071

新生儿筛查

Showing 1 changed file with 37 additions and 10 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java View file @ 174cb52
... ... @@ -95,8 +95,8 @@
95 95 System.out.print("孕妇基本信息删除成功!");
96 96 }
97 97 }
98   -
99   - String sql = "select id,bhnum from (select id,bhnum as bhnum from userzcfy.lyms_v_patientinfo where cardno= '"+patient.getVcCardNo()+"') where rownum=1";
  98 + String vaCardNo = getZcVcardNo(patient.getVcCardNo());
  99 + String sql = "select id,bhnum from (select id,bhnum as bhnum from userzcfy.lyms_v_patientinfo where cardno= '"+vaCardNo+"') where rownum=1";
100 100 ps = conn1.prepareStatement(sql);
101 101 rs = ps.executeQuery();
102 102 while(rs.next()){
... ... @@ -113,8 +113,16 @@
113 113 ps.setString(2,patient.getUsername());
114 114 ps.setString(3,patient.getCardNo());
115 115 ps.setString(4, hQuan);
116   - ps.setDate(5, new java.sql.Date(patient.getLastMenses().getTime()));
117   - ps.setDate(6, new java.sql.Date(patient.getCreated().getTime()));
  116 + if(patient.getLastMenses() != null){
  117 + ps.setDate(5, new java.sql.Date(patient.getLastMenses().getTime()));
  118 + }else{
  119 + ps.setNull(5,Types.DATE);
  120 + }
  121 + if(patient.getCreated() != null){
  122 + ps.setDate(6, new java.sql.Date(patient.getCreated().getTime()));
  123 + }else{
  124 + ps.setNull(6,Types.DATE);
  125 + }
118 126 ps.setString(7, patient.getHusbandName());
119 127 if("70ae1d93-2964-46bc-83fa-bec9ff605b1c".equals(patient.getHcertificateTypeId())){
120 128 ps.setString(8,patient.getHcertificateNum());
... ... @@ -153,6 +161,9 @@
153 161 {
154 162 conn.close();
155 163 }
  164 + if(conn1 != null){
  165 + conn1.close();
  166 + }
156 167 }catch (Exception e){
157 168 e.printStackTrace();
158 169 }
159 170  
... ... @@ -303,10 +314,10 @@
303 314 "yghxkt,xqjq,xnsd,hivkt,ydfmw,ydqjd,\n" +
304 315 "bChao,heartRate,fetalPosition,fetalPresentation,join1,checkDate,\n" +
305 316 "cDueWeek,checkDoctor,hospital,dirOpinion,infectDiseases,screenResult,highRisk,highriskDesc," +
306   - "sieveStatus,nextCheckTime,yinchan,gongwaiyun,syjg,diagnosis,diagnosisOther,score,placentas) " +
  317 + "sieveStatus,nextCheckTime,yinchan,gongwaiyun,syjg,diagnosis,diagnosisOther,score,placentas,patientId) " +
307 318 "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," +
308 319 "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," +
309   - "?,?,?,?,?,?,?,?,?)";
  320 + "?,?,?,?,?,?,?,?,?,?)";
310 321  
311 322  
312 323  
313 324  
... ... @@ -799,8 +810,8 @@
799 810 }else{
800 811 ps.setString(102,null);
801 812 }
  813 + ps.setString(103,patients.getId());
802 814  
803   -
804 815 int result = ps.executeUpdate();
805 816 if(result > 0){
806 817 br.setErrorcode(ErrorCodeConstants.SUCCESS);
... ... @@ -947,8 +958,8 @@
947 958 "hemoglobin,urineProtein,bloodSugar,bloodSugar2,\n" +
948 959 "bloodSugar3,bloodSugar4,bChao,diagnosis,\n" +
949 960 "diagnosisOther,treatmentOpinion,guide,screenResult,highRisk,highriskDesc,\n" +
950   - "resultSupple,sieveStatus,nextCheckTime,randomBloodSugar,score,tireData) " +
951   - "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  961 + "resultSupple,sieveStatus,nextCheckTime,randomBloodSugar,score,tireData,patientId) " +
  962 + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
952 963  
953 964 ps = conn.prepareStatement(innSql);
954 965 ps.setString(1,antenatalExaminationModel.getId());
955 966  
... ... @@ -1139,9 +1150,9 @@
1139 1150 }else{
1140 1151 ps.setString(42,null);
1141 1152 }
  1153 + ps.setString(43,patients.getId());
1142 1154  
1143 1155  
1144   -
1145 1156 int result = ps.executeUpdate();
1146 1157 if(result > 0){
1147 1158 br.setErrorcode(ErrorCodeConstants.SUCCESS);
... ... @@ -1274,6 +1285,22 @@
1274 1285 saveYf(startDate, endDate);
1275 1286 saveChuZhen(startDate, endDate);
1276 1287 saveFuZhen(startDate,endDate);
  1288 + }
  1289 +
  1290 +
  1291 + /**
  1292 + * 诸城就诊卡号处理
  1293 + * @param vcCardNo
  1294 + * @return
  1295 + */
  1296 + private String getZcVcardNo(String vcCardNo) {
  1297 + if (StringUtils.isNotEmpty(vcCardNo) && vcCardNo.length() > 7)
  1298 + {
  1299 + String no = "0000"+vcCardNo.substring(0,8);
  1300 + System.out.println(no);
  1301 + return no;
  1302 + }
  1303 + return vcCardNo;
1277 1304 }
1278 1305  
1279 1306 }