|
@@ -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);
|
|
|
}
|