Explorar o código

增加评分详情相关、病案指标接口

chengyao %!s(int64=3) %!d(string=hai) anos
pai
achega
d6d7e8348d
Modificáronse 27 ficheiros con 3493 adicións e 14 borrados
  1. 172 0
      common/src/main/java/com/lantone/common/constant/QualityContent.java
  2. 36 0
      common/src/main/java/com/lantone/common/constant/TimeContent.java
  3. 55 0
      common/src/main/java/com/lantone/common/enums/CheckerRoleEnum.java
  4. 3 3
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/entity/report/IndexRelevance.java
  5. 3 3
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/entity/report/IndexResult.java
  6. 1 1
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/entity/report/ManagementInfo.java
  7. 30 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/DoctorAdviceFacade.java
  8. 81 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/LisInfoFacade.java
  9. 49 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/PacsInfoFacade.java
  10. 26 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/QcresultInfoFacade.java
  11. 10 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/QuestionInfoFacade.java
  12. 54 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/BehospitalInfoMapper.java
  13. 9 1
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/DoctorAdviceMapper.java
  14. 12 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/IndexResultMapper.java
  15. 18 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/LisInfoMapper.java
  16. 14 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/PacsInfoMapper.java
  17. 5 1
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/QuestionInfoMapper.java
  18. 485 0
      dblayer-mbg/src/main/resources/mapper/report/BehospitalInfoMapper.xml
  19. 94 0
      dblayer-mbg/src/main/resources/mapper/report/DoctorAdviceMapper.xml
  20. 27 0
      dblayer-mbg/src/main/resources/mapper/report/IndexResultMapper.xml
  21. 250 0
      dblayer-mbg/src/main/resources/mapper/report/LisInfoMapper.xml
  22. 115 0
      dblayer-mbg/src/main/resources/mapper/report/PacsInfoMapper.xml
  23. 13 1
      dblayer-mbg/src/main/resources/mapper/report/QuestionInfoMapper.xml
  24. 1512 0
      report-service/src/main/java/com/lantone/report/facade/MrIndicatorManagementFacade.java
  25. 322 1
      report-service/src/main/java/com/lantone/report/facade/MrInfoManagementFacade.java
  26. 44 0
      report-service/src/main/java/com/lantone/report/web/MrIndicatorManagementController.java
  27. 53 3
      report-service/src/main/java/com/lantone/report/web/MrInfoManagementController.java

+ 172 - 0
common/src/main/java/com/lantone/common/constant/QualityContent.java

@@ -0,0 +1,172 @@
+package com.lantone.common.constant;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 新指标常用常量
+ */
+public class QualityContent {
+    public static final String recordNumber = "关联首页表质控病历人数";
+    public static final String NoRecordNumberId = "无病案首页病历ID";
+    public static final String DISCHARGED_PATIENTS = "出院人数";
+    public static final String NUMBER_OF_HOSPITAL = "入院人数";
+    public static final String NO_RECORD_OPERATION = "无病案首页手术患者";
+    public static final String NO_RECORD_OPERATION_PATHOLOGY = "无病案首页手术病理患者";
+    public static final double pathologyFee = 68.00;
+    /**
+     * 是否需要用到医嘱的指标名称
+     */
+    public static List<String> NO_MEDICAL_ADVICE = Arrays.asList("",
+            "入院记录24小时内完成率","出院记录24小时内完成率","病案首页24小时内完成率"
+    );
+    public static List<String> NEED_MEDICAL_ADVICE = Arrays.asList("",
+            "手术记录24小时内完成率","手术相关记录完成率","患者抢救记录及时完成率","临床用血相关记录符合率","CT检查记录符合率","MRI检查记录符合率","病理检查记录符合率","抗菌药物使用记录符合率","恶性肿瘤化学治疗记录符合率"
+    );
+    /**
+     * 关联首页无code需要去医嘱查询指标
+     */
+    public static List<String> NORecord_NEED_MEDICAL_ADVICE = Arrays.asList("",
+            "手术记录24小时内完成率","病理检查记录符合率","抗菌药物使用记录符合率"
+    );
+    /**
+     * 所有指标名称
+     */
+
+    public static final String QB = "";
+    public static final String ZYBA_CYHZ = "住院病案管理人员月均负担出院患者病历数";
+    public static final String BABM_CYHZ = "病案编码人员月均负担出院患者病历数";
+    public static final String MZBA_CYHZ = "门诊病案管理人员月均负担门诊患者病历数";
+    public static final String RYJL_24H_WCL = "入院记录24小时内完成率";
+    public static final String CYJL_24H_WCL = "出院记录24小时内完成率";
+    public static final String BASY_24H_WCL = "病案首页24小时内完成率";
+    public static final String SSJL_24H_WCL = "手术记录24小时内完成率";
+    public static final String CT_JCJL_FHL = "CT检查记录符合率";
+    public static final String MR_JCJL_FHL = "MRI检查记录符合率";
+    public static final String BL_JCJL_FHL = "病理检查记录符合率";
+    public static final String XJPY_JCJL_FHL = "细菌培养检查记录符合率";
+    public static final String KJYW_SY_FHL = "抗菌药物使用记录符合率";
+    public static final String EXZL_HXZL_FHL = "恶性肿瘤化学治疗记录符合率";
+    public static final String EXZL_FSZL_FHL = "恶性肿瘤放射治疗记录符合率";
+    public static final String SS_XGJL_WCL = "手术相关记录完成率";
+    public static final String ZRW_XGJL_WCL = "植入物相关记录符合率";
+    public static final String LCYX_XGJL_WCL = "临床用血相关记录符合率";
+    public static final String YSCF_JL_WCL = "医师查房记录完成率";
+    public static final String HZQJ_JLJS_WCL = "患者抢救记录及时完成率";
+    public static final String CCHZ_2DAY_GDL = "出院患者病历2日归档率";
+    public static final String CCHZ_GD_WZL = "出院患者病历归档完整率";
+    public static final String BHL_FZ_FSL = "不合理复制病历发生率";
+    public static final String ZQTYS_GF_QSL = "知情同意书规范签署率";
+    public static final String JJBLL = "甲级病历率";
+    /**
+     * 触发规则指标
+     */
+    public static final String RYJLWWC_24H = "residentAdmitNote";
+    public static final String SSJLWCC_24H = "operationNote";
+    public static final String CYJLWWC_24H = "dischargeRecord";
+    public static final String BASYWWC_24H = "medicalRecord";
+    /**
+     * 医嘱类型
+     */
+    public static final String STANDING_ORDER = "长期医嘱";
+    public static final String STAT_ORDER = "临时医嘱";
+    /**
+     * 医嘱状态
+     */
+    public static final String EXECUTE_ORDER = "执行";
+    public static final String IN_USE = "在用";
+    public static final String CANCELLATION_ORDER = "作废";
+    /**
+     * 医嘱判断相关
+     */
+    public static final String STOP = "停";
+    public static final String LAST = "前一次";
+    public static final String COUNTERMAND = "取消";
+    public static final String PAUSE = "暂停";
+    public static final String BACTERIAL_CULTURE = "细菌培养";
+    /**
+     * 病理判断
+     */
+    public static String[][] BL_LIST = {{"病理"}};
+
+    /**
+     * 医嘱CT相关
+     */
+    public static String[][] CT_LIST = {{"CT"},{"X线"}};
+    public static String[][] CT_REGULATION = {{"ATCH"},{"TCT"},{"HCT"},{"OCT"},{"NCT"},{"LCT"},{"ACT"},{"取消"},{"暂停"}};
+
+    /**
+     * 医嘱手术相关
+     */
+    public static String[][] OPERATION_LIST={
+            {"手术"}
+    };
+    public static String[][] OPERATION_ARG={
+            {"非手术"},
+            {"手术室"},
+            {"手术","取消"},
+            {"暂停","手术"},
+            {"静脉穿刺置管术"},
+            {"停"},
+            {"前一次"},
+            {"特殊病人手术使用一次性卫生材料"},
+            {"人免疫缺陷病毒抗体检测免费"}
+    };
+
+
+    /**
+     * 医嘱MR相关
+     */
+    public static final String MR = "MR";
+    public static String[][] MR_LIST = {{"MR"},{"磁共振"}};
+    public static String[][] MR_REGULATION = {{"IMRT"},{"mrs评分"},{"取消"}};
+    /**
+     * 抗菌药物目录
+     */
+    public static List<String> Antimicrobial_Drug_List = Arrays.asList(
+            "呋喃妥因", "呋喃唑酮", "盐酸小檗碱", "大蒜素", "鱼腥草素钠", "磺胺嘧啶", "甲氧苄啶", "复方磺胺甲恶唑",
+            "磺胺嘧啶银", "磺胺嘧啶锌", "盐酸四环素", "盐酸土霉素", "盐酸多西环素", "盐酸米诺环素", "盐酸美他环素", "硫酸庆大霉素", "硫酸链霉素"
+    );
+    /**
+     * 化疗药物目录
+     */
+    public static List<String> Chemotherapy_Drug_List = Arrays.asList(
+            "注射用盐酸表柔比星", "注射用盐酸吡柔比星", "注射用环磷酰胺", "卡铂注射液", "注射用奥沙利铂", "注射用阿糖胞苷", "注射用盐酸吉西他滨", "注射用甲氨蝶呤",
+            "注射用盐酸伊立替康", "紫杉醇注射液", "注射用培美曲塞二钠", "高三尖杉酯碱注射液", "注射用硫酸长春地辛", "多西他赛注射液", "注射用曲普瑞林", "注射用盐酸博来霉素", "注射用地西他滨",
+            "盐酸伊立替康注射液", "注射用盐酸托泊替康", "注射用氟尿嘧啶", "注射用达卡巴嗪", "醋酸戈舍瑞林缓释植入剂", "顺铂注射液"
+    );
+
+    /**
+     * 抢救药物  维护修改
+     */
+
+    public static List<String> RESCUEDRUGLIST = Arrays.asList(
+            "尼可刹米","可拉明","盐酸洛贝林","山梗菜碱","肾上腺素","阿拉明", "重酒石酸间羟胺", "多巴胺", "利血平", "25%硫酸镁注射液", "垂体后叶素","注射用血凝酶", "阿托品","氯解磷定注射液","盐酸纳洛酮","异丙嗪", "非那更","地西泮", "安定","20%甘露醇");
+
+
+    /**
+     *   临床用血
+     */
+    public static List<String> BLOODLIST = Arrays.asList(
+            "交叉配血","血交叉");
+
+    /**
+     * 用于代码判断指标1、2、3执行路径
+     */
+    public static List<String> FOURSTR = Arrays.asList(
+            "住院病案管理人员月均负担出院患者病历数", "病案编码人员月均负担出院患者病历数", "门诊病案管理人员月均负担门诊患者病历数");
+
+    // 放疗药物目录
+    public static List<String> radiotherapyDrugList = Arrays.asList(
+            "艾迪注射液", "康艾注射液", "康莱特注射液", "鸦胆子油乳注射液", "榄香烯乳注射液", "香菇多糖", "胎盘多肽注射液", "甘露聚糖肽注射液",
+            "脾多肽注射液", "E巨和粒", "欣粒生", "特尔津", "日达仙注射剂", "益比奥", "特比澳", "胸腺五肽", "古拉定","天晴甘美", "易善复", "己糖神经节苷脂钠",
+            "核糖核酸II", "参芪扶正注射液", "甘露醇注射液", "兰索拉唑", "奥西康", "卡络磺钠注射液", "维生素K1注射液", "氨甲苯酸注射液", "酚磺乙胺注射液",
+            "盐酸甲氧氯普胺注", "甲磺酸托烷司琼注射液", "伊班膦酸钠注射液", "唑来膦酸", "盐酸氨溴索注射液","氨茶碱注射液", "孟鲁司特钠片", "阿托伐他汀钙片",
+            "阿卡波糖片", "盐酸二甲双胍片", "瑞格列奈片", "格列齐特片","拉米夫定片","耐信","益血生胶囊","地榆升白片", "鲨肝醇片", "复方皂矾丸", "加巴喷丁胶囊",
+            "塞来昔布胶囊", "氨酚曲马多片", "盐酸羟考酮缓释片","硫酸吗啡缓释片", "盐酸吗啡片","复方甲氧那明胶囊","醋酸甲地孕酮分散","枸橼酸托瑞米芬片","标准桃金娘油肠溶",
+            "甲氧氯普胺片","多潘立酮片"
+    );
+}
+
+
+

