Commit 94dee293fbdd8a1cf938e3c8e92dc6f6dcb1ea04

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 7 changed files

platform-biz-service/src/main/java/com/lyms/platform/permission/model/BabyPatientExtendEarFollowUpQuery.java View file @ 94dee29
... ... @@ -55,8 +55,19 @@
55 55 * 人工耳蜗(0-左耳,2-右耳,3-全部)
56 56 */
57 57 private Integer artifiCochlea;
58   -
59 58 /**
  59 + * 是否选择助听器
  60 + */
  61 + private Integer isAudiphone;
  62 + /**
  63 + * 是否选择手术(0-未选择,1-选择)
  64 + */
  65 + private Integer isOperation;
  66 + /**
  67 + * 是否选择人工耳蜗(0-左耳,2-右耳,3-全部)
  68 + */
  69 + private Integer isArtifiCochlea;
  70 + /**
60 71 * 指导意见
61 72 */
62 73 private String guideOpinion;
... ... @@ -77,7 +88,7 @@
77 88 */
78 89 private Integer ifdel;
79 90 /**
80   - * 是否结案
  91 + * 是否结案 0-未结案,1-已结案
81 92 */
82 93 private Integer ifclose;
83 94 /**
... ... @@ -123,6 +134,30 @@
123 134 private Date nextEndTime;
124 135 //获取sql语句
125 136 private String sqlStr;
  137 +
  138 + public Integer getIsAudiphone() {
  139 + return isAudiphone;
  140 + }
  141 +
  142 + public void setIsAudiphone(Integer isAudiphone) {
  143 + this.isAudiphone = isAudiphone;
  144 + }
  145 +
  146 + public Integer getIsOperation() {
  147 + return isOperation;
  148 + }
  149 +
  150 + public void setIsOperation(Integer isOperation) {
  151 + this.isOperation = isOperation;
  152 + }
  153 +
  154 + public Integer getIsArtifiCochlea() {
  155 + return isArtifiCochlea;
  156 + }
  157 +
  158 + public void setIsArtifiCochlea(Integer isArtifiCochlea) {
  159 + this.isArtifiCochlea = isArtifiCochlea;
  160 + }
126 161  
127 162 public String getSqlStr() {
128 163 return sqlStr;
platform-biz-service/src/main/resources/mainOrm/master/BabyPatientExtendEarFollowUp.xml View file @ 94dee29
... ... @@ -15,6 +15,9 @@
15 15 <result column="audiphone" property="audiphone" jdbcType="INTEGER"/>
16 16 <result column="operation" property="operation" jdbcType="INTEGER"/>
17 17 <result column="artifi_cochlea" property="artifiCochlea" jdbcType="INTEGER"/>
  18 + <result column="is_audiphone" property="isAudiphone" jdbcType="INTEGER"/>
  19 + <result column="is_operation" property="isOperation" jdbcType="INTEGER"/>
  20 + <result column="is_artifi_cochlea" property="isArtifiCochlea" jdbcType="INTEGER"/>
18 21 <result column="guide_opinion" property="guideOpinion" jdbcType="VARCHAR"/>
19 22 <result column="follow_doctor_name" property="followDoctorName" jdbcType="VARCHAR"/>
20 23 <result column="follow_doctor_id" property="followDoctorId" jdbcType="VARCHAR"/>
... ... @@ -32,10 +35,7 @@
32 35  
33 36 <insert id="addBabyPatientExtendEarFollowUp"
34 37 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUp">
35   - insert into baby_patient_extend_ear_follow_up
36   - (id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble)
37   - values
38   - (#{id},#{babyId},#{followTime},#{followAddr},#{markTime},#{markResult},#{markDetail},#{followInfo},#{audiphone},#{operation},#{artifiCochlea},#{guideOpinion},#{followDoctorName},#{followDoctorId},#{nextTime},#{ifdel},#{ifclose},#{hospitalId},#{modifyTime},#{modifyId},#{createTime},#{createId},#{enalble})
  38 + insert into baby_patient_extend_ear_follow_up (id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,is_audiphone,is_operation,is_artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble) values (#{id},#{babyId},#{followTime},#{followAddr},#{markTime},#{markResult},#{markDetail},#{followInfo},#{audiphone},#{operation},#{artifiCochlea},#{isAudiphone},#{isOperation},#{isArtifiCochlea},#{guideOpinion},#{followDoctorName},#{followDoctorId},#{nextTime},#{ifdel},#{ifclose},#{hospitalId},#{modifyTime},#{modifyId},#{createTime},#{createId},#{enalble})
39 39 </insert>
40 40  
41 41  
... ... @@ -73,6 +73,15 @@
73 73 <if test="artifiCochlea != null and artifiCochlea >= 0">
74 74 artifi_cochlea = #{artifiCochlea,jdbcType=INTEGER},
75 75 </if>
  76 + <if test="isAudiphone != null and isAudiphone >= 0">
  77 + is_audiphone = #{isAudiphone,jdbcType=INTEGER},
  78 + </if>
  79 + <if test="isOperation != null and isOperation >= 0">
  80 + is_operation = #{isOperation,jdbcType=INTEGER},
  81 + </if>
  82 + <if test="isArtifiCochlea != null and isArtifiCochlea >= 0">
  83 + is_artifi_cochlea = #{isArtifiCochlea,jdbcType=INTEGER},
  84 + </if>
76 85 <if test="guideOpinion != null and guideOpinion != ''">
77 86 guide_opinion = #{guideOpinion,jdbcType=VARCHAR},
78 87 </if>
... ... @@ -121,7 +130,7 @@
121 130  
122 131 <select id="getBabyPatientExtendEarFollowUp" resultMap="BabyPatientExtendEarFollowUpResultMap"
123 132 parameterType="java.lang.String">
124   -select id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble
  133 +select id,baby_id,follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,is_audiphone,is_operation,is_artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble
125 134 from baby_patient_extend_ear_follow_up where id = #{id,jdbcType=VARCHAR}
126 135 </select>
127 136  
... ... @@ -147,7 +156,7 @@
147 156 </if>
148 157 <if test="babyIds!=null">
149 158 and baby_id in (
150   - <foreach item="babyId" collection="babyIds" separator="," >
  159 + <foreach item="babyId" collection="babyIds" separator=",">
151 160 #{babyId}
152 161 </foreach>
153 162 )
... ... @@ -247,7 +256,8 @@
247 256 <select id="queryBabyPatientExtendEarFollowUp" resultMap="BabyPatientExtendEarFollowUpResultMap"
248 257 parameterType="com.lyms.platform.permission.model.BabyPatientExtendEarFollowUpQuery">
249 258 select
250   - id,baby_id,max(follow_time) as follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble
  259 + id,baby_id,max(follow_time) as
  260 + follow_time,follow_addr,mark_time,mark_result,mark_detail,follow_info,audiphone,operation,artifi_cochlea,guide_opinion,follow_doctor_name,follow_doctor_id,next_time,ifdel,ifclose,hospital_id,modify_time,modify_id,create_time,create_id,enalble
251 261 from baby_patient_extend_ear_follow_up
252 262 <include refid="BabyPatientExtendEarFollowUpCondition"/>
253 263 GROUP BY baby_id
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 94dee29
... ... @@ -23,7 +23,10 @@
23 23  
24 24 private String id;
25 25 private List<String> ids;
  26 + private String pid;
26 27  
  28 + private List<String> pIds;
  29 +
27 30 private String husbandPhone;
28 31  
29 32 /**
... ... @@ -204,6 +207,14 @@
204 207 return provinceId;
205 208 }
206 209  
  210 + public List<String> getpIds() {
  211 + return pIds;
  212 + }
  213 +
  214 + public void setpIds(List<String> pIds) {
  215 + this.pIds = pIds;
  216 + }
  217 +
207 218 public void setProvinceId(String provinceId) {
208 219 this.provinceId = provinceId;
209 220 }
... ... @@ -272,7 +283,6 @@
272 283 this.lastMensesNeEnd = lastMensesNeEnd;
273 284 }
274 285  
275   - private String pid;
276 286  
277 287 public Date getLastRhTimeEnd() {
278 288 return lastRhTimeEnd;
... ... @@ -1074,6 +1084,9 @@
1074 1084 }
1075 1085 if (null != pid) {
1076 1086 condition = condition.and("pid", pid, MongoOper.IS);
  1087 + }
  1088 + if (null != pIds) {
  1089 + condition = condition.and("pid", pIds, MongoOper.IN);
1077 1090 }
1078 1091 Criteria c1 = null;
1079 1092  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java View file @ 94dee29
... ... @@ -116,7 +116,7 @@
116 116 }
117 117 }
118 118 if (CollectionUtils.isNotEmpty(patientIds)) {
119   - getAllPatientList(patientIds, resultInfo,loginState.getId());
  119 + getAllPatientList(startDate, endDate, childBirth, patientIds, resultInfo, loginState.getId());
120 120 }
121 121  
122 122  
123 123  
... ... @@ -169,8 +169,49 @@
169 169 }
170 170  
171 171 //获取患者全部检测数据
172   - public void getAllPatientList(List<String> patientId, Map<String, AntextDoctorPatient> resultInfo,Integer userId) {
  172 + public void getAllPatientList(Date startDate, Date endDate, Integer childBirth, List<String> patientId, Map<String, AntextDoctorPatient> resultInfo, Integer userId) {
173 173  
  174 +
  175 + PatientsQuery patientsQuery = new PatientsQuery();
  176 + patientsQuery.setIds(patientId);
  177 +
  178 + List<Patients> patientss = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  179 + List<String> pIds = new ArrayList<>();
  180 + for (Patients ps : patientss) {
  181 + pIds.add(ps.getPid());
  182 + }
  183 +
  184 + patientsQuery = new PatientsQuery();
  185 + patientsQuery.setpIds(pIds);
  186 +
  187 + if (startDate != null) {
  188 + //建档开始时间
  189 + patientsQuery.setBookbuildingDateStart(startDate);
  190 + }
  191 + if (endDate != null) {
  192 + //建档结束时间
  193 + patientsQuery.setBookbuildingDateEnd(endDate);
  194 + }
  195 + //有效
  196 + patientsQuery.setYn(1);
  197 + if (childBirth != null) {
  198 + patientsQuery.setType(childBirth);
  199 + }
  200 + Map<String, Set<String>> patientMap = new HashMap<>();
  201 + //获取患者集合
  202 + List<Patients> patientsList = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  203 + patientId = new ArrayList<>();
  204 + for (Patients ps : patientsList) {
  205 + if (patientMap.containsKey(ps.getPid())) {//存在
  206 + patientMap.get(ps.getPid()).add(ps.getId());
  207 + } else {
  208 + Set<String> paId = new HashSet<>();
  209 + paId.add(ps.getId());
  210 + patientMap.put(ps.getPid(), paId);
  211 + }
  212 + patientId.add(ps.getId());
  213 + }
  214 +
174 215 //根据当前登录人获取医院id
175 216 String hospital = autoMatchFacade.getHospitalId(userId);
176 217  
177 218  
178 219  
179 220  
180 221  
... ... @@ -188,22 +229,35 @@
188 229 List<AntenatalExaminationModel> antenatalExaminationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery());
189 230  
190 231 //复诊:患者id
191   - Map<String,Integer> hostNum = new HashMap<>();
  232 + Map<String, Integer> hostNum = new HashMap<>();
192 233  
193 234 //添加初诊结果
194 235 for (AntExChuModel ac : antExChuModels) {
195   - AntextDoctorPatient doctorPatient = resultInfo.get(ac.getParentId());
  236 + AntextDoctorPatient doctorPatient = null;
  237 +
  238 + if (!resultInfo.containsKey(ac.getParentId())) {
  239 + Set<String> pSet = patientMap.get(ac.getPid());
  240 + for (String pid : pSet) {
  241 + if (resultInfo.containsKey(pid)) {
  242 + doctorPatient = resultInfo.get(pid);
  243 + continue;
  244 + }
  245 + }
  246 + }else{
  247 + doctorPatient = resultInfo.get(ac.getParentId());
  248 + }
  249 +
196 250 doctorPatient.setAllCjNum(doctorPatient.getAllCjNum() + 1);
197   - if(ac.getHospitalId().equals(hospital)){//如果医院id相同,
198   - if(hostNum.containsKey(ac.getPid())){
  251 + if (ac.getHospitalId().equals(hospital)) {//如果医院id相同,
  252 + if (hostNum.containsKey(ac.getPid())) {
199 253 int num = hostNum.get(ac.getPid());
200 254 num++;
201   - if(num>doctorPatient.getCjNum()){
  255 + if (num > doctorPatient.getCjNum()) {
202 256 doctorPatient.setCjNum(num);
203 257 }
204   - hostNum.put(ac.getPid(),num);
205   - }else{
206   - hostNum.put(ac.getPid(),1);
  258 + hostNum.put(ac.getPid(), num);
  259 + } else {
  260 + hostNum.put(ac.getPid(), 1);
207 261 }
208 262 }
209 263 if (ac.getCheckTime().after(doctorPatient.getCheckTime())) {
210 264  
211 265  
212 266  
... ... @@ -214,20 +268,19 @@
214 268 }
215 269  
216 270  
217   -
218 271 //添加复诊结果
219 272 for (AntenatalExaminationModel aec : antenatalExaminationModels) {
220 273 AntextDoctorPatient doctorPatient = resultInfo.get(aec.getParentId());
221   - if(aec.getHospitalId().equals(hospital)){//如果医院id相同,
222   - if(hostNum.containsKey(aec.getPid())){
  274 + if (aec.getHospitalId().equals(hospital)) {//如果医院id相同,
  275 + if (hostNum.containsKey(aec.getPid())) {
223 276 int num = hostNum.get(aec.getPid());
224 277 num++;
225   - if(num>doctorPatient.getCjNum()){
  278 + if (num > doctorPatient.getCjNum()) {
226 279 doctorPatient.setCjNum(num);
227 280 }
228   - hostNum.put(aec.getPid(),num);
229   - }else{
230   - hostNum.put(aec.getPid(),1);
  281 + hostNum.put(aec.getPid(), num);
  282 + } else {
  283 + hostNum.put(aec.getPid(), 1);
231 284 }
232 285 }
233 286  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/EarController.java View file @ 94dee29
... ... @@ -110,10 +110,8 @@
110 110 if (!isConfirm) {// //若没有听诊记录或所有听诊记录都未确诊。提示:该儿童还未听力确诊,不能进行随访。
111 111 return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_POWER).setErrormsg("当前儿童听诊记录还未有确诊记录不能进行随访");
112 112 }
113   -
114 113 //根据条件查询基础配置信息表
115 114 InitFollowUp initHearingDiagnose = new InitFollowUp();
116   - initHearingDiagnose.setConfirmResult(EnumUtil.toJson(ConfirmedEnums.class));
117 115 return initHearingDiagnose.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功");
118 116 }
119 117  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 94dee29
... ... @@ -13,6 +13,8 @@
13 13 import com.lyms.platform.operate.web.service.IReportService;
14 14 import com.lyms.platform.operate.web.utils.*;
15 15 import com.lyms.platform.permission.dao.master.CouponMapper;
  16 +import com.lyms.platform.permission.model.Organization;
  17 +import com.lyms.platform.permission.service.OrganizationService;
16 18 import com.lyms.platform.pojo.*;
17 19 import com.lymsh.platform.reportdata.model.echarts.Series;
18 20 import org.apache.commons.collections.MapUtils;
... ... @@ -57,6 +59,9 @@
57 59 @Autowired
58 60 private MongoUtil mongoUtil;
59 61  
  62 + @Autowired
  63 + private OrganizationService organizationService;
  64 +
60 65 private static final Map<String, String> colorMap = new HashMap<>();
61 66  
62 67 /**
... ... @@ -1080,10 +1085,6 @@
1080 1085 String hospitalId = autoMatchFacade.getHospitalId(userId);
1081 1086 Set<String> patientIds = new HashSet<>();
1082 1087  
1083   - /*Criteria criteria = Criteria.where("created").gte(DateUtil.getYearDate(year))
1084   - .lt(DateUtil.getNextYearDate(year))
1085   - .and("hospitalId").is(hospitalId);*/
1086   -
1087 1088 Criteria criteria = Criteria.where("hospitalId").is(hospitalId).and("yn").nin(0);
1088 1089  
1089 1090 /** 产前检查: lyms_antexc(初诊),lyms_antex(复诊)设置pid */
1090 1091  
1091 1092  
... ... @@ -1140,14 +1141,22 @@
1140 1141 }
1141 1142  
1142 1143 List<Patients> patients = mongoTemplate.find(Query.query(criteria), Patients.class);
  1144 + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId));
  1145 + if(organization == null) {
  1146 + throw new IllegalStateException("机构未找到");
  1147 + }
  1148 + String hospitalCityId = organization.getCityId();
  1149 + BasicConfig basicConfig = mongoUtil.findBasicConfigById(hospitalCityId);
  1150 +
