Commit 038e6596e293832a7cecd504e3b0c4853b85571a
1 parent
3cce54a914
Exists in
master
and in
6 other branches
诸城初诊,复诊接口
Showing 2 changed files with 186 additions and 20 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdGwInterface.java
View file @
038e659
| ... | ... | @@ -2,20 +2,31 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.pojo.HealthRecord; |
| 4 | 4 | import com.lyms.platform.biz.service.BasicConfigService; |
| 5 | +import com.lyms.platform.biz.service.PatientsService; | |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | +import com.lyms.platform.common.enums.PermissionTypeEnums; | |
| 6 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 9 | +import com.lyms.platform.common.utils.DateUtil; | |
| 7 | 10 | import com.lyms.platform.common.utils.PropertiesUtil; |
| 11 | +import com.lyms.platform.operate.web.facade.ViewFacade; | |
| 8 | 12 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 13 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 9 | 14 | import com.lyms.platform.pojo.Patients; |
| 10 | 15 | import org.apache.commons.dbutils.DbUtils; |
| 11 | 16 | import org.apache.commons.dbutils.QueryRunner; |
| 17 | +import org.apache.commons.lang.StringUtils; | |
| 12 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 19 | import org.springframework.stereotype.Service; |
| 14 | 20 | |
| 15 | 21 | import java.sql.Connection; |
| 22 | +import java.sql.Date; | |
| 23 | +import java.sql.PreparedStatement; | |
| 24 | +import java.sql.Types; | |
| 25 | +import java.sql.ResultSet; | |
| 26 | +import java.util.Map; | |
| 16 | 27 | |
| 17 | 28 | /** |
| 18 | - * Created by Administrator on 2018/5/21. | |
| 29 | + * Created by Administrator on 2018/6/25. | |
| 19 | 30 | * 承德公共卫生系统接口(gxk) |
| 20 | 31 | * 保存个人基本信息,保存地址信息 |
| 21 | 32 | */ |
| 22 | 33 | |
| ... | ... | @@ -24,7 +35,12 @@ |
| 24 | 35 | |
| 25 | 36 | @Autowired |
| 26 | 37 | private BasicConfigService basicConfigService; |
| 38 | + @Autowired | |
| 39 | + private PatientsService patientsService; | |
| 40 | + @Autowired | |
| 41 | + private ViewFacade viewFacade; | |
| 27 | 42 | |
| 43 | + //基本信息以及地址信息 | |
| 28 | 44 | public BaseObjectResponse saveBaseInfo(Patients patient,String hosipitalId){ |
| 29 | 45 | |
| 30 | 46 | //户籍地址 |
| 31 | 47 | |
| 32 | 48 | |
| 33 | 49 | |
| ... | ... | @@ -54,29 +70,29 @@ |
| 54 | 70 | "CONTACT_NAME,CONTACT_TEL_NO,NATIONALITY_CODE,ABO_CODE,RH_CODE,\n" + |
| 55 | 71 | "EDUCATION_CODE,OCCUPATION_CODE,MARRIAGE_CODE,DRUG_ALLERGY_MARK,OP_HISTORY_MARK,TRAUMA_HISTORY_MARK,\n" + |
| 56 | 72 | "BLOOD_TRANSF_MARK,GENETIC_DISEASE_HISTORY,OPERATION_HISTORY,Sec_Type_Code,Employer_Tel_No,DELETE_MARK)\n" + |
| 57 | - "vakues("+patient.getHospitalId()+","+patient.getId()+","+patient.getVcCardNo()+",'03',"+patient.getUsername()+",\n" + | |
| 58 | - "'2',"+patient.getBirth()+",'01',"+patient.getCardNo()+","+patient.getPworkUnit()+","+patient.getPhone()+",\n" + | |
| 59 | - ""+patient.getHusbandName()+","+patient.getHusbandPhone()+","+patient.getPnationId()+",'5','4',\n" + | |
| 60 | - "'',"+patient.getPprofessionTypeId()+",'20','0','0','0',\n" + | |
| 61 | - "'9','无','无','01','无','0')"; | |
| 73 | + "vakues(\""+patient.getHospitalId()+"\",\""+patient.getId()+"\",\""+patient.getVcCardNo()+"\",\"03\",\""+patient.getUsername()+"\",\n" + | |
| 74 | + "\"2\",\""+patient.getBirth()+"\",\"01\",\""+patient.getCardNo()+"\",\""+patient.getPworkUnit()+"\",\""+patient.getPhone()+"\",\n" + | |
| 75 | + "\""+patient.getHusbandName()+"\",\""+patient.getHusbandPhone()+"\",\""+patient.getPnationId()+"\",\"5\",\"4\",\n" + | |
| 76 | + "\"\",\""+patient.getPprofessionTypeId()+"\",\"20\",\"0\",\"0\",\"0\",\n" + | |
| 77 | + "\"9\",\"无\",\"无\",\"01\",\"无\",\"0\")"; | |
| 62 | 78 | |
| 63 | 79 | //地址信息语句,01:户籍地址 |
| 64 | 80 | String inAddressSql01 = "insert into baseinfo_address(ORG_CODE,PATIENT_ID,Address_Type_Code,Addr_Province,Addr_City,\n" + |
| 65 | 81 | "Addr_County,Addr_Town,Addr_Village,Addr_House_No,Postal_Code,DELETE_MARK) \n" + |
| 66 | - "values("+patient.getHospitalId()+","+patient.getId()+",'01',"+hjSheng+","+hjShi+",\n" + | |
| 67 | - ""+hjXian+","+hjXiang+","+patient.getAddress()+","+patient.getAddress()+",'','0')"; | |
| 82 | + "values(\""+patient.getHospitalId()+"\",\""+patient.getId()+"\",\"01\",\""+hjSheng+"\",\""+hjShi+"\",\n" + | |
| 83 | + "\""+hjXian+"\",\""+hjXiang+"\",\""+patient.getAddress()+"\",\""+patient.getAddress()+"\",\"\",\"0\")"; | |
| 68 | 84 | |
| 69 | 85 | //地址信息语句,03:居住地址 |
| 70 | 86 | String inAddressSql03 = "insert into baseinfo_address(ORG_CODE,PATIENT_ID,Address_Type_Code,Addr_Province,Addr_City,\n" + |
| 71 | 87 | "Addr_County,Addr_Town,Addr_Village,Addr_House_No,Postal_Code,DELETE_MARK) \n" + |
| 72 | - "values("+patient.getHospitalId()+","+patient.getId()+",'03',"+jzSheng+","+jzShi+",\n" + | |
| 73 | - ""+jzXian+","+jzXiang+","+patient.getAddressRegister()+","+patient.getAddressRegister()+",'','0')"; | |
| 88 | + "values(\""+patient.getHospitalId()+"\",\""+patient.getId()+"\",\"03\",\""+jzSheng+"\",\""+jzShi+"\",\n" + | |
| 89 | + "\""+jzXian+"\",\""+jzXiang+"\",\""+patient.getAddressRegister()+"\",\""+patient.getAddressRegister()+"\",\"\",\"0\")"; | |
| 74 | 90 | |
| 75 | 91 | //地址信息语句,07:产后居住地 |
| 76 | 92 | String inAddressSql07 = "insert into baseinfo_address(ORG_CODE,PATIENT_ID,Address_Type_Code,Addr_Province,Addr_City,\n" + |
| 77 | 93 | "Addr_County,Addr_Town,Addr_Village,Addr_House_No,Postal_Code,DELETE_MARK) \n" + |
| 78 | - "values("+patient.getHospitalId()+","+patient.getId()+",'07',"+chSheng+","+chShi+",\n" + | |
| 79 | - ""+chXian+","+chXiang+","+patient.getAddressPostRest()+","+patient.getAddressPostRest()+",'','0')"; | |
| 94 | + "values(\""+patient.getHospitalId()+"\",\""+patient.getId()+"\",\"07\",\""+chSheng+"\",\""+chShi+"\",\n" + | |
| 95 | + "\""+chXian+"\",\""+chXiang+"\",\""+patient.getAddressPostRest()+"\",\""+patient.getAddressPostRest()+"\",\"\",\"0\")"; | |
| 80 | 96 | |
| 81 | 97 | try{ |
| 82 | 98 | //执行插入个人基本信息表(BASEINFO) |
| ... | ... | @@ -119,6 +135,140 @@ |
| 119 | 135 | |
| 120 | 136 | return null; |
| 121 | 137 | } |
| 138 | + | |
| 139 | + | |
| 140 | + //第一次产检随访服务 | |
| 141 | + public BaseObjectResponse saveWOMAN_PREFIRSTVISIT(AntExChuModel antExChuModel){ | |
| 142 | + BaseObjectResponse brp = new BaseObjectResponse(); | |
| 143 | + Connection conn = ConnTools.makeGwConnection(); | |
| 144 | + PreparedStatement ps = null; | |
| 145 | + ResultSet rs = null; | |
| 146 | + int result = 0; | |
| 147 | + | |
| 148 | + try{ | |
| 149 | + Patients patients = patientsService.findOnePatientById(antExChuModel.getParentId()); | |
| 150 | + BaseObjectResponse br = viewFacade.findAntExChu(antExChuModel.getId()); | |
| 151 | + | |
| 152 | + if (br.getData() != null && patients != null) { | |
| 153 | + | |
| 154 | + if(StringUtils.isNotEmpty(patients.getId()) && StringUtils.isNotEmpty(antExChuModel.getId())){ | |
| 155 | + | |
| 156 | + //根据病人ID和初诊ID查询是否有记录,有记录则为更新 | |
| 157 | + String selSql = "select count(*) from WOMAN_PREFIRSTVISIT where \n" + | |
| 158 | + "PATIENT_ID=\""+patients.getId()+"\" and PREN_VISIT_FORM_NO=\""+antExChuModel.getId()+"\""; | |
| 159 | + | |
| 160 | + ps = conn.prepareStatement(selSql); | |
| 161 | + rs = ps.executeQuery(); | |
| 162 | + while(rs.next()){ | |
| 163 | + result = rs.getInt(1); | |
| 164 | + } | |
| 165 | + | |
| 166 | + if(result > 0){//更新数据 | |
| 167 | + | |
| 168 | + String delSql = "delete from WOMAN_PREFIRSTVISIT where \n" + | |
| 169 | + "PATIENT_ID=\""+patients.getId()+"\" and PREN_VISIT_FORM_NO=\""+antExChuModel.getId()+"\""; | |
| 170 | + ps = conn.prepareStatement(delSql); | |
| 171 | + int delCount =ps.executeUpdate(); | |
| 172 | + if(delCount > 0){ | |
| 173 | + System.out.print("初诊数据删除成功,请重新插入!"); | |
| 174 | + } | |
| 175 | + | |
| 176 | + } | |
| 177 | + | |
| 178 | + //插入数据 | |
| 179 | + Map<String,Object> map = (Map)br.getData(); | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + String inSql = "insert into WOMAN_PREFIRSTVISIT(LAST_UPDATE_DTIME,ORG_CODE,PATIENT_ID,PREN_VISIT_FORM_NO,\n" + | |
| 184 | + "HEALTH_RECORD_NO,NAME,FILL_IN_DATE,GEST_WEEKS,BIRTH_DATE,HUSBAND_NAME,HUSBAND_TEL_NO,HUSBAND_BIRTH_DATE,\n" + | |
| 185 | + "GRAVIDITY,PARITY,VAGINAL_DELIVERY_TIMES,C_SECT_DELIVERY_TIMES,LAST_MENSES_MARK,MENSES_LAST_DATE,\n" + | |
| 186 | + "EXPECTED_CHILDBIRTH_DATE,GYN_OP_HISTORY_MARK,GYN_OP_HISTORY,GEST_COMPLICATION,ABORTION_TIMES,\n" + | |
| 187 | + "STILLBIRTH_NUM,DEAD_FETUS_NUM,NEWBORN_DEATH_NUM,BIRTH_DEFECT_COUNT,HEIGHT,WEIGHT,BMI,SBP,DBP,\n" + | |
| 188 | + "CHIEF_COMPLAINT,LUNG_ABNORM_MARK,LUNG_ABNORM_DESCR,HEART_ABNORM_MARK,HEART_ABNORM_DESCR,VULVA_ABNORM_MARK,\n" + | |
| 189 | + "VULVA_ABNORM_DESCR,VAGINA_ABNORM_MARK,VAGINA_ABNORM_DESCR,CERVIX_ABNORM_MARK,CERVIX_ABNORM_DESCR,\n" + | |
| 190 | + "CORPUSUTERI_ABNORM_MARK,CORPUSUTERI_ABNORM_DESCR,ADNEXA_ABNORM_MARK,ADNEXA_ABNORM_DESCR,HGB,WBC,PLT,\n" + | |
| 191 | + "PRO_QUAN_TEST_VALUE,PRO_QUAL_RESULT_CODE,GLU_QUAL_RESULT_CODE,GLU_QUAN_TEST_VALUE,KET_QUAL_RESULT_CODE,\n" + | |
| 192 | + "UOB_TEST_RESULT_CODE,ABO_CODE,RH_CODE,GLU,SGPT,AST,ALB,TBI,DBIL,BUN,SCR,WVD_EXAM_RESULT_CODE,\n" + | |
| 193 | + "WVD_CLEAN_CODE,HBEAB_TEST_RESULT_CODE,HBEAG_TEST_RESULT_CODE,HBSAB_TEST_RESULT_CODE,HBSAG_TEST_RESULT_CODE,\n" + | |
| 194 | + "HBCAB_TEST_RESULT_CODE,STS_RESULT_CODE,HIV_ANTI_RESULT_CODE,BSCAN_RESULT_DESCR,PREG_HEALTH_ABNORM_MARK,\n" + | |
| 195 | + "PREG_HEALTH_ABNORM_DESCR,REFERRAL_MARK,REFERTO_ORG_NAME,REFERTO_DEPT_NAME,REFERRAL_REASON,VISIT_DOCTOR_NAME,\n" + | |
| 196 | + "THIS_VISIT_DATE,NEXT_VISIT_DATE,NEXT_VISIT_PLACE) " + | |
| 197 | + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,\n" + | |
| 198 | + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |
| 199 | + | |
| 200 | + ps = conn.prepareStatement(inSql); | |
| 201 | + ps.setDate(1, new Date(antExChuModel.getModified().getTime())); | |
| 202 | + ps.setString(2, patients.getHospitalId()); | |
| 203 | + ps.setString(3,patients.getId()); | |
| 204 | + ps.setString(4,antExChuModel.getId()); | |
| 205 | + ps.setString(5,null); | |
| 206 | + ps.setString(6, patients.getUsername()); | |
| 207 | + ps.setDate(7, new Date(antExChuModel.getCreated().getTime())); | |
| 208 | + if(map.get("cDueWeek") != null){ | |
| 209 | + ps.setString(8,map.get("cDueWeek").toString()); | |
| 210 | + }else{ | |
| 211 | + ps.setString(8,null); | |
| 212 | + } | |
| 213 | + ps.setDate(9,new Date(patients.getBirth().getTime())); | |
| 214 | + ps.setString(10, patients.getHusbandName()); | |
| 215 | + ps.setString(11, patients.getHusbandPhone()); | |
| 216 | + ps.setDate(12, new Date(patients.getHusbandBirth().getTime())); | |
| 217 | + ps.setInt(13, antExChuModel.getPregnancyTimes()); | |
| 218 | + ps.setInt(14, antExChuModel.getProdTime()); | |
| 219 | + ps.setInt(15, antExChuModel.getDelivery()); | |
| 220 | + ps.setInt(16,antExChuModel.getPlanedProd()); | |
| 221 | + ps.setString(17, "1"); | |
| 222 | + ps.setDate(18, new Date(antExChuModel.getLastMenses().getTime())); | |
| 223 | + ps.setDate(19, new Date(patients.getDueDate().getTime())); | |
| 224 | + ps.setString(20, "0"); | |
| 225 | + ps.setString(21, "无"); | |
| 226 | + ps.setString(22,"无"); | |
| 227 | + ps.setInt(23, antExChuModel.getAbortion()); | |
| 228 | + ps.setInt(24,antExChuModel.getStillChan()); | |
| 229 | + ps.setInt(25,antExChuModel.getStillbirth()); | |
| 230 | + ps.setInt(26,antExChuModel.getNeoDeath()); | |
| 231 | + ps.setInt(27,antExChuModel.getBirthDefect()); | |
| 232 | + ps.setInt(28,Integer.parseInt(antExChuModel.getHeight())); | |
| 233 | + ps.setInt(29,Integer.parseInt(antExChuModel.getWeight())); | |
| 234 | + //体质指数(身高除以体重的平方(米的平方)) | |
| 235 | + //身高米的平方 | |
| 236 | + Double wh = (double)Integer.parseInt(antExChuModel.getHeight())/100; | |
| 237 | + Double shen = wh*wh; | |
| 238 | + Double bmi = Double.parseDouble(antExChuModel.getWeight())/shen; | |
| 239 | + ps.setDouble(30, bmi); | |
| 240 | + ps.setNull(31, Types.INTEGER); | |
| 241 | + ps.setNull(32, Types.INTEGER); | |
| 242 | + ps.setString(33, null); | |
| 243 | + ps.setString(34,null); | |
| 244 | + ps.setString(35,antExChuModel.getLungs()); | |
| 245 | + ps.setString(36,null); | |
| 246 | + ps.setString(37,antExChuModel.getHeart()); | |
| 247 | + ps.setString(38,null); | |
| 248 | + if(map.get("vulva") != null){ | |
| 249 | + ps.setString(39,map.get("vulva").toString()); | |
| 250 | + }else{ | |
| 251 | + ps.setString(39,null); | |
| 252 | + } | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + } | |
| 257 | + | |
| 258 | + } | |
| 259 | + | |
| 260 | + }catch (Exception e){ | |
| 261 | + e.printStackTrace(); | |
| 262 | + }finally { | |
| 263 | + | |
| 264 | + } | |
| 265 | + | |
| 266 | + return null; | |
| 267 | + } | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 122 | 272 | |
| 123 | 273 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java
View file @
038e659
| ... | ... | @@ -92,10 +92,18 @@ |
| 92 | 92 | |
| 93 | 93 | if(list != null && list.size()>0){ |
| 94 | 94 | for(int i=0;i<list.size();i++){ |
| 95 | - fetalPosition = list.get(i).get("fetalPosition").toString();//胎方位 | |
| 96 | - heartRate = list.get(i).get("heartRate").toString();//心率 | |
| 97 | - fetalPresentation = list.get(i).get("fetalPresentation").toString();//胎先露 | |
| 98 | - join1 = list.get(i).get("join").toString();//衔接 | |
| 95 | + if(list.get(i).get("fetalPosition") != null){ | |
| 96 | + fetalPosition = list.get(i).get("fetalPosition").toString();//胎方位 | |
| 97 | + } | |
| 98 | + if(list.get(i).get("heartRate") != null){ | |
| 99 | + heartRate = list.get(i).get("heartRate").toString();//心率 | |
| 100 | + } | |
| 101 | + if(list.get(i).get("fetalPresentation") != null){ | |
| 102 | + fetalPresentation = list.get(i).get("fetalPresentation").toString();//胎先露 | |
| 103 | + } | |
| 104 | + if(list.get(i).get("join") != null){ | |
| 105 | + join1 = list.get(i).get("join").toString();//衔接 | |
| 106 | + } | |
| 99 | 107 | String jsons="{\"fetalPosition\":"+fetalPosition+",\"heartRate\":"+heartRate+",\"fetalPresentation\":"+fetalPresentation+",\"join1\":"+join1+"}"; |
| 100 | 108 | list2.add(jsons); |
| 101 | 109 | } |
| ... | ... | @@ -755,10 +763,18 @@ |
| 755 | 763 | |
| 756 | 764 | if(list != null && list.size()>0){ |
| 757 | 765 | for(int i=0;i<list.size();i++){ |
| 758 | - fetalPosition = list.get(i).get("fetalPosition").toString();//胎方位 | |
| 759 | - heartRate = list.get(i).get("heartRate").toString();//心率 | |
| 760 | - fetalPresentation = list.get(i).get("fetalPresentation").toString();//胎先露 | |
| 761 | - join1 = list.get(i).get("join").toString();//衔接 | |
| 766 | + if(list.get(i).get("fetalPosition") != null){ | |
| 767 | + fetalPosition = list.get(i).get("fetalPosition").toString();//胎方位 | |
| 768 | + } | |
| 769 | + if(list.get(i).get("heartRate") != null){ | |
| 770 | + heartRate = list.get(i).get("heartRate").toString();//心率 | |
| 771 | + } | |
| 772 | + if(list.get(i).get("fetalPresentation") != null){ | |
| 773 | + fetalPresentation = list.get(i).get("fetalPresentation").toString();//胎先露 | |
| 774 | + } | |
| 775 | + if(list.get(i).get("join") != null){ | |
| 776 | + join1 = list.get(i).get("join").toString();//衔接 | |
| 777 | + } | |
| 762 | 778 | String jsons="{\"fetalPosition\":"+fetalPosition+",\"heartRate\":"+heartRate+",\"fetalPresentation\":"+fetalPresentation+",\"join1\":"+join1+"}"; |
| 763 | 779 | list2.add(jsons); |
| 764 | 780 | } |