lighter пре 3 година
родитељ
комит
12b02acf3b

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>1</version>
+    <version>2</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 10 - 0
src/main/java/thyyxxk/webserver/constants/sidicts/SiFunction.java

@@ -400,6 +400,16 @@ public enum SiFunction {
      */
     QUERY_DEPARTMENT_INFO("5101", ""),
 
+    /**
+     * 通过此交易上传住院病案首页信息(病案首页信息)
+     */
+    UPLOAD_FRONT_SHEET_INFO("4401", ""),
+
+    /**
+     * 通过此交易上传住院医嘱记录(住院医嘱记录)
+     */
+    UPLOAD_ACT_ORDER("4402", ""),
+
     /**
      * 通过此交易获取当前医药机构的医师、护士、药师人员信息(医执人员信息查询)
      */

+ 90 - 1
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiManageDao.java

@@ -5,8 +5,10 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 import thyyxxk.webserver.entity.medicalinsurance.manage.InstSetlLdgChkBrf;
+import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Baseinfo;
+import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Diseinfo;
+import thyyxxk.webserver.entity.medicalinsurance.manage.orderinfo.ActOrder;
 
-import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -56,4 +58,91 @@ public interface SiManageDao {
 
     @Select("select count(1) from dj_user_role where user_code=#{code} and role_id=41")
     Integer recoveryTradePermission(@Param("code") String code);
+
+    @Select("select mdtrtSn='H43010500370'+bah+'_'+cast(admiss_times as varchar), " +
+            "mdtrtId=(select top 1 mdtrt_id from t_si_setlinfo where pat_no=bah and times=admiss_times and revoked=0), " +
+            "psnNo=(select top 1 psn_no from t_si_setlinfo where pat_no=bah and times=admiss_times and revoked=0), " +
+            "admiss_times as patnIptCnt,bah as iptNo,medcasno=bah+'_'+cast(admiss_times as varchar), " +
+            "name as psnName,sex as gend,birth_date as brdy, " +
+            "ntly=(select si_code from zd_country_code where code=country), " +
+            "ntlyName=(select rtrim(name) from zd_country_code where code=country), " +
+            "nwbBirWt=case when new_born_weight='-' then '' else new_born_weight end, " +
+            "nwbAdmWt=case when new_born_admiss_weight='-' then '' else new_born_admiss_weight end, " +
+            "birth_place_name as birplc,native_place_name as napl, " +
+            "naty=(select wjw_code from zd_nation_code where code=nation), " +
+            "natyName=(select rtrim(name) from zd_nation_code where code=nation), " +
+            "social_no as certno,occupation as prfs, " +
+            "mrgStas=(select si_code from zd_marital_status where code=marriage), " +
+            "live_place as currAddr,phone as psnTel,hk_place_name as resdAddr, " +
+            "unit_phone as emprTel,unit_place as emprAddr,contact_phone as conerTel, " +
+            "contact_name as conerName,contact_addr_name as conerAddr,zy_admiss_way as admWayCode, " +
+            "admWayName=(select name from zy_zd_admiss_way where code=zy_admiss_way), " +
+            "admCaty=(select si_caty from zd_unit_code where code=admiss_dept_code), " +
+            "admiss_ward as admWard,admiss_date as admDate,dismiss_date as dscgDate, " +
+            "dscgCaty=(select si_caty from zd_unit_code where code=dismiss_dept_code), " +
+            "dismiss_ward as dscgWard,admiss_days as iptDays,allergy as drugDicmFlag, " +
+            "allergic_medicine as dicmDrugName,autopsy as dieAutpFlag,blood_type as aboCode, " +
+            "aboName=(select rtrim(name) from zd_blood_type where code=blood_type), " +
+            "rhCode=(select wjw_code from zd_hbsag where code=rh), " +
+            "rhName=(select rtrim(name) from zd_hbsag where code=rh), " +
+            "dept_leader_name as deptdrtName,leader_doctor_name as chfdrName, " +
+            "main_doctor_name as atddrName,admiss_doctor_name as iptDrName, " +
+            "duty_nurse_name as respNursName,study_doctor_name as trainDrName, " +
+            "internship_doctor_name as intnDrName,coder_name as codrName, " +
+            "quality_control_doctor_name as qltctrlDrName, " +
+            "quality_control_nurse_name as qltctrlNursName, " +
+            "quality_control_level as medcasQltCode, " +
+            "quality_control_date as qltctrlDate, " +
+            "dscgWay=(select wjw_code from zd_zy_dismiss_way where code=zy_dismiss_way), " +
+            "dscgWayName=(select name from zd_zy_dismiss_way where code=zy_dismiss_way), " +
+            "acpMedinsName=case when dismiss_destination='-' then '' else dismiss_destination end, " +
+            "admiss_again_in_one_month as dscg31DaysRinpFlag, " +
+            "dscg31DaysRinpPup=case when admiss_again_purpose='-' then '' else admiss_again_purpose end, " +
+            "damgIntxExtRea=case when hurt_reason_name='-' then '' else hurt_reason_name end, " +
+            "damgIntxExtReaDisecode=case when hurt_reason_code='-' then '' else hurt_reason_code end, " +
+            "brn_damg_bfadm_coma_dura=coma_days_before_admiss+'/'+coma_hours_before_admiss+'/'+coma_minutes_before_admiss, " +
+            "brn_damg_afadm_coma_dura=coma_days_after_admiss+'/'+coma_hours_after_admiss+'/'+coma_minutes_after_admiss, " +
+            "fixmedinsCode='H43010500370',age,hbs_ag as hbsag,hcv_ab,hiv_ab, " +
+            "rescue_times as rescCnt,rescue_success_times as rescSuccCnt,total_cost as medfeeSumamt, " +
+            "valiFlag='1',case_classification as ctd,dept_leader as deptdrtCode,leader_doctor as chfdrCode, " +
+            "main_doctor as atddrCode,admiss_doctor as iptDrCode,duty_nurse as respNursCode, " +
+            "quality_control_doctor as qltctrlDrCode,quality_control_nurse as qltctrlNursCode " +
+            "from t_case_frontsheet_main where bah=#{patNo} and admiss_times=#{times}")
+    Baseinfo selectFrontSheetBaseInfo(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select maindiagFlag=case when dis_diag_no=1 then '1' else '0' end, " +
+            "rtrim(dis_diag) as diagCode,rtrim(dis_diag) as inhospDiagCode, " +
+            "rtrim(dis_diag_comment) as diagName,rtrim(dis_diag_comment) as inhospDiagName, " +
+            "valiFlag='1',iptMedcasHmpgSn=rtrim(inpatient_no)+'_'+cast(admiss_times as varchar), " +
+            "mdtrtSn='H43010500370'+rtrim(inpatient_no)+'_'+cast(admiss_times as varchar), " +
+            "fixmedinsCode='H43010500370' " +
+            "from zy_dis_diag_yb where inpatient_no=#{patNo} and admiss_times=#{times}")
+    List<Diseinfo> selectYbDisdiags(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select maindiagFlag=case when no=1 then '1' else '0' end, " +
+            "code as diagCode,code as inhospDiagCode, " +
+            "name as diagName,name as inhospDiagName, " +
+            "valiFlag='1',iptMedcasHmpgSn=bah+'_'+cast(times as varchar), " +
+            "mdtrtSn='H43010500370'+bah+'_'+cast(times as varchar), " +
+            "fixmedinsCode='H43010500370' " +
+            "from t_case_frontsheet_disdiag where bah=#{patNo} and times=#{times}")
+    List<Diseinfo> selectFrontSheetDiseInfo(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select mdtrtSn='H43010500370'+rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar), " +
+            "mdtrtId=(select top 1 mdtrt_id from t_si_pat_info where " +
+            "pat_no=a.inpatient_no and times=a.admiss_times and mdtrt_id is not null and med_type!='42' ), " +
+            "psnNo=(select top 1 psn_no from t_si_pat_info where " +
+            "pat_no=a.inpatient_no and times=a.admiss_times and mdtrt_id is not null and med_type!='42' ), " +
+            "iptBedNo=rtrim(b.bed_no),drordNo=cast(cast(act_order_no as decimal) as varchar), " +
+            "isuDeptCode=(select si_caty from zd_unit_code t where t.code=(select dept_code from a_employee_mi e where e.code=a.enter_oper)), " +
+            "order_time as drordIsuNo,exeDeptCode=(select si_caty from zd_unit_code where code=exec_unit), " +
+            "exeDeptCode=(select si_caty from zd_unit_code t where t.code=(select top 1 exec_unit from zy_detail_charge e where e.order_no=a.act_order_no)), " +
+            "exedeptName=(select t.name from zd_unit_code t where t.code=(select top 1 exec_unit from zy_detail_charge e where e.order_no=a.act_order_no)), " +
+            "drordPtrName=(select t.name from a_employee_mi t where t.code=a.executer1), " +
+            "order_code as drordDetlCode,order_name as drordDetlName,valiFlag='1', " +
+            "iptDeptCode=(select si_caty from zd_unit_code t where t.code=b.small_dept), " +
+            "medcasDrordDetlId='H43010500370'+cast(cast(act_order_no as decimal) as varchar) " +
+            "from yz_act_order a, zy_actpatient b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
+            "and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times")
+    List<ActOrder> selectActOrders(@Param("patNo") String patNo, @Param("times") int times);
 }