1143 1151 ReportModel reportModel = new ReportModel();
1144   - reportModel.setLegend(Arrays.asList("秦皇岛市", "辖区外"));
  1152 + String name = basicConfig.getName();
  1153 + reportModel.setLegend(Arrays.asList(name, "辖区外"));
1145 1154  
1146 1155 reportModel.setxAxis(Arrays.asList("1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"));
1147 1156  
1148 1157 List<Map<String, Object>> mapList = mongoUtil.getListByGroup(patients);
1149 1158  
1150   - List<Series> series = createPatientSeries(mapList);
  1159 + List<Series> series = createPatientSeries(mapList, basicConfig.getId(), name);
1151 1160 reportModel.setSeries(series);
1152 1161 return RespBuilder.buildSuccess("patients", mapList, "report", reportModel);
1153 1162 }
1154 1163  
1155 1164  
... ... @@ -1343,17 +1352,15 @@
1343 1352 }*/
1344 1353 }
1345 1354  
1346   - private List<Series> createPatientSeries(List<Map<String, Object>> datas) {
  1355 + private List<Series> createPatientSeries(List<Map<String, Object>> datas, String cityId, String name) {
1347 1356 List<Series> series = new ArrayList<>();
1348 1357  
1349 1358 Series qhdSeries = new Series();
1350   - qhdSeries.setName("秦皇岛市");
  1359 + qhdSeries.setName(name);
1351 1360 qhdSeries.setType("bar");
1352 1361 qhdSeries.setStack("总计");
1353 1362  
1354   -// String provinceId = mongoUtil.findId("河北省");
1355   - String provinceId = mongoUtil.findId("秦皇岛市");
1356   - if(StringUtils.isNotEmpty(provinceId)) {
  1363 + if(StringUtils.isNotEmpty(cityId)) {
1357 1364 Map<Integer, Integer> qhdTemp = new HashMap<>();/** key = month . value = count*/
1358 1365 for (int i = 1; i < 13; i++) {
1359 1366 qhdTemp.put(i, 0);
... ... @@ -1364,7 +1371,7 @@
1364 1371 }
1365 1372 for (Map<String, Object> data : datas) {
1366 1373 // if(provinceId.equals(data.get("province_id"))) {
1367   - if(provinceId.equals(data.get("city_id"))) {
  1374 + if(cityId.equals(data.get("city_id"))) {
1368 1375 for(int i = 1; i < 13; i++) {
1369 1376 qhdTemp.put(i, qhdTemp.get(i) + Integer.parseInt(data.get(i + "") + ""));
1370 1377 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java View file @ 94dee29
... ... @@ -12,6 +12,7 @@
12 12 import org.springframework.data.mongodb.core.query.Criteria;
13 13 import org.springframework.data.mongodb.core.query.Query;
14 14 import org.springframework.stereotype.Component;
  15 +import org.springframework.util.Assert;
15 16  
16 17 import java.util.*;
17 18  
... ... @@ -195,6 +196,11 @@
195 196 }
196 197 }
197 198 return null;
  199 + }
  200 +
  201 + public BasicConfig findBasicConfigById(String id) {
  202 + Assert.notNull(id, "id不能为空");
  203 + return mongoTemplate.findById(id, BasicConfig.class);
198 204 }
199 205  
200 206 }