|
|
@@ -26,23 +26,21 @@ public interface PrintInfusionCardDao {
|
|
|
"and a.ward=#{wardCode} and a.bed_no in (${bedNos}) order by cast(bed_no as int)")
|
|
|
List<PatientBriefInfo> selectTargetPatients(String wardCode, String bedNos);
|
|
|
|
|
|
- @Delete("delete from yz_act_occ_infusion_new where dept_code=#{wardCode} and ward_code=#{wardCode}")
|
|
|
+ @Delete("delete from yz_act_occ_infusion_new where ward_code=#{wardCode}")
|
|
|
void deleteOldInfusion(String wardCode);
|
|
|
|
|
|
- @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,dept_name,ward_name,act_order_no," +
|
|
|
- "charge_code_0,drug_flag_0,specification_0,drug_occ_0,frequ_code_0,supply_name_0,supply_name_1," +
|
|
|
- "start_time_0,end_time_0,dept_code,ward_code,drug_name_0,instruction_0,parent_no,instruction_1," +
|
|
|
- "yz_dose,yz_dose_unit) " +
|
|
|
- "select distinct rtrim(a.inpatient_no),a.admiss_times,rtrim(b.dept_code),#{wardCode}," +
|
|
|
- "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i',rtrim(a.drug_specification)+" +
|
|
|
- "'('+rtrim(isnull(e.print_name,''))+')'," +
|
|
|
+ @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no,charge_code," +
|
|
|
+ "drug_flag,specification,drug_occ,frequ_code,supply_name,start_time,end_time,drug_name,instruction," +
|
|
|
+ "parent_no,yz_dose,yz_dose_unit,entrust) " +
|
|
|
+ "select distinct rtrim(a.inpatient_no),a.admiss_times,#{wardCode}," +
|
|
|
+ "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i'," +
|
|
|
+ "rtrim(a.drug_specification)+'('+rtrim(isnull(e.print_name,''))+')'," +
|
|
|
"rtrim(a.drug_occ),rtrim(d.code),rtrim(convert(varchar,a.dose))+isnull(f.name, '')," +
|
|
|
- "rtrim(a.mini_unit),a.start_time,a.end_time,rtrim(b.dept_code),#{wardCode},rtrim(a.order_name)," +
|
|
|
- "rtrim(e.supply_name),0,rtrim(a.instruction),rtrim(a.dose),rtrim(a.dose_unit) " +
|
|
|
+ "a.start_time,a.end_time,rtrim(a.order_name),rtrim(e.supply_name),0,rtrim(a.dose)," +
|
|
|
+ "rtrim(a.dose_unit),rtrim(a.instruction) " +
|
|
|
"from yz_act_order a left join yp_zd_unit f on a.dose_unit=f.code," +
|
|
|
"yz_act_occ b, zy_actpatient c, yz_order_frequency d,yz_supply_type e " +
|
|
|
- "where b.dept_code=#{wardCode} ${alwaysFlag} and b.ward_code=#{wardCode} and " +
|
|
|
- "b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
|
|
|
+ "where b.ward_code=#{wardCode} ${alwaysFlag} and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
|
|
|
"and isnull(b.status_flag, '')!='d' and a.status_flag>'1' and a.supply_code=e.supply_code " +
|
|
|
"and e.class='2' and isnull(a.parent_no,0)=0 and a.inpatient_no=c.inpatient_no " +
|
|
|
"and a.admiss_times=c.admiss_times and a.frequ_code=d.code ${printComment} " +
|
|
|
@@ -50,95 +48,100 @@ public interface PrintInfusionCardDao {
|
|
|
"and(isnull(a.end_time,'')='' or a.frequ_code like '%ONCE%' or a.end_time>=getdate())")
|
|
|
void insertNewInfusion(InfusionInsert data);
|
|
|
|
|
|
- @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,dept_name,ward_name," +
|
|
|
- "act_order_no,charge_code_0,drug_flag_0,specification_0,drug_occ_0,frequ_code_0," +
|
|
|
- "supply_name_0,supply_name_1,start_time_0,end_time_0,dept_code,ward_code,drug_name_0," +
|
|
|
- "instruction_0,parent_no,instruction_1,yz_dose,yz_dose_unit) " +
|
|
|
- "select distinct rtrim(a.inpatient_no),a.admiss_times,rtrim(b.dept_code),rtrim(b.ward_code)," +
|
|
|
+ @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no," +
|
|
|
+ "charge_code,drug_flag,specification,drug_occ,frequ_code,supply_name,start_time,end_time," +
|
|
|
+ "drug_name,instruction,parent_no,yz_dose,yz_dose_unit,entrust) " +
|
|
|
+ "select distinct rtrim(a.inpatient_no),a.admiss_times,#{wardCode}," +
|
|
|
"cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i'," +
|
|
|
"rtrim(a.drug_specification)+'('+rtrim(isnull(c.print_name,''))+')'," +
|
|
|
- "rtrim(a.drug_occ),rtrim(b.frequ_code_0),rtrim(convert(varchar,a.dose))+isnull(d.name,'')," +
|
|
|
- "rtrim(a.mini_unit),a.start_time,a.end_time,rtrim(b.dept_code),rtrim(b.ward_code)," +
|
|
|
- "ltrim(rtrim(a.order_name)),rtrim(c.supply_name),cast(cast(a.parent_no as decimal) as varchar)," +
|
|
|
- "rtrim(a.instruction),rtrim(a.dose),rtrim(a.dose_unit) from yz_act_order a left join yp_zd_unit d " +
|
|
|
+ "rtrim(a.drug_occ),rtrim(b.frequ_code),rtrim(convert(varchar,a.dose))+isnull(d.name,'')," +
|
|
|
+ "a.start_time,a.end_time,rtrim(a.order_name),rtrim(c.supply_name)," +
|
|
|
+ "cast(cast(a.parent_no as decimal) as varchar)," +
|
|
|
+ "rtrim(a.dose),rtrim(a.dose_unit),rtrim(a.instruction) from yz_act_order a left join yp_zd_unit d " +
|
|
|
"on a.dose_unit=d.code,yz_act_occ_infusion_new b,yz_supply_type c where " +
|
|
|
- "b.dept_code=#{wardCode} and b.ward_code=#{wardCode} and a.inpatient_no=b.inpatient_no " +
|
|
|
+ "b.ward_code=#{wardCode} and a.inpatient_no=b.inpatient_no " +
|
|
|
"and a.admiss_times=b.admiss_times and a.parent_no=b.act_order_no and a.supply_code=c.supply_code " +
|
|
|
"and(isnull(a.end_time,'')='' or a.frequ_code like '%ONCE%' or a.end_time>=getdate())")
|
|
|
void insertInfusionAgain(String wardCode);
|
|
|
|
|
|
- @Update("update yz_act_occ_infusion_new set inpatient_name=a.name," +
|
|
|
- "yz_act_occ_infusion_new.bed_no=a.bed_no from zy_actpatient a where " +
|
|
|
- "yz_act_occ_infusion_new.inpatient_no=a.inpatient_no and " +
|
|
|
- "yz_act_occ_infusion_new.admiss_times=a.admiss_times")
|
|
|
- void updateNewInfusion();
|
|
|
-
|
|
|
@Select("select * from (" +
|
|
|
- "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code,a.signer_0," +
|
|
|
- "drug_name_0=a.drug_name_0+'('+cast(d.name as varchar(8))+')',a.specification_0,a.drug_occ_0," +
|
|
|
- "a.frequ_code_0,a.supply_name_0,a.start_time_0,a.end_time_0,a.charge_code_0,occ_time=a.start_time_0," +
|
|
|
- "a.drug_flag_0,a.instruction_0,a.parent_no,a.supply_name_1,a.instruction_1," +
|
|
|
- "bz=(select top 1 case b.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
|
|
|
- "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null and " +
|
|
|
- "datediff(day,order_time,getdate())<=3 and ps_oper is not null), " +
|
|
|
- "a.yz_dose,a.yz_dose_unit,b.order_code from yz_act_occ_infusion_new a,yz_act_order b, " +
|
|
|
+ "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.signer," +
|
|
|
+ "drug_name=a.drug_name+'('+cast(d.name as varchar(8))+')',a.specification,a.drug_occ," +
|
|
|
+ "a.frequ_code,a.supply_name,a.start_time,a.end_time,a.charge_code,occ_time=a.start_time," +
|
|
|
+ "a.drug_flag,a.instruction,a.parent_no,a.entrust,a.yz_dose,a.yz_dose_unit,b.order_code " +
|
|
|
+ "from yz_act_occ_infusion_new a,yz_act_order b, " +
|
|
|
"(select code,max(manu_code)manu_code from yp_zd_dict group by code) c " +
|
|
|
"left join yp_zd_manufactory d on c.manu_code=d.code " +
|
|
|
- "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no=0 " +
|
|
|
- "and a.act_order_no=b.act_order_no and a.inpatient_no=b.inpatient_no and a.charge_code_0=c.code " +
|
|
|
+ "where a.ward_code=#{wardcode} and a.parent_no=0 and a.act_order_no=b.act_order_no " +
|
|
|
+ "and a.inpatient_no=b.inpatient_no and a.charge_code=c.code " +
|
|
|
"union " +
|
|
|
- "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code,a.signer_0, " +
|
|
|
- "drug_name_0=a.drug_name_0,a.specification_0,a.drug_occ_0,a.frequ_code_0,a.supply_name_0," +
|
|
|
- "a.start_time_0,a.end_time_0,a.charge_code_0,occ_time=a.start_time_0,a.drug_flag_0," +
|
|
|
- "a.instruction_0,a.parent_no,a.supply_name_1,a.instruction_1, " +
|
|
|
- "bz=(select top 1 case b.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
|
|
|
- "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null), " +
|
|
|
- "a.yz_dose,yz_dose_unit,b.order_code from yz_act_occ_infusion_new a,yz_act_order b " +
|
|
|
- "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no=0 and a.act_order_no=b.act_order_no " +
|
|
|
- "and a.inpatient_no=b.inpatient_no and a.charge_code_0 not in (select code from yp_zd_dict group by code)" +
|
|
|
+ "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.signer, " +
|
|
|
+ "drug_name=a.drug_name,a.specification,a.drug_occ,a.frequ_code,a.supply_name," +
|
|
|
+ "a.start_time,a.end_time,a.charge_code,occ_time=a.start_time,a.drug_flag," +
|
|
|
+ "a.instruction,a.parent_no,a.entrust,a.yz_dose,yz_dose_unit,b.order_code " +
|
|
|
+ "from yz_act_occ_infusion_new a,yz_act_order b " +
|
|
|
+ "where a.ward_code=#{wardcode} and a.parent_no=0 and a.act_order_no=b.act_order_no " +
|
|
|
+ "and a.inpatient_no=b.inpatient_no and a.charge_code not in (select code from yp_zd_dict group by code)" +
|
|
|
") t order by t.act_order_no")
|
|
|
List<YzActOccInfusionNew> selectMainDrugs(String wardCode);
|
|
|
|
|
|
@Select("select * from (" +
|
|
|
- "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code, " +
|
|
|
- "drug_name_0=a.drug_name_0+'('+cast(d.name as varchar(8))+')',a.specification_0,a.drug_occ_0,a.frequ_code_0, " +
|
|
|
- "a.supply_name_0,a.start_time_0,a.end_time_0,a.signer_0,a.charge_code_0,a.drug_flag_0,a.instruction_0, " +
|
|
|
- "a.parent_no,a.supply_name_1,a.instruction_1, " +
|
|
|
- "bz=(select top 1 case e.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
|
|
|
- "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null " +
|
|
|
- "and datediff(day,order_time,getdate())<=3 and ps_oper is not null), " +
|
|
|
- "yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code " +
|
|
|
+ "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.parent_no, " +
|
|
|
+ "drug_name=a.drug_name+'('+cast(d.name as varchar(8))+')',a.specification,a.drug_occ,a.frequ_code, " +
|
|
|
+ "a.supply_name,a.start_time,a.end_time,a.signer,a.charge_code,a.drug_flag,a.instruction, " +
|
|
|
+ "yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code,a.entrust " +
|
|
|
"from yz_act_occ_infusion_new a,yz_act_order b, " +
|
|
|
"(select code,max(manu_code)manu_code from yp_zd_dict group by code)c " +
|
|
|
"left join yp_zd_manufactory d on c.manu_code=d.code " +
|
|
|
- "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
|
|
|
- "and a.inpatient_no=b.inpatient_no and a.charge_code_0=c.code " +
|
|
|
+ "where a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
|
|
|
+ "and a.inpatient_no=b.inpatient_no and a.charge_code=c.code " +
|
|
|
"union " +
|
|
|
- "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.dept_code,a.ward_code, " +
|
|
|
- "drug_name_0=a.drug_name_0,a.specification_0,a.drug_occ_0,a.frequ_code_0,a.supply_name_0,a.start_time_0, " +
|
|
|
- "a.end_time_0,a.signer_0,a.charge_code_0,a.drug_flag_0,a.instruction_0,a.parent_no,a.supply_name_1, " +
|
|
|
- "a.instruction_1,yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code, " +
|
|
|
- "bz=(select top 1 case e.ps_status when 0 then '(阴性)' when 1 then '(阳性)' end from yz_act_order e " +
|
|
|
- "where e.inpatient_no=b.inpatient_no and e.order_code=b.order_code and e.ps_status is not null " +
|
|
|
- "and datediff(day,order_time,getdate())<=3)from yz_act_occ_infusion_new a,yz_act_order b " +
|
|
|
- "where a.dept_code=#{wardcode} and a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
|
|
|
- "and a.inpatient_no=b.inpatient_no and a.charge_code_0 not in (select code from yp_zd_dict group by code)" +
|
|
|
+ "select a.inpatient_no,a.act_order_no,a.admiss_times,a.bed_no,a.ward_code,a.parent_no, " +
|
|
|
+ "drug_name=a.drug_name,a.specification,a.drug_occ,a.frequ_code,a.supply_name,a.start_time, " +
|
|
|
+ "a.end_time,a.signer,a.charge_code,a.drug_flag,a.instruction, " +
|
|
|
+ "yz_dose=b.dose,yz_dose_unit=b.dose_unit,b.order_code,a.entrust " +
|
|
|
+ "from yz_act_occ_infusion_new a,yz_act_order b " +
|
|
|
+ "where a.ward_code=#{wardcode} and a.parent_no!=0 and a.act_order_no=b.act_order_no " +
|
|
|
+ "and a.inpatient_no=b.inpatient_no and a.charge_code not in (select code from yp_zd_dict group by code)" +
|
|
|
") t order by t.act_order_no")
|
|
|
List<YzActOccInfusionNew> selectSideDrugs(String wardCode);
|
|
|
|
|
|
- @Select("SELECT a.act_order_no,countValue=count(1) " +
|
|
|
- "FROM yz_act_occ_infusion_new a,yz_act_occ b WHERE " +
|
|
|
- "a.ward_code=#{wardCode} AND a.parent_no=0 and a.inpatient_no=b.inpatient_no " +
|
|
|
- "and a.admiss_times=b.admiss_times and a.act_order_no=b.act_order_no and " +
|
|
|
- "b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
|
|
|
- "group by a.inpatient_no,a.act_order_no,a.admiss_times")
|
|
|
- List<OccCount> selectOccCount(InfusionInsert data);
|
|
|
+ @Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no," +
|
|
|
+ "charge_code,drug_flag,specification,drug_occ,frequ_code,supply_name,start_time," +
|
|
|
+ "end_time,drug_name,instruction,yz_dose,yz_dose_unit) " +
|
|
|
+ "select distinct rtrim(a.inpatient_no),a.admiss_times,#{wardCode}," +
|
|
|
+ "cast(cast(a.act_order_no as decimal) as varchar),rtrim(a.order_code),'i'," +
|
|
|
+ "rtrim(convert(varchar,a.dose))+isnull(f.name,''),a.drug_occ,rtrim(c.print_name)," +
|
|
|
+ "rtrim(a.supply_code),a.start_time,a.end_time, " +
|
|
|
+ "rtrim(a.order_name)+'('+rtrim(a.drug_specification)+')',rtrim(a.instruction),rtrim(a.dose)," +
|
|
|
+ "rtrim(a.dose_unit) from yz_act_order a left join yp_zd_unit f on a.dose_unit=f.code, " +
|
|
|
+ "yz_act_occ b,yz_order_frequency c,zy_actpatient d,yz_supply_type e " +
|
|
|
+ "where b.ward_code=#{wardCode} ${alwaysFlag} " +
|
|
|
+ "and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} ${printComment} " +
|
|
|
+ "and isnull(b.status_flag,'')!='d' and d.dept=#{wardCode} and d.ward=#{wardCode} " +
|
|
|
+ "and a.status_flag>'1' and a.supply_code=e.supply_code and e.print_name!='iv' and e.class='2' " +
|
|
|
+ "and e.pring_flag='1' and isnull(a.parent_no,0)=0 and a.inpatient_no=d.inpatient_no " +
|
|
|
+ "and a.admiss_times=d.admiss_times and a.frequ_code=c.code and a.act_order_no=b.act_order_no " +
|
|
|
+ "and b.bed_no in (${bedNos})")
|
|
|
+ void insertNewBottleCard(InfusionInsert insert);
|
|
|
|
|
|
- @Select("select rtrim(a.inpatient_no) as patNo,a.admiss_times as times, " +
|
|
|
- "wardName=(select rtrim(d.name) from zd_unit_code d where d.code=#{wardCode}), " +
|
|
|
- "rtrim(a.name) as patName,rtrim(bed_no)+N'床' as bedNo, " +
|
|
|
- "patGender=case when a.sex='1' then '男' else '女' end, " +
|
|
|
- "ageDays=datediff(day,b.birth_date,getdate()) from zy_actpatient a,a_patient_mi b " +
|
|
|
- "where a.inpatient_no=#{patNo} and a.inpatient_no=b.inpatient_no")
|
|
|
- PatientBriefInfo selectPatientBriefInfo(String patNo, String wardCode);
|
|
|
+ @Select("SELECT distinct a.inpatient_no,a.drug_occ,a.start_time,a.drug_name,a.frequ_code, " +
|
|
|
+ "a.act_order_no,a.instruction,a.specification FROM yz_act_occ_infusion_new a,yz_act_occ b " +
|
|
|
+ "WHERE isnull(a.visible_flag,'0')!='1' and a.ward_code=#{wardCode} " +
|
|
|
+ "and isnull(a.instruction,'') not like N'冲管%' " +
|
|
|
+ "and b.act_order_no=a.act_order_no and b.occ_time>=#{startTime} AND b.occ_time<=#{endTime} " +
|
|
|
+ "AND isnull(b.status_flag,'')!='d' order by a.inpatient_no,a.act_order_no")
|
|
|
+ List<YzActOccInfusionNew> selectMainDrugsForBottleCard(InfusionInsert insert);
|
|
|
+
|
|
|
+ @Select("SELECT DISTINCT rtrim(c.print_name) as frequCode,rtrim(a.order_name) as orderName, " +
|
|
|
+ "specification=cast(a.dose as varchar)+isnull(e.name,''),a.drug_occ, " +
|
|
|
+ "parentNo=cast(cast(a.parent_no as decimal) as varchar),a.start_time, " +
|
|
|
+ "actOrderNo=cast(cast(a.act_order_no as decimal) as varchar),a.act_order_no as ordeNo " +
|
|
|
+ "FROM yz_act_order a left join yp_zd_unit e on a.dose_unit=e.code, " +
|
|
|
+ "yz_supply_type b,yz_order_frequency c,yz_act_occ d " +
|
|
|
+ "WHERE a.supply_code=b.supply_code and a.frequ_code=c.code " +
|
|
|
+ "and a.act_order_no=d.act_order_no and a.parent_no is not null AND a.status_flag>'1' " +
|
|
|
+ "AND a.status_flag<='5' AND d.occ_time>=#{startTime} AND d.occ_time<=#{endTime} " +
|
|
|
+ "AND isnull(d.status_flag,'')!='d' AND d.ward_code=#{wardCode} order by a.act_order_no")
|
|
|
+ List<YzActOccInfusionNew> selectSideDrugsForBottleCard(InfusionInsert insert);
|
|
|
}
|