Commit ac459f56154c17b78e06f0f71a5f24c07081b126
1 parent
a1b373421e
Exists in
master
and in
6 other branches
诸城复诊接口
Showing 1 changed file with 102 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java
View file @
ac459f5
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 7 | 7 | import com.lyms.platform.operate.web.facade.ViewFacade; |
| 8 | 8 | import com.lyms.platform.pojo.AntExChuModel; |
| 9 | +import com.lyms.platform.pojo.AntenatalExaminationModel; | |
| 9 | 10 | import com.lyms.platform.pojo.Patients; |
| 10 | 11 | import org.apache.commons.lang.StringUtils; |
| 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -96,7 +97,8 @@ |
| 96 | 97 | "bloodSugar,xqgbzam,xqgczam,albumin,totalBilirubin,\n" + |
| 97 | 98 | "jhBilirubin,ygbmky,ygbmkt,ygeky,ygekt,\n" + |
| 98 | 99 | "yghxkt,xqjq,xnsd,hivkt,ydfmw,ydqjd,\n" + |
| 99 | - "bChao,heartRate,fetalPosition,fetalPresentation,join1) " + | |
| 100 | + "bChao,heartRate,fetalPosition,fetalPresentation,join1,checkDate,\n" + | |
| 101 | + "cDueWeek,checkDoctor,hospital) " + | |
| 100 | 102 | "values("+antExChuModel.getId()+","+patients.getUsername()+","+patients.getCardNo()+","+patients.getVcCardNo()+",\n" + |
| 101 | 103 | ""+patients.getPhone()+","+map.get("genRemark")+","+map.get("gynRemark")+","+map.get("treatmentOpinion3")+",\n" + |
| 102 | 104 | ""+map.get("quicken")+","+map.get("quickenRemark")+","+map.get("resultSupple")+","+map.get("syjgSelect")+",\n" + |
| ... | ... | @@ -114,7 +116,8 @@ |
| 114 | 116 | ""+map.get("bloodSugar")+","+map.get("xqgbzam")+","+map.get("xqgczam")+","+map.get("albumin")+","+map.get("totalBilirubin")+",\n" + |
| 115 | 117 | ""+map.get("jhBilirubin")+","+map.get("ygbmky")+","+map.get("ygbmkt")+","+map.get("ygeky")+","+map.get("ygekt")+",\n" + |
| 116 | 118 | ""+map.get("yghxkt")+","+map.get("xqjq")+","+map.get("xnsd")+","+map.get("hivkt")+","+map.get("ydfmw")+","+map.get("ydqjd")+",\n" + |
| 117 | - ""+map.get("bChao")+","+heartRate+","+fetalPosition+","+fetalPresentation+","+join1+")"; | |
| 119 | + ""+map.get("bChao")+","+heartRate+","+fetalPosition+","+fetalPresentation+","+join1+","+map.get("checkDate")+",\n" + | |
| 120 | + ""+map.get("cDueWeek")+","+map.get("checkDoctor")+","+map.get("hospital")+")"; | |
| 118 | 121 | |
| 119 | 122 | ps=conn.prepareStatement(inSql); |
| 120 | 123 | int result = ps.executeUpdate(); |
| ... | ... | @@ -145,6 +148,103 @@ |
| 145 | 148 | } |
| 146 | 149 | |
| 147 | 150 | } |
| 151 | + return null; | |
| 152 | + } | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + //复诊 | |
| 157 | + public BaseObjectResponse saveAntexFu(AntenatalExaminationModel antenatalExaminationModel) { | |
| 158 | + | |
| 159 | + PreparedStatement ps = null; | |
| 160 | + ResultSet rs = null; | |
| 161 | + Connection conn = ConnTools.makeCzConnection(); | |
| 162 | + int count = 0; | |
| 163 | + | |
| 164 | + try{ | |
| 165 | + //首先查询孕妇基本信息 | |
| 166 | + Patients patients = patientsService.findOnePatientById(antenatalExaminationModel.getParentId()); | |
| 167 | + | |
| 168 | + BaseObjectResponse br = viewFacade.findAntenatalExamination(antenatalExaminationModel.getId()); | |
| 169 | + | |
| 170 | + if(br.getData() != null && patients != null){ | |
| 171 | + | |
| 172 | + String slSql = "select count(*) from lyms_zcfz where id = " + antenatalExaminationModel.getId() + ""; | |
| 173 | + ps = conn.prepareStatement(slSql); | |
| 174 | + rs = ps.executeQuery(); | |
| 175 | + while(rs.next()){ | |
| 176 | + count = rs.getInt(1); | |
| 177 | + } | |
| 178 | + | |
| 179 | + if(count > 0){//更新数据 | |
| 180 | + String delSql = "delete from lyms_zcfz where id="+antenatalExaminationModel.getId()+""; | |
| 181 | + ps = conn.prepareStatement(delSql); | |
| 182 | + int delCount = ps.executeUpdate(); | |
| 183 | + if(delCount == 1){ | |
| 184 | + System.out.print("旧数据删除成功!"); | |
| 185 | + } | |
| 186 | + | |
| 187 | + } | |
| 188 | + | |
| 189 | + | |
| 190 | + //新增数据 | |
| 191 | + Map<String,Object> map = (Map)br.getData(); | |
| 192 | + List<Map<String,Object>> list = (List)map.get("tireData"); | |
| 193 | + String fetalPosition = null; | |
| 194 | + String heartRate = null; | |
| 195 | + String fetalPresentation = null; | |
| 196 | + String join1 = null; | |
| 197 | + | |
| 198 | + if(list != null && list.size()>0){ | |
| 199 | + fetalPosition = list.get(0).get("fetalPosition").toString();//胎方位 | |
| 200 | + heartRate = list.get(0).get("heartRate").toString();//心率 | |
| 201 | + fetalPresentation = list.get(0).get("fetalPresentation").toString();//胎先露 | |
| 202 | + join1 = list.get(0).get("join").toString();//衔接 | |
| 203 | + | |
| 204 | + } | |
| 205 | + | |
| 206 | + String inSql = "insert into lyms_zcfz(id,name,idcard,vccardno,\n" + | |
| 207 | + "phone,checkDate,currentDueDate,checkDoctor,\n" + | |
| 208 | + "hospital,chiefComplaint,bp,weight,gongGao,\n" + | |
| 209 | + "abdominalCircumference,edema,tireNumber,quicken,\n" + | |
| 210 | + "quickenRemark,heartRate,FetalPosition,fetalPresentation,join1,\n" + | |
| 211 | + "hemoglobin,urineProtein,bloodSugar,bloodSugar2,\n" + | |
| 212 | + "bloodSugar3,bloodSugar4,bChao,diagnosis,\n" + | |
| 213 | + "diagnosisOther,treatmentOpinion,guide) " + | |
| 214 | + "values("+antenatalExaminationModel.getId()+","+patients.getUsername()+","+patients.getCardNo()+","+patients.getVcCardNo()+",\n" + | |
| 215 | + ""+patients.getPhone()+","+map.get("checkDate")+","+map.get("currentDueDate")+","+map.get("checkDoctor")+",\n" + | |
| 216 | + ""+map.get("hospital")+","+map.get("chiefComplaint")+","+map.get("bp")+","+map.get("weight")+","+map.get("gongGao")+",\n" + | |
| 217 | + ""+map.get("abdominalCircumference")+","+map.get("edema")+","+map.get("tireNumber")+","+map.get("quicken")+",\n" + | |
| 218 | + ""+map.get("quickenRemark")+","+heartRate+","+fetalPosition+","+fetalPresentation+","+join1+",\n" + | |
| 219 | + ""+map.get("hemoglobin")+","+map.get("urineProtein")+","+map.get("bloodSugar")+","+map.get("bloodSugar2")+",\n" + | |
| 220 | + ""+map.get("bloodSugar3")+","+map.get("bloodSugar4")+","+map.get("bChao")+","+map.get("diagnosis")+",\n" + | |
| 221 | + ""+map.get("diagnosisOther")+","+map.get("treatmentOpinion")+","+map.get("guide")+")"; | |
| 222 | + | |
| 223 | + ps = conn.prepareStatement(inSql); | |
| 224 | + int result = ps.executeUpdate(); | |
| 225 | + if(result > 0){ | |
| 226 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 227 | + br.setErrormsg("成功"); | |
| 228 | + return br; | |
| 229 | + } | |
| 230 | + | |
| 231 | + } | |
| 232 | + | |
| 233 | + }catch (Exception e){ | |
| 234 | + | |
| 235 | + e.printStackTrace(); | |
| 236 | + | |
| 237 | + }finally { | |
| 238 | + try{ | |
| 239 | + ps.close(); | |
| 240 | + rs.close(); | |
| 241 | + conn.close(); | |
| 242 | + }catch (Exception e){ | |
| 243 | + e.printStackTrace(); | |
| 244 | + } | |
| 245 | + | |
| 246 | + } | |
| 247 | + | |
| 148 | 248 | return null; |
| 149 | 249 | } |
| 150 | 250 |