Commit 8efcfb4cc4de68cdfd2754abc18ef35c40007565

Authored by dongqin
1 parent 21773f74e9

结果按时间倒序 ,添加检查医院字段

Showing 2 changed files with 29 additions and 5 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/IndividualCaseResult.java View file @ 8efcfb4
... ... @@ -24,6 +24,16 @@
24 24  
25 25 private String timeAxisStr;
26 26  
  27 + private String checkHospitalStr;
  28 +
  29 + public String getCheckHospitalStr() {
  30 + return checkHospitalStr;
  31 + }
  32 +
  33 + public void setCheckHospitalStr(String checkHospitalStr) {
  34 + this.checkHospitalStr = checkHospitalStr;
  35 + }
  36 +
27 37 public String getTimeAxisStr() {
28 38 return timeAxisStr;
29 39 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/IndividualCaseServiceImpl.java View file @ 8efcfb4
... ... @@ -21,7 +21,9 @@
21 21 import com.lyms.platform.operate.web.service.IndividualCaseService;
22 22 import com.lyms.platform.operate.web.utils.CollectionUtils;
23 23 import com.lyms.platform.operate.web.utils.ResolveUtils;
  24 +import com.lyms.platform.permission.model.Organization;
24 25 import com.lyms.platform.permission.model.Users;
  26 +import com.lyms.platform.permission.service.OrganizationService;
25 27 import com.lyms.platform.permission.service.UsersService;
26 28 import com.lyms.platform.pojo.AntExChuModel;
27 29 import com.lyms.platform.pojo.AntenatalExaminationModel;
... ... @@ -42,6 +44,9 @@
42 44 @Autowired
43 45 private HosptialHighRiskService hosptialHighRiskService;
44 46  
  47 + @Autowired
  48 + private OrganizationService organizationService;
  49 +
45 50 /**
46 51 * 产前妊娠风险评估记录
47 52 *
48 53  
49 54  
50 55  
51 56  
... ... @@ -61,20 +66,21 @@
61 66 List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId)), AntExChuModel.class);
62 67 if (CollectionUtils.isNotEmpty(antExChuModels)) {
63 68 AntExChuModel antExChuModel = antExChuModels.get(0);
  69 + String hospitalId = antExChuModel.getHospitalId();
64 70 String highRisks = antExChuModel.getHighrisk();
65 71 String otherHighRisk = antExChuModel.getOtherHighRisk();
66   - IndividualCaseResult<IndividualCaseResult.Infos> result = getInfosIndividualCaseResult(patient, antExChuModel.getProdDoctor(), highRisks, antExChuModel.getHighriskDesc(), otherHighRisk, antExChuModel.getCheckTime());
  72 + IndividualCaseResult<IndividualCaseResult.Infos> result = getInfosIndividualCaseResult(patient, antExChuModel.getProdDoctor(), highRisks, antExChuModel.getHighriskDesc(), otherHighRisk, antExChuModel.getCheckTime(), hospitalId);
67 73 results.add(result);
68 74  
69 75 }
70   - List<AntenatalExaminationModel> antenatalExaminationModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId)).with(new Sort(Sort.Direction.ASC, "created")), AntenatalExaminationModel.class);
  76 + List<AntenatalExaminationModel> antenatalExaminationModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(patientId)).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class);
71 77 if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) {
72 78 for (AntenatalExaminationModel examinationModel : antenatalExaminationModels) {
73 79 String riskFactors = examinationModel.getRiskFactor();
74 80 String otherRisk = examinationModel.getOtherRisk();
75   - IndividualCaseResult<IndividualCaseResult.Infos> result = getInfosIndividualCaseResult(patient, examinationModel.getCheckDoctor(), riskFactors, examinationModel.getHighriskDesc(), otherRisk, examinationModel.getCheckDate());
  81 + String hospitalId = examinationModel.getHospitalId();
  82 + IndividualCaseResult<IndividualCaseResult.Infos> result = getInfosIndividualCaseResult(patient, examinationModel.getCheckDoctor(), riskFactors, examinationModel.getHighriskDesc(), otherRisk, examinationModel.getCheckDate(), hospitalId);
76 83 results.add(result);
77   -
78 84 }
79 85 }
80 86 BaseResponse baseResponse = new BaseResponse();
81 87  
... ... @@ -97,9 +103,17 @@
97 103 * @param checkTime 产检时间
98 104 * @return
99 105 */
100   - private IndividualCaseResult<IndividualCaseResult.Infos> getInfosIndividualCaseResult(Patients patient, String doctor, String highRisks, String highRiskDesc, String otherHighRisk, Date checkTime) {
  106 + private IndividualCaseResult<IndividualCaseResult.Infos> getInfosIndividualCaseResult(Patients patient, String doctor, String highRisks, String highRiskDesc, String otherHighRisk, Date checkTime, String hospitalId) {
101 107 List<String> list = JsonUtil.toList(highRisks, String.class);
102 108 IndividualCaseResult<IndividualCaseResult.Infos> result = new IndividualCaseResult<>();
  109 + String checkHospitalStr = "";
  110 + if (StringUtils.isNotEmpty(hospitalId)) {
  111 + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId));
  112 + if (organization != null) {
  113 + checkHospitalStr = organization.getName();
  114 + }
  115 + }
  116 + result.setCheckHospitalStr(checkHospitalStr);
103 117 result.setName(patient.getUsername());
104 118 result.setIdCard(patient.getCardNo());
105 119 Users users = usersService.getUsers(Integer.parseInt(doctor));