瀏覽代碼

最近一次其他史

rgb 6 年之前
父節點
當前提交
e86032f9b1

+ 28 - 5
icss-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -17,6 +17,7 @@ import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.GetInquiryDetailVO;
+import com.diagbot.vo.GetLastOtherVO;
 import com.diagbot.vo.HisInquirysVO;
 import com.diagbot.vo.ReadInquiryVO;
 import com.diagbot.vo.SaveInquiryDetailVO;
@@ -126,9 +127,31 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
      */
     public ReadInquiryDTO readInquiry(ReadInquiryVO readInquiryVO) {
         ReadInquiryDTO readInquiryDTO = new ReadInquiryDTO();
+        QueryWrapper<InquiryInfo> queryWrapper = new QueryWrapper<InquiryInfo>();
+        queryWrapper.eq("is_deleted", "N");
+        queryWrapper.eq("hospital_id", readInquiryVO.getHospitalId());
+        queryWrapper.eq("hospital_dept_id", readInquiryVO.getHospitalDeptId());
+        queryWrapper.eq("doctor_id", readInquiryVO.getDoctorId());
+        queryWrapper.eq("patient_id", readInquiryVO.getPatientId());
+        queryWrapper.eq("inquiry_code", readInquiryVO.getInquiryCode());
+        InquiryInfo inquiryInfo = this.getOne(queryWrapper);
 
-        HospitalInfo hospitalInfo = hospitalInfoFacade.getHospitalByCode(readInquiryVO.getHospitalCode());
-        PatientInfo patientInfo = patientInfoFacade.getPatientByCode(readInquiryVO.getHospitalCode(), readInquiryVO.getPatientCode());
+        if (inquiryInfo != null) {
+            readInquiryDTO.setDataJson(inquiryInfo.getDataJson());
+        }
+
+        return readInquiryDTO;
+    }
+    
+    /**
+     * 获取最近一次其他史信息
+     *
+     * @param readInquiryVO
+     * @return
+     */
+    public String getLastOther(GetLastOtherVO getLastOtherVO) {
+        HospitalInfo hospitalInfo = hospitalInfoFacade.getHospitalByCode(getLastOtherVO.getHospitalCode());
+        PatientInfo patientInfo = patientInfoFacade.getPatientByCode(getLastOtherVO.getHospitalCode(), getLastOtherVO.getPatientCode());
 
         Map<String, Object> map = new HashMap<>();
         map.put("hospitalId", hospitalInfo.getId());
@@ -136,10 +159,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         InquiryInfo inquiryInfo = baseMapper.getPatientLast(map);
 
         if (inquiryInfo != null) {
-            readInquiryDTO.setDataJson(inquiryInfo.getDataJson());
+        	return inquiryInfo.getDataJson();
+        }else{
+        	return null;
         }
-
-        return readInquiryDTO;
     }
 
     /**

+ 35 - 0
icss-service/src/main/java/com/diagbot/vo/GetLastOtherVO.java

@@ -0,0 +1,35 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value="获取最近一次其他史信息接口传参")
+@Getter
+@Setter
+public class GetLastOtherVO {
+	
+	/**
+	 * 医院编号
+	 */
+	@ApiModelProperty(value="医院编号",required=true)
+	@NotBlank(message="医院编号必填")
+	private String hospitalCode;
+	
+	/**
+	 * 医院患者编号
+	 */
+	@ApiModelProperty(value="医院患者编号",required=true)
+	@NotBlank(message="医院患者编号必填")
+	private String patientCode;
+	
+	   
+}

+ 47 - 11
icss-service/src/main/java/com/diagbot/vo/ReadInquiryVO.java

@@ -1,6 +1,7 @@
 package com.diagbot.vo;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -17,19 +18,54 @@ import lombok.Setter;
 @Setter
 public class ReadInquiryVO {
 	
-	/**
-	 * 医院编号
-	 */
-	@ApiModelProperty(value="医院编号",required=true)
-	@NotBlank(message="医院编号必填")
-	private String hospitalCode;
+//	/**
+//	 * 医院编号
+//	 */
+//	@ApiModelProperty(value="医院编号",required=true)
+//	@NotBlank(message="医院编号必填")
+//	private String hospitalCode;
+//	
+//	/**
+//	 * 医院患者编号
+//	 */
+//	@ApiModelProperty(value="医院患者编号",required=true)
+//	@NotBlank(message="医院患者编号必填")
+//	private String patientCode;
 	
 	/**
-	 * 医院患者编号
-	 */
-	@ApiModelProperty(value="医院患者编号",required=true)
-	@NotBlank(message="医院患者编号必填")
-	private String patientCode;
+     * 医院id
+     */
+	@ApiModelProperty(value="医院id",required=true)
+	@NotNull(message="医院id必传")
+    private Long hospitalId;
+
+    /**
+     * 科室id
+     */
+	@ApiModelProperty(value="科室id",required=true)
+	@NotNull(message="科室id必传")
+    private Long hospitalDeptId;
+
+    /**
+     * 医生id
+     */
+	@ApiModelProperty(value="医生id",required=true)
+	@NotNull(message="医生id必传")
+    private Long doctorId;
+
+    /**
+     * 患者id
+     */
+	@ApiModelProperty(value="患者id",required=true)
+	@NotNull(message="患者id必传")
+    private Long patientId;
+
+    /**
+     * 就诊序列号
+     */
+	@ApiModelProperty(value="就诊序列号",required=true)
+	@NotBlank(message="就诊序列号必传")
+    private String inquiryCode;
 	
 	   
 }

+ 20 - 9
icss-service/src/main/java/com/diagbot/web/InquiryInfoController.java

@@ -1,6 +1,17 @@
 package com.diagbot.web;
 
 
+import java.util.List;
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+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 com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetInquiryDetailDTO;
 import com.diagbot.dto.HisInquiryDTO;
@@ -9,20 +20,13 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SaveInquiryDTO;
 import com.diagbot.facade.InquiryInfoFacade;
 import com.diagbot.vo.GetInquiryDetailVO;
+import com.diagbot.vo.GetLastOtherVO;
 import com.diagbot.vo.HisInquirysVO;
 import com.diagbot.vo.ReadInquiryVO;
 import com.diagbot.vo.SaveInquiryVO;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-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;
 
 /**
  * @author rengb
@@ -51,6 +55,13 @@ public class InquiryInfoController {
     public RespDTO<ReadInquiryDTO> readInquiry(@Valid @RequestBody ReadInquiryVO readInquiryVO) {
         return RespDTO.onSuc(inquiryInfoFacade.readInquiry(readInquiryVO));
     }
+    
+    @ApiOperation(value = "获取最近一次其他史信息[by:rengb]")
+    @PostMapping("/getLastOther")
+    @SysLogger("getLastOther")
+    public RespDTO<String> getLastOther(@Valid @RequestBody GetLastOtherVO getLastOtherVO) {
+        return RespDTO.onSuc(inquiryInfoFacade.getLastOther(getLastOtherVO));
+    }
 
     @ApiOperation(value = "历史病历列表[by:rengb]")
     @PostMapping("/hisInquirys")