瀏覽代碼

Merge remote-tracking branch 'origin/dev/20200903_1.4.5' into debug

# Conflicts:
#	src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java
chengyao 4 年之前
父節點
當前提交
7b69ed6291

+ 19 - 19
src/main/java/com/diagbot/dto/DoctorAdviceDTO.java

@@ -56,25 +56,25 @@ public class DoctorAdviceDTO {
 //     */
 //    private String usageUnit;
 //
-//    /**
-//     * 医嘱单次剂量
-//     */
-//    private String dose;
-//
-//    /**
-//     * 单次剂量单位
-//     */
-//    private String doseUnit;
-//
-//    /**
-//     * 给药方式
-//     */
-//    private String medModeType;
-//
-//    /**
-//     * 医嘱频率
-//     */
-//    private String daFrequency;
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
 //
 //    /**
 //     * 医嘱处理类型

+ 4 - 0
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -1253,6 +1253,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         // 医嘱信息
         pageMap.put("医嘱信息", null);
+        // 医嘱信息
+        pageMap.put("检查信息", null);
+        // 医嘱信息
+        pageMap.put("检验信息", null);
         // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
         pageMap.put("知情同意书", recordDTOList);
         pageMap.put("谈话告知书", recordMap.get(54L));

+ 3 - 0
src/main/java/com/diagbot/facade/DoctorAdviceFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DoctorAdviceDTO;
+import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.DoctorAdviceServiceImpl;
@@ -10,6 +11,8 @@ import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.DoctorAdviceVO;
 import org.springframework.stereotype.Component;
 
+import java.util.Collection;
+
 /**
  * @Description:
  * @author: zhoutg

+ 4 - 2
src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java

@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DoctorAdviceDTO;
 import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.vo.DoctorAdviceVO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -18,6 +20,6 @@ import java.util.List;
  */
 public interface DoctorAdviceMapper extends BaseMapper<DoctorAdvice> {
     public void updateBatchByKey(List<DoctorAdvice> list);
-
-    IPage<DoctorAdviceDTO> getPage(DoctorAdviceVO doctorAdviceVO);
+    IPage<DoctorAdviceDTO> getPage(@Param("doctorAdviceVO")DoctorAdviceVO doctorAdviceVO, @Param("infos") Set<String> infos);
+    List<String> getInfo(@Param("hospitalId")Long hospitalId, @Param("behospitalCode")String behospitalCode);
 }

+ 28 - 1
src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java

@@ -7,9 +7,12 @@ import com.diagbot.mapper.DoctorAdviceMapper;
 import com.diagbot.service.DoctorAdviceService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.vo.DoctorAdviceVO;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -29,7 +32,31 @@ public class DoctorAdviceServiceImpl extends ServiceImpl<DoctorAdviceMapper, Doc
         this.baseMapper.updateBatchByKey(list);
     }
 
+
+
+
     public IPage<DoctorAdviceDTO> getPage(DoctorAdviceVO doctorAdviceVO){
-        return this.baseMapper.getPage(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 targetInfo : targetInfos) {
+                        if(!targetInfo.contains("医嘱")){
+                            infoSet.add(targetInfo);
+                        }
+
+                    }
+
+                }
+            }
+        }
+
+        IPage<DoctorAdviceDTO> page = this.baseMapper.getPage(doctorAdviceVO,infoSet);
+        return page;
     }
 }

+ 10 - 10
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -209,28 +209,28 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      */
     @Override
     public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
-       //基础数据
-        IPage<EntryNumDTO> entryNumDTOIPage  = baseMapper.entryGroupByEntryInnerPage(filterPageVO);
+        //基础数据
+        IPage<EntryNumDTO> entryNumDTOIPage = baseMapper.entryGroupByEntryInnerPage(filterPageVO);
         List<EntryNumDTO> records = entryNumDTOIPage.getRecords();