+ 36 - 0
common/src/main/java/com/lantone/common/constant/TimeContent.java

@@ -0,0 +1,36 @@
+package com.lantone.common.constant;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 新指标常用常量
+ */
+public class TimeContent {
+
+    public static List<String> HolidaysTimeList = Arrays.asList(
+            "2021-01-01", "2021-01-02", "2021-01-03",//元旦
+            "2021-02-11", "2021-02-12", "2021-02-13", "2021-02-14", "2021-02-15", "2021-02-16", "2021-02-17",//春节
+            "2021-04-03", "2021-04-04", "2021-04-05",//清明节
+            "2021-05-01",  "2021-05-02", "2021-05-03", "2021-05-04", "2021-05-05",//劳动节
+            "2021-06-12",  "2021-06-13", "2021-06-14",//端午节
+            "2021-09-19", "2021-09-20", "2021-09-21",//中秋节
+            "2021-10-01", "2021-10-02", "2021-10-03", "2021-10-04", "2021-10-05", "2021-10-06", "2021-10-07",//国庆节
+
+            "2021-01-09", "2021-01-10", "2021-01-16", "2021-01-17", "2021-01-23", "2021-01-24", "2021-01-30", "2021-01-31",//一月周末假日
+            "2021-02-06", "2021-02-21", "2021-02-27", "2021-02-28", //二月周末假日
+            "2021-03-06", "2021-03-07", "2021-03-13", "2021-03-14", "2021-03-20", "2021-03-21", "2021-03-27", "2021-03-28",//三月周末假日
+            "2021-04-10", "2021-04-11", "2021-04-17", "2021-04-18", "2021-04-24", //四月周末假日
+            "2021-05-09", "2021-05-15", "2021-05-16", "2021-05-22", "2021-05-23", "2021-05-29", "2021-05-30",//五月周末假日
+            "2021-06-05", "2021-06-06", "2021-06-19", "2021-06-20", "2021-06-26", "2021-06-27",//六月周末假日
+            "2021-07-03", "2021-07-04", "2021-07-10", "2021-07-11", "2021-07-17", "2021-07-18", "2021-07-24", "2021-07-25","2021-07-31",//七月周末假日
+            "2021-08-01", "2021-08-07", "2021-08-08", "2021-08-14", "2021-08-15", "2021-08-21", "2021-08-22", "2021-08-28", "2021-08-29",//八月周末假日
+            "2021-09-04", "2021-09-05", "2021-09-11", "2021-09-12", "2021-09-25",//九月周末假日
+            "2021-10-10", "2021-10-16", "2021-10-17", "2021-10-23", "2021-10-24", "2021-10-30", "2021-10-31", //十月周末假日
+            "2021-11-06", "2021-11-07", "2021-11-13", "2021-11-14", "2021-11-20", "2021-11-21", "2021-11-27", "2021-11-28",//十一月周末假日
+            "2021-12-04", "2021-12-06", "2021-12-11", "2021-12-12", "2021-12-18", "2021-12-19", "2021-12-25", "2021-12-26" //十二周末假日
+    );
+}
+
+
+

+ 55 - 0
common/src/main/java/com/lantone/common/enums/CheckerRoleEnum.java

