Zhaops 6 năm trước cách đây
mục cha
commit
ef1af7f1f5

+ 19 - 0
icss-service/src/main/java/com/diagbot/client/bean/AdverseReaction.java

@@ -0,0 +1,19 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description: 不良反应
+ * @Author:zhaops
+ * @time: 2019/3/14 11:14
+ */
+@Getter
+@Setter
+public class AdverseReaction {
+    private String name;  //名称
+    private Integer controlType; //控件类型
+    private List<AdverseReactionDetail> details;
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/client/bean/AdverseReactionDetail.java

@@ -0,0 +1,16 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 不良反应明细
+ * @Author:zhaops
+ * @time: 2019/3/14 11:19
+ */
+@Getter
+@Setter
+public class AdverseReactionDetail {
+    private String name;
+    private Integer isSelected; //是否选中:0-未选中,1-选中
+}

+ 20 - 0
icss-service/src/main/java/com/diagbot/client/bean/MedicalIndication.java

@@ -0,0 +1,20 @@
+package com.diagbot.client.bean;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Getter;
+import lombok.Setter;
+
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/14 14:40
+ */
+@Getter
+@Setter
+public class MedicalIndication {
+    private Integer type; //1-量表,2-核心指标,3-公式,4,是否
+    private String name;
+    private JSONObject content;  //type<>1 量表之外的内容
+    private String scaleName;    //type=1 量表名字
+}

+ 29 - 2
icss-service/src/main/java/com/diagbot/client/bean/ResponseData.java

@@ -18,8 +18,11 @@ public class ResponseData {
     private List<FeatureRate> dis = new ArrayList<>(10);
     private List<FeatureRate> labs = new ArrayList<>(10);
     private List<FeatureRate> pacs = new ArrayList<>(10);
-    private List<FeatureRate> history=new ArrayList<>(10);
+    private List<FeatureRate> history = new ArrayList<>(10);
     private Map<String, JSONObject> treat;
+    private Map<String, JSONObject> scale;
+    private Map<String, JSONObject> managementEvaluation;
+    private List<MedicalIndication> medicalIndications;
 
     private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.5f);
 
@@ -95,4 +98,28 @@ public class ResponseData {
     public void setInputs(Map<String, Map<String, String>> inputs) {
         this.inputs = inputs;
     }
-}
+
+    public Map<String, JSONObject> getScale() {
+        return scale;
+    }
+
+    public void setScale(Map<String, JSONObject> scale) {
+        this.scale = scale;
+    }
+
+    public Map<String, JSONObject> getManagementEvaluation() {
+        return managementEvaluation;
+    }
+
+    public void setManagementEvaluation(Map<String, JSONObject> managementEvaluation) {
+        this.managementEvaluation = managementEvaluation;
+    }
+
+    public List<MedicalIndication> getMedicalIndications() {
+        return medicalIndications;
+    }
+
+    public void setMedicalIndications(List<MedicalIndication> medicalIndications) {
+        this.medicalIndications = medicalIndications;
+    }
+}

+ 18 - 0
icss-service/src/main/java/com/diagbot/dto/MedicalIndicationDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import com.diagbot.client.bean.MedicalIndication;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 指标推送结果
+ * @Author:zhaops
+ * @time: 2019/3/14 14:44
+ */
+@Getter
+@Setter
+public class MedicalIndicationDTO extends MedicalIndication {
+    private Long id;
+    private String tagName;
+    private ScaleDTO scale;
+}

+ 6 - 2
icss-service/src/main/java/com/diagbot/dto/PushDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.alibaba.fastjson.JSONObject;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -20,5 +21,8 @@ public class PushDTO {
     private List<QuestionDTO> lab;
     private List<QuestionDTO> pacs;
     private Map<String, List<QuestionDTO>> dis;
-    private Map<String,Object> treat;
-}
+    private Map<String, Object> treat;
+    private Map<String, JSONObject> managementEvaluation;
+    private Map<String, JSONObject> scale;
+    private List<MedicalIndicationDTO> medicalIndications;
+}

+ 17 - 0
icss-service/src/main/java/com/diagbot/dto/ScaleDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 量表
+ * @Author:zhaops
+ * @time: 2019/3/14 14:45
+ */
+@Getter
+@Setter
+public class ScaleDTO {
+    private Long id;
+    private String name;
+    private String tagName;
+}

+ 49 - 0
icss-service/src/main/java/com/diagbot/enums/ARControlTypeEnum.java

