Commit ff1a4c7063af3d9cc61cba3c7346e54ce03414dd

Authored by liquanyu
1 parent fa8b76cd1e

update

Showing 10 changed files with 385 additions and 13 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ ff1a4c7
... ... @@ -6614,6 +6614,59 @@
6614 6614 }
6615 6615 }
6616 6616  
  6617 +
  6618 + public static void savePragnantBone(String fileName) {
  6619 + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
  6620 + MongoTemplate mongoTemplate
  6621 + = (MongoTemplate) applicationContext.getBean("mongoTemplate");
  6622 + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
  6623 + File file = new File(fileName);
  6624 + Workbook wb = null;
  6625 + try {
  6626 + wb = Workbook.getWorkbook(file);
  6627 + Sheet s = wb.getSheet(0);
  6628 + System.out.println(s.getName() + " : ");
  6629 + int rows = s.getRows();
  6630 + if (rows > 0) {
  6631 + //遍历每行
  6632 + for (int i = 1; i < rows; i++) {
  6633 + System.out.println("rows=" + i);
  6634 + BoneConfigModel model = new BoneConfigModel();
  6635 + model.setType(0);
  6636 + Cell[] cells = s.getRow(i);
  6637 + if (cells.length > 0) {
  6638 + for (int j = 0; j < cells.length; j++) {
  6639 + String str = cells[j].getContents().trim();
  6640 + switch (j) {
  6641 + case 0:
  6642 + String[] arrs = str.split("-");
  6643 + model.setStart(Integer.parseInt(arrs[0]));
  6644 + model.setEnd(Integer.parseInt(arrs[1]));
  6645 + continue;
  6646 + case 1:
  6647 + List<String> list2 = Arrays.asList(str.split("\n"));
  6648 + model.setNormals(list2);
  6649 + continue;
  6650 + case 2:
  6651 + List<String> list3 = Arrays.asList(str.split("\n"));
  6652 + model.setReduces(list3);
  6653 + continue;
  6654 + case 3:
  6655 + List<String> list4 = Arrays.asList(str.split("\n"));
  6656 + model.setSerious(list4);
  6657 + continue;
  6658 +
  6659 + }
  6660 + }
  6661 + }
  6662 + mongoTemplate.save(model);
  6663 + }
  6664 + }
  6665 + } catch (Exception e) {
  6666 + e.printStackTrace();
  6667 + }
  6668 + }
  6669 +
6617 6670 public static void main(String[] args) {
6618 6671 // getData();
6619 6672 //weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
... ... @@ -6662,8 +6715,8 @@
6662 6715 //saveDiteDoctorSuggest("F:\\儿童营养报告\\秦皇岛儿童膳食营养报告\\医生建议内容.xls");
6663 6716 //saveMicroelements("E:\\dev\\微量元素指导报告模板.xls");
6664 6717 //saveBabyMicroelements("F:\\技术文档\\儿童微量元素\\儿童微量元素指导报告模板.xls");
6665   - saveBabyBone("F:\\技术文档\\骨密度\\儿童骨密度报告模板内容表.xls");
6666   -
  6718 + //saveBabyBone("F:\\技术文档\\骨密度\\儿童骨密度报告模板内容表.xls");
  6719 + savePragnantBone("F:\\技术文档\\骨密度\\孕期骨密度报告模板内容表.xls");
6667 6720 }
6668 6721  
6669 6722  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java View file @ ff1a4c7
... ... @@ -266,7 +266,7 @@
266 266 @TokenRequired
267 267 public BaseResponse findAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest, HttpServletRequest request) {
268 268 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
269   - return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), false, "true");
  269 + return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), false, "true",false);
270 270 }
271 271  
272 272  
... ... @@ -295,7 +295,7 @@
295 295 @TokenRequired
296 296 public BaseResponse findRegionAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest, HttpServletRequest request) {
297 297 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
298   - return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), true, "true");
  298 + return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), true, "true",antExManagerQueryRequest.isCurrent());