@@ -0,0 +1,55 @@
+package com.lantone.common.enums;
+
+
+import com.lantone.common.constant.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum CheckerRoleEnum implements KeyedNamed {
+    DEPT_SUPERVISOR(4, "临床科室监管人员"),
+    DEPT_GENERAL(7, "临床科室质控人员"),
+    QUAT_SUPERVISOR(5, "质控科监管人员"),
+    QUAT_GENERAL(8, "质控科质控人员"),
+    HOSP_SUPERVISOR(6, "院级监管人员"),
+    HOSP_GENERAL(9, "院级质控人员");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    CheckerRoleEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static CheckerRoleEnum getEnum(int key) {
+        for (CheckerRoleEnum item : CheckerRoleEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        CheckerRoleEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 3 - 3
dblayer-mbg/src/main/java/com/lantone/dblayermbg/entity/report/IndexRelevance.java

@@ -41,7 +41,7 @@ public class IndexRelevance implements Serializable {
      * 医院ID
      */
     @TableField("hospital_id")
-    private Integer hospitalId;
+    private String hospitalId;
 
     /**
      * 病人病历号
@@ -50,10 +50,10 @@ public class IndexRelevance implements Serializable {
     private String behospitalCode;
 
     @TableField("start_date")
-    private Date startDate;
+    private String startDate;
 
     @TableField("end_date")
-    private Date endDate;
+    private String endDate;
 
     /**
      * 是否删除,N:未删除,Y:删除

+ 3 - 3
dblayer-mbg/src/main/java/com/lantone/dblayermbg/entity/report/IndexResult.java

@@ -29,7 +29,7 @@ public class IndexResult implements Serializable {
      * 医院ID
      */
     @TableField("hospital_id")
-    private Integer hospitalId;
+    private String hospitalId;
 
     /**
      * 入院记录24小时内完成率--分母
@@ -122,10 +122,10 @@ public class IndexResult implements Serializable {
     private Double fileCompleteResult;
 
     @TableField("start_date")
-    private Date startDate;
+    private String startDate;
 
     @TableField("end_date")
-    private Date endDate;
+    private String endDate;
 
     /**
      * 是否删除,N:未删除,Y:删除

+ 1 - 1
dblayer-mbg/src/main/java/com/lantone/dblayermbg/entity/report/ManagementInfo.java

@@ -53,7 +53,7 @@ public class ManagementInfo implements Serializable {
      * 单位时间内管理人员总人数
      */
     @TableField("work_person")
-    private String workPerson;
+    private Double workPerson;
 
     /**
      * 是否删除,N:未删除,Y:删除

+ 30 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/DoctorAdviceFacade.java

@@ -1,8 +1,15 @@
 package com.lantone.dblayermbg.facade.report;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.DoctorAdviceDTO;
+import com.lantone.common.vo.report.DoctorAdviceVO;
 import com.lantone.dblayermbg.service.impl.report.DoctorAdviceServiceImpl;
 import org.springframework.stereotype.Component;
 
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 /**
  * <p>
  * 表名:med_doctor_advice 业务类
@@ -11,4 +18,27 @@ import org.springframework.stereotype.Component;
 @Component
 public class DoctorAdviceFacade extends DoctorAdviceServiceImpl {
 
+
+    public IPage<DoctorAdviceDTO> getPage(DoctorAdviceVO doctorAdviceVO) {
+
+        List<String> infos = this.baseMapper.getInfo(doctorAdviceVO.getHospitalId(), doctorAdviceVO.getBehospitalCode());
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("医嘱:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String target : targetInfos) {
+                        if (!"医嘱".equals(target)) {
+                            infoSet.add(target);
+                        }
+                    }
+                }
+            }
+        }
+
+        IPage<DoctorAdviceDTO> page = this.baseMapper.getPage(doctorAdviceVO, infoSet);
+        return page;
+    }
+
 }

+ 81 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/LisInfoFacade.java

@@ -1,8 +1,19 @@
 package com.lantone.dblayermbg.facade.report;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.ExamineInfoDTO;
+import com.lantone.common.dto.report.ExamineSonInfoDTO;
+import com.lantone.common.vo.report.ExamineInfoVO;
+import com.lantone.common.vo.report.ExamineSonInfoVO;
 import com.lantone.dblayermbg.service.impl.report.LisInfoServiceImpl;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * <p>
  * 表名:med_lis_info 业务类
@@ -11,4 +22,74 @@ import org.springframework.stereotype.Component;
 @Component
 public class LisInfoFacade extends LisInfoServiceImpl {
 
+
+    public IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO) {
+
+        List<String> infos = this.baseMapper.getInfo(examineInfoVO.getHospitalId(), examineInfoVO.getBehospitalCode());
+
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("化验:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"化验".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+                    }
+                }
+            }
+        }
+
+        //获取病人进出院时间
+        Map<String, Object> timeMap = this.baseMapper.getTime(examineInfoVO.getBehospitalCode());
+        if (null != timeMap) {
+            if(null !=  timeMap.get("behospital_date")){
+                Date behospital_date = (Date) timeMap.get("behospital_date");
+                examineInfoVO.setBehospitalDate(behospital_date);
+            }
+            if(null != timeMap.get("leave_hospital_date")){
+                Date leaveHospitalDate = (Date) timeMap.get("leave_hospital_date");
+                examineInfoVO.setLeaveHospitalDate(leaveHospitalDate);
+            }
+        }
+
+        String behospitalCode = examineInfoVO.getBehospitalCode();
+        if (2l == examineInfoVO.getHospitalId()) {
+            examineInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        //获取缺陷检验项目
+        List<String> badCheckInfo = this.baseMapper.getBadExamineInfo(examineInfoVO, infoSet);
+        //获取缺陷判别类别检查项目
+        IPage<ExamineInfoDTO> page = this.baseMapper.getExamineInfo(examineInfoVO, infoSet,badCheckInfo);
+        return page;
+    }
+
+    public IPage<ExamineSonInfoDTO> getExamineSonInfo(ExamineSonInfoVO examineSonInfoVO) {
+        List<String> infos = this.baseMapper.getInfo(examineSonInfoVO.getHospitalId(), examineSonInfoVO.getBehospitalCode());
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("化验:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"化验".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+                    }
+                }
+            }
+        }
+        String behospitalCode = examineSonInfoVO.getBehospitalCode();
+        if (2l == examineSonInfoVO.getHospitalId()) {
+            examineSonInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        IPage<ExamineSonInfoDTO> page = this.baseMapper.getExamineSonInfo(examineSonInfoVO, infoSet);
+        return page;
+    }
+
 }

+ 49 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/PacsInfoFacade.java

@@ -1,7 +1,15 @@
 package com.lantone.dblayermbg.facade.report;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.CheckInfoDTO;
+import com.lantone.common.vo.report.CheckInfoVO;
 import com.lantone.dblayermbg.service.impl.report.PacsInfoServiceImpl;
 import org.springframework.stereotype.Component;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -11,4 +19,45 @@ import org.springframework.stereotype.Component;
 @Component
 public class PacsInfoFacade extends PacsInfoServiceImpl {
 
+    public IPage<CheckInfoDTO> getCheckInfo(CheckInfoVO checkInfoVO) {
+
+        List<String> infos = this.baseMapper.getInfo(checkInfoVO.getHospitalId(), checkInfoVO.getBehospitalCode());
+
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("检查:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"检查".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+
+                    }
+
+                }
+            }
+        }
+
+        //获取病人进出院时间
+        Map<String, Object> timeMap = this.baseMapper.getTime(checkInfoVO.getBehospitalCode());
+        if (null != timeMap) {
+            if(null != timeMap.get("behospital_date")){
+                Date behospital_date = (Date) timeMap.get("behospital_date");
+                checkInfoVO.setBehospitalDate(behospital_date);
+            }
+            if(null != timeMap.get("leave_hospital_date")){
+                Date leaveHospitalDate = (Date) timeMap.get("leave_hospital_date");
+                checkInfoVO.setLeaveHospitalDate(leaveHospitalDate);
+            }
+        }
+        String behospitalCode = checkInfoVO.getBehospitalCode();
+        if(2l == checkInfoVO.getHospitalId()){
+            checkInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        IPage<CheckInfoDTO> page = this.baseMapper.getCheckInfo(checkInfoVO, infoSet);
+        return page;
+    }
 }

+ 26 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/QcresultInfoFacade.java

@@ -1,5 +1,11 @@
 package com.lantone.dblayermbg.facade.report;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.lantone.common.dto.report.QcResultDTO;
+import com.lantone.common.enums.IsDeleteEnum;
+import com.lantone.common.util.BeanUtil;
+import com.lantone.common.vo.report.GetDetailVO;
+import com.lantone.dblayermbg.entity.report.QcresultInfo;
 import com.lantone.dblayermbg.service.impl.report.QcresultInfoServiceImpl;
 import org.springframework.stereotype.Component;
 
@@ -10,5 +16,25 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class QcresultInfoFacade extends QcresultInfoServiceImpl {
+    /**
+     * 获取评分主表信息
+     *
+     * @param getDetailVO
+     * @return
+     */
+    public QcResultDTO getByBehospitalCode(GetDetailVO getDetailVO) {
+        QcResultDTO res = new QcResultDTO();
+        QcresultInfo qcresultInfo = this.getOne(new QueryWrapper<QcresultInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", getDetailVO.getHospitalId())
+                .eq("behospital_code", getDetailVO.getBehospitalCode()), false
+        );
+        if (qcresultInfo != null) {
+            BeanUtil.copyProperties(qcresultInfo, res);
+        } else {
+            return null;
+        }
+        return res;
+    }
 
 }

+ 10 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/QuestionInfoFacade.java

@@ -1,8 +1,13 @@
 package com.lantone.dblayermbg.facade.report;
 
+import com.lantone.common.dto.report.QuestionEntryDTO;
+import com.lantone.common.util.EntityUtil;
 import com.lantone.dblayermbg.service.impl.report.QuestionInfoServiceImpl;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 表名:qc_question_info 业务类
@@ -11,4 +16,9 @@ import org.springframework.stereotype.Component;
 @Component
 public class QuestionInfoFacade extends QuestionInfoServiceImpl {
 
+    public Map<Long, List<QuestionEntryDTO>> getByCaseEntryIdsFac(Map map) {
+        List<QuestionEntryDTO> questionEntryDTOList = this.getBaseMapper().getByCaseEntryIds(map);
+        return  EntityUtil.makeEntityListMap(questionEntryDTOList, "casesEntryId");
+    }
+
 }

+ 54 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/BehospitalInfoMapper.java

@@ -10,14 +10,17 @@ import com.lantone.common.dto.report.HomePageImproveDTO;
 import com.lantone.common.dto.report.HomePageNumDTO;
 import com.lantone.common.dto.report.LevelStatisticsDTO;
 import com.lantone.common.dto.report.LevelStatisticsTZDTO;
+import com.lantone.common.dto.report.MedManageParamsDTO;
 import com.lantone.common.dto.report.MedicalCheckDTO;
 import com.lantone.common.dto.report.MedicalCheckExportDTO;
 import com.lantone.common.dto.report.MedicalCheckIdNameDTO;
+import com.lantone.common.dto.report.MsgDTO;
 import com.lantone.common.dto.report.NumDTO;
 import com.lantone.common.dto.report.QcResultShortDTO;
 import com.lantone.common.dto.report.QualityControlDTO;
 import com.lantone.common.dto.report.ReBeHosMergeDTO;
 import com.lantone.common.dto.report.UnModifyMRDetailDTO;
+import com.lantone.common.vo.report.AnalyzeVO;
 import com.lantone.common.vo.report.BehospitalPageVO;
 import com.lantone.common.vo.report.CaseScoreVO;
 import com.lantone.common.vo.report.EntryStatisticsVO;
@@ -26,6 +29,7 @@ import com.lantone.common.vo.report.FilterMedicalCheckVO;
 import com.lantone.common.vo.report.FilterOrderVO;
 import com.lantone.common.vo.report.FilterUnModifyMRVO;
 import com.lantone.common.vo.report.FilterVO;
+import com.lantone.common.vo.report.MedIndexFilterVO;
 import com.lantone.common.vo.report.QcResultPageVO;
 import com.lantone.common.vo.report.QcResultShortPageVO;
 import com.lantone.common.vo.report.ReBeHosPageVO;
@@ -33,6 +37,7 @@ import com.lantone.dblayermbg.entity.report.BehospitalInfo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -322,4 +327,53 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    public List<MsgDTO> getMsg(AnalyzeVO analyzeVO);
+
+    /**
+     * 病理CT/MR触发多规则人数
+     * @param filterVO
+     * @return
+     */
+    public Map<String,Long> triggeringRules(@Param("filterVO") FilterVO filterVO);
+
+    /**
+     * 病案管理指标获取基础数据
+     *
+     * @param timeVo
+     * @return
+     */
+    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo);
+
+    /**
+     * 手术费,抗菌药物,手术和病理费等含有人数
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<Map<String, String>> selectOperationNum(@Param("filterVO") FilterVO filterVO);
+
+    /**
+     * 病案管理规则质控病历参数查询
+     *
+     * @param filterVO
+     * @return
+     */
+
+    public List<MedManageParamsDTO> getMedManageParams(FilterVO filterVO);
+
+    /**
+     * 病案首页关联的出院病历
+     * @param filterVO
+     * @return
+     */
+    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
+
+    /**
+     * 首页恶性肿瘤人数
+     * @param filterVO
+     * @return
+     */
+    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO);
+
+
 }

+ 9 - 1
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/DoctorAdviceMapper.java

@@ -1,7 +1,14 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.DoctorAdviceDTO;
+import com.lantone.common.vo.report.DoctorAdviceVO;
 import com.lantone.dblayermbg.entity.report.DoctorAdvice;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -9,5 +16,6 @@ import com.lantone.dblayermbg.entity.report.DoctorAdvice;
  * </p>
  */
 public interface DoctorAdviceMapper extends BaseMapper<DoctorAdvice> {
-
+    IPage<DoctorAdviceDTO> getPage(@Param("doctorAdviceVO") DoctorAdviceVO doctorAdviceVO, @Param("infos") Set<String> infos);
+    List<String> getInfo(@Param("hospitalId")Long hospitalId, @Param("behospitalCode")String behospitalCode);
 }

+ 12 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/IndexResultMapper.java

@@ -1,7 +1,11 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.lantone.common.vo.report.FilterVO;
 import com.lantone.dblayermbg.entity.report.IndexResult;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * <p>
@@ -9,5 +13,13 @@ import com.lantone.dblayermbg.entity.report.IndexResult;
  * </p>
  */
 public interface IndexResultMapper extends BaseMapper<IndexResult> {
+    /**
+     * 指标分母人数
+     * @param filterVO
+     * @return
+     */
+    public Map<String, Double> medicalRecordIndicator(@Param("filterVO") FilterVO filterVO);
+
+
 
 }

