소스 검색

添加症状阳性标识

zhoutg 4 년 전
부모
커밋
054e83367f

+ 5 - 0
cdssman-service/src/main/java/com/diagbot/entity/KlSymptom.java

@@ -56,6 +56,11 @@ public class KlSymptom implements Serializable {
      */
     private Long conceptId;
 
+    /**
+     * 阳性症状(0:否,1:是)
+     */
+    private Integer isPositive;
+
     /**
      * 英文名称
      */

+ 21 - 3
cdssman-service/src/main/java/com/diagbot/facade/KlDrugRegisterFacade.java

@@ -11,19 +11,24 @@ import com.diagbot.enums.InsertOrUpdateEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.service.KlDrugRegisterService;
 import com.diagbot.service.impl.KlDrugRegisterServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.ExcelUtils;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.KlDrugMappingGetVO;
 import com.diagbot.vo.KlDrugRegisterDelVO;
 import com.diagbot.vo.KlDrugRegisterGetVO;
+import com.diagbot.vo.KlDrugRegisterImportExVO;
 import com.diagbot.vo.KlDrugRegisterPageVO;
 import com.diagbot.vo.KlDrugRegisterSaveVO;
 import com.diagbot.vo.KlDrugSearchVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -38,10 +43,11 @@ public class KlDrugRegisterFacade extends KlDrugRegisterServiceImpl {
     @Autowired
     KlDrugMappingFacade klDrugMappingFacade;
     @Autowired
-    KlDrugRegisterFacade klDrugRegisterFacade;
-    @Autowired
     KlConceptFacade klConceptFacade;
     @Autowired
+    @Qualifier("klDrugRegisterServiceImpl")
+    KlDrugRegisterService klDrugRegisterService;
+    @Autowired
     UserFacade userFacade;
 
     /**
@@ -164,7 +170,7 @@ public class KlDrugRegisterFacade extends KlDrugRegisterServiceImpl {
         // 获取注册对应的药品通用名
         KlDrugMappingGetVO klDrugMappingGetVO = new KlDrugMappingGetVO();
         klDrugMappingGetVO.setRegisterId(klDrugRegister.getId());
-        List<KlConceptSimDTO> klConceptSimDTOList = klDrugRegisterFacade.getMappingDrug(klDrugMappingGetVO);
+        List<KlConceptSimDTO> klConceptSimDTOList = this.getMappingDrug(klDrugMappingGetVO);
         if (ListUtil.isNotEmpty(klConceptSimDTOList)) {
             KlConceptSimDTO conceptSimDTO = klConceptSimDTOList.get(0);
             klDrugRegisterDTO.setDrugName(conceptSimDTO.getLibName());
@@ -182,4 +188,16 @@ public class KlDrugRegisterFacade extends KlDrugRegisterServiceImpl {
     public List<KlConceptSimDTO> searchDrugFac(KlDrugSearchVO klDrugSearchVO) {
         return this.searchDrug(klDrugSearchVO);
     }
+
+    /**
+     * 注册药品导入
+     *
+     * @param file
+     */
+    public void importRegister(MultipartFile file) {
+        List<KlDrugRegisterImportExVO> data = ExcelUtils.importExcel(file, 0, 1, KlDrugRegisterImportExVO.class);
+        List<KlDrugRegister> drugRegisterList = BeanUtil.listCopyTo(data, KlDrugRegister.class);
+        // TODO 校验通用名,删除原注册名称、映射关系
+        klDrugRegisterService.saveBatch(drugRegisterList);
+    }
 }

+ 66 - 0
cdssman-service/src/main/java/com/diagbot/vo/KlDrugRegisterImportExVO.java

@@ -0,0 +1,66 @@
+package com.diagbot.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 药品注册表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-05-11
+ */
+@Data
+public class KlDrugRegisterImportExVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="药品代码")
+    private String drugCode;
+
+    @Excel(name="注册名称")
+    private String name;
+
+    @Excel(name="英文名称")
+    private String enName;
+
+    @Excel(name="商品名称")
+    private String tradeName;
+
+    @Excel(name="注册剂型")
+    private String form;
+
+    @Excel(name="注册规格")
+    private String specification;
+
+    @Excel(name="最小包装数量")
+    private String minPackQuantity;
+
+    @Excel(name="最小包装单位")
+    private String minPackUnit;
+
+    @Excel(name="药品企业")
+    private String company;
+
+    @Excel(name="批准文号")
+    private String approval;
+
+    @Excel(name="药品本位码")
+    private String standardCode;
+
+    @Excel(name="甲乙类")
+    private String insuranceType;
+
+    @Excel(name="医保备注")
+    private String insuranceRemrk;
+
+    @Excel(name="药品类别")
+    private String drugType;
+
+    @Excel(name="药品通用名")
+    private String drugName;
+
+}

