Commit 07dfb064ab77afe4744b4980a36db7201531e9e8

Authored by dongqin
1 parent 0aa2d398bf

统计 - 体重模块-添加报告解读人

Showing 8 changed files with 104 additions and 16 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/HealthChargeModel.java View file @ 07dfb06
... ... @@ -46,6 +46,19 @@
46 46 //结算状态 1未结算 2结算
47 47 private Integer status;
48 48  
  49 + /**
  50 + * 报告解读人
  51 + */
  52 + private String doctorId;
  53 +
  54 + public String getDoctorId() {
  55 + return doctorId;
  56 + }
  57 +
  58 + public void setDoctorId(String doctorId) {
  59 + this.doctorId = doctorId;
  60 + }
  61 +
49 62 public Integer getStatus() {
50 63 return status;
51 64 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java View file @ 07dfb06
... ... @@ -32,15 +32,9 @@
32 32  
33 33 @ResponseBody
34 34 @RequestMapping(method = RequestMethod.POST)
35   -
36   -
37   -
38   -
39   -
40   -
41 35 @TokenRequired
42   - public BaseResponse addOrUpdate(PatientWeight patientWeight, HttpServletRequest request) {
43   - return patientWeightService.addOrUpdate(getUserId(request), patientWeight);
  36 + public BaseResponse addOrUpdate(@RequestParam(value = "doctorId", required = false) String doctorId, PatientWeight patientWeight, HttpServletRequest request) {
  37 + return patientWeightService.addOrUpdate(getUserId(request), patientWeight, doctorId);
44 38 }
45 39  
46 40 /**
47 41  
... ... @@ -137,14 +131,14 @@
137 131 @ResponseBody
138 132 @RequestMapping(value = "/update", method = RequestMethod.POST)
139 133 @TokenRequired
140   - public BaseResponse update(String id, String beforeWeight, String beforeHeight, String date, String nowWeight, HttpServletRequest request, String bregmatic, String bregmaticOther) {
141   - return patientWeightService.update(getUserId(request), id, beforeWeight, beforeHeight, date, nowWeight, bregmatic, bregmaticOther, true);
  134 + public BaseResponse update(String id, String beforeWeight, String beforeHeight, String date, String nowWeight, HttpServletRequest request, String bregmatic, String bregmaticOther, String doctorId) {
  135 + return patientWeightService.update(getUserId(request), id, beforeWeight, beforeHeight, date, nowWeight, bregmatic, bregmaticOther, true, doctorId);
142 136 }
143 137  
144 138 @ResponseBody
145 139 @RequestMapping(value = "/sync/update", method = RequestMethod.POST)
146 140 public BaseResponse syncUpdate(String id, String beforeWeight, String beforeHeight, String date, String nowWeight, Integer userId, String bregmatic, String bregmaticOther) {
147   - return patientWeightService.update(userId, id, beforeWeight, beforeHeight, date, nowWeight, bregmatic, bregmaticOther, false);
  141 + return patientWeightService.update(userId, id, beforeWeight, beforeHeight, date, nowWeight, bregmatic, bregmaticOther, false, null);
148 142 }
149 143  
150 144 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/HealthChargeFacade.java View file @ 07dfb06
... ... @@ -52,6 +52,17 @@
52 52 @Autowired
53 53 private UsersService usersService;
54 54  
  55 + public BaseResponse addHealthCharge(String hospitalId,Integer healthType,String foreignId,Integer type,Integer source, Integer userId, String doctorId){
  56 + HealthChargeRequest request = new HealthChargeRequest();
  57 + request.setHospitalId(hospitalId);
  58 + request.setHealthType(healthType);
  59 + request.setForeignId(foreignId);
  60 + request.setType(type);
  61 + request.setSource(source);
  62 + request.setDoctorId(doctorId);
  63 + return addHealthCharge(request, userId);
  64 + }
  65 +
55 66 /**
56 67 * 打印体重、血糖、血压调用接口
57 68 * @param hospitalId 医院id
... ... @@ -95,6 +106,10 @@
95 106  
96 107 if (DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCreated())))
97 108 {
  109 + String doctorId = request.getDoctorId();
  110 + if (StringUtils.isNotEmpty(doctorId)){
  111 + model.setDoctorId(doctorId);
  112 + }
98 113 model.setType(request.getType());
99 114 model.setModified(new Date());
100 115 healthChargeService.updateHealthCharge(model);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 07dfb06
... ... @@ -12,6 +12,7 @@
12 12 import com.lyms.platform.common.utils.*;
13 13 import com.lyms.platform.operate.web.request.*;
14 14 import com.lyms.platform.operate.web.result.*;
  15 +import com.lyms.platform.operate.web.service.PatientWeightService;
15 16 import com.lyms.platform.operate.web.utils.CommonsHelper;
16 17 import com.lyms.platform.operate.web.worker.QuanChanPatientWorker;
17 18 import com.lyms.platform.operate.web.worker.QuanPatientWorker;
... ... @@ -110,6 +111,9 @@
110 111 private MatDeliverFollowService matDeliverFollowService;
111 112 @Autowired
112 113 private CouponMapper couponMapper;
  114 +
  115 + @Autowired
  116 + private PatientWeightService patientWeightService;
113 117 /**
114 118 * 修改产妇的社区
115 119 *
... ... @@ -1623,6 +1627,9 @@
1623 1627 patientBaseResult.setHeight(StringUtils.isNotEmpty(patientWeight.getBeforeHeight()) ? patientWeight.getBeforeHeight() : "");
1624 1628 patientBaseResult.setWeight(StringUtils.isNotEmpty(patientWeight.getNowWeight()) ? patientWeight.getNowWeight() : "");
1625 1629 patientBaseResult.setBeforWeight(StringUtils.isNotEmpty(patientWeight.getBeforeWeight()) ? patientWeight.getBeforeWeight() : "");
  1630 + List<Map<String, Object>> dayWeights2 = patientWeight.getDayWeights2();
  1631 + String doctorId = patientWeightService.getDoctorId(dayWeights2);
  1632 + patientBaseResult.setDoctorId(doctorId);
1626 1633 }
1627 1634 }
1628 1635 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HealthChargeRequest.java View file @ 07dfb06
... ... @@ -30,6 +30,11 @@
30 30 //档案来源类型 1院内建档 2零时建档
31 31 private Integer source;
32 32  
  33 + /**
  34 + * 报告解读人
  35 + */
  36 + private String doctorId;
  37 +
33 38 @Override
34 39 public HealthChargeModel convertToDataModel() {
35 40 HealthChargeModel model = new HealthChargeModel();
36 41  
... ... @@ -39,7 +44,16 @@
39 44 model.setForeignId(foreignId);
40 45 model.setType(type);
41 46 model.setSource(source);
  47 + model.setDoctorId(doctorId);
42 48 return model;
  49 + }
  50 +
  51 + public String getDoctorId() {
  52 + return doctorId;
  53 + }
  54 +
  55 + public void setDoctorId(String doctorId) {
  56 + this.doctorId = doctorId;
43 57 }
44 58  
45 59 public String getId() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientBaseResult.java View file @ 07dfb06
... ... @@ -61,6 +61,16 @@
61 61  
62 62 private boolean flag;
63 63  
  64 + private String doctorId;
  65 +
  66 + public String getDoctorId() {
  67 + return doctorId;
  68 + }
  69 +
  70 + public void setDoctorId(String doctorId) {
  71 + this.doctorId = doctorId;
  72 + }
  73 +
64 74 public boolean isFlag() {
65 75 return flag;
66 76 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java View file @ 07dfb06
... ... @@ -23,7 +23,7 @@
23 23  
24 24 BaseResponse patientRecipeInfo(String pid, Integer type, String time);
25 25  
26   - BaseResponse addOrUpdate(Integer userId, PatientWeight patientWeight);
  26 + BaseResponse addOrUpdate(Integer userId, PatientWeight patientWeight, String doctorId);
27 27  
28 28 BaseResponse list(String key, String vcCardNo, Integer currentWeekStart, Integer currentWeekEnd, Integer age, Integer page, Integer limit, Integer userId);
29 29  
... ... @@ -45,7 +45,7 @@
45 45  
46 46 BaseResponse patientBaseInfo(String pid);
47 47  
48   - BaseResponse update(Integer userId, String id, String beforeWeight, String beforeHeight, String date, String nowWeight, String bregmatic, String bregmaticOther, boolean sync);
  48 + BaseResponse update(Integer userId, String id, String beforeWeight, String beforeHeight, String date, String nowWeight, String bregmatic, String bregmaticOther, boolean sync, String doctorId);
49 49  
50 50 WeightConfigModel getWeightConfigByWeek(int week);
51 51  
... ... @@ -64,5 +64,6 @@
64 64  
65 65 public void getSerie(Map<String, Map<Integer, Double>> series, String bmiStr, String bregmatic);
66 66  
  67 + String getDoctorId(List<Map<String, Object>> dayWeights2);
67 68 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 07dfb06
... ... @@ -110,7 +110,7 @@
110 110 }
111 111  
112 112 @Override
113   - public BaseResponse addOrUpdate(Integer userId, PatientWeight patientWeight) {
  113 + public BaseResponse addOrUpdate(Integer userId, PatientWeight patientWeight, String doctorId) {
114 114 String hospitalId = autoMatchFacade.getHospitalId(userId);
115 115 String nowWeight = patientWeight.getNowWeight();
116 116 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
... ... @@ -175,6 +175,8 @@
175 175 map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
176 176 map.put("date", ymdDate);
177 177 map.put("nowWeight", nowWeight);
  178 + map.put("doctorId", doctorId);
  179 +
178 180 }
179 181 }
180 182 if (flag) {
... ... @@ -183,6 +185,7 @@
183 185 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
184 186 m.put("date", ymdDate);
185 187 m.put("nowWeight", nowWeight);
  188 + m.put("doctorId", doctorId);
186 189 dayWeights2.add(m);
187 190 }
188 191 pw.setDayWeights2(dayWeights2);
... ... @@ -212,6 +215,7 @@
212 215 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
213 216 m.put("date", DateUtil.getyyyy_MM_dd(new Date()));
214 217 m.put("nowWeight", nowWeight);
  218 + m.put("doctorId", doctorId);
215 219 dayWeights2.add(m);
216 220 patientWeight.setDayWeights2(dayWeights2);
217 221  
218 222  
... ... @@ -663,8 +667,10 @@
663 667 setReport(map, weights, patientWeight.getBeforeWeight(), patientWeight.getBmi(), patientWeight.getDayWeights(), patientWeight.getBregmatic());
664 668 CollectionUtils.removeNullValue(map);
665 669  
  670 + List<Map<String, Object>> dayWeights2 = patientWeight.getDayWeights2();
  671 + String doctorId = getDoctorId(dayWeights2);
666 672  
667   - healthChargeFacade.addHealthCharge(hospitalId, 1, patientWeight.getPatientId(), 1, 1, userId);
  673 + healthChargeFacade.addHealthCharge(hospitalId, 1, patientWeight.getPatientId(), 1, 1, userId, doctorId);
668 674 return RespBuilder.buildSuccess(map);
669 675 }
670 676 return RespBuilder.buildSuccess();
... ... @@ -672,6 +678,28 @@
672 678  
673 679  
674 680 @Override
  681 + public String getDoctorId(List<Map<String, Object>> dayWeights2) {
  682 + if (CollectionUtils.isNotEmpty(dayWeights2)){
  683 + if (dayWeights2 != null){
  684 + for (Map m : dayWeights2){
  685 + String currentDate = DateUtil.getyyyy_MM_dd(new Date());
  686 + Object object = m.get("date");
  687 + if (object != null){
  688 + if (currentDate.equals(object.toString())){
  689 + Object obj = m.get("doctorId");
  690 + if (obj != null){
  691 + return obj.toString();
  692 + }
  693 + }
  694 + }
  695 + }
  696 + }
  697 + }
  698 + return "";
  699 + }
  700 +
  701 +
  702 + @Override
675 703 public BaseResponse wxReport(String pid) {
676 704 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("yn").ne("0")), PatientWeight.class);
677 705 if (patientWeight != null) {
... ... @@ -825,7 +853,9 @@
825 853 }
826 854  
827 855 @Override
828   - public BaseResponse update(final Integer userId, final String id, final String beforeWeight, final String beforeHeight, final String date, final String nowWeight, final String bregmatic, final String bregmaticOther, boolean sync) {
  856 + public BaseResponse update(final Integer userId, final String id, final String beforeWeight,
  857 + final String beforeHeight, final String date, final String nowWeight,
  858 + final String bregmatic, final String bregmaticOther, boolean sync, final String doctorId) {
829 859 PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class);
830 860  
831 861 if (patientWeight == null) {
... ... @@ -872,6 +902,10 @@
872 902 map.put("hospitalId", hospitalId);
873 903 map.put("hospitalName", couponMapper.getHospitalName(hospitalId));
874 904 map.put("nowWeight", nowWeight);
  905 + // 同步时暂时不用
  906 + if (sync){
  907 + map.put("doctorId", doctorId);
  908 + }
875 909 }
876 910 }
877 911 Map<String, String> dayWeights = patientWeight.getDayWeights();