+ 18 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/LisInfoMapper.java

@@ -1,7 +1,17 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.ExamineInfoDTO;
+import com.lantone.common.dto.report.ExamineSonInfoDTO;
+import com.lantone.common.vo.report.ExamineInfoVO;
+import com.lantone.common.vo.report.ExamineSonInfoVO;
 import com.lantone.dblayermbg.entity.report.LisInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -9,5 +19,13 @@ import com.lantone.dblayermbg.entity.report.LisInfo;
  * </p>
  */
 public interface LisInfoMapper extends BaseMapper<LisInfo> {
+    Map<String, Object> getTime(@Param("behospitalCode") String behospitalCode);
+
+    List<String> getBadExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos);
+
+    IPage<ExamineInfoDTO> getExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos, @Param("badCheckInfo") List<String> badCheckInfo);
+
+    List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
 
+    IPage<ExamineSonInfoDTO> getExamineSonInfo(@Param("examineSonInfoVO") ExamineSonInfoVO examineSonInfoVO, @Param("infos") Set<String> infos);
 }

+ 14 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/PacsInfoMapper.java

@@ -1,7 +1,15 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.CheckInfoDTO;
+import com.lantone.common.vo.report.CheckInfoVO;
 import com.lantone.dblayermbg.entity.report.PacsInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -9,5 +17,11 @@ import com.lantone.dblayermbg.entity.report.PacsInfo;
  * </p>
  */
 public interface PacsInfoMapper extends BaseMapper<PacsInfo> {
+    Map<String,Object> getTime(@Param("behospitalCode") String behospitalCode);
+
+
+    IPage<CheckInfoDTO> getCheckInfo(@Param("checkInfoVO") CheckInfoVO checkInfoVO, @Param("infos") Set<String> infos);
+
+    List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
 
 }

+ 5 - 1
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/QuestionInfoMapper.java

@@ -1,13 +1,17 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.lantone.common.dto.report.QuestionEntryDTO;
 import com.lantone.dblayermbg.entity.report.QuestionInfo;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 表名:qc_question_info Mapper接口
  * </p>
  */
 public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
-
+    public List<QuestionEntryDTO> getByCaseEntryIds(Map map);
 }

+ 485 - 0
dblayer-mbg/src/main/resources/mapper/report/BehospitalInfoMapper.xml

@@ -7039,4 +7039,489 @@
         AND f1.behDeptName = f2.behDeptName
     </select>
 
