Commit 6995b20ef35059b7878769825948db45705e4cf6
1 parent
3de38e92fc
Exists in
dev
产妇转诊
Showing 9 changed files with 207 additions and 20 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/AppointmentMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/MedicalRecordVo.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/AppointmentServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/AppointmentMapper.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyScreeningController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyScreeningFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ApplyScreeningOutResult.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/AppointmentMapper.java
View file @
6995b20
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | List<AppointmentModel> queryAppointment(AppointmentQuery appointmentQuery); |
| 11 | 11 | int queryAppointmentCount(AppointmentQuery appointmentQuery); |
| 12 | 12 | |
| 13 | + int queryListCount(MedicalRecordVo medicalRecordVo); | |
| 13 | 14 | List<MedicalRecordVo> queryList(MedicalRecordVo medicalRecordVo); |
| 14 | 15 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/MedicalRecordVo.java
View file @
6995b20
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/AppointmentServiceImpl.java
View file @
6995b20
| ... | ... | @@ -37,6 +37,9 @@ |
| 37 | 37 | |
| 38 | 38 | @Override |
| 39 | 39 | public List<MedicalRecordVo> queryList(MedicalRecordVo medicalRecordVo) { |
| 40 | + if (StringUtils.isNotEmpty(medicalRecordVo.getNeed())){ | |
| 41 | + medicalRecordVo.mysqlBuild( appointmentMapper.queryListCount(medicalRecordVo)); | |
| 42 | + } | |
| 40 | 43 | return appointmentMapper.queryList(medicalRecordVo); |
| 41 | 44 | } |
| 42 | 45 | } |
platform-biz-service/src/main/resources/mainOrm/master/AppointmentMapper.xml
View file @
6995b20
| ... | ... | @@ -68,6 +68,95 @@ |
| 68 | 68 | </select> |
| 69 | 69 | |
| 70 | 70 | |
| 71 | + <select id="queryListCount" resultType="int" parameterType="com.lyms.platform.permission.model.MedicalRecordVo"> | |
| 72 | + select count(id) from medical_record | |
| 73 | + where | |
| 74 | + 1=1 | |
| 75 | + <!-- 基本信息查询条件 --> | |
| 76 | + <if test="mdtrtId != null and mdtrtId != ''"> | |
| 77 | + AND MDTRT_ID = #{mdtrtId} | |
| 78 | + </if> | |
| 79 | + | |
| 80 | + <if test="pid != null and pid != ''"> | |
| 81 | + AND PID = #{pid} | |
| 82 | + </if> | |
| 83 | + | |
| 84 | + <if test="name != null and name != ''"> | |
| 85 | + AND NAME = #{name} | |
| 86 | + </if> | |
| 87 | + | |
| 88 | + <if test="cardNo != null and cardNo != ''"> | |
| 89 | + AND CARD_NO = #{cardNo} | |
| 90 | + </if> | |
| 91 | + | |
| 92 | + <if test="age != null"> | |
| 93 | + AND AGE = #{age} | |
| 94 | + </if> | |
| 95 | + | |
| 96 | + <if test="phone != null and phone != ''"> | |
| 97 | + AND PHONE = #{phone} | |
| 98 | + </if> | |
| 99 | + | |
| 100 | + <if test="gender != null and gender != ''"> | |
| 101 | + AND GENDER = #{gender} | |
| 102 | + </if> | |
| 103 | + | |
| 104 | + <!-- 医疗信息查询条件 --> | |
| 105 | + <if test="zyType != null and zyType != ''"> | |
| 106 | + AND ZY_TYPE = #{zyType} | |
| 107 | + </if> | |
| 108 | + | |
| 109 | + <if test="medType != null and medType != ''"> | |
| 110 | + AND MED_TYPE = #{medType} | |
| 111 | + </if> | |
| 112 | + | |
| 113 | + <if test="department != null and department != ''"> | |
| 114 | + AND DEPARTMENT = #{department} | |
| 115 | + </if> | |
| 116 | + | |
| 117 | + <if test="diagnosis != null and diagnosis != ''"> | |
| 118 | + AND DIAGNOSIS = #{diagnosis} | |
| 119 | + </if> | |
| 120 | + | |
| 121 | + <if test="diagnosisCode != null and diagnosisCode != ''"> | |
| 122 | + AND DIAGNOSIS_CODE = #{diagnosisCode} | |
| 123 | + </if> | |
| 124 | + | |
| 125 | + <if test="operation != null and operation != ''"> | |
| 126 | + AND OPERATION = #{operation} | |
| 127 | + </if> | |
| 128 | + | |
| 129 | + <if test="operationCode != null and operationCode != ''"> | |
| 130 | + AND OPERATION_CODE = #{operationCode} | |
| 131 | + </if> | |
| 132 | + | |
| 133 | + <if test="medicine != null and medicine != ''"> | |
| 134 | + AND MEDICINE = #{medicine} | |
| 135 | + </if> | |
| 136 | + | |
| 137 | + <!-- 分娩与产后信息查询条件 --> | |
| 138 | + <if test="deliveryType != null and deliveryType != ''"> | |
| 139 | + AND DELIVERY_TYPE = #{deliveryType} | |
| 140 | + </if> | |
| 141 | + | |
| 142 | + <if test="deliveryTime != null"> | |
| 143 | + AND DELIVERY_TIME = #{deliveryTime} | |
| 144 | + </if> | |
| 145 | + | |
| 146 | + <if test="matnHistory != null and matnHistory != ''"> | |
| 147 | + AND MATN_HISTORY = #{matnHistory} | |
| 148 | + </if> | |
| 149 | + | |
| 150 | + <!-- 时间范围查询条件 --> | |
| 151 | + <if test="modified != null"> | |
| 152 | + AND MODIFIED = #{modified} | |
| 153 | + </if> | |
| 154 | + | |
| 155 | + <if test="created != null"> | |
| 156 | + AND CREATED = #{created} | |
| 157 | + </if> | |
| 158 | + </select> | |
| 159 | + | |
| 71 | 160 | <select id="queryList" parameterType="com.lyms.platform.permission.model.MedicalRecordVo" resultType="com.lyms.platform.permission.model.MedicalRecordVo"> |
| 72 | 161 | SELECT |
| 73 | 162 | MDTRT_ID as mdtrtId, |
| 74 | 163 | |
| ... | ... | @@ -179,8 +268,9 @@ |
| 179 | 268 | <if test="created != null"> |
| 180 | 269 | AND CREATED = #{created} |
| 181 | 270 | </if> |
| 182 | - | |
| 183 | 271 | ORDER BY CREATED DESC |
| 272 | + <include refid="orderAndLimit"/> | |
| 273 | + | |
| 184 | 274 | </select> |
| 185 | 275 | </mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyScreeningController.java
View file @
6995b20
| ... | ... | @@ -57,6 +57,17 @@ |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | + * 转诊列表查询 | |
| 61 | + * | |
| 62 | + * @return | |
| 63 | + */ | |
| 64 | + @RequestMapping(method = RequestMethod.GET, value = "/queryMedicalRecord") | |
| 65 | + @ResponseBody | |
| 66 | + public BaseResponse queryMedicalRecord(@Valid ApplyScreeningQueryRequest screeningQueryRequest) { | |
| 67 | + return applyScreeningFacade.queryMedicalRecord(screeningQueryRequest); | |
| 68 | + } | |
| 69 | + | |
| 70 | + /** | |
| 60 | 71 | * 转诊保存 |
| 61 | 72 | */ |
| 62 | 73 | @RequestMapping(method = RequestMethod.POST, value = "/saveChange") |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyScreeningFacade.java
View file @
6995b20
| ... | ... | @@ -15,10 +15,8 @@ |
| 15 | 15 | import com.lyms.platform.operate.web.result.*; |
| 16 | 16 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 17 | 17 | import com.lyms.platform.operate.web.utils.FunvCommonUtil; |
| 18 | -import com.lyms.platform.permission.model.Organization; | |
| 19 | -import com.lyms.platform.permission.model.OrganizationQuery; | |
| 20 | -import com.lyms.platform.permission.model.PatientService; | |
| 21 | -import com.lyms.platform.permission.model.Users; | |
| 18 | +import com.lyms.platform.permission.model.*; | |
| 19 | +import com.lyms.platform.permission.service.AppointmentService; | |
| 22 | 20 | import com.lyms.platform.permission.service.CouponService; |
| 23 | 21 | import com.lyms.platform.permission.service.OrganizationService; |
| 24 | 22 | import com.lyms.platform.permission.service.UsersService; |
| ... | ... | @@ -90,6 +88,9 @@ |
| 90 | 88 | @Autowired |
| 91 | 89 | private PatientServiceFacade patientServiceFacade; |
| 92 | 90 | |
| 91 | + @Autowired | |
| 92 | + private AppointmentService appointmentService; | |
| 93 | + | |
| 93 | 94 | /* @Autowired |
| 94 | 95 | private CouponService couponService; |
| 95 | 96 | |
| ... | ... | @@ -476,7 +477,8 @@ |
| 476 | 477 | } |
| 477 | 478 | screeningOutResult.setDiagnosis(diagnosis); |
| 478 | 479 | |
| 479 | - screeningOutResult.setrRisk(stringBuilder.toString()); | |
| 480 | +// screeningOutResult.setrRisk(stringBuilder.toString()); | |
| 481 | + screeningOutResult.setrRisk(queryRiskListName(screeningModel.getrRisk())); | |
| 480 | 482 | screeningOutResult.setScore(screeningModel.getScore()); |
| 481 | 483 | screeningOutResult.setReason(StringUtils.isNotEmpty(screeningModel.getReason()) ? screeningModel.getReason() : "--"); |
| 482 | 484 | List rLevel = new ArrayList(); |
| ... | ... | @@ -516,6 +518,82 @@ |
| 516 | 518 | return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(referralApplyScreeningQuery.getPageInfo()); |
| 517 | 519 | } |
| 518 | 520 | |
| 521 | + public BaseListResponse queryMedicalRecord(ApplyScreeningQueryRequest applyScreeningQueryRequest) { | |
| 522 | + List<ApplyScreeningOutResult> data = new ArrayList(); | |
| 523 | + MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
| 524 | + medicalRecordVo.setNeed("true"); | |
| 525 | + medicalRecordVo.setLimit(applyScreeningQueryRequest.getLimit()); | |
| 526 | + medicalRecordVo.setPage(applyScreeningQueryRequest.getPage()); | |
| 527 | + List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
| 528 | + if(CollectionUtils.isNotEmpty(medicalRecordVoList)){ | |
| 529 | + for (MedicalRecordVo recordVo : medicalRecordVoList) { | |
| 530 | + ApplyScreeningOutResult screeningOutResult = new ApplyScreeningOutResult(); | |
| 531 | + screeningOutResult.setName(recordVo.getName()); | |
| 532 | + screeningOutResult.setAge("1"); | |
| 533 | + screeningOutResult.setCardNo(recordVo.getCardNo()); | |
| 534 | + screeningOutResult.setDueWeek(recordVo.getDeliveryTime()); | |
| 535 | + screeningOutResult.setPhone(recordVo.getPhone()); | |
| 536 | + // 查建档 | |
| 537 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 538 | + patientsQuery.setCardNo(recordVo.getCardNo()); | |
| 539 | + patientsQuery.setYn(1); | |
| 540 | + patientsQuery.setDesc("true"); | |
| 541 | + patientsQuery.setSort("created"); | |
| 542 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 543 | + if(CollectionUtils.isNotEmpty(patientsList)){ | |
| 544 | + Patients patients = patientsList.get(0); | |
| 545 | + // 高危因素 | |
| 546 | + List level = new ArrayList(); | |
| 547 | + try { | |
| 548 | + List<String> list = JsonUtil.patientRiskLevelIdToList(patients.getRiskLevelId()); | |
| 549 | + for (String str : list) { | |
| 550 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str); | |
| 551 | + if (null != basicConfig) { | |
| 552 | + Map map = new HashMap(); | |
| 553 | + basicConfig.replenRisk(map); | |
| 554 | + if (!level.contains(map)){ | |
| 555 | + level.add(map); | |
| 556 | + } | |
| 557 | + } | |
| 558 | + } | |
| 559 | + } catch (Exception e) { | |
| 560 | + ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); | |
| 561 | + } | |
| 562 | + screeningOutResult.setrLevel(level); | |
| 563 | + // 高危风险因素 | |
| 564 | + screeningOutResult.setrRisk(queryRiskListName(patients.getRiskFactorId())); | |
| 565 | + | |
| 566 | + ReferralApplyScreeningQuery query = new ReferralApplyScreeningQuery(); | |
| 567 | + query.setCardNo(recordVo.getCardNo()); | |
| 568 | + List<ReferralApplyScreeningModel> screeningModels = | |
| 569 | + applyScreeningService.queryReferralApplyScreeningWithQuery(query); | |
| 570 | + if (CollectionUtils.isNotEmpty(screeningModels)){ | |
| 571 | + screeningOutResult.setTransferredDepartment(screeningModels.get(0).getTransferredDepartment()); | |
| 572 | + screeningOutResult.setCreated(screeningModels.get(0).getCreated().toString()); | |
| 573 | + screeningOutResult.setReceived(screeningModels.get(0).getCreated().toString()); | |
| 574 | + screeningOutResult.setRecDoctor(screeningModels.get(0).getRecDoctor()); | |
| 575 | + screeningOutResult.setId(screeningModels.get(0).getId()); | |
| 576 | + screeningOutResult.setPid(screeningModels.get(0).getPid()); | |
| 577 | + } | |
| 578 | + } | |
| 579 | + data.add(screeningOutResult); | |
| 580 | + } | |
| 581 | + } | |
| 582 | + return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 583 | + } | |
| 584 | + | |
| 585 | + private List queryRiskListName(List l) { | |
| 586 | + List data = new ArrayList(); | |
| 587 | + for (int i = 0; i < l.size(); i++) { | |
| 588 | + String key = (String) l.get(i); | |
| 589 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 590 | + if (null != basicConfig) { | |
| 591 | + data.add(basicConfig.getName()); | |
| 592 | + } | |
| 593 | + } | |
| 594 | + return data; | |
| 595 | + } | |
| 596 | + | |
| 519 | 597 | public BaseResponse saveChange(PatientBaseResult patientBaseResult) { |
| 520 | 598 | |
| 521 | 599 | ReferralApplyScreeningQuery query = new ReferralApplyScreeningQuery(); |
| ... | ... | @@ -648,7 +726,8 @@ |
| 648 | 726 | } |
| 649 | 727 | screeningOutResult.setDiagnosis(diagnosis); |
| 650 | 728 | |
| 651 | - screeningOutResult.setrRisk(stringBuilder.toString()); | |
| 729 | +// screeningOutResult.setrRisk(stringBuilder.toString()); | |
| 730 | + screeningOutResult.setrRisk(queryRiskListName(screeningModel.getrRisk())); | |
| 652 | 731 | screeningOutResult.setScore(screeningModel.getScore()); |
| 653 | 732 | screeningOutResult.setReason(StringUtils.isNotEmpty(screeningModel.getReason()) ? screeningModel.getReason() : "--"); |
| 654 | 733 | List rLevel = new ArrayList(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
6995b20
| ... | ... | @@ -2136,12 +2136,6 @@ |
| 2136 | 2136 | } |
| 2137 | 2137 | |
| 2138 | 2138 | public BaseResponse findPatient(PatientQueryRequest patientQueryRequest, Integer userId) { |
| 2139 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 2140 | - patientsQuery.setPid(patientQueryRequest.getPid()); | |
| 2141 | - patientsQuery.setId(patientQueryRequest.getId()); | |
| 2142 | - patientsQuery.setPhone(patientQueryRequest.getPhone()); | |
| 2143 | - patientsQuery.setCardNo(patientQueryRequest.getCardNo()); | |
| 2144 | - | |
| 2145 | 2139 | Patients patients = antenatalExaminationFacade.findOnePatient(patientQueryRequest.getCardNo(), patientQueryRequest.getVcCardNo(), patientQueryRequest.getId(), groupsFacade.findGroupHospital(userId, false), -1, true, patientQueryRequest.getPid(), false); |
| 2146 | 2140 | |
| 2147 | 2141 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java
View file @
6995b20
| ... | ... | @@ -199,6 +199,16 @@ |
| 199 | 199 | private String allPats;//用于区分是那个来的 |
| 200 | 200 | private String needPage; |
| 201 | 201 | |
| 202 | + private String patientsType; | |
| 203 | + | |
| 204 | + public String getPatientsType() { | |
| 205 | + return patientsType; | |
| 206 | + } | |
| 207 | + | |
| 208 | + public void setPatientsType(String patientsType) { | |
| 209 | + this.patientsType = patientsType; | |
| 210 | + } | |
| 211 | + | |
| 202 | 212 | public String getNeedPage() { |
| 203 | 213 | return needPage; |
| 204 | 214 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ApplyScreeningOutResult.java
View file @
6995b20
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | //高危等级 |
| 33 | 33 | private List<Map> rLevel; |
| 34 | 34 | //风险因素 |
| 35 | - private String rRisk; | |
| 35 | + private List<String> rRisk; | |
| 36 | 36 | //筛查结果 |
| 37 | 37 | private String screenResult; |
| 38 | 38 | private Integer score = 0; |
| 39 | 39 | |
| ... | ... | @@ -335,14 +335,11 @@ |
| 335 | 335 | this.rLevel = rLevel; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - public String getrRisk() { | |
| 339 | - if (StringUtils.isEmpty(rRisk)) { | |
| 340 | - return SPIT; | |
| 341 | - } | |
| 338 | + public List<String> getrRisk() { | |
| 342 | 339 | return rRisk; |
| 343 | 340 | } |
| 344 | 341 | |
| 345 | - public void setrRisk(String rRisk) { | |
| 342 | + public void setrRisk(List<String> rRisk) { | |
| 346 | 343 | this.rRisk = rRisk; |
| 347 | 344 | } |
| 348 | 345 |