Commit 28528f98c06dba234cf257235d23a9c20296c492
1 parent
2a9d661632
Exists in
master
and in
6 other branches
分娩
Showing 2 changed files with 19 additions and 13 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyFmService.java
View file @
28528f9
... | ... | @@ -124,9 +124,8 @@ |
124 | 124 | " CONVERT(char(19),婴儿产出时日,120) as BABY_DELIVERY_TIME,\n" + |
125 | 125 | " 婴儿性别 as BABY_SEX,\n" + |
126 | 126 | " 孕周 as DUE_WEEK,\n" + |
127 | - // " DUE_DAY as DUE_DAY,\n" + | |
128 | 127 | " 胎次 as FETUS_NUM,\n" + |
129 | - " 窒息 as BABY_ASPHYXIAM,\n" + | |
128 | + " CONVERT(int,窒息) as BABY_ASPHYXIAM,\n" + | |
130 | 129 | " CONVERT(int,left(体重,len(体重)-1)) as BABY_WEIGHT,\n" + |
131 | 130 | " CONVERT(int,left(身长,len(身长)-2)) as BABY_HEIGHT,\n" + |
132 | 131 | " CONVERT(int,left(Apgar评分1,len(Apgar评分1)-1)) as BABY_APGAR_SCORE_ONE,\n" + |
133 | 132 | |
134 | 133 | |
... | ... | @@ -161,16 +160,15 @@ |
161 | 160 | try { |
162 | 161 | |
163 | 162 | String sql ="select "+cloumns+" from xlhhis..v_fmjl where " + |
164 | - " CREATED > CONVERT(char(19), '"+start+"', 120) and CREATED <= CONVERT(char(19), '"+start+"', 120)" ; | |
165 | - if (phone != null) | |
163 | + " 时间 > CONVERT(char(19), '"+start+"', 120) and 时间 <= CONVERT(char(19), '"+end+"', 120)" ; | |
164 | + if (StringUtils.isNotEmpty(phone)) | |
166 | 165 | { |
167 | 166 | sql+=" and 手机号码 = '"+phone+"'"; |
168 | 167 | } |
168 | + System.out.println(sql); | |
169 | 169 | List<Fm> list = queryRunner.query(conn, sql, new BeanListHandler<Fm>(Fm.class)); |
170 | 170 | ExceptionUtils.catchException("size====" + list.size()); |
171 | 171 | |
172 | - /*List<Fm> list=new ArrayList<Fm>(); | |
173 | - list.add(fm1);*/ | |
174 | 172 | if(CollectionUtils.isNotEmpty(list)){ |
175 | 173 | |
176 | 174 | for(Fm fm:list){ |
... | ... | @@ -181,7 +179,7 @@ |
181 | 179 | String id = fm.getID();//获取所有的孕妇ID,方便孕妇产下双胞胎而用 |
182 | 180 | |
183 | 181 | //用来查询这个孕妇分娩的最近日期的sql |
184 | - String dateSql = "select max(CONVERT(char(19),CREATED,120)) as babyDate from xlhhis..v_fmjl where " + | |
182 | + String dateSql = "select max(CONVERT(char(19),婴儿产出时日,120)) as babyDate from xlhhis..v_fmjl where " + | |
185 | 183 | " ID='"+id+"'" ; |
186 | 184 | |
187 | 185 | //获取到这个孕妇的最近的分娩日期 |
188 | 186 | |
189 | 187 | |
190 | 188 | |
... | ... | @@ -191,19 +189,16 @@ |
191 | 189 | calendar.add(Calendar.DAY_OF_MONTH, -1); |
192 | 190 | Date sDate = calendar.getTime(); |
193 | 191 | String startDate = fmt.format(sDate); |
194 | - String endDate = dateList.get(0).getBabyDate(); | |
192 | + String endDate = DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(fmt.parse(dateList.get(0).getBabyDate()), 1)); | |
195 | 193 | |
196 | 194 | //查询这个孕妇最近日期所有分娩记录的sql |
197 | 195 | String allSql = "select "+cloumns+" from xlhhis..v_fmjl where " + |
198 | - " CREATED > CONVERT(char(19),'"+startDate+"',120) and CREATED <= CONVERT(char(19),'"+endDate+"',120)" + | |
196 | + " 婴儿产出时日 > CONVERT(char(19),'"+startDate+"',120) and 婴儿产出时日 <= CONVERT(char(19),'"+endDate+"',120)" + | |
199 | 197 | " and ID='"+id+"'" ; |
200 | 198 | |
199 | + System.out.println("-==========="+allSql); | |
201 | 200 | //查出这个ID对应孕妇在这个时间段的分娩记录 |
202 | 201 | List<Fm> allList = queryRunner.query(conn, allSql, new BeanListHandler<Fm>(Fm.class)); |
203 | - | |
204 | - /*List<Fm> allList = new ArrayList<Fm>(); | |
205 | - allList.add(fm);*/ | |
206 | - | |
207 | 202 | Date dueDate = null; |
208 | 203 | List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); |
209 | 204 | MatDeliverAddRequest deliverAddRequest = new MatDeliverAddRequest(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
28528f9
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | import com.lyms.hospitalapi.Cdfy.CdfyHisService; |
6 | 6 | import com.lyms.hospitalapi.dzfy.DzfyFmService; |
7 | 7 | import com.lyms.hospitalapi.lcdcf.LcdcfFmService; |
8 | +import com.lyms.hospitalapi.llfy.LlfyFmService; | |
8 | 9 | import com.lyms.hospitalapi.qhdfy.QhdfyFmService; |
9 | 10 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
10 | 11 | import com.lyms.hospitalapi.rcfy.RcGlxtService; |
... | ... | @@ -3124,6 +3125,16 @@ |
3124 | 3125 | Map<String,String> map = new HashMap<>(); |
3125 | 3126 | map.put("id,","2134123412431"); |
3126 | 3127 | return map; |
3128 | + } | |
3129 | + | |
3130 | + @Autowired | |
3131 | + private LlfyFmService llfyFmService; | |
3132 | + | |
3133 | + @RequestMapping(method = RequestMethod.GET, value = "/llfm") | |
3134 | + @ResponseBody | |
3135 | + public String getFm(String start,String end,String syxh){ | |
3136 | + llfyFmService.queryFmPatient(start, end, syxh); | |
3137 | + return "1"; | |
3127 | 3138 | } |
3128 | 3139 | |
3129 | 3140 | } |