Commit 29bf01a83bffd3a753e2e5bea3843d19190687f2

Authored by liquanyu
1 parent 3f8db414be

update code

Showing 8 changed files with 472 additions and 27 deletions

platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 29bf01a
... ... @@ -1103,7 +1103,7 @@
1103 1103  
1104 1104  
1105 1105 if (StringUtils.isNotEmpty(rFactor)) {
1106   - condition = condition.and("riskFactorId", rFactor, MongoOper.LIKE);
  1106 + condition = condition.and("riskFactorId", rFactor, MongoOper.IN);
1107 1107 }
1108 1108 else if(norFactor){
1109 1109 condition = condition.and("riskFactorId", new ArrayList<String>(), MongoOper.NE);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ 29bf01a
... ... @@ -138,6 +138,17 @@
138 138 return viewFacade.getBabyCheckPageInfo(id);
139 139 }
140 140  
  141 + /**
  142 + * 妇女查看页面
  143 + * @param id
  144 + * @return
  145 + */
  146 + @RequestMapping(value = "/getResidentsPageById/{id}", method = RequestMethod.GET)
  147 + @ResponseBody
  148 + public BaseObjectResponse getResidentsPageById(@PathVariable("id")String id){
  149 + return viewFacade.getResidentsPageById(id);
  150 + }
  151 +
141 152  
142 153 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 29bf01a
... ... @@ -217,6 +217,22 @@
217 217 PatientsQuery patientsQuery = new PatientsQuery();
218 218 patientsQuery.setPhone(riskPatientsQueryRequest.getPhone());
219 219 patientsQuery.setCardNo(riskPatientsQueryRequest.getCardNo());
  220 +
  221 + //add lqy 高危孕产妇统计需求
  222 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getType()))
  223 + {
  224 + if ("2".equals(riskPatientsQueryRequest.getType()))
  225 + {
  226 + //1孕妇
  227 + patientsQuery.setType(1);
  228 + }
  229 + else if ("3".equals(riskPatientsQueryRequest.getType()))
  230 + {
  231 + //3产妇
  232 + patientsQuery.setType(3);
  233 + }
  234 + }
  235 +
220 236 //设置为孕妇
221 237 patientsQuery.setType(type);
222 238 patientsQuery.setLikeName(riskPatientsQueryRequest.getName());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java View file @ 29bf01a
... ... @@ -63,10 +63,22 @@
63 63 patientsQuery.setBuildTypeList(buildType);
64 64 patientsQuery.setHospitalId(hospitalId);
65 65  
66   - //1孕妇
67   -// patientsQuery.setType(1);
  66 + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getType()))
  67 + {
  68 + if ("2".equals(riskPatientsQueryRequest.getType()))
  69 + {
  70 + //1孕妇
  71 + patientsQuery.setType(1);
  72 + }
  73 + else if ("3".equals(riskPatientsQueryRequest.getType()))
  74 + {
  75 + //3产妇
  76 + patientsQuery.setType(3);
  77 + }
  78 + }
  79 +
68 80 // 0未终止妊娠 1终止妊娠
69   - patientsQuery.setDueStatus(0);
  81 + // patientsQuery.setDueStatus(0);
70 82  
71 83 //预产期
72 84 if (org.apache.commons.lang.StringUtils.isNotEmpty(riskPatientsQueryRequest.getDueDate())) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 29bf01a
... ... @@ -9,10 +9,7 @@
9 9 import com.lyms.platform.common.utils.JsonUtil;
10 10 import com.lyms.platform.common.utils.SystemConfig;
11 11 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
12   -import com.lyms.platform.operate.web.result.BabyCheckPageResult;
13   -import com.lyms.platform.operate.web.result.BabyCheckResult;
14   -import com.lyms.platform.operate.web.result.BabyPageResult;
15   -import com.lyms.platform.operate.web.result.HighScoreResult;
  12 +import com.lyms.platform.operate.web.result.*;
16 13 import com.lyms.platform.operate.web.utils.*;
17 14 import com.lyms.platform.permission.model.Organization;
18 15 import com.lyms.platform.permission.model.Users;
... ... @@ -67,6 +64,9 @@
67 64 @Autowired
68 65 private BabyCheckService babyCheckService;
69 66  
  67 + @Autowired
  68 + private ResidentsArchiveService residentsArchiveService;
  69 +
