diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientWeightDao.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientWeightDao.java index 0408781..d93d0d5 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientWeightDao.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientWeightDao.java @@ -3,6 +3,8 @@ package com.lyms.platform.biz.dal; import com.lyms.platform.pojo.PatientWeight; import org.springframework.data.mongodb.core.query.Query; +import java.util.List; + /** * 体重管理 */ @@ -12,4 +14,6 @@ public interface IPatientWeightDao { void updatePatient(Query query, PatientWeight patientWeight); + List queryPatientWeight(Query query); + } diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientWeightDaoImpl.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientWeightDaoImpl.java index 2537988..df721ba 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientWeightDaoImpl.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientWeightDaoImpl.java @@ -6,6 +6,8 @@ import com.lyms.platform.pojo.PatientWeight; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Repository; +import java.util.List; + /** * 产前检查 初诊记录 */ @@ -22,4 +24,9 @@ public class PatientWeightDaoImpl extends BaseMongoDAOImpl implem update(query, patientWeight); } + + @Override + public List queryPatientWeight(Query query) { + return find(query); + } } diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientWeightService2.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientWeightService2.java index 6433fcd..14bb3ba 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientWeightService2.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientWeightService2.java @@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class PatientWeightService2 { @@ -20,4 +22,10 @@ public class PatientWeightService2 { public void update(Query query, PatientWeight patientWeight) { patientWeightDao.updatePatient(query, patientWeight); } + + + public List queryPatientWeight(Query query) { + return patientWeightDao.queryPatientWeight(query); + } + } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java index 450cee6..fe245ed 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java @@ -7,6 +7,7 @@ import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.common.result.BaseResponse; import com.lyms.platform.operate.web.facade.MeasureInfoFacade; import com.lyms.platform.operate.web.request.MeasureInfoRequest; +import com.lyms.platform.operate.web.request.NutritionInfoRequest; import com.lyms.platform.operate.web.request.SmsTemplateRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -112,4 +113,43 @@ public class MeasureInfoController extends BaseController { { return measureInfoFacade.getMeasurePatientInfo(certType, certNo, hospitalId); } + + + /** + * 体重与营养管理,获取孕妇基本信息 + * @param certType 1身份证 2就诊卡 + * @param certNo + * @param hospitalId + * @param request + * @return + */ + @RequestMapping(method = RequestMethod.GET, value = "/getNutritionPatientInfo") + @ResponseBody + public BaseObjectResponse getNutritionPatientInfo(@RequestParam(value = "certType", required = true) Integer certType, + @RequestParam(value = "certNo", required = true) String certNo, + @RequestParam(value = "hospitalId", required = true) String hospitalId, + HttpServletRequest request + ) + { + return measureInfoFacade.getNutritionPatientInfo(certType, certNo, hospitalId); + } + + + /** + * 体重与营养管理 保存体重测量数据 + * @param request + * @return + */ + @RequestMapping(method = RequestMethod.POST, value = "/addtNutritionInfo") + @ResponseBody + public BaseObjectResponse addtNutritionInfo(@RequestBody NutritionInfoRequest nutritionInfoRequest, + HttpServletRequest request + ) + { + return measureInfoFacade.addtNutritionInfo(nutritionInfoRequest); + } + + + + } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java index ada460d..d68d1ea 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java @@ -1,9 +1,7 @@ package com.lyms.platform.operate.web.facade; import com.lyms.hospitalapi.qhdfy.MeasurePatientInfo; -import com.lyms.platform.biz.service.BasicConfigService; -import com.lyms.platform.biz.service.DataPermissionService; -import com.lyms.platform.biz.service.PatientsService; +import com.lyms.platform.biz.service.*; import com.lyms.platform.common.constants.ErrorCodeConstants; import com.lyms.platform.common.enums.SexEnum; import com.lyms.platform.common.enums.YnEnums; @@ -13,6 +11,7 @@ import com.lyms.platform.common.result.BaseResponse; import com.lyms.platform.common.utils.DateUtil; import com.lyms.platform.common.utils.ExceptionUtils; import com.lyms.platform.operate.web.request.MeasureInfoRequest; +import com.lyms.platform.operate.web.request.NutritionInfoRequest; import com.lyms.platform.operate.web.result.MeasureBaseInfoResult; import com.lyms.platform.operate.web.result.MeasureInfoResult; import com.lyms.platform.operate.web.utils.CommonsHelper; @@ -28,6 +27,8 @@ import org.apache.commons.dbutils.QueryRunner; import org.apache.commons.dbutils.handlers.BeanListHandler; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.mongodb.core.query.Criteria; +import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; import java.sql.Connection; @@ -52,6 +53,13 @@ public class MeasureInfoFacade { private OrganizationService organizationService; @Autowired + private PatientWeightService2 patientWeightService2; + + @Autowired + private AntenatalExaminationService antenatalExaminationService; + + + @Autowired private BasicConfigService basicConfigService; private static String[] blood_item = new String[]{"--","--","--","--","--","--","--","--","--"}; @@ -631,7 +639,7 @@ public class MeasureInfoFacade { { MeasureDataInfoQuery query = new MeasureDataInfoQuery(); query.setModifiedTimeEnd(DateUtil.parseYMD(DateUtil.getymd())); - query.setModifiedTimeStart(DateUtil.addDay(new Date(),-2)); + query.setModifiedTimeStart(DateUtil.addDay(new Date(), -2)); List list = mysqlMeasureDataInfoService.queryMeasureList(query); if (CollectionUtils.isNotEmpty(list)) { @@ -645,5 +653,91 @@ public class MeasureInfoFacade { } + /** + * 1身份证 2就诊卡 + * @param certType + * @param certNo + * @param hospitalId + * @return + */ + public BaseObjectResponse getNutritionPatientInfo(Integer certType, String certNo, String hospitalId) { + + System.out.println("getNutritionPatientInfo:certType" + certType + ";certNo="+certNo+";hospitalId="+hospitalId); + + BaseObjectResponse objectResponse = new BaseObjectResponse(); + PatientsQuery patientsQuery = new PatientsQuery(); + if (1 == certType) + { + patientsQuery.setCardNo(certNo); + } + else if (2 == certType) + { + patientsQuery.setVcCardNo(certNo); + } + + patientsQuery.setHospitalId(hospitalId); + patientsQuery.setYn(YnEnums.YES.getId()); + List patientses = patientsService.queryPatient(patientsQuery); + if (CollectionUtils.isEmpty(patientses)) + { + objectResponse.setErrorcode(ErrorCodeConstants.NO_DATA); + objectResponse.setErrormsg("测量用户还未建档"); + return objectResponse; + } + Patients pat = patientses.get(0); + Map patInfo = new HashMap<>(); + patInfo.put("userName",pat.getUsername()); + patInfo.put("age",DateUtil.getAge(pat.getBirth())+"岁"); + patInfo.put("week",DateUtil.getWeekDesc(pat.getLastMenses(), new Date())); + patInfo.put("dueDate",DateUtil.getyyyy_MM_dd(DateUtil.addDay(pat.getLastMenses(), 280))); + patInfo.put("phone",pat.getPhone()); + patInfo.put("vcCardNo",pat.getVcCardNo()); + + String beforeWeight = ""; + String beforeHeight = ""; + String tireNumber = ""; + String bmi = ""; + String currentWeight = ""; + + List patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("patientId").is(pat.getId()))); + if (CollectionUtils.isNotEmpty(patientWeights)) + { + PatientWeight weight = patientWeights.get(0); + bmi = weight.getBmi() == null ? "" : weight.getBmi(); + beforeWeight = weight.getBeforeWeight() == null ? "" : weight.getBeforeWeight(); + beforeHeight = weight.getBeforeHeight() == null ? "" : weight.getBeforeHeight(); + } + else + { + AntExChuQuery antExChuQuery = new AntExChuQuery(); + antExChuQuery.setHospitalId(hospitalId); + antExChuQuery.setParentId(pat.getId()); + antExChuQuery.setYn(YnEnums.YES.getId()); + List chuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); + if (CollectionUtils.isNotEmpty(chuModelList)) { + AntExChuModel chuModel = chuModelList.get(0); + beforeWeight = chuModel.getYqWeight() == null ? "" : chuModel.getYqWeight(); + beforeHeight = chuModel.getHeight() == null ? "" : chuModel.getHeight(); + tireNumber = chuModel.getTireNumber() == null ? "" : chuModel.getTireNumber(); + bmi = chuModel.getBaricIndex() == null ? "" : chuModel.getBaricIndex(); + } + } + + patInfo.put("beforeWeight",beforeWeight); + patInfo.put("beforeHeight",beforeHeight); + patInfo.put("tireNumber",tireNumber); + patInfo.put("bmi",bmi); + patInfo.put("currentWeight",currentWeight); + patInfo.put("patientId",pat.getId()); + + objectResponse.setData(patInfo); + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); + objectResponse.setErrormsg("成功"); + return objectResponse; + } + + public BaseObjectResponse addtNutritionInfo(NutritionInfoRequest nutritionInfoRequest) { + return null; + } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java index 5a8f6c4..6f6b2dc 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java @@ -4294,66 +4294,6 @@ public class ViewFacade { } public Map getMatDeliverData(String idCard, String hospitalName) { - - - Map hospitals = new HashMap<>(); - hospitals.put("秦皇岛市妇幼保健院","秦皇岛市妇幼保健院"); - hospitals.put("秦皇岛市海港医院","秦皇岛市海港医院"); - hospitals.put("秦皇岛军工医院","秦皇岛市军工医院"); - hospitals.put("河北港口集团有限公司港口医院","秦皇岛港口医院"); - hospitals.put("秦皇岛柳江医院","秦皇岛市柳江医院"); - hospitals.put("秦皇岛市第一医院","秦皇岛市第一医院"); - hospitals.put("秦皇岛经济技术开发区医院","秦皇岛市经济技术开发区医院"); - hospitals.put("秦皇岛北戴河新区卫生和计划生育局","北戴河新区卫计局"); - hospitals.put("秦皇岛北戴河新区南戴河医院","北戴河新区南戴河社区卫生服务中心"); - hospitals.put("秦皇岛北戴河新区顺德医院","北戴河新区顺德医院"); - hospitals.put("秦皇岛市山海关区妇幼保健计划生育服务中心","秦皇岛山海关区妇幼保健站"); - hospitals.put("秦皇岛市工人医院","秦皇岛市工人医院"); - hospitals.put("秦皇岛市山海关人民医院","山海关区人民医院"); - hospitals.put("秦皇岛市北戴河区妇幼保健计划生育服务中心","秦皇岛北戴河区妇幼保健站"); - hospitals.put("秦皇岛市北戴河医院","北戴河医院"); - hospitals.put("秦皇岛市北戴河区牛头崖镇中心卫生院","北戴河区牛头崖镇卫生院"); - hospitals.put("秦皇岛市抚宁区卫生和计划生育局","抚宁区卫计局"); - hospitals.put("秦皇岛市抚宁区妇幼保健院","抚宁县妇幼保健院"); - hospitals.put("秦皇岛天马湖医院","秦皇岛天马湖医院"); - hospitals.put("秦皇岛市抚宁区榆关镇中心卫生院","抚宁区榆关镇中心卫生院"); - hospitals.put("秦皇岛市抚宁紫金山医院","抚宁紫金山医院"); - hospitals.put("秦皇岛市抚宁区中医医院","抚宁县中医院"); - hospitals.put("秦皇岛市抚宁区人民医院","抚宁区人民医院"); - hospitals.put("卢龙县妇幼保健院","卢龙县妇幼保健院"); - hospitals.put("卢龙县中医院","卢龙县中医院"); - hospitals.put("卢龙县刘田各庄中心卫生院","卢龙县刘田各庄中心卫生院"); - hospitals.put("卢龙县医院","卢龙县医院"); - hospitals.put("昌黎县妇幼保健院","昌黎妇幼保健院"); - hospitals.put("秦皇岛市第二医院","秦皇岛市第二医院"); - hospitals.put("昌黎县人民医院","昌黎县人民医院"); - hospitals.put("昌黎县中医院","昌黎县中医院"); - hospitals.put("青龙满族自治县生殖保健医院","青龙满族自治县生殖保健医院"); - hospitals.put("青龙满族自治县医院","青龙满族自治县医院"); - hospitals.put("青龙满族自治县中医院","青龙满族自治县中医院"); - hospitals.put("青龙满族自治县龙王庙中心卫生院","青龙满族自治县龙王庙中心卫生院"); - hospitals.put("青龙满族自治县祖山镇卫生院","青龙满族自治县祖山镇卫生院"); - hospitals.put("青龙满族自治县隔河头中心卫生院","青龙满族自治县隔河头中心卫生院"); - hospitals.put("青龙满族自治县董丈子卫生院","青龙满族自治县董杖子村卫生院"); - hospitals.put("青龙满族自治县双山子中心卫生院","青龙满族自治县双山子中心卫生院"); - hospitals.put("青龙满族自治县木头凳中心卫生院","青龙满族自治县木头凳中心卫生院"); - hospitals.put("青龙满族自治县八道河中心卫生院","青龙满族自治县八道河中心卫生院"); - hospitals.put("青龙满族自治县妇幼保健计划生育服务中心","青龙满族自治县妇幼保健计划生育服务中心"); - hospitals.put("秦皇岛玛丽妇产医院","秦皇岛玛丽妇产医院"); - hospitals.put("秦皇岛海港友谊医院","秦皇岛海港友谊医院"); - - hospitals.put("秦皇岛市卫生和计划生育委员会","秦皇岛市卫计委"); - hospitals.put("秦皇岛市海港区卫生和计划生育局","秦皇岛市海港区卫生和计划生育局"); - hospitals.put("秦皇岛市海港区妇幼保健计划生育服务中心","秦皇岛海港区妇幼保健站"); - hospitals.put("秦皇岛经济技术开发区卫计局","秦皇岛经济技术开发区卫计局"); - hospitals.put("秦皇岛市山海关区卫生和计划生育局","秦皇岛市山海关区卫生和计划生育局"); - hospitals.put("中铁山桥集团医院","中铁山桥集团医院"); - hospitals.put("秦皇岛市北戴河区卫生和计划生育局","秦皇岛市北戴河区卫生和计划生育局"); - hospitals.put("秦皇岛市卢龙县卫生和计划生育局","秦皇岛市卢龙县卫生和计划生育局"); - hospitals.put("秦皇岛市昌黎县卫生和计划生育局","秦皇岛市昌黎县卫生和计划生育局"); - hospitals.put("秦皇岛市青龙满族自治县卫生和计划生育局","秦皇岛市青龙满族自治县卫生和计划生育局"); - hospitals.put("青龙满族自治县博爱医院","青龙满族自治县博爱医院"); - Map deliverMap = new HashMap<>(); try { PatientsQuery patientsQuery = new PatientsQuery(); @@ -4361,25 +4301,21 @@ public class ViewFacade { patientsQuery.setCardNo(idCard); patientsQuery.setType(3); - if (StringUtils.isNotEmpty(hospitalName)) { - hospitalName = hospitals.get(hospitalName.trim()); - if (StringUtils.isNotEmpty(hospitalName)) - { - OrganizationQuery query = new OrganizationQuery(); - query.setName(hospitalName); - query.setYn(YnEnums.YES.getId()); - List organizations = organizationService.queryOrganization(query); - if (CollectionUtils.isNotEmpty(organizations)) { - patientsQuery.setHospitalId(String.valueOf(organizations.get(0).getId())); - } - } - else - { - deliverMap.put("motherinfo",new ArrayList<>()); - return deliverMap; + if (StringUtils.isNotEmpty(hospitalName)) + { + OrganizationQuery query = new OrganizationQuery(); + query.setName(hospitalName.trim()); + query.setYn(YnEnums.YES.getId()); + List organizations = organizationService.queryOrganization(query); + if (CollectionUtils.isNotEmpty(organizations)) { + patientsQuery.setHospitalId(String.valueOf(organizations.get(0).getId())); } } - + else + { + deliverMap.put("motherinfo",new ArrayList<>()); + return deliverMap; + } List> deliverList = new ArrayList<>(); List list = patientsService.queryPatient1(patientsQuery, "created"); @@ -4401,7 +4337,6 @@ public class ViewFacade { patientMap.put("mid",pat.getId());// patientMap.put("mbuilddate",DateUtil.getyyyy_MM_dd(pat.getBookbuildingDate()));// 建档时间 - String buildHospital = ""; if (StringUtils.isNotEmpty(pat.getHospitalId())) { Organization organization = organizationService.getOrganization(Integer.parseInt(pat.getHospitalId())); @@ -4454,17 +4389,7 @@ public class ViewFacade { } else { fmHospital = pat.getFmHospital(); } - if (StringUtils.isNotEmpty(fmHospital)) - { - for (String key : hospitals.keySet()) - { - if (fmHospital.equals(hospitals.get(key))) - { - fmHospital = key; - break; - } - } - } + } patientMap.put("hospital", fmHospital);//接生单位 diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NutritionInfoRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NutritionInfoRequest.java new file mode 100644 index 0000000..97825ac --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NutritionInfoRequest.java @@ -0,0 +1,7 @@ +package com.lyms.platform.operate.web.request; + +/** + * Created by Administrator on 2018-05-07. + */ +public class NutritionInfoRequest { +}