+ 141 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/manage/orderinfo/ActOrder.java

@@ -0,0 +1,141 @@
+package thyyxxk.webserver.entity.medicalinsurance.manage.orderinfo;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ActOrder {
+    @JSONField(name = "mdtrt_sn")
+    private String mdtrtSn;
+
+    @JSONField(name = "mdtrt_id")
+    private String mdtrtId;
+
+    @JSONField(name = "psn_no")
+    private String psnNo;
+
+    @JSONField(name = "ipt_bedno")
+    private String iptBedno;
+
+    @JSONField(name = "drord_no")
+    private String drordNo;
+
+    @JSONField(name = "isu_dept_code")
+    private String isuDeptCode;
+
+    @JSONField(name = "drord_isu_no")
+    private Date drordIsuNo;
+
+    @JSONField(name = "exe_dept_code")
+    private String exeDeptCode;
+
+    @JSONField(name = "exedept_name")
+    private String exedeptName;
+
+    @JSONField(name = "drord_chker_name")
+    private String drordChkerName;
+
+    @JSONField(name = "drord_ptr_name")
+    private String drordPtrName;
+
+    @JSONField(name = "drord_grpno")
+    private String drordGrpno;
+
+    @JSONField(name = "drord_type")
+    private String drordType;
+
+    @JSONField(name = "drord_item_type")
+    private String drordItemType;
+
+    @JSONField(name = "drord_item_name")
+    private String drordItemName;
+
+    @JSONField(name = "drord_detl_code")
+    private String drordDetlCode;
+
+    @JSONField(name = "drord_detl_name")
+    private String drordDetlName;
+
+    @JSONField(name = "medn_type_code")
+    private String mednTypeCode;
+
+    @JSONField(name = "medn_type_name")
+    private String mednTypeName;
+
+    @JSONField(name = "drug_dosform")
+    private String drugDosform;
+
+    @JSONField(name = "drug_dosform_name")
+    private String drugDosformName;
+
+    @JSONField(name = "drug_spec")
+    private String drugSpec;
+
+    @JSONField(name = "dismed_cnt")
+    private String dismedCnt;
+
+    @JSONField(name = "dismed_cnt_unt")
+    private String dismedCntUnt;
+
+    @JSONField(name = "medn_use_frqu")
+    private String mednUseFrqu;
+
+    @JSONField(name = "medn_used_dosunt")
+    private String mednUsedDosunt;
+
+    @JSONField(name = "drug_used_sdose")
+    private String drugUsedSdose;
+
+    @JSONField(name = "drug_used_idose")
+    private String drugUsedIdose;
+
+    @JSONField(name = "drug_used_way_code")
+    private String drugUsedWayCode;
+
+    @JSONField(name = "drug_used_way")
+    private String drugUsedWay;
+
+    @JSONField(name = "medc_days")
+    private String medcDays;
+
+    @JSONField(name = "medc_begntime")
+    private Date medcBegntime;
+
+    @JSONField(name = "medc_endtime")
+    private Date medcEndtime;
+
+    @JSONField(name = "skintst_dicm")
+    private String skintstDicm;
+
+    @JSONField(name = "tcmherb_foote")
+    private String tcmherbFoote;
+
+    @JSONField(name = "drord_endtime")
+    private Date drordEndtime;
+
+    @JSONField(name = "ipt_dept_code")
+    private String iptDeptCode;
+
+    @JSONField(name = "medins_orgcode")
+    private String medinsOrgcode;
+
+    @JSONField(name = "unif_purc_drug_flag")
+    private String unifPurcDrugFlag;
+
+    @JSONField(name = "drug_mgt_plaf_code")
+    private String drugMgtPlafCode;
+
+    @JSONField(name = "drug_purc_code")
+    private String drugPurcCode;
+
+    @JSONField(name = "bas_medn_flag")
+    private String basMednFlag;
+
+    @JSONField(name = "vali_flag")
+    private String valiFlag;
+
+    @JSONField(name = "medcas_drord_detl_id")
+    private String medcasDrordDetlId;
+}