+ 5 - 0
cdssman-service/src/main/java/com/diagbot/vo/KlSymptomVO.java

@@ -19,6 +19,11 @@ public class KlSymptomVO implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 阳性症状(0:否,1:是)
+     */
+    private Integer isPositive;
+
     /**
      * 英文名称
      */

+ 10 - 0
cdssman-service/src/main/java/com/diagbot/web/KlDrugRegisterController.java

@@ -19,7 +19,9 @@ 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.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -104,4 +106,12 @@ public class KlDrugRegisterController {
         List<KlConceptSimDTO> data = klDrugRegisterFacade.searchDrugFac(klDrugSearchVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "注册药品导入[by:zhoutg]",
+            notes = "")
+    @PostMapping("/importRegister")
+    public RespDTO<Boolean> importRegister(@RequestParam("file") MultipartFile file) {
+        klDrugRegisterFacade.importRegister(file);
+        return RespDTO.onSuc(true);
+    }
 }

+ 1 - 0
cdssman-service/src/main/resources/mapper/KlSymptomMapper.xml

@@ -11,6 +11,7 @@
         <result column="creator" property="creator" />
         <result column="modifier" property="modifier" />
         <result column="concept_id" property="conceptId" />
+        <result column="is_positive" property="isPositive" />
         <result column="en_name" property="enName" />
         <result column="definition" property="definition" />
         <result column="ch_western" property="chWestern" />

+ 7 - 2
docs/041.20210511知识库扩展/knowledgeExt_init.sql

@@ -1,3 +1,7 @@
+INSERT INTO `cdss`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('128', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '否', '0', '1', '1', '是否选项');
+INSERT INTO `cdss`.`sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('129', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '是', '1', '1', '2', '是否选项');
+
+
 use `med_2021`;
 
 INSERT INTO `kl_lexicon` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `is_has_common`, `only_one`, `can_change`, `remark`) VALUES ('45', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '疾病系统分类', '411', '0', '0', '0', '');
@@ -14,7 +18,7 @@ ALTER TABLE `kl_disease` add COLUMN `en_name` varchar(255) not null DEFAULT '' C
 ALTER TABLE `kl_disease` add COLUMN `en_name_simple` varchar(255) not null DEFAULT '' COMMENT '英文简称' AFTER `icd10_code`;
 ALTER TABLE `kl_disease` add COLUMN `name_simple` varchar(255) not null DEFAULT '' COMMENT '简称' AFTER `icd10_code`;
 ALTER TABLE `kl_disease` add COLUMN `is_heredity` TINYINT(4) not null DEFAULT '0' COMMENT '是否遗传(0:否,1:是)' AFTER `icd10_code`;
-ALTER TABLE `kl_disease` add COLUMN `is_common_dis` TINYINT(4) not null DEFAULT '0' COMMENT '是否常见病(0:否,1:是)' AFTER `icd10_code`;
+ALTER TABLE `kl_disease` add COLUMN `is_common_dis` TINYINT(4) not null DEFAULT '1' COMMENT '是否常见病(0:否,1:是)' AFTER `icd10_code`;
 ALTER TABLE `kl_disease` add COLUMN `ch_western` TINYINT(4) not null DEFAULT '0' COMMENT '中西医疾病(0:通用,1:西,2:中)' AFTER `icd10_code`;
 ALTER TABLE `kl_disease` add COLUMN `dis_type` varchar(1024) not null DEFAULT '' COMMENT '疾病分型' AFTER `icd10_code`;
 ALTER TABLE `kl_disease` add COLUMN `pathogeny` varchar(1024) not null DEFAULT '' COMMENT '病因' AFTER `icd10_code`;
@@ -103,6 +107,7 @@ CREATE TABLE `kl_symptom` (
   `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
   `concept_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '术语概念id',
+  `is_positive` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '阳性症状(0:否,1:是)',
   `en_name` varchar(255) NOT NULL DEFAULT '' COMMENT '英文名称',
   `definition` varchar(1024) NOT NULL DEFAULT '' COMMENT '定义',
   `ch_western` TINYINT(4) not null DEFAULT '0' COMMENT '中西医症状(0:通用,1:西,2:中)',
@@ -179,4 +184,4 @@ CREATE TABLE `kl_vital_result` (
   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`id`),
   UNIQUE KEY `idx_concept_id` (`concept_id`) USING BTREE COMMENT '概念id全表唯一'
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='体征结果扩展表';
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='体征结果扩展表';