299 299 }
300 300  
301 301  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BoneController.java View file @ ff1a4c7
... ... @@ -72,6 +72,8 @@
72 72 @RequestParam(required = false) String queryNo,
73 73 @RequestParam(required = false) Integer start,
74 74 @RequestParam(required = false) Integer end,
  75 + @RequestParam(required = false) String startTime,
  76 + @RequestParam(required = false) String endTime,
75 77 @RequestParam(required = false) Integer age,
76 78 @RequestParam(required = false) Integer type,
77 79 @RequestParam(required = false) Integer result,
... ... @@ -79,7 +81,7 @@
79 81 @RequestParam(required = true) Integer limit,
80 82 @RequestParam(required = false) String vcCardNo) {
81 83  
82   - return BoneFacade.queryBoneList(queryNo, start, end, age, vcCardNo, type, result,page, limit, getUserId(request));
  84 + return BoneFacade.queryBoneList(queryNo, start, end,startTime,endTime,age, vcCardNo, type, result,page, limit, getUserId(request));
83 85  
84 86 }
85 87 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ ff1a4c7
... ... @@ -267,7 +267,7 @@
267 267 *
268 268 * @return
269 269 */
270   - public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId, boolean isRegion, String isPage) {
  270 + public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId, boolean isRegion, String isPage,boolean isCurrent) {
271 271 PatientsQuery patientsQuery = new PatientsQuery();
272 272 List<Patients> patientses = null;
273 273 if (StringUtils.isNotEmpty(antExManagerQueryRequest.getQueryNo())) {
... ... @@ -301,6 +301,63 @@
301 301 String hospital = autoMatchFacade.getHospitalId(userId);
302 302 List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created");
303 303 List<AntExManagerResult> data = getAntExRecords(antExRecordModelList, hospital, isRegion, antExManagerQueryRequest.getShowDetail());
  304 +
  305 + if (isCurrent && CollectionUtils.isNotEmpty(data))
  306 + {
  307 + for (AntExManagerResult result : data)
  308 + {
  309 + if (CollectionUtils.isNotEmpty(result.getrLevel()))
  310 + {
  311 + List<Map> list = result.getrLevel();
  312 + for (Map map : list)
  313 + {
  314 + if(map.get("id") != null)
  315 + {
  316 + if (map.get("id").toString().equals("224b2329-cb82-4da3-a071-8527f8283aab"))
  317 + {
  318 + result.setLevelNum(1);
  319 + break;
  320 + }
  321 + else if (map.get("id").toString().equals("eb146c03-b19f-4e28-b85f-fda574b2283b"))
  322 + {
  323 + result.setLevelNum(2);
  324 + break;
  325 + }
  326 + else if (map.get("id").toString().equals("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2"))
  327 + {
  328 + result.setLevelNum(3);
  329 + break;
  330 + }
  331 + else if (map.get("id").toString().equals("315107bd-91fe-42a1-9237-752f3c046a40"))
  332 + {
  333 + result.setLevelNum(4);
  334 + break;
  335 + }
  336 + else if (map.get("id").toString().equals("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2"))
  337 + {
  338 + result.setLevelNum(5);
  339 + break;
  340 + }
  341 +
  342 + }
  343 +
  344 + }
  345 + }
  346 + }
  347 +
  348 + Collections.sort(data, new Comparator<AntExManagerResult>() {
  349 + @Override
  350 + public int compare(AntExManagerResult o1, AntExManagerResult o2) {
  351 + if (o1 == null || o2 == null)
  352 + {
  353 + return 0;
  354 + }
  355 + return o1.getLevelNum() - o2.getLevelNum();
  356 + }
  357 + });
  358 + }
  359 +
  360 +
304 361 return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(antExRecordQuery.getPageInfo());
305 362 }
306 363  
... ... @@ -512,7 +569,7 @@
512 569  
513 570 public void exportFindAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b, HttpServletResponse httpServletResponse) {
514 571  
515   - BaseListResponse listRep = (BaseListResponse) findList(antExManagerQueryRequest, id, b, null);
  572 + BaseListResponse listRep = (BaseListResponse) findList(antExManagerQueryRequest, id, b, null,false);
516 573 List<Map<String, Object>> datas = new ArrayList<>();
517 574 try {
518 575 if (listRep != null) {
... ... @@ -581,7 +638,7 @@
581 638 }
582 639  
583 640 public void exportfindRegionAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b, HttpServletResponse httpServletResponse) {
584   - BaseListResponse listRep = (BaseListResponse) findList(antExManagerQueryRequest, id, b, null);
  641 + BaseListResponse listRep = (BaseListResponse) findList(antExManagerQueryRequest, id, b, null,false);
585 642 List<Map<String, Object>> datas = new ArrayList<>();
586 643 try {
587 644  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BoneFacade.java View file @ ff1a4c7
... ... @@ -56,13 +56,20 @@
56 56 @Autowired
57 57 private MongoTemplate mongoTemplate;
58 58  
59   - public BaseResponse queryBoneList(String queryNo, Integer start, Integer end, Integer age, String vcCardNo,Integer type ,Integer result,Integer page, Integer limit, Integer userId) {
  59 + public BaseResponse queryBoneList(String queryNo, Integer start, Integer end,String startTime,String endTime, Integer age, String vcCardNo,Integer type ,Integer result,Integer page, Integer limit, Integer userId) {
60 60  
61 61  
62 62 List dataList = new ArrayList();
63 63 String hospitalId = autoMatchFacade.getHospitalId(userId);
64 64 BoneQuery query = new BoneQuery();
65 65 query.setResult(result);
  66 +
  67 + if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime))
  68 + {
  69 + query.setCreatedTimeStart(DateUtil.parseYMD(startTime));
  70 + query.setCreatedTimeEnd(DateUtil.parseYMDHMS(endTime + " 23:59:59"));
  71 + }
  72 +
66 73 //孕妇骨密度
67 74 if (type == 0)
68 75 {
69 76  
... ... @@ -238,8 +245,22 @@
238 245 data.put("result",model.getResult());
239 246 data.put("created", DateUtil.getyyyy_MM_dd(model.getCreated()));
240 247 Date lastMenses = DateUtil.addDay(pat.getLastMenses(),1);
241   - int week = DateUtil.getWeek(lastMenses,model.getCreated());
  248 + int week = DateUtil.getWeek(lastMenses, model.getCreated());
  249 + List<BoneConfigModel> configModels = mongoTemplate.find(
  250 + Query.query(Criteria.where("type").is(0)), BoneConfigModel.class);
  251 + if (CollectionUtils.isNotEmpty(configModels))
  252 + {
  253 + for (BoneConfigModel configModel : configModels)
  254 + {
  255 + if (configModel.getStart() <= week && week <= configModel.getEnd())
  256 + {
  257 + List<String> contents = model.getResult() == 0 ?configModel.getNormals() : (model.getResult() == 1 ? configModel.getReduces() : configModel.getSerious());
  258 + data.put("contents",contents);
  259 + }
  260 + }
  261 + }
242 262  
  263 + healthChargeFacade.addHealthCharge(hospitalId,8, model.getPatientId(), 1, 1, userId, doctorId, false);
243 264 }
244 265 //儿童骨密度报告
245 266 else
246 267  
... ... @@ -276,10 +297,11 @@
276 297 }
277 298 }
278 299 }
  300 + healthChargeFacade.addHealthCharge(hospitalId,10, model.getPatientId(), 1, 1, userId, doctorId, false);