-        if(CollectionUtils.isEmpty(records)){
+        if (CollectionUtils.isEmpty(records)) {
             return entryNumDTOIPage;
         }
         String hospitalId = filterPageVO.getHospitalId();
         //缺陷总数
-          Integer sumInteget = baseMapper.entryGroupByEntrySum(filterPageVO.getHospitalId(),filterPageVO.getIsPlacefile(),
-                                                                filterPageVO.getStartDate(),filterPageVO.getEndDate());
+        Integer sumInteget = baseMapper.entryGroupByEntrySum(filterPageVO.getHospitalId(), filterPageVO.getIsPlacefile(),
+                filterPageVO.getStartDate(), filterPageVO.getEndDate());
         float nsum = 0;
-          Set<Long> ids = new HashSet<Long>();
+        Set<Long> ids = new HashSet<Long>();
         for (EntryNumDTO record : records) {
             ids.add(record.getId());
             int num = record.getNum().intValue();
-            if(sumInteget!=null && sumInteget!=0 ){
+            if (sumInteget != null && sumInteget != 0) {
                 int sum = sumInteget.intValue();
-                 nsum =(float) num/sum;
+                nsum = (float) num / sum;
             }
             DecimalFormat df = new DecimalFormat("0.00");
-            String percent = df.format(nsum*100);
-            record.setPercentStr(percent+"%");
+            String percent = df.format(nsum * 100);
+            record.setPercentStr(percent + "%");
             record.setTotleNum(sumInteget);
         }
         //缺陷分值

+ 11 - 0
src/main/java/com/diagbot/vo/DoctorAdviceVO.java

@@ -1,6 +1,7 @@
 package com.diagbot.vo;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
@@ -22,6 +23,11 @@ public class DoctorAdviceVO extends Page {
     @ApiModelProperty(hidden = true)
     private Long hospitalId;
 
+    /**
+     * 医嘱类型缺陷判别(0-全部医嘱 1缺陷医嘱 2非缺陷医嘱)
+     */
+    private Integer adviceType = 0;
+
     /**
      * 病历号
      */
@@ -47,5 +53,10 @@ public class DoctorAdviceVO extends Page {
      * 医嘱开始时间结束
      */
     private Date daStartDateEnd;
+    /**
+     * 提示信息
+     */
+    @JsonIgnore
+    private String info;
 
 }

+ 62 - 0
src/main/java/com/diagbot/vo/MedLisInfoVO.java

@@ -0,0 +1,62 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/3 17:20
+ */
+@Getter
+@Setter
+public class MedLisInfoVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * 检查缺陷类型判别(0-全部检查项 1缺陷检查项 2非缺陷检查项)
+     */
+    private Integer checkType = 0;
+
+    /**
+     * 病历号
+     */
+    @NotBlank(message = "请输入病历号")
+    private String behospitalCode;
+
+    /**
+     * 检查类型判别
+     */
+    private String checkItemType;
+
+    /**
+     * 检查项目名称
+     */
+    private String checkItemName;
+
+    /**
+     * 检查开始时间开始
+     */
+    private Date daStartDateStart;
+
+    /**
+     * 检查开始时间结束
+     */
+    private Date daStartDateEnd;
+    /**
+     * 提示信息
+     */
+    @JsonIgnore
+    private String info;
+
+}

+ 70 - 16
src/main/resources/mapper/DoctorAdviceMapper.xml

@@ -37,32 +37,86 @@
     </resultMap>
 
     <select id="getPage" parameterType="com.diagbot.vo.DoctorAdviceVO" resultType="com.diagbot.dto.DoctorAdviceDTO">
-        SELECT
-            t.*
-        FROM
+        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'),')')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
+            where
             t.is_deleted = 'N'
-        <if test="hospitalId != null">
-            and t.hospital_id = #{hospitalId}
+        <if test="doctorAdviceVO.hospitalId != null">
+            and t.hospital_id = #{doctorAdviceVO.hospitalId}
         </if>
-        <if test="behospitalCode != null and behospitalCode != ''">
-            and t.behospital_code = #{behospitalCode}
+        <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="doctorAdviceType != null and doctorAdviceType != ''">
-            and t.doctor_advice_type like CONCAT('%',#{doctorAdviceType},'%')
+        <if test="doctorAdviceVO.daItemName != null and doctorAdviceVO.daItemName != ''">
+            and t.da_item_name like CONCAT('%',#{doctorAdviceVO.daItemName},'%')
         </if>
-        <if test="daItemName != null and daItemName != ''">
-            and t.da_item_name like CONCAT('%',#{daItemName},'%')
+        <if test="doctorAdviceVO.daStartDateStart != null">
+            <![CDATA[ and t.da_start_date >= #{doctorAdviceVO.daStartDateStart}]]>
         </if>
-        <if test="daStartDateStart != null">
-            <![CDATA[ and t.da_start_date >= #{daStartDateStart}]]>
+        <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>
+            and b.info in('000000ASDQWEZXC')
         </if>
-        <if test="daStartDateEnd != null">
-            <![CDATA[ and t.da_start_date < #{daStartDateEnd}]]>
+        <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 2 ">
+            <if test="infos != null and infos.size() != 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            and 1=1
         </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>
     <update id="updateBatchByKey">
         <foreach collection="list" item="item"  separator=";">
             update med_doctor_advice