Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/web-server

xiaochan 2 years ago
parent
commit
d23f5fff75

+ 11 - 0
src/main/java/thyyxxk/webserver/controller/dictionary/FetchDictionariesController.java

@@ -4,11 +4,13 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import thyyxxk.webserver.constants.sidicts.PsnCertType;
 import thyyxxk.webserver.dao.his.dictionary.FetchDictionariesDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.utils.ResultVoUtil;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @RestController
@@ -35,4 +37,13 @@ public class FetchDictionariesController {
     public ResultVo<List<CodeName>> selectRelations() {
         return ResultVoUtil.success(dao.selectRelations());
     }
+
+    @GetMapping("/psnCertType")
+    public ResultVo<List<CodeName>> selectPsnCertTypes() {
+        List<CodeName> list = new ArrayList<>();
+        for (PsnCertType psnCertType : PsnCertType.values()) {
+            list.add(new CodeName(psnCertType.getCode(), psnCertType.getName()));
+        }
+        return ResultVoUtil.success(list);
+    }
 }

+ 1 - 66
src/main/java/thyyxxk/webserver/controller/inpatient/DismissController.java

@@ -29,13 +29,8 @@ import java.util.List;
 @RequestMapping("/dismiss")
 public class DismissController {
     private final DismissService service;
-    private final SiZyService zyService;
-    private final PatientDao dao;
-
-    public DismissController(DismissService service, SiZyService zyService, PatientDao dao) {
+    public DismissController(DismissService service) {
         this.service = service;
-        this.zyService = zyService;
-        this.dao = dao;
     }
 
     @PassToken
@@ -69,64 +64,4 @@ public class DismissController {
         return service.executeDischarging(param);
     }
 
-    @PassToken
-    @PostMapping("/verification")
-    public ResultVo<List<IllegalFee>> verification(@Validated @RequestBody HrgDismissParam param) {
-        if (param.getDismissFlag() == 2 && null == param.getZjdzDatetime()) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "中间断账时,断账时间不能为空。");
-        }
-        String table = "zy_actpatient";
-        Patient p = dao.getPatientInfoForHrg(param.getInpatientNo(), param.getAdmissTimes(), table);
-        if (null == p) {
-            table = "zy_inactpatient";
-            p = dao.getPatientInfoForHrg(param.getInpatientNo(), param.getAdmissTimes(), table);
-        }
-        if (null == p) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未找到住院号【" + param.getInpatientNo() + "】的在院业务。");
-        }
-        p.setTable(table);
-        p.setStaffId(param.getStaffId());
-        p.setMidSetl(param.getDismissFlag() == 2);
-        return service.calculateForDismiss(p);
-    }
-
-    @PassToken
-    @PostMapping("/execute")
-    public synchronized ResultVo<String> dismissForHrg(@Validated @RequestBody HrgDismissParam param) {
-        if (param.getDismissFlag() == 2 && null == param.getZjdzDatetime()) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "中间断账时,断账时间不能为空。");
-        }
-        log.info("出院结算:{}", param);
-        String table = "zy_actpatient";
-        Patient p = dao.getPatientInfoForHrg(param.getInpatientNo(), param.getAdmissTimes(), table);
-        if (null == p) {
-            table = "zy_inactpatient";
-            p = dao.getPatientInfoForHrg(param.getInpatientNo(), param.getAdmissTimes(), table);
-        }
-        if (null == p) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未找到住院号【" + param.getInpatientNo() + "】的在院业务。");
-        }
-        p.setTable(table);
-        if (StringUtil.isBlank(p.getMedType()) || p.getMedType().equals(MedType.SELF_PAY.getCode())) {
-            MedinsSettleFee feePojo = new MedinsSettleFee();
-            feePojo.setInpatientNo(p.getInpatientNo());
-            feePojo.setAdmissTimes(p.getAdmissTimes());
-            feePojo.setBedNo(p.getBedNo());
-            feePojo.setMidSetl(param.getDismissFlag() == 2);
-            feePojo.setZjdzDatetime(param.getZjdzDatetime());
-            feePojo.setStaffId(param.getStaffId());
-            feePojo.setWardCode(p.getAdmissWard());
-            feePojo.setDeptCode(p.getAdmissDept());
-            feePojo.setTable(table);
-            return service.executeDischarging(feePojo);
-        } else {
-            ZyPatientInfo zyPatientInfo = new ZyPatientInfo();
-            zyPatientInfo.setInpatientNo(param.getInpatientNo());
-            zyPatientInfo.setAdmissTimes(param.getAdmissTimes());
-            zyPatientInfo.setMidSetl(param.getDismissFlag() == 2);
-            zyPatientInfo.setZjdzDatetime(param.getZjdzDatetime());
-            zyPatientInfo.setStaffId(param.getStaffId());
-            return zyService.dischargeProcessing(zyPatientInfo);
-        }
-    }
 }