279 301 }
280 302 }
281 303  
282   - healthChargeFacade.addHealthCharge(hospitalId,8, model.getPatientId(), 1, 1, userId, doctorId, false);
  304 +
283 305 return new BaseObjectResponse().setData(data).
284 306 setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
285 307 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java View file @ ff1a4c7
... ... @@ -92,6 +92,16 @@
92 92 // 0 未诊断 1已诊断
93 93 private Integer status;
94 94  
  95 + private boolean isCurrent;
  96 +
  97 + public boolean isCurrent() {
  98 + return isCurrent;
  99 + }
  100 +
  101 + public void setIsCurrent(boolean isCurrent) {
  102 + this.isCurrent = isCurrent;
  103 + }
  104 +
95 105 public Integer getStatus() {
96 106 return status;
97 107 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntExManagerResult.java View file @ ff1a4c7
... ... @@ -64,6 +64,16 @@
64 64 //产次
65 65 private int cTimes=1;
66 66  
  67 + private int levelNum;
  68 +
  69 + public int getLevelNum() {
  70 + return levelNum;
  71 + }
  72 +
  73 + public void setLevelNum(int levelNum) {
  74 + this.levelNum = levelNum;
  75 + }
  76 +
67 77 public List<Map> getIncrRLevel() {
68 78 return incrRLevel;
69 79 }
platform-transfer/src/main/java/com/lyms/platform/model/BoneModel.java View file @ ff1a4c7
  1 +package com.lyms.platform.model;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * Created by Administrator on 2020-03-24.
  7 + */
  8 +public class BoneModel implements Serializable {
  9 +
  10 + private String cardNo;
  11 + private String position;
  12 + private Double zvalue;
  13 + private Double tvalue;
  14 + private Double sos;
  15 +
  16 + private Double bqi;
  17 + private Double rrf;
  18 + private Double eoa;
  19 +
  20 + private Double adultPercent;
  21 + private Double agePercent;
  22 + private Double age;
  23 + private Integer type;
  24 +
  25 + public BoneModel(Builder builder) {
  26 + this.cardNo = builder.cardNo;
  27 + this.position = builder.position;
  28 + this.zvalue = builder.zvalue;
  29 + this.tvalue = builder.tvalue;
  30 + this.sos = builder.sos;
  31 + this.bqi = builder.bqi;
  32 + this.rrf = builder.rrf;
  33 + this.eoa = builder.eoa;
  34 + this.adultPercent = builder.adultPercent;
  35 + this.agePercent = builder.agePercent;
  36 + this.age = builder.age;
  37 + this.type = builder.type;
  38 + }
  39 +
  40 + public static class Builder {
  41 + public Builder() {
  42 + }
  43 + private String cardNo;
  44 + private String position;
  45 + private Double zvalue;
  46 + private Double tvalue;
  47 + private Double sos;
  48 +
  49 + private Double bqi;
  50 + private Double rrf;
  51 + private Double eoa;
  52 +
  53 + private Double adultPercent;
  54 + private Double agePercent;
  55 + private Double age;
  56 + private Integer type;
  57 +
  58 + public Builder cardNo(String cardNo) {
  59 + this.cardNo = cardNo;
  60 + return this;
  61 + }
  62 +
  63 + public Builder position(String position) {
  64 + this.position = position;
  65 + return this;
  66 + }
  67 +
  68 + public Builder zvalue(Double zvalue) {
  69 + this.zvalue = zvalue;
  70 + return this;
  71 + }
  72 +
  73 + public Builder tvalue(Double tvalue) {
  74 + this.tvalue = tvalue;
  75 + return this;
  76 + }
  77 +
  78 + public Builder sos(Double sos) {
  79 + this.sos = sos;
  80 + return this;
  81 + }
  82 +
  83 + public Builder bqi(Double bqi) {
  84 + this.bqi = bqi;
  85 + return this;
  86 + }
  87 +
  88 +
  89 + public Builder rrf(Double rrf) {
  90 + this.rrf = rrf;
  91 + return this;
  92 + }
  93 +
  94 +
  95 + public Builder eoa(Double eoa) {
  96 + this.eoa = eoa;
  97 + return this;
  98 + }
  99 +
  100 + public Builder adultPercent(Double adultPercent) {
  101 + this.adultPercent = adultPercent;
  102 + return this;
  103 + }
  104 +
  105 + public Builder agePercent(Double agePercent) {
  106 + this.agePercent = agePercent;
  107 + return this;
  108 + }
  109 +
  110 + public Builder age(Double age) {
  111 + this.age = age;
  112 + return this;
  113 + }
  114 +
  115 + public Builder type(Integer type) {
  116 + this.type = type;
  117 + return this;
  118 + }
  119 +
  120 + public BoneModel build() {
  121 + return new BoneModel(this);
  122 + }
  123 + }
  124 +
  125 + public String getCardNo() {
  126 + return cardNo;
  127 + }
  128 +
  129 + public void setCardNo(String cardNo) {
  130 + this.cardNo = cardNo;
  131 + }
  132 +
  133 + public String getPosition() {
  134 + return position;
  135 + }
  136 +
  137 + public void setPosition(String position) {
  138 + this.position = position;
  139 + }
  140 +
  141 + public Double getZvalue() {
  142 + return zvalue;
  143 + }
  144 +
  145 + public void setZvalue(Double zvalue) {
  146 + this.zvalue = zvalue;
  147 + }
  148 +
  149 + public Double getTvalue() {
  150 + return tvalue;
  151 + }
  152 +
  153 + public void setTvalue(Double tvalue) {
  154 + this.tvalue = tvalue;
  155 + }
  156 +
  157 + public Double getSos() {
  158 + return sos;
  159 + }
  160 +
  161 + public void setSos(Double sos) {
  162 + this.sos = sos;
  163 + }
  164 +
  165 + public Double getBqi() {
  166 + return bqi;
  167 + }
  168 +
  169 + public void setBqi(Double bqi) {
  170 + this.bqi = bqi;
  171 + }
  172 +
  173 + public Double getRrf() {
  174 + return rrf;
  175 + }
  176 +
  177 + public void setRrf(Double rrf) {
  178 + this.rrf = rrf;
  179 + }
  180 +
  181 + public Double getEoa() {
  182 + return eoa;
  183 + }
  184 +
  185 + public void setEoa(Double eoa) {
  186 + this.eoa = eoa;
  187 + }
  188 +
  189 + public Double getAdultPercent() {
  190 + return adultPercent;
  191 + }
  192 +
  193 + public void setAdultPercent(Double adultPercent) {
  194 + this.adultPercent = adultPercent;
  195 + }
  196 +
  197 + public Double getAgePercent() {
  198 + return agePercent;
  199 + }
  200 +
  201 + public void setAgePercent(Double agePercent) {
  202 + this.agePercent = agePercent;
  203 + }
  204 +
  205 + public Double getAge() {
  206 + return age;
  207 + }
  208 +
  209 + public void setAge(Double age) {
  210 + this.age = age;
  211 + }
  212 +
  213 + public Integer getType() {
  214 + return type;
  215 + }
  216 +
  217 + public void setType(Integer type) {
  218 + this.type = type;
  219 + }
  220 +}
platform-transfer/src/main/java/com/lyms/platform/worker/BoneTransferWorker.java View file @ ff1a4c7
... ... @@ -43,7 +43,6 @@
43 43 Map map = new HashMap();
44 44  
45 45 String PatientID = rst.getString("PatientID"); //身份证后八位
46   - //String position = rst.getString("");
47 46 map.put("cardNo",PatientID);
48 47  
49 48 String PartDisplayName = rst.getString("PartDisplayName");
platform-transfer/src/main/java/com/lyms/platform/worker/TransferWorker.java View file @ ff1a4c7
... ... @@ -24,6 +24,5 @@
24 24 boneTransferWorker.doTransfer();
25 25 }
26 26  
27   -
28 27 }