Jelajahi Sumber

荧光接口

xiaochan 2 tahun lalu
induk
melakukan
26e08b564f

+ 6 - 8
src/main/java/thyyxxk/webserver/controller/jiekou/FluorescenceTestController.java

@@ -33,23 +33,21 @@ public class FluorescenceTestController {
     public ResultVo<String> save(@RequestBody JSONObject js) {
         JSONObject personInfo = js.getJSONObject("ReportPersonInfo");
         String caseStr = personInfo.getString("Case");
-
         if (StringUtil.isBlank(caseStr)) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "病例号为空无法保存。");
         }
-
         Integer id = Integer.valueOf(caseStr);
-
-        Patient p = dao.selectPatInfoByReqNo(id);
+        // 查询门诊患者
+        Patient p = dao.selectPatInfoMz(id);
+        // 查询住院患者
+        p = p == null ? dao.selectPatInfoByReqNo(id) : p;
         if (p == null) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "未查询到患者信息。");
         }
-
-        Integer count = dao.selectCountById(id);
+        Integer count = dao.selectCountById(id, p.getInpatientNo(), p.getAdmissTimes());
         if (count > 0) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "请勿重复上传。");
         }
-
         FluorescenceSpecimenResult f = new FluorescenceSpecimenResult();
         f.setHospitalName(personInfo.getString("HospitalName"))
                 .setId(id)
@@ -68,13 +66,13 @@ public class FluorescenceTestController {
                 .setBedNo(personInfo.getString("BedNo"))
                 .setPatNo(p.getInpatientNo())
                 .setTimes(p.getAdmissTimes());
-
         js.remove("ReportPersonInfo");
         f.setOutcome(js.toString());
         dao.insert(f);
         return ResultVoUtil.success();
     }
 
+
     private static Date strToDate(String str) {
         if (StringUtil.notBlank(str)) {
             str = str.replace("T", " ");

+ 9 - 2
src/main/java/thyyxxk/webserver/dao/his/jiekou/FluorescenceTestDao.java

@@ -15,8 +15,15 @@ public interface FluorescenceTestDao extends BaseMapper<FluorescenceSpecimenResu
             "where req_no = #{id}")
     Patient selectPatInfoByReqNo(@Param("id") Integer id);
 
+
+    @Select("select patient_id as inpatient_no ,times as admiss_times" +
+            " from mz_yj_req where req_no = #{id} ")
+    Patient selectPatInfoMz(@Param("id") Integer id);
+
     @Select("select count(1) " +
             "from fluorescence_specimen_result " +
-            "where id = #{id} ")
-    Integer selectCountById(@Param("id") Integer id);
+            "where id = #{id} and pat_no = #{patNo} and times = #{times}")
+    Integer selectCountById(@Param("id") Integer id,
+                            @Param("patNo") String patNo,
+                            @Param("times") Integer times);
 }