70 70 /**
71 71 * 建档查询
72 72 * @param id
... ... @@ -1604,7 +1604,20 @@
1604 1604 checkModels = babyCheckService.queryBabyCheckRecord(query);
1605 1605 if (checkModels != null && checkModels.size() > 0) {
1606 1606 BabyCheckModel checkModel = checkModels.get(0);
1607   - result = getBabyCheckResult(checkModel);
  1607 +
  1608 +
  1609 + BabyModelQuery babyQuery = new BabyModelQuery();
  1610 + babyQuery.setId(checkModel.getBuildId());
  1611 + babyQuery.setYn(YnEnums.YES.getId());
  1612 + BabyModel babyModel = null;
  1613 + List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
  1614 + if (CollectionUtils.isNotEmpty(models))
  1615 + {
  1616 + babyModel = models.get(0);
  1617 + }
  1618 + result = getBabyCheckResult(checkModel,babyModel);
  1619 +
  1620 +
1608 1621 }
1609 1622 }
1610 1623 br.setData(result);
1611 1624  
1612 1625  
... ... @@ -1614,13 +1627,83 @@
1614 1627 }
1615 1628  
1616 1629  
1617   - private BabyCheckPageResult getBabyCheckResult(BabyCheckModel checkModel) {
  1630 + private BabyCheckPageResult getBabyCheckResult(BabyCheckModel checkModel,BabyModel babyModel) {
1618 1631 BabyCheckPageResult model = new BabyCheckPageResult();
  1632 +
  1633 + if (babyModel != null)
  1634 + {
  1635 + model.setBabyName(babyModel.getName());
  1636 + model.setBabyBirthday(DateUtil.getyyyy_MM_dd(babyModel.getBirth()));
  1637 + model.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date()));
  1638 + model.setMommyPhone(babyModel.getMphone());
  1639 + model.setMommyName(babyModel.getMname());
  1640 + model.setRemark(babyModel.getMremark());
  1641 +
  1642 + model.setSex(SexEnum.getTextById(babyModel.getSex()));
  1643 +
  1644 + model.setMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date()));
  1645 + model.setCheckMonthAge(DateUtil.getBabyMonthAge(babyModel.getBirth(), checkModel.getCheckDate()));
  1646 +
  1647 + String buildDiagnose = "";
  1648 +
  1649 + String buildDiagnoseStr = checkModel.getDiagnose();
  1650 + if (!com.lyms.platform.common.utils.StringUtils.isEmpty(buildDiagnoseStr)) {
  1651 + List diagnoses = JsonUtil.toList(buildDiagnoseStr, List.class);
  1652 + for (int i = 0 ;i < diagnoses.size();i++) {
  1653 + if (diagnoses.get(i) != null) {
  1654 + BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
  1655 + basicConfigQuery.setYn(YnEnums.YES.getId());
  1656 + basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID);
  1657 + basicConfigQuery.setId(String.valueOf(diagnoses.get(i)));
  1658 + List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery);
  1659 + if (CollectionUtils.isNotEmpty(datas)) {
  1660 + if (i != diagnoses.size() - 1)
  1661 + {
  1662 + buildDiagnose+=datas.get(0).getName()+",";
  1663 + }
  1664 + else
  1665 + {
  1666 + buildDiagnose+=datas.get(0).getName();
  1667 + }
  1668 + }
  1669 + }
  1670 +
  1671 + }
  1672 + }
  1673 +
  1674 + model.setBuildDiagnose(buildDiagnose);
  1675 +
  1676 + //母亲是否高危
  1677 + if (!com.lyms.platform.common.utils.StringUtils.isEmpty(babyModel.getMcertNo())) {
  1678 +
  1679 + PatientsQuery patientsQuery = new PatientsQuery();
  1680 + patientsQuery.setCardNo(babyModel.getMcertNo());
  1681 + patientsQuery.setYn(YnEnums.YES.getId());
  1682 +
  1683 + List<Patients> list = patientsService.queryPatient(patientsQuery);
  1684 + if (CollectionUtils.isNotEmpty(list)) {
  1685 + HighScoreResult res = antenatalExaminationFacade.getPatLastRiskByDate(list.get(0).getPid(), false, list.get(0).getLastMenses(), babyModel.getBirth());
  1686 + List<String> listHighRisk = res.getHighRisk();
  1687 +
  1688 + if (CollectionUtils.isNotEmpty(listHighRisk)) {
  1689 + if (listHighRisk.contains("健康")) {
  1690 + model.setMommyHighRisk("健康");
  1691 + } else {
  1692 + model.setMommyHighRisk("高危");
  1693 + }
  1694 + } else {
  1695 + model.setMommyHighRisk("健康");
  1696 + }
  1697 + }
  1698 +
  1699 + }
  1700 + }
  1701 +
1619 1702 model.setId(checkModel.getId());
1620 1703  
1621 1704 model.setBuildId(checkModel.getBuildId());
1622   - model.setMainFoster(checkModel.getMainFoster());
1623   - model.setFeedType(checkModel.getFeedType());
  1705 + model.setMainFoster(StringUtils.isNotEmpty(checkModel.getMainFoster()) ? FyTypeEnums.getNameById(Integer.valueOf(checkModel.getMainFoster())) : "");
  1706 + model.setFeedType(StringUtils.isNotEmpty(checkModel.getFeedType()) ? WyTypeEnums.getNameById(Integer.valueOf(checkModel.getFeedType())) : "");
1624 1707 model.setPee(checkModel.getPee());
1625 1708 model.setExcrement(checkModel.getExcrement());
1626 1709 model.setSleep(checkModel.getSleep());
1627 1710  
1628 1711  
... ... @@ -1663,17 +1746,17 @@
1663 1746 String bilirubin = "";
1664 1747 if (StringUtils.isNotEmpty(checkModel.getBilirubinHead()))
1665 1748 {
1666   - bilirubin+="头"+checkModel.getBilirubinHead()+"mg/dl";
  1749 + bilirubin+=" 头"+checkModel.getBilirubinHead()+" mg/dl";
1667 1750 }
1668 1751  
1669 1752 if (StringUtils.isNotEmpty(checkModel.getBilirubinChest()))
1670 1753 {
1671   - bilirubin+="胸"+checkModel.getBilirubinChest()+"mg/dl";
  1754 + bilirubin+=" 胸"+checkModel.getBilirubinChest()+" mg/dl";
1672 1755 }
1673 1756  
1674 1757 if (StringUtils.isNotEmpty(checkModel.getBilirubinBelly()))
1675 1758 {
1676   - bilirubin+="腹"+checkModel.getBilirubinBelly()+"mg/dl";
  1759 + bilirubin+=" 腹"+checkModel.getBilirubinBelly()+" mg/dl";
1677 1760 }
1678 1761  
1679 1762 model.setBilirubin(bilirubin);
1680 1763  
1681 1764  
1682 1765  
1683 1766  
1684 1767  
... ... @@ -1773,24 +1856,21 @@
1773 1856  
1774 1857 }
1775 1858  
  1859 + if (StringUtils.isNotEmpty(checkModel.getHospitalId()))
  1860 + {
  1861 + Organization organization = organizationService.getOrganization(Integer.parseInt(checkModel.getHospitalId()));
  1862 + if (organization!=null && organization.getYn()==YnEnums.YES.getId()){
  1863 + model.setCheckHospital(organization.getName());
  1864 + }
  1865 + }
  1866 +
1776 1867 model.setNextCheckDate(DateUtil.getyyyy_MM_dd(checkModel.getNextDate()));
1777   - model.setHighRisk(checkModel.getHighRisk() == 1 ? "是" : "否" );
  1868 + model.setHighRisk(checkModel.getHighRisk() == 1 ? "是" : "否");
1778 1869 model.setCheckDate(DateUtil.getyyyy_MM_dd(checkModel.getCheckDate()));
1779 1870  
1780   - BabyModelQuery babyQuery = new BabyModelQuery();
1781   - babyQuery.setId(checkModel.getBuildId());
1782   - babyQuery.setYn(YnEnums.YES.getId());
1783 1871  
1784   - List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
1785 1872  
1786   - if (CollectionUtils.isNotEmpty(models)) {
1787   - model.setMonthAge(DateUtil.getBabyMonthAge(models.get(0).getBirth(), checkModel.getCheckDate()));
1788   - }
1789 1873  
1790   - if (StringUtils.isNotEmpty(checkModel.getDrugGllergic()))
1791   - {
1792   -
1793   - }
1794 1874 String drugGllergic = "";
1795 1875 if (StringUtils.isNotEmpty(checkModel.getDrugGllergic()))
1796 1876 {
... ... @@ -1840,5 +1920,35 @@
1840 1920  
1841 1921 }
1842 1922  
  1923 + /**
  1924 + * 妇女查看页面
  1925 + * @param id
  1926 + * @return
  1927 + */
  1928 + public BaseObjectResponse getResidentsPageById(String id) {
  1929 + BaseObjectResponse br = new BaseObjectResponse();
  1930 + ResidentsArchiveResult result = new ResidentsArchiveResult();
  1931 +
  1932 + ResidentsArchiveQuery query = new ResidentsArchiveQuery();
  1933 + query.setYn(YnEnums.YES.getId());
  1934 + query.setId(id);
  1935 + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
  1936 + if (CollectionUtils.isNotEmpty(modelList)){
  1937 + ResidentsArchiveModel model = modelList.get(0);
  1938 + //建档详情
  1939 + result = getResidentsPageResult(model);
  1940 + }
  1941 +
  1942 + br.setData(result);
  1943 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  1944 + br.setErrormsg("成功");
  1945 + return br;
  1946 + }
  1947 +
  1948 + private ResidentsArchiveResult getResidentsPageResult(ResidentsArchiveModel model) {
  1949 + ResidentsPageResult result = new ResidentsPageResult();
  1950 +
  1951 + return null;
  1952 + }