+    <select id="getMsg" resultType="com.lantone.common.dto.report.MsgDTO">
+        SELECT a.*, u.linkman
+        FROM
+        (
+        SELECT DISTINCT b.`name` model_name,c.score,c.msg,c.cases_entry_id,c.is_reject,c.id id,c.info, a.cases_id cases_id, d.score cases_score,
+        b.id model_id, a.name standard_msg, c.opt_type, c.grade_type,
+         c.gmt_create, c.gmt_modified, c.modifier,c.is_deleted,c.explain_info as explainInfo,
+        a.type, a.drgs
+        FROM
+        `qc_cases_entry` a, qc_mode b, med_qcresult_detail c, qc_cases_hospital d
+        where a.is_deleted = 'N' and b.is_deleted = 'N' and d.is_deleted = 'N'
+        and a.id = c.cases_entry_id and a.mode_id = b.id
+        AND c.cases_id = d.cases_id and c.hospital_id = d.hospital_id
+        and c.hospital_id = #{hospitalId}
+        and c.behospital_code = #{behospitalCode}
+        order by b.order_no, c.grade_type desc, a.order_no) a
+        LEFT JOIN sys_user u  on u.id = a.modifier  and u.is_deleted = 'N'
+    </select>
+
+
+    <!--    关于触发规则不符合人数-->
+    <select id="triggeringRules"  resultType="java.util.Map">
+        SELECT
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type=5 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'operationNote',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 4 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'residentAdmitNote',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 6 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'dischargeRecord',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 7 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'medicalRecord',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type=8 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'CT',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 9 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'MR',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 10 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'operationPathologyFee',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 11 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'bacterialCulture',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 12 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'antibiosis',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 13 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'chemotherapyMalignantTumors',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 15 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'operationRecordNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 17 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'bloodNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 18 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'WardRoundNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 19 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'rescueNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 22 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'unreasonedCopyNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 14 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'tumorRadiationNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 16 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'implantsNum',
+        count(
+        DISTINCT
+        CASE
+        WHEN a.type = 23 THEN
+        a.behospital_code
+        ELSE
+        NULL
+        END
+        ) AS 'InformedNum'
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        a.hospital_id,
+        q.type
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        a.cases_entry_id,
+        a.hospital_id
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        c.cases_entry_id,
+        a.hospital_id
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        a.hospital_id
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.is_placefile = #{filterVO.isPlacefile}
+        <if test="filterVO.startDate != null and  filterVO.endDate != null">
+            <![CDATA[ and a.leave_hospital_date >= #{filterVO.startDate}]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
+        </if>
+        AND a.behospital_code = c.behospital_code
+        AND a.hospital_id = #{filterVO.hospitalId}
+        AND a.hospital_id = c.hospital_id
+        ) a
+        LEFT JOIN med_qcresult_detail c ON c.is_deleted = 'N'
+        AND a.behospital_code = c.behospital_code
+        AND a.hospital_id = c.hospital_id
+        ) a
+        JOIN qc_cases_entry d ON d.id = a.cases_entry_id
+        AND d.is_deleted = 'N'
+        ) a
+        JOIN qc_cases_relevance_entry q ON a.cases_entry_id = q.relevance_id
+        AND a.hospital_id = q.hospital_id
+        ) a
+        JOIN med_index_relevance r ON r.behospital_code = a.behospital_code
+        AND r.relevance_type = a.type
+        AND r.is_deleted = 'N'
+        AND a.hospital_id = r.hospital_id
+    </select>
+
+    <!--病案管理指标基础sql明细-->
+    <select id="getBaseIndex"   resultType="java.util.Map">
+        select
+        f1.firWorkNum,
+        f2.secWorkNum,
+        f3.thrWorkNum,
+        f3.forWorkNum,
+        f3.sixWorkNum
+        from (
+        SELECT count(DISTINCT a.behospital_code)  as firWorkNum
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        AND a.is_placefile = 1
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{lastStartDate}]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{lastEndDate}]]>
+        </if>)f1,
+        ( SELECT count(DISTINCT a.behospital_code) AS secWorkNum
+        FROM
+        med_outpatient_info a
+        WHERE
+        a.is_deleted = 'N'
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.visit_date >= #{lastStartDate}]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.visit_date <= #{lastEndDate}]]>
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>)f2,(
+        select
+        count(DISTINCT case when  <![CDATA[m.behospital_date >= #{startDate}]]>  and  <![CDATA[m.behospital_date <= #{endDate}]]>
+        and m.is_placefile = 0 then m.behospital_code else null end) as thrWorkNum,
+        count(DISTINCT case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]>  and  <![CDATA[m.leave_hospital_date <= #{endDate}]]>  and m.is_placefile = 1 then m.behospital_code else null end) as forWorkNum,
+        count(DISTINCT case when  <![CDATA[m.leave_hospital_date >= #{startDate}]]> and <![CDATA[m.leave_hospital_date <= #{endDate}]]> and m.is_placefile = 1 and m.level = '甲' then m.behospital_code else null end) as sixWorkNum
+        from(
+        SELECT DISTINCT a.*,b.level
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.behospital_code = b.behospital_code
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>)m
+        )f3
+    </select>
+
+    <!--  时间段出院,住院, 手术费,抗菌药物,手术和病理费等含有人数 -->
+    <select id="selectOperationNum"  resultType="java.util.Map">
+        select
+        d.behospital_code behospitalCode,
+        b.operation_fee operationFee,
+        b.pathology_fee pathologyFee,
+        b.antibiosis_fee antibiosisFee
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        a.hospital_id,
+        a.behospital_date,
+        a.leave_hospital_date
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.is_placefile = #{filterVO.isPlacefile}
+        <if test="filterVO.startDate != null and  filterVO.endDate != null">
+            <![CDATA[ and a.leave_hospital_date >= #{filterVO.startDate}]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
+        </if>
+        <![CDATA[ and  a.qc_type_id <>'0' ]]>
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = #{filterVO.hospitalId}
+        and a.behospital_code = c.behospital_code
+        ) d
+        JOIN med_home_page b ON b.behospital_code = d.behospital_code
+        AND d.hospital_id = b.hospital_id
+        AND b.is_deleted = 'N'
+    </select>
+
+    <!-- 病案管理规则质控缺陷病历总数查询-->
+    <select id="getMedManageParams"  resultType="com.lantone.common.dto.report.MedManageParamsDTO">
+        SELECT
+        f1.behospitalCode,
+        <if test="flagStr != null and flagStr == 1 ">
+            f2.rep_name as repName,
+        </if>
+        <if test="flagStr != null and flagStr == 2">
+            f3.da_item_name as daItemName,
+            f3.da_status AS daStatus,
+            f3.doctor_advice_type as doctorAdviceType,
+        </if>
+        <if test="flagStr != null and flagStr == 4 ">
+            f5.content as content,
+            f5.rec_title as recTitle,
+        </if>
+        f1.hospitalId
+        from(
+        SELECT DISTINCT
+        a.hospital_id as hospitalId,
+        a.behospital_code as behospitalCode
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND <![CDATA[a.leave_hospital_date >= #{startDate}]]>
+        AND  <![CDATA[a.leave_hospital_date <= #{endDate}]]>
+        AND  a.is_placefile = 1
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>)f1
+        <if test="flagStr != null and flagStr == 1 ">
+            join med_lis_info f2
+            on  f2.is_deleted = 'N'
+            AND f1.hospitalId = f2.hospital_id
+            AND f1.behospitalCode = f2.behospital_code
+        </if>
+        <if test="flagStr != null and flagStr == 2">
+            join  med_doctor_advice f3
+            on  f3.is_deleted = 'N'
+            AND f1.hospitalId = f3.hospital_id
+            AND f1.behospitalCode = f3.behospital_code
+        </if>
+        <if test="flagStr != null and flagStr == 3">
+            join  med_qcresult_detail f4
+            on  f4.is_deleted = 'N'
+            AND f1.hospitalId = f4.hospital_id
+            AND f1.behospitalCode = f4.behospital_code
+            AND f4.is_reject = 1
+        </if>
+        <if test="flagStr != null and flagStr == 4">
+            join  str_informed_consent f5
+            on  f5.is_deleted = 'N'
+            AND f1.hospitalId = f5.hospital_id
+            AND f1.behospitalCode = f5.behospital_code
+        </if>
+    </select>
+
+
+    <!--    跟病案首页关联的出院病历-->
+    <select id="getMedicalRecords"  resultType="java.util.Map">
+        SELECT
+        d.behospital_code,
+        d.behospital_date,
+        d.leave_hospital_date,
+        b.behospital_code AS b_code,
+        b.operation_fee,
+        b.antibiosis_fee,
+        b.pathology_fee
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        a.hospital_id,
+        a.behospital_date,
+        a.leave_hospital_date
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.behospital_code = c.behospital_code
+        AND a.hospital_id = #{filterVO.hospitalId}
+        AND a.is_placefile = #{filterVO.isPlacefile}
+        AND a.hospital_id = c.hospital_id
+        AND a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        <![CDATA[ and  a.qc_type_id <>'0' ]]>
+        <if test="filterVO.startDate != null and  filterVO.endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{filterVO.startDate}]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
+        </if>
+        ) d
+        LEFT JOIN med_home_page b ON b.behospital_code = d.behospital_code
+        AND d.hospital_id = b.hospital_id
+        AND b.is_deleted = 'N'
+        where ISNULL(b.behospital_code)
+    </select>
+
+
+    <!--    首页恶性肿瘤-->
+    <select id="malignancy"  resultType="java.util.Map">
+        select
+        a.behospital_code,
+        a.hospital_id,
+        d.diagnose_name,
+        d.diagnose_type,
+        d.icd_code
+        from(
+        SELECT
+        d.behospital_code,
+        d.hospital_id,
+        b.home_page_id
+        FROM
+        (
+        SELECT
+        a.behospital_code,
+        a.hospital_id,
+        a.behospital_date,
+        a.leave_hospital_date
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.behospital_code = c.behospital_code
+        AND a.hospital_id =  #{filterVO.hospitalId}
+        AND a.is_placefile =  #{filterVO.isPlacefile}
+        AND a.hospital_id = c.hospital_id
+        AND a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        <![CDATA[ and  a.qc_type_id <>'0' ]]>
+        <if test="filterVO.startDate != null and  filterVO.endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{filterVO.startDate}]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
+        </if>
+        ) d
+        JOIN med_home_page b ON b.behospital_code = d.behospital_code
+        AND d.hospital_id = b.hospital_id
+        AND b.is_deleted = 'N'
+        )a join
+        med_home_diagnose_info d on a.hospital_id=d.hospital_id
+        where a.home_page_id =d.home_page_id
+        and d.is_deleted ='N'
+        and d.diagnose_name like '%恶性肿瘤%'
+        and d.icd_code like 'C%'
+    </select>
 </mapper>

+ 94 - 0
dblayer-mbg/src/main/resources/mapper/report/DoctorAdviceMapper.xml

@@ -2,4 +2,98 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.DoctorAdviceMapper">
 
+    <select id="getPage" resultType="com.lantone.common.dto.report.DoctorAdviceDTO">
+        select b.*
+        from(
+        SELECT
+        t.doctor_advice_id,
+        t.hospital_id,
+        t.behospital_code,
+        t.doctor_advice_type,
+        t.da_start_date,
+        t.da_stop_date,
+        t.da_item_name,
+        CONCAT( t.da_item_name, '(',DATE_FORMAT( t.da_start_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        t.da_prescription_type,
+        t.medicine_type,
+        t.dose,
+        t.dose_unit,
+        t.med_mode_type,
+        t.da_frequency,
+        t.doctor_name
+        FROM
+        `med_doctor_advice` t
+        where
+        t.is_deleted = 'N'
+        <if test="doctorAdviceVO.hospitalId != null">
+            and t.hospital_id = #{doctorAdviceVO.hospitalId}
+        </if>
+        <if test="doctorAdviceVO.medicineType != null and doctorAdviceVO.medicineType != '' and doctorAdviceVO.medicineType == 0"  >
+            and (t.medicine_type = "普药" or t.medicine_type = #{doctorAdviceVO.medicineType})
+        </if>
+        <if test="doctorAdviceVO.medicineType != null and doctorAdviceVO.medicineType != '' and doctorAdviceVO.medicineType == 1 "  >
+            and (t.medicine_type = "抗生素" or t.medicine_type = #{doctorAdviceVO.medicineType})
+        </if>
+        <if test="doctorAdviceVO.medicineType != null and doctorAdviceVO.medicineType != '' and doctorAdviceVO.medicineType == 2 "  >
+            and (t.medicine_type = "激素" or t.medicine_type = #{doctorAdviceVO.medicineType})
+        </if>
+        <if test="doctorAdviceVO.behospitalCode != null and doctorAdviceVO.behospitalCode != ''">
+            and t.behospital_code = #{doctorAdviceVO.behospitalCode}
+        </if>
+        <if test="doctorAdviceVO.doctorAdviceType != null and doctorAdviceVO.doctorAdviceType != ''">
+            and t.doctor_advice_type like CONCAT('%',#{doctorAdviceVO.doctorAdviceType},'%')
+        </if>
+        <if test="doctorAdviceVO.daItemName != null and doctorAdviceVO.daItemName != ''">
+            and t.da_item_name like CONCAT('%',#{doctorAdviceVO.daItemName},'%')
+        </if>
+        <if test="doctorAdviceVO.daStartDateStart != null">
+            <![CDATA[ and t.da_start_date >= #{doctorAdviceVO.daStartDateStart}]]>
+        </if>
+        <if test="doctorAdviceVO.daStartDateEnd != null">
+            <![CDATA[ and t.da_start_date < #{doctorAdviceVO.daStartDateEnd}]]>
+        </if>) b
+        where 1=1
+        <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1 = 2
+            </if>
+        </if>
+        <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and b.info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1=1
+            </if>
+        </if>
+    </select>
+
+
+    <!--    获取质控提示信息-->
+    <select id="getInfo" resultType="java.lang.String">
+        select b.info
+        from
+        med_behospital_info a,
+        med_qcresult_detail b
+        where
+        a.is_deleted = 'N'
+        and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id
+        and a.behospital_code = b.behospital_code
+        <if test="hospitalId != null">
+            and a.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and a.behospital_code = #{behospitalCode}
+        </if>
+    </select>
 </mapper>

+ 27 - 0
dblayer-mbg/src/main/resources/mapper/report/IndexResultMapper.xml

@@ -2,4 +2,31 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.IndexResultMapper">
 
+
+    <select id="medicalRecordIndicator" resultType="java.util.Map">
+         SELECT
+            COALESCE (sum(a.admission_result), 0) AS 'startCount',
+            COALESCE (sum(a.operation_result), 0) AS 'operationFeeNum',
+            COALESCE (sum(a.ct_result), 0) AS 'CTNum',
+            COALESCE (sum(a.mri_result), 0) AS 'MRNum',
+            COALESCE (sum(a.pathology_result), 0) AS 'operationPathologyFeeNum',
+            COALESCE (sum(a.germ_result), 0) AS 'bacterialCultureNum',
+            COALESCE (sum(a.antibiosis_result), 0) AS 'antibiosisFeeNum',
+            COALESCE (sum(a.tumor_chemistry_result),0) AS 'chemotherapyMalignantTumorsNum',
+            COALESCE (sum(a.tumor_radiation_result),0) AS 'tumor_radiation_result',
+            COALESCE (sum(a.implants_result), 0) AS 'implantsResult',
+            COALESCE (sum(a.blood_result), 0) AS 'bloodResult',
+            COALESCE (sum(a.rescue_result), 0) AS 'rescueResult',
+            COALESCE (sum(a.sec_file_result), 0) AS 'secFileResult',
+            COALESCE (sum(a.file_complete_result), 0) AS 'fileCompleteResult',
+            COALESCE (sum(a.tumor_radiation_result), 0) AS 'tumorRadiationResult'
+
+        FROM
+            med_index_result a
+        WHERE
+            a.hospital_id = #{filterVO.hospitalId}
+        AND a.is_deleted = 'N'
+        AND (a.start_date BETWEEN #{filterVO.startDate} AND #{filterVO.endDate} )
+        AND (a.end_date BETWEEN #{filterVO.startDate} AND #{filterVO.endDate} )
+ </select>
 </mapper>

+ 250 - 0
dblayer-mbg/src/main/resources/mapper/report/LisInfoMapper.xml

@@ -2,4 +2,254 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.LisInfoMapper">
 
+    <!--    获取病人的出入院时间-->
+    <select id="getTime" resultType="java.util.HashMap">
+        select
+        t.behospital_date,
+        t.leave_hospital_date
+        from med_behospital_info t
+        where
+        t.is_deleted = 'N'
+        <if test="behospitalCode != null">
+            and t.behospital_code = #{behospitalCode}
+        </if>
+    </select>
+    <!--获取缺陷检验项信息-->
+    <select id="getBadExamineInfo" resultType="java.lang.String">
+        select
+        distinct
+        b.repNo
+        from(
+        SELECT
+        t1.rep_no as repNo,
+        t1.rep_name as examineItemName,
+        t1.rep_type_name as examineItemType,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as cTime,
+        t1.apply_doctor as doctorName,
+        t1.hospital_id as hospitalId,
+        t1.behospital_code as behospitalCode
+        FROM
+        med_lis_info t1,
+        med_lis_result t2
+        WHERE
+        t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        AND t2.item_name IS NOT NULL
+        AND t1.hospital_id = t2.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        <if test="examineInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineInfoVO.hospitalId}
+        </if>
+        <if test="examineInfoVO.behospitalCode != null and examineInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineInfoVO.behospitalCode}
+        </if>
+        <if test="examineInfoVO.examineItemType != null and examineInfoVO.examineItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{examineInfoVO.examineItemType},'%')
+        </if>
+        <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
+            and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
+            <if test="examineInfoVO.leaveHospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+            </if>
+            <if test="examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND b.cTime >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND b.cTime <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
+        <if test="infos != null and infos.size() > 0">
+            and b.info  in
+            <foreach collection="infos" open="(" separator="," close=")" item="item">
+                '${item}'
+            </foreach>
+        </if>
+        <if test="infos = null || infos.size() == 0">
+            and 1 = 2
+        </if>
+
+    </select>
+
+
+    <!--获取检验信息-->
+    <select id="getExamineInfo" resultType="com.lantone.common.dto.report.ExamineInfoDTO">
+        select
+        distinct
+        b.repNo,
+        b.examineItemName,
+        b.examineItemType,
+        b.rTime as reptTime,
+        b.cTime as checkTime,
+        b.doctorName,
+        b.hospitalId,
+        b.behospitalCode
+        from(
+        SELECT
+        t1.rep_no as repNo,
+        t1.rep_name as examineItemName,
+        t1.rep_type_name as examineItemType,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as cTime,
+        t1.apply_doctor as doctorName,
+        t1.hospital_id as hospitalId,
+        t1.behospital_code as behospitalCode
+        FROM
+        med_lis_info t1
+        left join
+        med_lis_result t2
+        on t1.hospital_id = t2.hospital_id
+        AND t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        AND t2.item_name IS NOT NULL
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        where 1=1
+        <if test="examineInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineInfoVO.hospitalId}
+        </if>
+        <if test="examineInfoVO.behospitalCode != null and examineInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineInfoVO.behospitalCode}
+        </if>
+        <if test="examineInfoVO.examineItemType != null and examineInfoVO.examineItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{examineInfoVO.examineItemType},'%')
+        </if>
+        <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
+            and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
+        </if>
+
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND b.cTime >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND b.cTime <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
+        <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1 = 2
+            </if>
+        </if>
+        <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 2 ">
+            <if test="badCheckInfo != null and badCheckInfo.size() > 0">
+                and b.repNo not in
+                <foreach collection="badCheckInfo" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="badCheckInfo = null || badCheckInfo.size() == 0">
+                and 1 = 1
+            </if>
+        </if>
+    </select>
+
+    <!--    获取质控提示信息-->
+    <select id="getInfo" resultType="java.lang.String">
+        select b.info
+        from
+        med_behospital_info a,
+        med_qcresult_detail b
+        where
+        a.is_deleted = 'N'
+        and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id
+        and a.behospital_code = b.behospital_code
+        <if test="hospitalId != null">
+            and a.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and a.behospital_code = #{behospitalCode}
+        </if>
+    </select>
+
+    <!--    获取检验子项信息-->
+    <select id="getExamineSonInfo" resultType="com.lantone.common.dto.report.ExamineSonInfoDTO">
+        select t.* from(
+        SELECT
+        t2.item_name AS examineItemName,
+        CONCAT( t2.result, ifnull(t2.unit,'') ) AS examineItemResult,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as reptTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as checkTime,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        t1.apply_doctor AS doctorName
+        FROM
+        med_lis_info t1,
+        med_lis_result t2
+        where
+        t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        AND t1.hospital_id = t2.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        <if test="examineSonInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineSonInfoVO.hospitalId}
+        </if>
+        <if test="examineSonInfoVO.behospitalCode != null and examineSonInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineSonInfoVO.behospitalCode}
+        </if>
+        <if test="examineSonInfoVO.repNo != null and examineSonInfoVO.repNo != ''">
+            and t1.rep_no = #{examineSonInfoVO.repNo}
+        </if>)t
+        where 1=1
+        <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and t.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1 = 2
+            </if>
+        </if>
+        <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and t.info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1 = 1
+            </if>
+        </if>
+    </select>
 </mapper>

+ 115 - 0
dblayer-mbg/src/main/resources/mapper/report/PacsInfoMapper.xml

@@ -2,4 +2,119 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.PacsInfoMapper">
 
+    <!--    获取病人的出入院时间-->
+    <select id="getTime" resultType="java.util.HashMap">
+        select
+        t.behospital_date,
+        t.leave_hospital_date
+        from med_behospital_info t
+        where
+        t.is_deleted = 'N'
+        <if test="behospitalCode != null">
+            and t.behospital_code = #{behospitalCode}
+        </if>
+    </select>
+
+    <select id="getCheckInfo" resultType="com.lantone.common.dto.report.CheckInfoDTO">
+        select DISTINCT b.*
+        from(
+        SELECT
+        t1.rep_name as checkItemName,
+        t1.rep_type_name as checkItemType,
+        CONCAT( t1.rep_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        date_format (t1.rep_date,'%Y-%m-%d %H:%i:%s') as reptTime,
+        date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as checkTime,
+        t1.apply_doctor as doctorName,
+        t2.hospital_id as hospitalId,
+        t2.behospital_code as behospitalCode,
+        t2.rept_diag as checkResult
+        FROM
+        med_pacs_info t1
+        left join
+        med_pacs_result t2
+        on t1.hospital_id = t2.hospital_id
+        AND t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t1.rep_name IS NOT NULL
+        AND t1.check_date IS NOT NULL
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        WHERE
+        1=1
+        <if test="checkInfoVO.hospitalId != null">
+            and t1.hospital_id = #{checkInfoVO.hospitalId}
+        </if>
+        <if test="checkInfoVO.behospitalCode != null and checkInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{checkInfoVO.behospitalCode}
+        </if>
+        <if test="checkInfoVO.checkItemType != null and checkInfoVO.checkItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{checkInfoVO.checkItemType},'%')
+        </if>
+        <if test="checkInfoVO.checkItemName != null and checkInfoVO.checkItemName != ''">
+            and t1.rep_name like CONCAT('%',#{checkInfoVO.checkItemName},'%')
+        </if>
+        <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 1">
+            <if test="checkInfoVO.leaveHospitalDate != null and checkInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{checkInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 0">
+            <if test="checkInfoVO.leaveHospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{checkInfoVO.leaveHospitalDate}]]>
+            </if>
+            <if test="checkInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+        <if test="checkInfoVO.jxDateStart != null">
+            <![CDATA[ AND b.checkTime >= #{checkInfoVO.jxDateStart}]]>
+        </if>
+        <if test="checkInfoVO.jxDateEnd != null">
+            <![CDATA[ AND b.checkTime <= #{checkInfoVO.jxDateEnd}]]>
+        </if>
+        <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1 = 2
+            </if>
+        </if>
+        <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and b.info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1 = 1
+            </if>
+        </if>
+    </select>
+
+    <!--    获取质控提示信息-->
+    <select id="getInfo" resultType="java.lang.String">
+        select b.info
+        from
+        med_behospital_info a,
+        med_qcresult_detail b
+        where
+        a.is_deleted = 'N'
+        and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id
+        and a.behospital_code = b.behospital_code
+        <if test="hospitalId != null">
+            and a.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and a.behospital_code = #{behospitalCode}
+        </if>
+    </select>
 </mapper>

+ 13 - 1
dblayer-mbg/src/main/resources/mapper/report/QuestionInfoMapper.xml

@@ -1,5 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.QuestionInfoMapper">
-
+    <select id="getByCaseEntryIds" resultType="com.lantone.common.dto.report.QuestionEntryDTO">
+        SELECT q2.question_id id, q2.cases_entry_id FROM qc_question_info q1, qc_question_entry q2
+        where q1.is_deleted = 'N' and q2.is_deleted = 'N' and q1.id = q2.question_id
+        <if test="hospitalId != null">
+            AND q1.hospital_id = #{hospitalId}
+        </if>
+        <if test="casesEntryIds != null and casesEntryIds.size > 0">
+            and q2.cases_entry_id in
+            <foreach  collection="casesEntryIds" item="item" open="("  separator=","  close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 </mapper>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1512 - 0
report-service/src/main/java/com/lantone/report/facade/MrIndicatorManagementFacade.java


+ 322 - 1
report-service/src/main/java/com/lantone/report/facade/MrInfoManagementFacade.java

@@ -1,22 +1,63 @@
 package com.lantone.report.facade;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.lantone.common.dto.report.BehosDTO;
 import com.lantone.common.dto.report.BehospitalInfoDTO;
+import com.lantone.common.dto.report.CheckInfoDTO;
+import com.lantone.common.dto.report.DoctorAdviceDTO;
+import com.lantone.common.dto.report.ExamineInfoDTO;
+import com.lantone.common.dto.report.ExamineSonInfoDTO;
 import com.lantone.common.dto.report.ExportExcelBehospitalDTO;
 import com.lantone.common.dto.report.ExportExcelDTO;
 import com.lantone.common.dto.report.ExportExcelWideBehospitalDTO;
 import com.lantone.common.dto.report.ExportWideExcelDTO;
+import com.lantone.common.dto.report.MsgDTO;
+import com.lantone.common.dto.report.QcResultDTO;
+import com.lantone.common.dto.report.QuestionEntryDTO;
+import com.lantone.common.enums.CheckerRoleEnum;
+import com.lantone.common.enums.IsDeleteEnum;
+import com.lantone.common.exception.ApiException;
+import com.lantone.common.util.BeanUtil;
+import com.lantone.common.util.DateUtil;
+import com.lantone.common.util.EntityUtil;
 import com.lantone.common.util.ExcelUtils;
 import com.lantone.common.util.ListUtil;
 import com.lantone.common.util.SysUserUtils;
+import com.lantone.common.vo.report.AnalyzeVO;
 import com.lantone.common.vo.report.BehospitalPageVO;
+import com.lantone.common.vo.report.CheckInfoVO;
+import com.lantone.common.vo.report.DoctorAdviceVO;
+import com.lantone.common.vo.report.ExamineInfoVO;
+import com.lantone.common.vo.report.ExamineSonInfoVO;
 import com.lantone.common.vo.report.ExportQcresultVO;
+import com.lantone.common.vo.report.GetDetailVO;
+import com.lantone.common.vo.report.MedNurseInfoVO;
+import com.lantone.dblayermbg.entity.UserRole;
+import com.lantone.dblayermbg.entity.report.BehospitalInfo;
+import com.lantone.dblayermbg.entity.report.CheckInfo;
+import com.lantone.dblayermbg.entity.report.HomePage;
+import com.lantone.dblayermbg.entity.report.Nurse;
+import com.lantone.dblayermbg.facade.UserRoleFacade;
 import com.lantone.dblayermbg.facade.report.BehospitalInfoFacade;
+import com.lantone.dblayermbg.facade.report.CheckInfoFacade;
+import com.lantone.dblayermbg.facade.report.DoctorAdviceFacade;
+import com.lantone.dblayermbg.facade.report.HomePageFacade;
+import com.lantone.dblayermbg.facade.report.LisInfoFacade;
+import com.lantone.dblayermbg.facade.report.NurseFacade;
+import com.lantone.dblayermbg.facade.report.PacsInfoFacade;
+import com.lantone.dblayermbg.facade.report.QcresultInfoFacade;
+import com.lantone.dblayermbg.facade.report.QuestionInfoFacade;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 
 @Component
@@ -26,7 +67,24 @@ public class MrInfoManagementFacade {
     private FilterFacade filterFacade;
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
-
+    @Autowired
+    private CheckInfoFacade checkInfoFacade;
+    @Autowired
+    private HomePageFacade homePageFacade;
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+    @Autowired
+    private QuestionInfoFacade questionInfoFacade;
+    @Autowired
+    private UserRoleFacade userRoleFacade;
+    @Autowired
+    NurseFacade nurseFacade;
+    @Autowired
+    PacsInfoFacade pacsInfoFacade;
+    @Autowired
+    LisInfoFacade lisInfoFacade;
+    @Autowired
+    DoctorAdviceFacade doctorAdviceFacade;
     /**
      * 病历分页列表
      *
@@ -89,4 +147,267 @@ public class MrInfoManagementFacade {
         }
         return resWide;
     }
+
+    /**
+     * 获取医嘱信息翻页
+     *
+     * @param doctorAdviceVO 获取医嘱信息入参
+     * @return 医嘱翻页信息
+     */
+    public IPage<DoctorAdviceDTO> getPageFac(DoctorAdviceVO doctorAdviceVO) {
+        doctorAdviceVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalId()));
+        if (null != doctorAdviceVO.getDaStartDateStart()) {
+            doctorAdviceVO.setDaStartDateStart(DateUtil.getFirstTimeOfDay(doctorAdviceVO.getDaStartDateStart()));
+        }
+        if (null != doctorAdviceVO.getDaStartDateEnd()) {
+            doctorAdviceVO.setDaStartDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(doctorAdviceVO.getDaStartDateEnd(), 1)));
+        }
+        if (null != doctorAdviceVO.getDaStartDateStart() && null != doctorAdviceVO.getDaStartDateEnd()) {
+            if (DateUtil.after(doctorAdviceVO.getDaStartDateStart(), doctorAdviceVO.getDaStartDateEnd())) {
+                throw new ApiException( "开始时间必须小于结束时间!");
+            }
+        }
+        return doctorAdviceFacade.getPage(doctorAdviceVO);
+    }
+    /**
+     * 获取检验子项信息
+     * @param examineSonInfoVO
+     * @return
+     */
+
+    public IPage<ExamineSonInfoDTO> getExamineSonPage(ExamineSonInfoVO examineSonInfoVO)  {
+        examineSonInfoVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
+        return lisInfoFacade.getExamineSonInfo(examineSonInfoVO);
+    }
+
+    /**
+     * @Description:  获取检验信息
+     * @Param: [examineInfoVO]
+     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.common.dto.report.ExamineInfoDTO>
+     */
+    public IPage<ExamineInfoDTO> getExaminePage(ExamineInfoVO examineInfoVO) {
+        examineInfoVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
+        if (null != examineInfoVO.getJyDateStart()) {
+            examineInfoVO.setJyDateStart(DateUtil.getFirstTimeOfDay(examineInfoVO.getJyDateStart()));
+        }
+        if (null != examineInfoVO.getJyDateEnd()) {
+            examineInfoVO.setJyDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(examineInfoVO.getJyDateEnd(), 1)));
+        }
+        if (null != examineInfoVO.getJyDateStart() && null != examineInfoVO.getJyDateEnd()) {
+            if (DateUtil.after(examineInfoVO.getJyDateStart(), examineInfoVO.getJyDateEnd())) {
+                throw new ApiException( "开始时间必须小于结束时间!");
+            }
+        }
+        return lisInfoFacade.getExamineInfo(examineInfoVO);
+    }
+
+    /**
+     * @Description: 获取检查信息
+     * @Param: [checkInfoVO]
+     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.common.dto.report.CheckInfoDTO>
+     */
+    public IPage<CheckInfoDTO> getCheckPage(CheckInfoVO checkInfoVO) {
+
+        checkInfoVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
+        if (null != checkInfoVO.getJxDateStart()) {
+            checkInfoVO.setJxDateStart(DateUtil.getFirstTimeOfDay(checkInfoVO.getJxDateStart()));
+        }
+        if (null != checkInfoVO.getJxDateEnd()) {
+            checkInfoVO.setJxDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(checkInfoVO.getJxDateEnd(), 1)));
+        }
+        if (null != checkInfoVO.getJxDateStart() && null != checkInfoVO.getJxDateEnd()) {
+            if (DateUtil.after(checkInfoVO.getJxDateStart(), checkInfoVO.getJxDateEnd())) {
+                throw new ApiException( "开始时间必须小于结束时间!");
+            }
+        }
+        return pacsInfoFacade.getCheckInfo(checkInfoVO);
+    }
+
+    public  IPage<Nurse> getMedNursePage(MedNurseInfoVO medNurseInfoVO){
+        // 添加住院病历信息
+        BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("behospital_code", medNurseInfoVO.getBehospitalCode())
+                .select("behospital_code","hospital_id","behospital_date","leave_hospital_date")
+        );
+        QueryWrapper<Nurse> medNurseQueryWrapper = new QueryWrapper<>();
+        medNurseQueryWrapper.eq("behospital_code",medNurseInfoVO.getBehospitalCode());
+        medNurseQueryWrapper .eq("hospital_id",behospitalInfo.getHospitalId());
+        medNurseQueryWrapper .eq("is_deleted", IsDeleteEnum.N.getKey());
+        medNurseQueryWrapper .like("item_name", medNurseInfoVO.getItemName());
+        medNurseQueryWrapper.orderByDesc( "measure_time");
+        //测量时间
+        medNurseQueryWrapper.ge( "measure_time", medNurseInfoVO.getDateStart());
+        medNurseQueryWrapper.le( "measure_time", medNurseInfoVO.getDateEnd());
+        //出入院时间
+        medNurseQueryWrapper.ge( "measure_time", behospitalInfo.getBehospitalDate());
+        if(behospitalInfo.getLeaveHospitalDate() != null){
+            medNurseQueryWrapper.le( "measure_time",behospitalInfo.getLeaveHospitalDate());
+        }
+        Page<Nurse> pageCase = new Page<Nurse>(medNurseInfoVO.getCurrent(),medNurseInfoVO.getSize());
+        IPage<Nurse> medNurseIPage = nurseFacade.getBaseMapper().selectPage(pageCase, medNurseQueryWrapper);
+        medNurseIPage.getRecords().forEach(medNurse -> {
+            medNurse.setItemValue(medNurse.getItemValue()+medNurse.getItemUnit());
+        });
+        return medNurseIPage;
+
+    }
+
+    /**
+     * 获取明细
+     *
+     * @param getDetailVO
+     * @return
+     */
+    public Map<String, Object> getByBehospitalCode(GetDetailVO getDetailVO) {
+        Map<String, Object> res = new HashMap<>(); // 返回结果
+        Long hospitalId = SysUserUtils.getCurrentHospitalId();
+        getDetailVO.setHospitalId(hospitalId);
+        // 获取病历信息
+        BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", getDetailVO.getHospitalId())
+                .eq("behospital_code", getDetailVO.getBehospitalCode()), false
+        );
+
+        // 获取患者年龄
+        HomePage homePage = homePageFacade.getOne(new QueryWrapper<HomePage>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", getDetailVO.getHospitalId())
+                .eq("behospital_code", getDetailVO.getBehospitalCode()), false
+        );
+
+        List<String> paramList = getDetailVO.getParamStr();// 参数列表
+
+        if (ListUtil.isEmpty(paramList) || paramList.contains("beHospital")) {
+            BehosDTO behosDTO = new BehosDTO();
+            if (behospitalInfo == null) {
+                throw new ApiException("该病历已删除!");
+            }
+            BeanUtil.copyProperties(behospitalInfo, behosDTO);
+            if(null != homePage && StringUtils.isNotEmpty(homePage.getAge()) && StringUtils.isNotEmpty(homePage.getAgeUnit())){
+                behosDTO.setAge(homePage.getAge()+homePage.getAgeUnit());
+            }
+            res.put("beHospital", behosDTO);
+        }
+
+        if (ListUtil.isEmpty(paramList) || paramList.contains("result") || paramList.contains("resultSimple")) {
+            // 获取结果主表信息
+            QcResultDTO qcResultDTO = qcresultInfoFacade.getByBehospitalCode(getDetailVO);
+            if (qcResultDTO == null) {
+                throw new ApiException( "该病历未评分!");
+            }
+            if (paramList.contains("resultSimple")) {
+                qcResultDTO.setPageData("");
+                qcResultDTO.setMenuData("");
+            }
+            res.put("result", qcResultDTO);
+            //增加该病历是否核查状态
+            QueryWrapper<CheckInfo> medCheckInfoQuerys = new QueryWrapper<>();
+            medCheckInfoQuerys.eq("is_deleted", IsDeleteEnum.N.getKey());
+            medCheckInfoQuerys.eq("behospital_code", getDetailVO.getBehospitalCode());
+            medCheckInfoQuerys.eq("hospital_id", hospitalId);
+            medCheckInfoQuerys.in("check_type", 0, 2);
+            medCheckInfoQuerys.eq("status", 1);
+            int count = checkInfoFacade.count(medCheckInfoQuerys);
+            if (count > 0) {
+                res.put("checkStatus", 1);
+            } else {
+                res.put("checkStatus", 0);
+            }
+            //增加该病案首页是否核查状态
+            Map<String, Object> mapAllMr = new HashMap<String, Object>();
+            mapAllMr.put("is_deleted", IsDeleteEnum.N.getKey());
+            mapAllMr.put("behospital_code", getDetailVO.getBehospitalCode());
+            mapAllMr.put("hospital_id", hospitalId);
+            mapAllMr.put("check_type", 1);
+            QueryWrapper<CheckInfo> medCheckInfoMr = new QueryWrapper<>();
+            medCheckInfoMr.allEq(mapAllMr);
+            int countMr = checkInfoFacade.count(medCheckInfoMr);
+            if (countMr > 0) {
+                res.put("mrStatus", 1);
+            } else {
+                res.put("mrStatus", 0);
+            }
+            //新增如果当前用户不是核查人员返回标志位用户核查按钮、修改、删除、隐藏显示
+            //1.获取病历核查人员id,该操作只能是核查员操作
+            List<CheckInfo> medCheckInfos = checkInfoFacade.list(new QueryWrapper<CheckInfo>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("hospital_id", hospitalId)
+                    .eq("behospital_code", getDetailVO.getBehospitalCode()));
+            if (medCheckInfos.size() == 1 && medCheckInfos.get(0).getCheckId() != null
+                    && medCheckInfos.get(0).getCheckId().equals(SysUserUtils.getCurrentPrincipleId())) {
+                //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
+                int jobType = checkInfoFacade.list(new QueryWrapper<CheckInfo>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("behospital_code", getDetailVO.getBehospitalCode())
+                        .eq("hospital_id", hospitalId)
+                        .eq("check_id", SysUserUtils.getCurrentPrincipleId())).get(0).getJobType();
+                //2.2获取用户角色
+                List<Long> roleIds = userRoleFacade.list(new QueryWrapper<UserRole>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("user_id", SysUserUtils.getCurrentPrincipleId())
+                ).stream().distinct().map(UserRole::getRoleId).collect(Collectors.toList());
+                switch (jobType) {
+                    case 0:
+                        if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
+                            res.put("checkShow", 1);
+                        } else {
+                            res.put("checkShow", 0);
+                        }
+                        break;
+                    case 1:
+                        if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
+                            res.put("checkShow", 1);
+                        } else {
+                            res.put("checkShow", 0);
+                        }
+                        break;
+                    case 2:
+                        if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
+                            res.put("checkShow", 1);
+                        } else {
+                            res.put("checkShow", 0);
+                        }
+                        break;
+                    default:
+                        res.put("checkShow", 0);
+                        break;
+                }
+
+            } else {
+                res.put("checkShow", 0);
+            }
+        }
+
+        // 获取提示信息
+        if (ListUtil.isEmpty(paramList) || paramList.contains("msg")) {
+            AnalyzeVO analyzeVO = new AnalyzeVO();
+            BeanUtil.copyProperties(getDetailVO, analyzeVO);
+            List<MsgDTO> msgDTOList = behospitalInfoFacade.getBaseMapper().getMsg(analyzeVO);
+            if (ListUtil.isNotEmpty(msgDTOList)) {
+                // 从qc_question_info的cases_entry_ids获取
+                Map<String, Object> paramMap = new HashMap<>();
+                paramMap.put("hospitalId", hospitalId);
+                paramMap.put("casesEntryIds", msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList()));
+                Map<Long, List<QuestionEntryDTO>> quesEntryMap = questionInfoFacade.getByCaseEntryIdsFac(paramMap);
+                for (MsgDTO msgDTO : msgDTOList) {
+                    if (quesEntryMap.get(msgDTO.getCasesEntryId()) != null) {
+                        msgDTO.setPageKeyList(quesEntryMap.get(msgDTO.getCasesEntryId())
+                                .stream().map(r -> r.getId()).collect(Collectors.toList()));
+                    }
+                }
+            }
+            // 根据模块分组
+            Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
+            res.put("msg", msgMap);
+
+            // 添加DRGS分组
+            List<MsgDTO> msgDTOListDrgs = msgDTOList.stream().filter(r -> r.getDrgs().equals(1)).collect(Collectors.toList());
+            Map<String, List<MsgDTO>> drgsMap = EntityUtil.makeEntityListMap(msgDTOListDrgs, "modelName");
+            res.put("drgs", drgsMap);
+        }
+
+        return res;
+    }
 }

+ 44 - 0
report-service/src/main/java/com/lantone/report/web/MrIndicatorManagementController.java

@@ -0,0 +1,44 @@
+package com.lantone.report.web;
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.report.facade.MrIndicatorManagementFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * <p>
+ * 病案指标管理统计相关API
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-27
+ */
+
+@RestController
+@RequestMapping("/console")
+@Api(value = "病案指标管理统计相关API", tags = { "病案指标管理统计相关API" })
+@SuppressWarnings("unchecked")
+public class MrIndicatorManagementController {
+    @Autowired
+    private MrIndicatorManagementFacade mrIndicatorManagementFacade;
+
+    /**
+     * 病案指标管理统计相关API
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "病案指标管理统计相关API[by:zh]")
+    @PostMapping("/medicalRecordIndicator")
+    public CommonResult<List<Map<String,String>>> medicalRecordIndicator(@RequestBody @Valid FilterVO filterVO) {
+        return CommonResult.success(mrIndicatorManagementFacade.medicalRecordIndicator(filterVO));
+    }
+}

+ 53 - 3
report-service/src/main/java/com/lantone/report/web/MrInfoManagementController.java

@@ -3,8 +3,19 @@ package com.lantone.report.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.lantone.common.api.CommonResult;
 import com.lantone.common.dto.report.BehospitalInfoDTO;
+import com.lantone.common.dto.report.CheckInfoDTO;
+import com.lantone.common.dto.report.DoctorAdviceDTO;
+import com.lantone.common.dto.report.ExamineInfoDTO;
+import com.lantone.common.dto.report.ExamineSonInfoDTO;
 import com.lantone.common.vo.report.BehospitalPageVO;
+import com.lantone.common.vo.report.CheckInfoVO;
+import com.lantone.common.vo.report.DoctorAdviceVO;
+import com.lantone.common.vo.report.ExamineInfoVO;
+import com.lantone.common.vo.report.ExamineSonInfoVO;
 import com.lantone.common.vo.report.ExportQcresultVO;
+import com.lantone.common.vo.report.GetDetailVO;
+import com.lantone.common.vo.report.MedNurseInfoVO;
+import com.lantone.dblayermbg.entity.report.Nurse;
 import com.lantone.report.facade.MrInfoManagementFacade;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -15,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.Map;
 
 /**
  * <p>
@@ -25,7 +38,7 @@ import javax.servlet.http.HttpServletResponse;
  */
 
 @RestController
-@RequestMapping("/qc/behospitalInfo")
+@RequestMapping("/qc")
 @Api(value = "病历列表相关API", tags = { "病历列表相关API" })
 @SuppressWarnings("unchecked")
 public class MrInfoManagementController {
@@ -33,15 +46,52 @@ public class MrInfoManagementController {
     private MrInfoManagementFacade mrInfoManagementFacade;
 
     @ApiOperation(value = "病历列表-报表[by:zhoutg]")
-    @PostMapping("/page")
+    @PostMapping("/behospitalInfo/page")
     public CommonResult<IPage<BehospitalInfoDTO>> page(@RequestBody BehospitalPageVO behospitalPageVO) {
         IPage<BehospitalInfoDTO> data = mrInfoManagementFacade.pageFac(behospitalPageVO);
         return CommonResult.success(data);
     }
 
     @ApiOperation(value = "病历列表-报表导出[by:zhaops]")
-    @PostMapping("/exportQcresult")
+    @PostMapping("/behospitalInfo/exportQcresult")
     public void exportQcresult(HttpServletResponse response, @RequestBody ExportQcresultVO exportQcresultVO) {
         mrInfoManagementFacade.exportQcresult(response, exportQcresultVO);
     }
+
+    @ApiOperation(value = "根据病历id获取详情[by:zhoutg]")
+    @PostMapping("/behospitalInfo/getByBehospitalCode")
+    public CommonResult<Map<String, Object>> getByBehospitalCode(@RequestBody GetDetailVO getDetailVO) {
+        Map<String, Object> data = mrInfoManagementFacade.getByBehospitalCode(getDetailVO);
+        return CommonResult.success(data);
+    }
+
+    @ApiOperation(value = "护理信息API[by:cy]")
+    @PostMapping("/medNurse/getMedNursePage")
+    public CommonResult<IPage<Nurse>> getMedNursePage(@RequestBody @Valid MedNurseInfoVO medNurseInfoVO) {
+        return  CommonResult.success(mrInfoManagementFacade.getMedNursePage(medNurseInfoVO));
+    }
+
+    @ApiOperation(value = "获取检查信息[by:cy]")
+    @PostMapping("/medPacsInfo/getCheckPage")
+    public CommonResult<IPage<CheckInfoDTO>> getCheckPage(@RequestBody @Valid CheckInfoVO checkInfoVO) {
+        return  CommonResult.success(mrInfoManagementFacade.getCheckPage(checkInfoVO));
+    }
+
+    @ApiOperation(value = "获取检验信息[by:cy]")
+    @PostMapping("/medLisInfo/getExaminePage")
+    public CommonResult<IPage<ExamineInfoDTO>> getExaminePage(@RequestBody @Valid ExamineInfoVO examineInfoVO) {
+        return CommonResult.success(mrInfoManagementFacade.getExaminePage(examineInfoVO));
+    }
+
+    @ApiOperation(value = "获取检验子项信息[by:cy]")
+    @PostMapping("/medLisInfo/getExamineSonPage")
+    public CommonResult<IPage<ExamineSonInfoDTO>> getExamineSonPage(@RequestBody @Valid ExamineSonInfoVO examineSonInfoVO) {
+        return CommonResult.success(mrInfoManagementFacade.getExamineSonPage(examineSonInfoVO));
+    }
+
+    @ApiOperation(value = "获取医嘱信息[by:gaodm]")
+    @PostMapping("/doctoradvice/getPage")
+    public CommonResult<IPage<DoctorAdviceDTO>> getPage(@RequestBody @Valid DoctorAdviceVO doctorAdviceVO) {
+        return CommonResult.success(mrInfoManagementFacade.getPageFac(doctorAdviceVO));
+    }
 }