Explorar el Código

事中参数校验

0027005599 hace 2 años
padre
commit
6315b15497

+ 53 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/HisController.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.medical.controller;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.map.MapUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -14,12 +15,15 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.config.sign.util.HttpUtils;
 import org.jeecg.modules.medical.Constant;
 import org.jeecg.modules.medical.entity.AdvanceWarningVO;
+import org.jeecg.modules.medical.entity.AdviceDetailsVO;
 import org.jeecg.modules.medical.entity.Audit;
+import org.jeecg.modules.medical.entity.DiagnosesVO;
 import org.jeecg.modules.medical.entity.HospMidIncidentWarningVO;
 import org.jeecg.modules.medical.entity.MidIncidentWarningVO;
 import org.jeecg.modules.medical.entity.MidResult;
@@ -126,6 +130,55 @@ public class HisController extends JeecgController<Audit, IAuditService> {
     @PostMapping(value = "/outpatientMidIncidentWarning")
     public Result outpatientMidIncidentWarning(@RequestBody @Valid MidIncidentWarningVO midIncidentWarningVO,HttpServletRequest httpServletRequest) {
         log.info("事中门诊预警请求报文:{}", JSON.toJSONString(midIncidentWarningVO));
+        if(CollectionUtil.isNotEmpty(midIncidentWarningVO.getDiagnoses())){
+            for(DiagnosesVO diagnosesVO : midIncidentWarningVO.getDiagnoses()){
+                if(StringUtils.isBlank(diagnosesVO.getDiagnose_code())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "diagnoses.diagnose_code诊断编码不能为空");
+                }
+                if(StringUtils.isBlank(diagnosesVO.getDiagnose_desc())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "diagnoses.diagnose_desc诊断名称不能为空");
+                }
+            }
+
+            for(AdviceDetailsVO adviceDetailsVO : midIncidentWarningVO.getAdvice_details()){
+                if(StringUtils.isBlank(adviceDetailsVO.getProject_code())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.project_code 医嘱项目明细医院项目编码不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getProject_name())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.project_name 医嘱项目明细医院项目名称不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getMedical_project_code())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.medical_project_code 医嘱项目明细医保项目编码不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getMedical_project_name())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.medical_project_name 医嘱项目明细医保项目名称不能为空");
+                }
+                if(null == adviceDetailsVO.getPrice() || adviceDetailsVO.getPrice()<0){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.price 医嘱项目明细单价不能为空或者小于0");
+                }
+                if(null == adviceDetailsVO.getAmount() || adviceDetailsVO.getAmount()<0){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.amount 医嘱项目明细金额不能为空或者小于0");
+                }
+                if(null == adviceDetailsVO.getQuantity() || adviceDetailsVO.getQuantity()<0){
+                    adviceDetailsVO.setQuantity(1);
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getRecipe_no())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.recipe_no 医嘱项目明细处方号不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getExpense_category())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.expense_category 医嘱项目明细费用类别不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getChange_class())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.change_class 医嘱项目明细收费项目等级不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getProject_use_time())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.project_use_time 医嘱项目明细项目使用时间不能为空");
+                }
+                if(StringUtils.isBlank(adviceDetailsVO.getMedical_insurance_mark())){
+                    return Result.error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, "advice_details.medical_insurance_mark 医嘱项目明细是否医保不能为空");
+                }
+            }
+        }
         String ipStr = HttpUtils.getIPAddress(httpServletRequest);
         log.info("事中远端请求的服务ip地址:{}", ipStr);
         midIncidentWarningVO.setVisit_type("2");

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/AdviceDetailsVO.java

@@ -65,7 +65,7 @@ public class AdviceDetailsVO {
     @Positive(message = "单价必须是正数")
     private Double price;//	true	float	单价,必须使用数值型,如”12.5”
     @Positive(message = "数量必须是正数")
-    private Float quantity;//	true	float	耗材、诊疗、发药数量,必须使用数值型,如”10”
+    private Integer quantity;//	true	float	耗材、诊疗、发药数量,必须使用数值型,如”10”
     private String dose_unit;//	true	char	单位,发药单位,例如:瓶、盒、片等,和发药数量对应
     @NotBlank(message = "医嘱明细项目金额不能为空")
     private Double amount;//	true	float	金额,必须使用数值型,如”50.5”

+ 2 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/DiagnosesVO.java

@@ -12,7 +12,8 @@ public class DiagnosesVO {
     private String diagnose_code;   //医院内部诊断编码
     @NotBlank(message = "医院内部诊断描述不能为空")
     private String diagnose_desc;   //医院内部诊断描述
-
+    @NotBlank(message = "医保诊断编码不能为空")
     private String medical_diagnose_code; //true	char	医保诊断代码(使用医保下发诊断代码(ICD-10))
+    @NotBlank(message = "医保诊断名称不能为空")
     private String medical_diagnose_name; //true	char	医保诊断描述
 }

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentVisitDetailLog.java

@@ -156,7 +156,7 @@ public class MidIncidentVisitDetailLog implements Serializable {
 	/**数量;数量,必须使用数值型,如”10”*/
 	@Excel(name = "数量;数量,必须使用数值型,如”10”", width = 15)
     @ApiModelProperty(value = "数量;数量,必须使用数值型,如”10”")
-    private java.lang.Float medicalNumber;
+    private java.lang.Integer medicalNumber;
 	/**单位*/
 	@Excel(name = "单位", width = 15)
     @ApiModelProperty(value = "单位")

+ 6 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/entity/MidIncidentWarningVO.java

@@ -5,6 +5,8 @@ import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
 import java.util.List;
 
 /**
@@ -63,6 +65,8 @@ public class MidIncidentWarningVO {
      */
     private String discharge_status;
     @NotEmpty(message = "诊断编码不能为空")
+    @NotNull(message = "诊断编码不能为空")
+    @Size(min = 1, message = "至少给一条诊断编码")
     private List<DiagnosesVO> diagnoses;	//true	Array	诊断信息(多项)(内容说明参见Diagnoses(诊断信息说明)
     @NotBlank(message = "医师编号不能为空")
     private String doctor_code;//	true	char	医师编号
@@ -95,6 +99,8 @@ public class MidIncidentWarningVO {
      */
     private Double totoal_amount;
     @NotEmpty(message = "医嘱明细不能为空")
+    @NotNull(message = "医嘱明细不能为空")
+    @Size(min = 1, message = "至少给一条医嘱明细")
     private List<AdviceDetailsVO> advice_details;//	true	Array	医嘱明细信息(多项)(内容说明参见advice_details(医嘱明细信息说明))
     /**
      * 内部使用