+ 4 - 5
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SiManageController.java

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.controller.medicalinsurance;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -100,15 +101,13 @@ public class SiManageController {
         return service.deptInfoDelete(deptInfo);
     }
 
-    @PassToken
     @PostMapping("/queryDeptInfo")
-    public ResultVo<JSONObject> queryDeptInfo(@RequestBody DeptInfoQuery query) {
-        return service.queryDeptInfo(query);
+    public ResultVo<JSONArray> queryDeptInfo() {
+        return service.queryDeptInfo();
     }
 
-    @PassToken
     @PostMapping("/queryMedStaffInfo")
-    public ResultVo<JSONObject> queryMedStaffInfo(@RequestBody MedStaffQuery query) {
+    public ResultVo<JSONArray> queryMedStaffInfo(@RequestBody MedStaffQuery query) {
         return service.queryMedStaffInfo(query);
     }
 

+ 0 - 41
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -94,47 +94,6 @@ public interface PatientDao {
             "</script>")
     Patient getPatientInfo(@Param("inpatientNo") String inpatientNo, @Param("table") String table, @Param("times") Integer times);
 
-    @Select("select inpatientNo=rtrim(a.inpatient_no),a.admiss_times,a.med_type,b.social_no, " +
-            "name=rtrim(a.name),sex=isnull(a.sex, b.sex),act_ipt_days=(datediff(day, admiss_date, getdate())), " +
-            "birthDate=(convert(varchar(10), birth_date, 21)),home_tel=rtrim(b.home_tel), " +
-            "admissPhysician=rtrim(a.admiss_physician), " +
-            "admissPhysicianName=rtrim((select name FROM a_employee_mi WHERE code = a.admiss_physician)), " +
-            "referPhysician=rtrim(a.refer_physician),a.dise_code,a.dise_name, " +
-            "referPhysicianName=rtrim((select name FROM a_employee_mi WHERE code = a.refer_physician)), " +
-            "admissDiagStr=rtrim(isnull(a.admiss_diag_str,'')), " +
-            "clinicDiagStr=rtrim(isnull(a.clinic_diag_str,'')), " +
-            "admissWard=rtrim(isnull(a.ward,a.admiss_ward)), " +
-            "admissWardName=(select rtrim(name) from zd_unit_code where code=a.ward), " +
-            "admissDept=rtrim(a.admiss_dept), a.matn_type,smallDept=rtrim(a.small_dept), " +
-            "smallDeptName=rtrim((select name from zd_unit_code where code=small_dept)), " +
-            "admiss_date,ybRegisterDate=isnull(yb_register_date, admiss_date), " +
-            "responceType=rtrim(isnull(a.responce_type, '01')), " +
-            "responceTypeName=(select rtrim(name) from zy_zd_responce_type where code = isnull(a.responce_type, '01')), " +
-            "zkWard=rtrim(a.zk_ward),ward=(a.ward),a.latechb_flag,a.pret_flag,ledgerSn=a.times_billed, " +
-            "admissStatus=rtrim(a.admiss_status), " +
-            "dismissOrder=(select count(1) from yz_act_order y where y.inpatient_no=b.inpatient_no  " +
-            "and y.admiss_times=a.admiss_times and status_flag>'1' and isnull(group_no,'00')='00' " +
-            "and order_code in ('06026','06053','05973')),  " +
-            "disDiagStatus=(select RTRIM(dis_diag_status) from zy_dis_diag_yb where inpatient_no=a.inpatient_no " +
-            "and admiss_times=a.admiss_times and dis_diag_no=1), " +
-            "operation=rtrim(a.operation),a.zy_serial_no, " +
-            "bedNo=rtrim(a.bed_no),a.admdvs, " +
-            "mdtrtId=(select mdtrt_id from t_si_pat_info where pat_no=a.inpatient_no and times=a.admiss_times and ledger_sn=a.times_billed), " +
-            "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +
-            "and times=a.admiss_times and ledger_sn=a.times_billed), " +
-            "chargeYb=(select isnull(charge_yb, '0.00') from zy_ledger_file where inpatient_no=a.inpatient_no " +
-            "and admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
-            "totalCharge=(select rtrim(isnull(total_charge, '0.00')) from zy_ledger_file where inpatient_no=a.inpatient_no " +
-            "and admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
-            "balance=RTRIM((select balance+charge_yb from zy_ledger_file where inpatient_no=a.inpatient_no and " +
-            "admiss_times=a.admiss_times and ledger_sn=a.times_billed)), " +
-            "injuryArea=(select injury_area from t_injury_si_pat_info where pat_no=a.inpatient_no " +
-            "and times=a.admiss_times and ledger_sn=a.times_billed) " +
-            "FROM ${table} a, a_patient_mi b WHERE a.inpatient_no=#{patNo} and a.admiss_times=#{times} AND b.inpatient_no=a.inpatient_no")
-    Patient getPatientInfoForHrg(@Param("patNo") String patNo,
-                                 @Param("times") Integer times,
-                                 @Param("table") String table);
-
     @Select("select dis_diag_no, " +
             "rtrim(dis_diag) disDiag, " +
             "rtrim(dis_diag_comment) disDiagComment, " +

+ 2 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -3,6 +3,7 @@ package thyyxxk.webserver.service.medicalinsurance;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.copier.CopyOptions;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.IdcardUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.RandomUtil;
@@ -2312,7 +2313,7 @@ public class SetlListUpldService {
         setlinfoUpld.setBizSn(SnowFlakeId.instance().nextId());
 
         // 新生儿入院类型写死为1
-        if (StringUtil.notBlank(setlinfoUpld.getNwbBirWt())) {
+        if (StringUtil.notBlank(setlinfoUpld.getNwbAge()) && NumberUtil.isNumber(setlinfoUpld.getNwbAge()) && Convert.toInt(setlinfoUpld.getNwbAge(),0)  > 0) {
             setlinfoUpld.setNwbAdmType("1");
         }
         String medType = dao.getMedicalCategory(patNo, times, ledgerSn);

+ 26 - 4
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -625,11 +625,17 @@ public class SiManageService {
         return SiUtil.makeReturnWithoutOutput(result, "科室信息撤销成功。");
     }
 
-    public ResultVo<JSONObject> queryDeptInfo(DeptInfoQuery query) {
+    public ResultVo<JSONArray> queryDeptInfo() {
         JSONObject input = exec.makeTradeHeader(SiFunction.QUERY_DEPARTMENT_INFO);
+        String staffId = TokenUtil.getTokenUserId();
+        DeptInfoQuery query = new DeptInfoQuery();
+        query.setOpterType("1");
+        query.setOpter(staffId);
+        query.setOpterName(redis.getEmployeeName(staffId));
         query.setInfno(SiFunction.QUERY_DEPARTMENT_INFO.getCode());
         query.setMsgid(input.getString("msgid"));
         query.setInfTime(input.getString("inf_time"));
+        query.setMdtrtareaAdmvs(SiUtil.INSTITUTION_AREA);
         query.setFixmedinsCode(SiUtil.INSTITUTION_ID);
         query.setFixmedinsName(SiUtil.INSTITUTION_NAME);
         query.setSignNo(input.getString("sign_no"));
@@ -643,13 +649,21 @@ public class SiManageService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
         if (infcode == 0) {
-            return ResultVoUtil.success(result.getJSONObject(OUTPUT));
+            JSONObject output = result.getJSONObject(OUTPUT);
+            if (null == output) {
+                return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+            }
+            JSONArray details = output.getJSONArray("feedetail");
+            if (null == details || details.isEmpty()) {
+                return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+            }
+            return ResultVoUtil.success(details);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
     // 接口存在问题
-    public ResultVo<JSONObject> queryMedStaffInfo(MedStaffQuery query) {
+    public ResultVo<JSONArray> queryMedStaffInfo(MedStaffQuery query) {
         String ref = JSONObject.toJSONString(query);
         JSONObject input = exec.makeTradeHeader(SiFunction.QUERY_MEDICAL_STAFF_INFO);
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
@@ -660,7 +674,15 @@ public class SiManageService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
         }
         if (infcode == 0) {
-            return ResultVoUtil.success(result.getJSONObject(OUTPUT));
+            JSONObject output = result.getJSONObject(OUTPUT);
+            if (null == output) {
+                return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+            }
+            JSONArray details = output.getJSONArray("feedetail");
+            if (null == details || details.isEmpty()) {
+                return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+            }
+            return ResultVoUtil.success(details);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }

+ 1 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -820,7 +820,7 @@ public class SiQueryService {
             JSONObject output = result.getJSONObject(OUTPUT);
             JSONArray array = output.getJSONArray("psnfixmedin");
             if (null == array || array.size() == 0) {
-                return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到对应的定信息。");
+                return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到对应的定信息。");
             }
             List<PsnFixMedin> list = new ArrayList<>();
             for (int i = 0; i < array.size(); i++) {