+ 29 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -22,7 +22,10 @@ import thyyxxk.webserver.entity.medicalinsurance.manage.deptmanage.DeptInfoQuery
 import thyyxxk.webserver.entity.medicalinsurance.manage.deptmanage.DrInfoQuery;
 import thyyxxk.webserver.entity.medicalinsurance.manage.detailanalyse.MainPart;
 import thyyxxk.webserver.entity.medicalinsurance.manage.examination.BilgItemInfo;
+import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Baseinfo;
+import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Diseinfo;
 import thyyxxk.webserver.entity.medicalinsurance.manage.goods.*;
+import thyyxxk.webserver.entity.medicalinsurance.manage.orderinfo.ActOrder;
 import thyyxxk.webserver.entity.medicalinsurance.setlinfo.SiSetlinfo;
 import thyyxxk.webserver.entity.medicalinsurance.setlinfo.SlctSetlPrm;
 import thyyxxk.webserver.utils.*;
@@ -555,4 +558,30 @@ public class SiManageService {
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
+
+    public ResultVo<String> uploadFrontSheet(String patNo, int times) {
+        Baseinfo baseinfo = dao.selectFrontSheetBaseInfo(patNo, times);
+        List<Diseinfo> diseinfos = dao.selectYbDisdiags(patNo, times);
+        if (null == diseinfos || diseinfos.isEmpty()) {
+            diseinfos = dao.selectFrontSheetDiseInfo(patNo, times);
+        }
+        JSONObject input = exec.makeTradeHeader(SiFunction.UPLOAD_FRONT_SHEET_INFO);
+        String base = JSONObject.toJSONStringWithDateFormat(baseinfo, "yyyy-MM-dd");
+        String dise = JSONArray.toJSONString(diseinfos);
+        input.getJSONObject("input").put("baseinfo", JSONObject.parseObject(base));
+        input.getJSONObject("input").put("diseinfo", JSONArray.parseArray(dise));
+        JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_FRONT_SHEET_INFO);
+        log.info("【操作员:{}】,病案首页信息上传:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
+        return SiUtil.makeReturnWithoutOutput(result, "病案首页信息上传成功。");
+    }
+
+    public ResultVo<String> uploadActOrder(String patNo, int times) {
+        List<ActOrder> actOrders = dao.selectActOrders(patNo, times);
+        JSONObject input = exec.makeTradeHeader(SiFunction.UPLOAD_ACT_ORDER);
+        String ref = JSONArray.toJSONStringWithDateFormat(actOrders, "yyyy-MM-dd HH:mm:ss");
+        input.getJSONObject("input").put("data", JSONArray.parseArray(ref));
+        JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_ACT_ORDER);
+        log.info("【操作员:{}】,医嘱记录上传:\n参数:{},\n结果:{}", TokenUtil.getTokenUserId(), input, result);
+        return SiUtil.makeReturnWithoutOutput(result, "医嘱记录上传成功。");
+    }
 }

+ 4 - 4
src/main/resources/application.yml

@@ -65,7 +65,7 @@ mybatis-plus:
   configuration:
     map-underscore-to-camel-case: true
 
-triage-notify-url: http://localhost:8083/triage/roomScreen/pushMsg
+triage-notify-url: http://localhost:8082/triage/roomScreen/pushMsg
 si-tj-url: http://jkglcsx.server.zhongmeihealth.com/openInter
 
 si-access-key: 04eMGRg7beAO6vqwrZiLacV8Uy3jNn7QGDUcBO
@@ -73,7 +73,7 @@ si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
 
 execute-scheduled: false
 
-logging:
-  level:
-    thyyxxk.webserver.dao: debug
+#logging:
+#  level:
+#    thyyxxk.webserver.dao: debug