Commit dcb260bba50bf83fefc98a20edbfe0fccd8c8237
1 parent
445807537d
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 67 additions and 23 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
dcb260b
... | ... | @@ -913,7 +913,51 @@ |
913 | 913 | return map; |
914 | 914 | } |
915 | 915 | |
916 | + public boolean isOpenAutoSaveAntenatal(String hospitalId) | |
917 | + { | |
918 | + String value = ""; | |
919 | + //查询当前医院是否有配置此权限 | |
920 | + ModularFunctionConfigModel functionConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId)), ModularFunctionConfigModel.class); | |
921 | + if (null != functionConfigModel) { | |
922 | + List<Map<String, Object>> mapList = functionConfigModel.getConfigs(); | |
923 | + if (CollectionUtils.isNotEmpty(mapList)) { | |
924 | + for (Map<String, Object> map : mapList) { | |
925 | + if (map.get("type").toString().equals("88")) { | |
926 | + value = map.get("value").toString(); | |
927 | + } | |
928 | + } | |
929 | + } | |
930 | + } | |
931 | + return value != null && "2".equals(value); | |
932 | + } | |
933 | + | |
934 | + | |
916 | 935 | /** |
936 | + * | |
937 | + * 如果是体重测量在后,就通过测量体重时候去修改产检中的体重 | |
938 | + * @param hospitalId | |
939 | + * @param pid | |
940 | + * @param currentWeight | |
941 | + */ | |
942 | + public void updateAntenatal(String hospitalId,String pid,Double currentWeight) | |
943 | + { | |
944 | + if (!isOpenAutoSaveAntenatal(hospitalId)) | |
945 | + { | |
946 | + return; | |
947 | + } | |
948 | + List<AntenatalExaminationModel> examinationModel = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)), AntenatalExaminationModel.class); | |
949 | + if (CollectionUtils.isNotEmpty(examinationModel)) { | |
950 | + for (AntenatalExaminationModel model : examinationModel) { | |
951 | + if (StringUtils.isNotEmpty(DateUtil.getyyyy_MM_dd(model.getCheckDate())) && | |
952 | + DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCheckDate()))) { | |
953 | + model.setWeight(currentWeight); | |
954 | + } | |
955 | + } | |
956 | + } | |
957 | + } | |
958 | + | |
959 | + | |
960 | + /** | |
917 | 961 | * 小程序创建产检 |
918 | 962 | * |
919 | 963 | * @param fuh |
920 | 964 | |
... | ... | @@ -928,21 +972,8 @@ |
928 | 972 | public BaseResponse inputWxData(String fuh, String abdominalGirth, String fhr, String pid, String hospitalId, String nextTime, String doctorId) { |
929 | 973 | WxMeasureInfoModel wxMeasureInfo = new WxMeasureInfoModel(); |
930 | 974 | boolean falg = true; |
931 | - String value = null; | |
932 | 975 | if (StringUtils.isNotEmpty(pid) && StringUtils.isNotEmpty(hospitalId)) { |
933 | - //查询当前医院是否有配置此权限 | |
934 | - ModularFunctionConfigModel functionConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId)), ModularFunctionConfigModel.class); | |
935 | - if (null != functionConfigModel) { | |
936 | - List<Map<String, Object>> mapList = functionConfigModel.getConfigs(); | |
937 | - if (CollectionUtils.isNotEmpty(mapList)) { | |
938 | - for (Map<String, Object> map : mapList) { | |
939 | - if (map.get("type").toString().equals("88")) { | |
940 | - value = map.get("value").toString(); | |
941 | - } | |
942 | - } | |
943 | - } | |
944 | - } | |
945 | - if (value != null && "2".equals(value)) { | |
976 | + if (isOpenAutoSaveAntenatal(hospitalId)) { | |
946 | 977 | List<AntenatalExaminationModel> examinationModel = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)), AntenatalExaminationModel.class); |
947 | 978 | if (CollectionUtils.isNotEmpty(examinationModel)) { |
948 | 979 | for (AntenatalExaminationModel model : examinationModel) { |
... | ... | @@ -972,7 +1003,7 @@ |
972 | 1003 | } |
973 | 1004 | if (falg) { |
974 | 1005 | //创建一条复诊记录 |
975 | - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("hospitalId").is(hospitalId).and("type").is(1)), Patients.class); | |
1006 | + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("hospitalId").is(hospitalId).and("type").is(1).and("yn").is(1)), Patients.class); | |
976 | 1007 | if (null != patients) { |
977 | 1008 | AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(patients.getId())), AntExChuModel.class); |
978 | 1009 | if (null != antExChuModel) { |
979 | 1010 | |
... | ... | @@ -1052,16 +1083,24 @@ |
1052 | 1083 | } |
1053 | 1084 | } |
1054 | 1085 | //获取体重记录 |
1055 | - PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId).and("patientId").is(patients.getId()).and("yn").is("1")), PatientWeight.class); | |
1056 | - if (patientWeight != null) { | |
1057 | - Map<String, String> dayWeights = patientWeight.getDayWeights(); | |
1058 | - if (null != dayWeights && dayWeights.size() > 0) { | |
1059 | - String valus = dayWeights.get(DateUtil.getyyyy_MM_dd(new Date())); | |
1060 | - if (StringUtils.isNotEmpty(valus)) { | |
1061 | - antExAddRequest.setWeight(Double.valueOf(valus)); | |
1086 | + List<PatientWeight> patientWeights = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid).and("yn").is("1")), PatientWeight.class); | |
1087 | + if (CollectionUtils.isNotEmpty(patientWeights)) | |
1088 | + { | |
1089 | + for (PatientWeight patientWeight : patientWeights) | |
1090 | + { | |
1091 | + if (patientWeight != null) { | |
1092 | + Map<String, String> dayWeights = patientWeight.getDayWeights(); | |
1093 | + if (null != dayWeights && dayWeights.size() > 0) { | |
1094 | + String valus = dayWeights.get(DateUtil.getyyyy_MM_dd(new Date())); | |
1095 | + if (StringUtils.isNotEmpty(valus)) { | |
1096 | + antExAddRequest.setWeight(Double.valueOf(valus)); | |
1097 | + break; | |
1098 | + } | |
1099 | + } | |
1062 | 1100 | } |
1063 | 1101 | } |
1064 | 1102 | } |
1103 | + | |
1065 | 1104 | antenatalExaminationFacade.addOneAntEx(antExAddRequest, Integer.parseInt(doctorId)); |
1066 | 1105 | } |
1067 | 1106 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
dcb260b
... | ... | @@ -61,6 +61,8 @@ |
61 | 61 | private DataPermissionService dataPermissionService; |
62 | 62 | |
63 | 63 | @Autowired |
64 | + private AntExRecordFacade antExRecordFacade; | |
65 | + @Autowired | |
64 | 66 | private OrganizationService organizationService; |
65 | 67 | |
66 | 68 | @Autowired |
... | ... | @@ -984,7 +986,7 @@ |
984 | 986 | public BaseObjectResponse addNutritionInfo(NutritionInfoRequest nutritionInfoRequest) { |
985 | 987 | |
986 | 988 | Patients patients = patientsService.findOnePatientById(nutritionInfoRequest.getPatientId()); |
987 | - List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("patientId").is(nutritionInfoRequest.getPatientId()))); | |
989 | + List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("pid").is(patients.getPid()).and("yn").is("1"))); | |
988 | 990 | String hospitalId = nutritionInfoRequest.getHospitalId().trim(); |
989 | 991 | |
990 | 992 | |
... | ... | @@ -1084,6 +1086,9 @@ |
1084 | 1086 | patientWeightService2.add(patientWeight); |
1085 | 1087 | |
1086 | 1088 | } |
1089 | + | |
1090 | + //更新当天产检记录的体重 | |
1091 | + antExRecordFacade.updateAntenatal(hospitalId, patients.getPid(), Double.parseDouble(currentWeight)); | |
1087 | 1092 | |
1088 | 1093 | MeasureInfoRequest measureInfoRequest = new MeasureInfoRequest(); |
1089 | 1094 | measureInfoRequest.setCertNo(patients.getCardNo()); |