@@ -0,0 +1,49 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description: 不良反应控件类型
+ * @Author:zhaops
+ * @time: 2019/3/14 11:16
+ */
+public enum  ARControlTypeEnum implements KeyedNamed {
+    Radio(1, "单选"),
+    CheckBox(0, "多选");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    ARControlTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ARControlTypeEnum getEnum(Integer key) {
+        for (ARControlTypeEnum item : ARControlTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        ARControlTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 57 - 0
icss-service/src/main/java/com/diagbot/enums/FeatureTypeEnum.java

@@ -0,0 +1,57 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description: 推送类型
+ * @Author:zhaops
+ * @time: 2019/3/14 11:28
+ */
+public enum FeatureTypeEnum implements KeyedNamed {
+    Symptom(1, "症状"),
+    Other(3, "其他史"),
+    Vital(4, "查体"),
+    Lis(5, "化验"),
+    Pacs(6, "辅检"),
+    Disease(7, "诊断"),
+    Treat(8, "治疗"),
+    Scale(21, "量表内容"),
+    MedicalIndication(22, "指标"),
+    ManagementEvaluation(11, "管理评估");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    FeatureTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static FeatureTypeEnum getEnum(Integer key) {
+        for (FeatureTypeEnum item : FeatureTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        FeatureTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 3 - 1
icss-service/src/main/java/com/diagbot/enums/QuestionTypeEnum.java

@@ -16,7 +16,9 @@ public enum QuestionTypeEnum implements KeyedNamed {
     Pacs(6, "辅检"),
     Disease(7, "诊断"),
     Drug(8, "药品"),
-    DrugClass(9, "药品分类");
+    DrugClass(9, "药品分类"),
+    Scale(21, "量表"),
+    MedicalIndication(22, "推送指标");
 
     @Setter
     private Integer key;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 149 - 34
icss-service/src/main/java/com/diagbot/facade/PushFacade.java


+ 15 - 0
icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -165,4 +165,19 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         Map<Long, QuestionInfo> map = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
         return map;
     }
+
+    /**
+     * 根据tagName和类型查找标签
+     * @param name
+     * @param type
+     * @return
+     */
+    public QuestionInfo getQuestionByTagNameAndType(String name,Integer type) {
+        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("tag_name", name).eq("type", type);
+        QuestionInfo questionInfo = this.getOne(questionInfoQueryWrapper);
+        return questionInfo;
+    }
+
 }

+ 16 - 0
icss-service/src/main/java/com/diagbot/vo/MedicalIndicationVO.java

@@ -0,0 +1,16 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/14 11:00
+ */
+@Getter
+@Setter
+public class MedicalIndicationVO {
+    private String name;
+    private String result;
+}

+ 7 - 3
icss-service/src/main/java/com/diagbot/vo/PushVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.client.bean.AdverseReaction;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -29,7 +30,10 @@ public class PushVO {
     private String past;
     private String other;
     private Long diseaseId;
-    private Long patientId;
+    private Long patientId;   //病人id
     private String scaleName; //量表名称
-    private Long scaleId;  //量表id
-}
+    private Long scaleId;     //量表id
+    private Integer disType;  //0-慢病,1-急诊,普通病不填
+    private List<AdverseReaction> adverseReactions; //不良反应
+    private List<MedicalIndicationVO> medicalIndications;   //推理指标
+}

+ 18 - 0
icss-service/src/main/java/com/diagbot/web/PushController.java

@@ -1,5 +1,6 @@
 package com.diagbot.web;
 
+import com.alibaba.fastjson.JSONObject;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.dto.PushDTO;
@@ -9,6 +10,7 @@ import com.diagbot.enums.InputModeEnum;
 import com.diagbot.facade.PushFacade;
 import com.diagbot.vo.PushKYJVO;
 import com.diagbot.vo.PushVO;
+import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +20,8 @@ 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;
 
 /**
  * @Description:推理接口
@@ -122,4 +126,18 @@ public class PushController {
     public RespDTO<PushKYJDTO> pushKYJ(@RequestBody @Valid PushKYJVO pushKYJVO) {
         return RespDTO.onSuc(pushFacade.pushKYJ(pushKYJVO));
     }
+
+    @PostMapping("/getScaleContent")
+    @SysLogger("getScaleContent")
+    public RespDTO<String> getScaleContent(@RequestBody @Valid PushVO pushVO) {
+        return RespDTO.onSuc(pushFacade.getScaleContent(pushVO));
+    }
+
+    @PostMapping("/getManagementEvaluationContent")
+    @SysLogger("getManagementEvaluationContent")
+    public RespDTO<Map<String, JSONObject>> getManagementEvaluationContent(@RequestBody @Valid PushVO pushVO) {
+        List<String> titles = Lists.newLinkedList();
+        titles.add("疗效评估");
+        return RespDTO.onSuc(pushFacade.getManagementEvaluationContent(pushVO, titles));
+    }
 }