1843 1953 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java View file @ 29bf01a
... ... @@ -107,6 +107,17 @@
107 107 //产检医生
108 108 private String lastCheckDoctorId;
109 109  
  110 + //1. 全部孕产妇 2.全部孕妇 3. 全部产妇
  111 + private String type;
  112 +
  113 + public String getType() {
  114 + return type;
  115 + }
  116 +
  117 + public void setType(String type) {
  118 + this.type = type;
  119 + }
  120 +
110 121 public String getQueryNo() {
111 122 return queryNo;
112 123 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ResidentsPageResult.java View file @ 29bf01a
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +
  4 +
  5 +
  6 +public class ResidentsPageResult {
  7 +
  8 + /************基本信息*************/
  9 +
  10 + //姓名
  11 + private String username;
  12 + //性别
  13 + private String sex;
  14 + //出生日期
  15 + private String birthday;
  16 + //国籍
  17 + private String country;
  18 + //民族Id
  19 + private String nation;
  20 + //婚姻状况
  21 + private String marriage;
  22 + //证件类型Id
  23 + private String certificateType;
  24 + //证件号
  25 + private String certificateNum;
  26 + //户籍类型
  27 + private String censusType;
  28 + //居住类别
  29 + private String liveType;
  30 + //文化程度
  31 + private String levelType;
  32 + //职业类别
  33 + private String professionType;
  34 + //年龄
  35 + private Integer age;
  36 +
  37 + /************联系方式*************/
  38 +
  39 + //手机号
  40 + private String phone;
  41 + //工作单位
  42 + private String workUnit;
  43 + //居住地
  44 + private String liveAddress;
  45 + //户籍地址
  46 + private String addressRegister;
  47 +
  48 + /************病史信息*************/
  49 +
  50 + //既往史
  51 + private String pastHistory;
  52 + //家族史
  53 + private String familyHistory;
  54 + //个人史
  55 + private String personalHistory;
  56 + //药物过敏史
  57 + private String ywgmHistory;
  58 + //现病史
  59 + private String presentHistory;
  60 +
  61 + /************院内信息*************/
  62 +
  63 + //就诊卡号
  64 + private String vcCardNo;
  65 + //建档人
  66 + private String buildDoctor;
  67 + //建档日期
  68 + private String buildDate;
  69 +
  70 + /* table info */
  71 +
  72 + //建档号
  73 + private String id;
  74 +
  75 + public String getUsername() {
  76 + return username;
  77 + }
  78 +
  79 + public void setUsername(String username) {
  80 + this.username = username;
  81 + }
  82 +
  83 + public String getSex() {
  84 + return sex;
  85 + }
  86 +
  87 + public void setSex(String sex) {
  88 + this.sex = sex;
  89 + }
  90 +
  91 + public String getBirthday() {
  92 + return birthday;
  93 + }
  94 +
  95 + public void setBirthday(String birthday) {
  96 + this.birthday = birthday;
  97 + }
  98 +
  99 + public String getCountry() {
  100 + return country;
  101 + }
  102 +
  103 + public void setCountry(String country) {
  104 + this.country = country;
  105 + }
  106 +
  107 + public String getNation() {
  108 + return nation;
  109 + }
  110 +
  111 + public void setNation(String nation) {
  112 + this.nation = nation;
  113 + }
  114 +
  115 + public String getMarriage() {
  116 + return marriage;
  117 + }
  118 +
  119 + public void setMarriage(String marriage) {
  120 + this.marriage = marriage;
  121 + }
  122 +
  123 + public String getCertificateType() {
  124 + return certificateType;
  125 + }
  126 +
  127 + public void setCertificateType(String certificateType) {
  128 + this.certificateType = certificateType;
  129 + }
  130 +
  131 + public String getCertificateNum() {
  132 + return certificateNum;
  133 + }
  134 +
  135 + public void setCertificateNum(String certificateNum) {
  136 + this.certificateNum = certificateNum;
  137 + }
  138 +
  139 + public String getCensusType() {
  140 + return censusType;
  141 + }
  142 +
  143 + public void setCensusType(String censusType) {
  144 + this.censusType = censusType;
  145 + }
  146 +
  147 + public String getLiveType() {
  148 + return liveType;
  149 + }
  150 +
  151 + public void setLiveType(String liveType) {
  152 + this.liveType = liveType;
  153 + }
  154 +
  155 + public String getLevelType() {
  156 + return levelType;
  157 + }
  158 +
  159 + public void setLevelType(String levelType) {
  160 + this.levelType = levelType;
  161 + }
  162 +
  163 + public String getProfessionType() {
  164 + return professionType;
  165 + }
  166 +
  167 + public void setProfessionType(String professionType) {
  168 + this.professionType = professionType;
  169 + }
  170 +
  171 + public Integer getAge() {
  172 + return age;
  173 + }
  174 +
  175 + public void setAge(Integer age) {
  176 + this.age = age;
  177 + }
  178 +
  179 + public String getPhone() {
  180 + return phone;
  181 + }
  182 +
  183 + public void setPhone(String phone) {
  184 + this.phone = phone;
  185 + }
  186 +
  187 + public String getWorkUnit() {
  188 + return workUnit;
  189 + }
  190 +
  191 + public void setWorkUnit(String workUnit) {
  192 + this.workUnit = workUnit;
  193 + }
  194 +
  195 + public String getLiveAddress() {
  196 + return liveAddress;
  197 + }
  198 +
  199 + public void setLiveAddress(String liveAddress) {
  200 + this.liveAddress = liveAddress;
  201 + }
  202 +
  203 + public String getAddressRegister() {
  204 + return addressRegister;
  205 + }
  206 +
  207 + public void setAddressRegister(String addressRegister) {
  208 + this.addressRegister = addressRegister;
  209 + }
  210 +
  211 + public String getPastHistory() {
  212 + return pastHistory;
  213 + }
  214 +
  215 + public void setPastHistory(String pastHistory) {
  216 + this.pastHistory = pastHistory;
  217 + }
  218 +
  219 + public String getFamilyHistory() {
  220 + return familyHistory;
  221 + }
  222 +
  223 + public void setFamilyHistory(String familyHistory) {
  224 + this.familyHistory = familyHistory;
  225 + }
  226 +
  227 + public String getPersonalHistory() {
  228 + return personalHistory;
  229 + }
  230 +
  231 + public void setPersonalHistory(String personalHistory) {
  232 + this.personalHistory = personalHistory;
  233 + }
  234 +
  235 + public String getYwgmHistory() {
  236 + return ywgmHistory;
  237 + }
  238 +
  239 + public void setYwgmHistory(String ywgmHistory) {
  240 + this.ywgmHistory = ywgmHistory;
  241 + }
  242 +
  243 + public String getPresentHistory() {
  244 + return presentHistory;
  245 + }
  246 +
  247 + public void setPresentHistory(String presentHistory) {
  248 + this.presentHistory = presentHistory;
  249 + }
  250 +
  251 + public String getVcCardNo() {
  252 + return vcCardNo;
  253 + }
  254 +
  255 + public void setVcCardNo(String vcCardNo) {
  256 + this.vcCardNo = vcCardNo;
  257 + }
  258 +
  259 + public String getBuildDoctor() {
  260 + return buildDoctor;
  261 + }
  262 +
  263 + public void setBuildDoctor(String buildDoctor) {
  264 + this.buildDoctor = buildDoctor;
  265 + }
  266 +
  267 + public String getBuildDate() {
  268 + return buildDate;
  269 + }
  270 +
  271 + public void setBuildDate(String buildDate) {
  272 + this.buildDate = buildDate;
  273 + }
  274 +
  275 + public String getId() {
  276 + return id;
  277 + }
  278 +
  279 + public void setId(String id) {
  280 + this.id = id;
  281 + }
  282 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HiskCountTask.java View file @ 29bf01a
... ... @@ -90,6 +90,9 @@
90 90 query.setBookbuildingDateEnd(patientsQuery.getBookbuildingDateEnd());
91 91  
92 92 query.setrFactor(config.getId());
  93 +
  94 + query.setType(patientsQuery.getType());
  95 +
93 96 //单个高危因素孕产妇条数
94 97 int riskPatientCount = patientsService.queryPatientCount(query);
95 98 if (riskPatientCount > 0)