|
@@ -4,14 +4,13 @@ import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import thyyxxk.webserver.entity.api.forpowersi.drgdip.*;
|
|
|
import thyyxxk.webserver.entity.api.forpowersi.drgdip.statement.*;
|
|
|
-import thyyxxk.webserver.entity.medicalinsurance.query.SiPatInfo;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@Mapper
|
|
|
public interface DrgDipDao {
|
|
|
|
|
|
- @Select("select * from " +
|
|
|
+ @Select("select * from " +
|
|
|
"(SELECT ROW_NUMBER() OVER(ORDER BY code) AS idx,del_flag as flag, " +
|
|
|
"rtrim(code) as deptCode,rtrim(name) as deptName,rtrim(code) as sortNo, " +
|
|
|
"isClinicDept=case when inpatient_flag=1 then 'Y' else 'N' end " +
|
|
@@ -50,7 +49,7 @@ public interface DrgDipDao {
|
|
|
@Select("select * from " +
|
|
|
"(SELECT ROW_NUMBER() OVER(ORDER BY a.setl_id) AS idx, " +
|
|
|
"a.setl_id as settlId, " +
|
|
|
- "a.mdtrt_id as visitId, " +
|
|
|
+ "visitId=a.pat_no+'_'+cast(a.times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
|
|
|
"settlTime=convert(varchar(19), a.setl_time, 21), " +
|
|
|
"visitTime=convert(varchar(19), a.begntime, 21), " +
|
|
|
"a.medfee_sumamt as discountMoney, " +
|
|
@@ -64,8 +63,8 @@ public interface DrgDipDao {
|
|
|
List<HisOutpSettlData> selectHisOutpSettlData(int page, int size);
|
|
|
|
|
|
@Select("select " +
|
|
|
+ "visitId=a.pat_no+'_'+cast(a.times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
|
|
|
"a.setl_id as settlId, " +
|
|
|
- "a.mdtrt_id as visitId, " +
|
|
|
"settlTime=convert(varchar(19), a.setl_time, 21), " +
|
|
|
"visitTime=convert(varchar(19), a.begntime, 21), " +
|
|
|
"a.medfee_sumamt as discountMoney, " +
|
|
@@ -74,14 +73,14 @@ public interface DrgDipDao {
|
|
|
"icdCode=b.dise_code, " +
|
|
|
"isSpecial=case when a.med_type='14' then 'Y' else 'N' end " +
|
|
|
"from t_si_setlinfo a with(nolock), t_si_pat_info b with(nolock) " +
|
|
|
- "where a.mdtrt_id=#{visitId} and a.mdtrt_id=b.mdtrt_id")
|
|
|
- List<HisOutpSettlData> selectHisOutpSettlDataByVisitId(String visitId);
|
|
|
+ "where a.setl_id=#{setlId} and a.mdtrt_id=b.mdtrt_id")
|
|
|
+ List<HisOutpSettlData> selectHisOutpSettlDataByVisitId(String setlId);
|
|
|
|
|
|
@Select("select " +
|
|
|
"adviceDetailId=rtrim(b.patient_id)+'_'+cast(b.times as varchar)+'_'+" +
|
|
|
"cast(b.receipt_no as varchar)+'_'+cast(b.item_no as varchar), " +
|
|
|
"adviceId=rtrim(b.patient_id)+'_'+cast(b.times as varchar)+'_'+cast(b.receipt_no as varchar), " +
|
|
|
- "a.mdtrt_id as visitId, " +
|
|
|
+ "visitId=a.pat_no+'_'+cast(a.times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
|
|
|
"isnull(b.group_order,0) as adviceNo, " +
|
|
|
"rtrim(b.charge_item_code) as itemsId, " +
|
|
|
"itemsName=case when b.serial in ('01','99') then (select top 1 rtrim(d.name) from yp_zd_dict d " +
|
|
@@ -90,14 +89,15 @@ public interface DrgDipDao {
|
|
|
"dosForms=(select d.name from yp_zd_dosage d where d.code=(select e.dosage from yp_zd_dict e " +
|
|
|
"where e.code=b.charge_item_code)) " +
|
|
|
"from t_si_setlinfo a with(nolock), mz_charge_detail b with(nolock) " +
|
|
|
- "where a.mdtrt_id=#{visitId} and a.pat_no=b.patient_id " +
|
|
|
+ "where a.setl_id=#{setlId} and a.pat_no=b.patient_id " +
|
|
|
"and a.times=b.times and b.bill_item_code!='TC'")
|
|
|
- List<HisOutpAdviceDetail> selectHisOutpAdviceDetail(String visitId);
|
|
|
+ List<HisOutpAdviceDetail> selectHisOutpAdviceDetail(String setlId);
|
|
|
|
|
|
@Select("select " +
|
|
|
"chargeDetailId=a.pat_no+'_'+cast(a.times as varchar)+'_'+cast(b.receipt_no as varchar)+'_'+" +
|
|
|
"cast(b.item_no as varchar)+'_'+rtrim(b.charge_item_code), " +
|
|
|
- "a.mdtrt_id as visitId,a.setl_id as settlId,rtrim(b.bill_item_code) as categoryId, " +
|
|
|
+ "visitId=a.pat_no+'_'+cast(a.times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
|
|
|
+ "a.setl_id as settlId,rtrim(b.bill_item_code) as categoryId, " +
|
|
|
"categoryName=(select d.name from mz_bill_item d where d.code=b.bill_item_code), " +
|
|
|
"itemsCategory=case when b.bill_item_code in ('010','011','012') then 1 when " +
|
|
|
"b.bill_item_code in ('013','018') then 5 else 2 end, " +
|
|
@@ -123,9 +123,9 @@ public interface DrgDipDao {
|
|
|
"adviceDetailId=a.pat_no+'_'+cast(b.times as varchar)+'_'+cast(b.receipt_no as varchar)+'_'+cast(b.item_no as varchar), " +
|
|
|
"flag=case when a.revoked=0 then 0 else 2 end " +
|
|
|
"from t_si_setlinfo a with(nolock), mz_charge_detail b with(nolock) " +
|
|
|
- "where a.mdtrt_id=#{visitId} and a.pat_no=b.patient_id " +
|
|
|
+ "where a.setl_id=#{setlId} and a.pat_no=b.patient_id " +
|
|
|
"and a.times=b.times and b.bill_item_code!='TC' b.charge_item_code!='BILL99'")
|
|
|
- List<HisOutpCharge> selectHisOutpCharge(String visitId);
|
|
|
+ List<HisOutpCharge> selectHisOutpCharge(String setlId);
|
|
|
|
|
|
@Select("select visitId=rtrim(inpatient_no)+'_'+cast(admiss_times as varchar)+'_'+cast(times_billed as varchar) " +
|
|
|
"from zy_actpatient a where a.med_type!='42'")
|
|
@@ -136,72 +136,87 @@ public interface DrgDipDao {
|
|
|
List<VisitId> selectHisHsptzdPatientBaseByDateRange(String start, String end);
|
|
|
|
|
|
@Select("select " +
|
|
|
- "mdtrt_id as visitId,pat_no as admNo,psn_name as name,gend as sexId, " +
|
|
|
- "age,birthday=convert(varchar(10), brdy, 21),certno as id_card, " +
|
|
|
- "status=case when setl_msgid is null then '02' else '11' end, " +
|
|
|
- "visitDeptId=isnull((select rtrim(d.small_dept) from zy_actpatient d where d.inpatient_no=a.pat_no), " +
|
|
|
- "(select rtrim(d.small_dept) from zy_inactpatient d where d.inpatient_no=a.pat_no and d.admiss_times=a.times)), " +
|
|
|
- "hsptzdTime=convert(varchar(19), a.visit_datetime, 21), " +
|
|
|
- "tbDoctorId=isnull((select rtrim(d.refer_physician) from zy_actpatient d where d.inpatient_no=a.pat_no), " +
|
|
|
- "(select rtrim(d.refer_physician) from zy_inactpatient d where d.inpatient_no=a.pat_no and d.admiss_times=a.times)), " +
|
|
|
- "hospDischDeptId=(select rtrim(d.zk_ward) from zy_inactpatient d where d.inpatient_no=a.pat_no and d.admiss_times=a.times), " +
|
|
|
- "hospDischTime=(select convert(varchar(19),d.dis_date,21) from zy_inactpatient d where d.inpatient_no=a.pat_no and d.admiss_times=a.times), " +
|
|
|
- "a.insuplc_admdvs as insurAreaId,a.insutype as insurType,a.med_type as ttmntTypeCode,a.times as hsptzdCount, " +
|
|
|
- "disCode=(select d.icd_code from zy_in_diag_yb d where d.inpatient_no=a.pat_no and d.admiss_times=a.times and d.diag_no=1), " +
|
|
|
- "disName=(select d.icd_text from zy_in_diag_yb d where d.inpatient_no=a.pat_no and d.admiss_times=a.times and d.diag_no=1) " +
|
|
|
- "from t_si_pat_info a where a.mdtrt_id=#{visitId} and a.ledger_sn>0")
|
|
|
- List<HisHsptzdPatientBase> selectHisHsptzdPatientBaseByVisitId(String visitId);
|
|
|
+ "visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.times_billed as varchar), " +
|
|
|
+ "rtrim(a.inpatient_no) as admNo,rtrim(b.name) as name,rtrim(b.sex) as sexId, " +
|
|
|
+ "birthday=convert(varchar(10), b.birth_date, 21),rtrim(b.social_no) as idCard, " +
|
|
|
+ "status='02',rtrim(a.small_dept) as visitDeptId, " +
|
|
|
+ "hsptzdTime=convert(varchar(19), a.admiss_date, 21), " +
|
|
|
+ "rtrim(a.refer_physician) as tbDoctorId, " +
|
|
|
+ "insurAreaId=(select top 1 d.insuplc_admdvs from t_si_pat_info d where d.pat_no=a.inpatient_no and d.times=a.admiss_times), " +
|
|
|
+ "insurType=(select top 1 d.insutype from t_si_pat_info d where d.pat_no=a.inpatient_no and d.times=a.admiss_times), " +
|
|
|
+ "a.med_type as ttmntTypeCode,a.admiss_times as hsptzdCount, " +
|
|
|
+ "disCode=(select d.icd_code from zy_in_diag_yb d where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.diag_no=1), " +
|
|
|
+ "disName=(select d.icd_text from zy_in_diag_yb d where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.diag_no=1) " +
|
|
|
+ "from zy_actpatient a, a_patient_mi b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and a.inpatient_no=b.inpatient_no ")
|
|
|
+ List<HisHsptzdPatientBase> selectHisHsptzdPatientBaseInHosp(String patNo, int times);
|
|
|
+
|
|
|
+ @Select("select " +
|
|
|
+ "visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.times_billed as varchar), " +
|
|
|
+ "rtrim(a.inpatient_no) as admNo,rtrim(b.name) as name,rtrim(b.sex) as sexId, " +
|
|
|
+ "birthday=convert(varchar(10), b.birth_date, 21),rtrim(b.social_no) as idCard, " +
|
|
|
+ "status='11',rtrim(a.small_dept) as visitDeptId, " +
|
|
|
+ "hsptzdTime=convert(varchar(19), a.admiss_date, 21), " +
|
|
|
+ "rtrim(a.refer_physician) as tbDoctorId, " +
|
|
|
+ "rtrim(a.zk_ward) as hospDischDeptId, " +
|
|
|
+ "hospDischTime=convert(varchar(19),a.dis_date,21), " +
|
|
|
+ "insurAreaId=(select top 1 d.insuplc_admdvs from t_si_pat_info d where d.pat_no=a.inpatient_no and d.times=a.admiss_times), " +
|
|
|
+ "insurType=(select top 1 d.insutype from t_si_pat_info d where d.pat_no=a.inpatient_no and d.times=a.admiss_times), " +
|
|
|
+ "a.med_type as ttmntTypeCode,a.admiss_times as hsptzdCount, " +
|
|
|
+ "disCode=(select d.icd_code from zy_in_diag_yb d where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.diag_no=1), " +
|
|
|
+ "disName=(select d.icd_text from zy_in_diag_yb d where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times and d.diag_no=1) " +
|
|
|
+ "from zy_actpatient a, a_patient_mi b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} and a.inpatient_no=b.inpatient_no ")
|
|
|
+ List<HisHsptzdPatientBase> selectHisHsptzdPatientBaseOutHosp(String patNo, int times);
|
|
|
|
|
|
@Select("select " +
|
|
|
- "chargeDetailId=a.pat_no+'_'+cast(a.times as varchar)+'_'+cast(a.ledger_sn as varchar)+'_'+ " +
|
|
|
- "cast(b.detail_sn as varchar), " +
|
|
|
- "a.mdtrt_id as visitId, " +
|
|
|
- "categoryId=case when b.serial in ('01','99') then " +
|
|
|
- "(select d.code from zy_bill_item d where d.charge_code=b.charge_code) " +
|
|
|
- "else (select d.bill_item_zy from zd_charge_item d where d.code=b.charge_code_mx) end, " +
|
|
|
- "categoryName=case when b.serial in ('01','99') then " +
|
|
|
- "(select d.name from zy_bill_item d where d.charge_code=b.charge_code) " +
|
|
|
+ "chargeDetailId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar)+'_'+ " +
|
|
|
+ "cast(a.detail_sn as varchar), " +
|
|
|
+ "visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
|
|
|
+ "categoryId=case when a.serial in ('01','99') then " +
|
|
|
+ "(select d.code from zy_bill_item d where d.charge_code=a.charge_code) " +
|
|
|
+ "else (select d.bill_item_zy from zd_charge_item d where d.code=a.charge_code_mx) end, " +
|
|
|
+ "categoryName=case when a.serial in ('01','99') then " +
|
|
|
+ "(select d.name from zy_bill_item d where d.charge_code=a.charge_code) " +
|
|
|
"else (select d.name from zy_bill_item d where d.code= " +
|
|
|
- "(select d.bill_item_zy from zd_charge_item d where d.code=b.charge_code_mx)) end, " +
|
|
|
- "itemsCategory=case when b.charge_code in ('BILL01','BILL02','BILL28') then 1 else " +
|
|
|
- "(case when (select d.bill_item_zy from zd_charge_item d where d.code=b.charge_code_mx)='027' " +
|
|
|
+ "(select d.bill_item_zy from zd_charge_item d where d.code=a.charge_code_mx)) end, " +
|
|
|
+ "itemsCategory=case when a.charge_code in ('BILL01','BILL02','BILL28') then 1 else " +
|
|
|
+ "(case when (select d.bill_item_zy from zd_charge_item d where d.code=a.charge_code_mx)='027' " +
|
|
|
"then 5 else 2 end) end, " +
|
|
|
- "rtrim(b.charge_code_mx) as itemsId, " +
|
|
|
- "itemsName=case when b.serial in ('01','99') then " +
|
|
|
- "(select top 1 rtrim(d.name) from yp_zd_dict d where d.code=b.charge_code_mx) " +
|
|
|
- "else (select d.name from zd_charge_item d where d.code=b.charge_code_mx) end, " +
|
|
|
- "stand=case when b.serial in ('01','99') then " +
|
|
|
- "(select top 1 rtrim(d.specification) from yp_zd_dict d where d.code=b.charge_code_mx) " +
|
|
|
- "else (select d.specification from zd_charge_item d where d.code=b.charge_code_mx) end, " +
|
|
|
- "unit=case when b.serial in ('01','99') then " +
|
|
|
- "(select top 1 rtrim(d.unit) from yp_zd_dict d where d.code=b.charge_code_mx) " +
|
|
|
- "else (select d.charge_unit from zd_charge_item d where d.code=b.charge_code_mx) end, " +
|
|
|
- "b.retprice as unvln,b.charge_amount as num,b.charge_fee as discountMoney, " +
|
|
|
- "occurTime=convert(varchar(19), b.charge_date, 21), " +
|
|
|
- "produceTime=convert(varchar(19), b.gen_time, 21), " +
|
|
|
- "prescrDoctorId=isnull(nullif(b.doctor_code,''),b.refer_physician), " +
|
|
|
+ "rtrim(a.charge_code_mx) as itemsId, " +
|
|
|
+ "itemsName=case when a.serial in ('01','99') then " +
|
|
|
+ "(select top 1 rtrim(d.name) from yp_zd_dict d where d.code=a.charge_code_mx) " +
|
|
|
+ "else (select d.name from zd_charge_item d where d.code=a.charge_code_mx) end, " +
|
|
|
+ "stand=case when a.serial in ('01','99') then " +
|
|
|
+ "(select top 1 rtrim(d.specification) from yp_zd_dict d where d.code=a.charge_code_mx) " +
|
|
|
+ "else (select d.specification from zd_charge_item d where d.code=a.charge_code_mx) end, " +
|
|
|
+ "unit=case when a.serial in ('01','99') then " +
|
|
|
+ "(select top 1 rtrim(d.unit) from yp_zd_dict d where d.code=a.charge_code_mx) " +
|
|
|
+ "else (select d.charge_unit from zd_charge_item d where d.code=a.charge_code_mx) end, " +
|
|
|
+ "a.retprice as unvln,a.charge_amount as num,a.charge_fee as discountMoney, " +
|
|
|
+ "occurTime=convert(varchar(19), a.charge_date, 21), " +
|
|
|
+ "produceTime=convert(varchar(19), a.gen_time, 21), " +
|
|
|
+ "prescrDoctorId=isnull(nullif(a.doctor_code,''),a.refer_physician), " +
|
|
|
"prescrDoctor=(select rtrim(d.name) from a_employee_mi d where d.code= " +
|
|
|
- "isnull(nullif(b.doctor_code,''),b.refer_physician)), " +
|
|
|
- "rtrim(b.dept_code) as prescrDeptId, " +
|
|
|
- "prescrDept=(select rtrim(d.name) from zd_unit_code d where d.code=b.dept_code), " +
|
|
|
- "rtrim(b.exec_unit) as execDeptId, " +
|
|
|
- "execDept=(select rtrim(d.name) from zd_unit_code d where d.code=b.exec_unit), " +
|
|
|
- "visitDeptId=isnull((select rtrim(d.small_dept) from zy_actpatient d where d.inpatient_no=a.pat_no), " +
|
|
|
- "(select rtrim(d.small_dept) from zy_inactpatient d where d.inpatient_no=a.pat_no and d.admiss_times=a.times)), " +
|
|
|
- "cast(b.order_no as varchar) as mdclAdviceId, " +
|
|
|
+ "isnull(nullif(a.doctor_code,''),a.refer_physician)), " +
|
|
|
+ "rtrim(a.dept_code) as prescrDeptId, flag=0, " +
|
|
|
+ "prescrDept=(select rtrim(d.name) from zd_unit_code d where d.code=a.dept_code), " +
|
|
|
+ "rtrim(a.exec_unit) as execDeptId, " +
|
|
|
+ "execDept=(select rtrim(d.name) from zd_unit_code d where d.code=a.exec_unit), " +
|
|
|
+ "visitDeptId=isnull((select rtrim(d.small_dept) from zy_actpatient d where d.inpatient_no=a.inpatient_no), " +
|
|
|
+ "(select rtrim(d.small_dept) from zy_inactpatient d where d.inpatient_no=a.inpatient_no and d.admiss_times=a.admiss_times)), " +
|
|
|
+ "cast(a.order_no as varchar) as mdclAdviceId, " +
|
|
|
"hospSend=case when trans_flag_yb=1 then 'Y' else 'N' end, " +
|
|
|
- "flag=0,a.setl_id as insurSettlId " +
|
|
|
- "from t_si_pat_info a with(nolock), zy_detail_charge b with(nolock) " +
|
|
|
- "where a.mdtrt_id=#{visitId} and a.pat_no=b.inpatient_no and a.times=b.admiss_times " +
|
|
|
- "and a.ledger_sn=b.ledger_sn and b.trans_flag_yb!=2 and b.charge_status!='1'")
|
|
|
- List<HisHsptzdCharge> selectHisHsptzdCharge(String visitId);
|
|
|
-
|
|
|
- @Select("select b.mdtrt_id as visitId,rtrim(a.inpatient_no) as babyId,rtrim(a.name) as babyName " +
|
|
|
- "from a_patient_mi a, t_si_pat_info b where b.mdtrt_id=#{visitId} and a.inpatient_no like b.pat_no+'$%'")
|
|
|
- List<HisBabyInfo> selectHisBabyInfo(String visitId);
|
|
|
-
|
|
|
- @Select("select pat_no,times,ledger_sn from t_si_pat_info where mdtrt_id=#{visitId}")
|
|
|
- SiPatInfo selectBriefPatInfo(String visitId);
|
|
|
+ "insurSettlId=(select d.setl_id from t_si_setlinfo d where d.pat_no=a.inpatient_no and d.times=a.admiss_times " +
|
|
|
+ "and d.ledger_sn=a.ledger_sn and d.revoked=0) " +
|
|
|
+ "from zy_detail_charge a with(nolock) " +
|
|
|
+ "where a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
|
|
|
+ "and a.ledger_sn=#{ledgerSn} and a.trans_flag_yb!=2 and a.charge_status!='1'")
|
|
|
+ List<HisHsptzdCharge> selectHisHsptzdCharge(String patNo, int times, int ledgerSn);
|
|
|
+
|
|
|
+ @Select("select visitId=b.pat_no+'_'+cast(b.times as varchar)+'_'+cast(b.ledger_sn as varchar), " +
|
|
|
+ "rtrim(a.inpatient_no) as babyId,rtrim(a.name) as babyName " +
|
|
|
+ "from a_patient_mi a, t_si_pat_info b where b.pat_no=#{patNo} and b.times=#{times} " +
|
|
|
+ "and b.ledger_sn=#{ledgerSn} and a.inpatient_no like b.pat_no+'$%'")
|
|
|
+ List<HisBabyInfo> selectHisBabyInfo(String patNo, int times, int ledgerSn);
|
|
|
|
|
|
@Select("select count(1) from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
int selectInHospCount(String patNo, int times);
|
|
@@ -235,7 +250,8 @@ public interface DrgDipDao {
|
|
|
"from ${table} where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
List<HisHsptzdMdclAdvice> selectHisHsptzdMdclAdvice(String patNo, int times, String table);
|
|
|
|
|
|
- @Select("select mdtrt_id as visitId,mdtrt_id,psn_no,setl_id,insuplc_admdvs from t_si_setlinfo " +
|
|
|
+ @Select("select visitId=pat_no+'_'+cast(times as varchar)+'_'+cast(ledger_sn as varchar), " +
|
|
|
+ "mdtrt_id,psn_no,setl_id,insuplc_admdvs from t_si_setlinfo " +
|
|
|
"where revoked=0 and setl_time>=#{start} and setl_time<=#{end} ")
|
|
|
List<YibaoSetlinfo2304Brief> selectSetlBrief(String start, String end);
|
|
|
|
|
@@ -247,19 +263,21 @@ public interface DrgDipDao {
|
|
|
"hifmi_pay,hifob_pay,maf_pay,oth_pay,fund_pay_sumamt,psn_part_amt, " +
|
|
|
"acct_pay,psn_cash_pay,hosp_part_amt,balc,acct_mulaid_pay, " +
|
|
|
"status=case when setl_list_id is null then 0 else 1 end, " +
|
|
|
- "mdtrt_id as visitId,setl_id,insuplc_admdvs,clr_way, " +
|
|
|
+ "visitId=pat_no+'_'+cast(times as varchar)+'_'+cast(ledger_sn as varchar), " +
|
|
|
+ "setl_id,insuplc_admdvs,clr_way, " +
|
|
|
"fixmedinsCode='H43010500370',fixmedinsName='长沙泰和医院', " +
|
|
|
"begndate=convert(varchar(19), begntime, 21), " +
|
|
|
"enddate=convert(varchar(19), endtime, 21),clr_type " +
|
|
|
- "from t_si_setlinfo where revoked=0 and mdtrt_id=#{visitId} ")
|
|
|
- List<YibaoSetlinfo2304> selectYibaoSetlinfo2304(String visitId);
|
|
|
+ "from t_si_setlinfo where revoked=0 and setl_id=#{setlId} ")
|
|
|
+ List<YibaoSetlinfo2304> selectYibaoSetlinfo2304(String setlId);
|
|
|
|
|
|
@Select("select " +
|
|
|
"a.fund_pay_type,a.inscp_scp_amt,a.crt_payb_lmt_amt,a.fund_payamt,a.fund_pay_type_name, " +
|
|
|
- "a.setl_proc_info,b.mdtrt_id as visitId,b.setl_id " +
|
|
|
- "from t_si_setldetail a, t_si_setlinfo b where b.mdtrt_id=#{visitId} and " +
|
|
|
+ "a.setl_proc_info,b.setl_id, " +
|
|
|
+ "visitId=b.pat_no+'_'+cast(b.times as varchar)+'_'+cast(b.ledger_sn as varchar) " +
|
|
|
+ "from t_si_setldetail a, t_si_setlinfo b where b.setl_id=#{setlId} and " +
|
|
|
"a.pat_no=b.pat_no and a.times=b.times and a.ledger_sn=b.ledger_sn")
|
|
|
- List<YibaoSetldetail2304> selectYibaoSetldetail2304(String visitId);
|
|
|
+ List<YibaoSetldetail2304> selectYibaoSetldetail2304(String setlId);
|
|
|
|
|
|
@Select("select " +
|
|
|
"a.mdtrt_id,a.setl_id,a.feedetl_sn,b.med_type,a.fee_ocur_time, " +
|
|
@@ -270,40 +288,34 @@ public interface DrgDipDao {
|
|
|
"a.hosp_prep_flag,a.hosp_appr_flag,a.tcmdrug_used_way,a.prodplac_type, " +
|
|
|
"a.bas_medn_flag,a.hi_nego_drug_flag,a.chld_medc_flag,a.etip_flag, " +
|
|
|
"a.etip_hosp_code,a.dscg_tkdrug_flag,a.list_sp_item_flag,a.matn_fee_flag, " +
|
|
|
- "a.drt_reim_flag,a.memo,a.opter_id,a.opter_name,a.opt_time,a.mdtrt_id as visitId " +
|
|
|
+ "a.drt_reim_flag,a.memo,a.opter_id,a.opter_name,a.opt_time, " +
|
|
|
+ "visitId=b.pat_no+'_'+cast(b.times as varchar)+'_'+cast(b.ledger_sn as varchar) " +
|
|
|
"from t_si_setl_fee_detl a, t_si_setlinfo b " +
|
|
|
- "where a.setl_id=b.setl_id and a.mdtrt_id=#{visitId} ")
|
|
|
- List<Yibao5204> selectYibao5204(String visitId);
|
|
|
+ "where a.setl_id=#{setlId} and a.setl_id=b.setl_id ")
|
|
|
+ List<Yibao5204> selectYibao5204(String setlId);
|
|
|
|
|
|
@Select("select " +
|
|
|
- "b.mdtrt_id as visitId,dagnsCategory=1, " +
|
|
|
+ "dagnsCategory=1, " +
|
|
|
"dagnsTypeId=case when diag_no=1 then 1 else 2 end, " +
|
|
|
"dagnsWayId=1,icd_text as diseaseName, " +
|
|
|
- "icd_code from zy_in_diag_yb a, t_si_setlinfo b " +
|
|
|
- "where b.mdtrt_id=#{visitId} and b.pat_no=a.inpatient_no " +
|
|
|
- "and b.times=a.admiss_times " +
|
|
|
+ "icd_code from zy_in_diag_yb " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times} " +
|
|
|
"union " +
|
|
|
"select " +
|
|
|
- "b.mdtrt_id as visitId, " +
|
|
|
"dagnsCategory=case when si_diag_type in ('1','2') then 1 else 2 end, " +
|
|
|
"dagnsTypeId=case when dis_diag_no=1 then 1 else 2 end, " +
|
|
|
"dagnsWayId=2, " +
|
|
|
"rtrim(dis_diag_comment) as diseaseName, " +
|
|
|
"rtrim(dis_diag) as icdCode " +
|
|
|
- "from zy_dis_diag_yb a, t_si_setlinfo b " +
|
|
|
- "where b.mdtrt_id=#{visitId} and b.pat_no=a.inpatient_no " +
|
|
|
- "and b.times=a.admiss_times")
|
|
|
- List<HisPatientDagns> selectHisPatientDagns(String visitId);
|
|
|
-
|
|
|
- @Select("select b.mdtrt_id as visitId,a.no, " +
|
|
|
- "a.code as oprtCode,a.name as oprtName " +
|
|
|
- "from t_case_frontsheet_surgery a,t_si_setlinfo b " +
|
|
|
- "where b.mdtrt_id=#{visitId} and b.pat_no=a.bah and b.times=a.times")
|
|
|
- List<HisPatientOprtInfo> selectHisPatientOprtInfo(String visitId);
|
|
|
-
|
|
|
- @Select("select b.mdtrt_id as visitId from t_case_frontsheet_main a,t_si_setlinfo b " +
|
|
|
- "where a.sign_date>=#{start} and a.sign_date<=#{end} and " +
|
|
|
- "a.bah=b.pat_no and a.admiss_times=b.times")
|
|
|
+ "from zy_dis_diag_yb " +
|
|
|
+ "where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
+ List<HisPatientDagns> selectHisPatientDagns(String patNo, int times);
|
|
|
+
|
|
|
+ @Select("select no,code as oprtCode,name as oprtName from t_case_frontsheet_surgery where bah=#{patNo} and times=#{times}")
|
|
|
+ List<HisPatientOprtInfo> selectHisPatientOprtInfo(String patNo, int times);
|
|
|
+
|
|
|
+ @Select("select visitId=bah+'_'+cast(admiss_times as varchar)+'_1' from t_case_frontsheet_main " +
|
|
|
+ "where sign_date>=#{start} and sign_date<=#{end} ")
|
|
|
List<VisitId> selectSignedVistiId(String start, String end);
|
|
|
|
|
|
@Select("select " +
|