|
@@ -1,12 +1,14 @@
|
|
|
package thyyxxk.webserver.dao.his.inpatient.nursemodule;
|
|
package thyyxxk.webserver.dao.his.inpatient.nursemodule;
|
|
|
|
|
|
|
|
import org.apache.ibatis.annotations.*;
|
|
import org.apache.ibatis.annotations.*;
|
|
|
|
|
+import thyyxxk.webserver.entity.executeItem.YzActOcc;
|
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.request.InfusionInsert;
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.request.InfusionInsert;
|
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.OccCount;
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.OccCount;
|
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientBed;
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientBed;
|
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientBriefInfo;
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.PatientBriefInfo;
|
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.YzActOccInfusionNew;
|
|
import thyyxxk.webserver.entity.inpatient.nursemodule.response.YzActOccInfusionNew;
|
|
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@Mapper
|
|
@Mapper
|
|
@@ -29,6 +31,9 @@ public interface PrintInfusionCardDao {
|
|
|
@Delete("delete from yz_act_occ_infusion_new where ward_code=#{wardCode}")
|
|
@Delete("delete from yz_act_occ_infusion_new where ward_code=#{wardCode}")
|
|
|
void deleteOldInfusion(String wardCode);
|
|
void deleteOldInfusion(String wardCode);
|
|
|
|
|
|
|
|
|
|
+ @Delete("delete from yz_act_occ_infusion_new where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
|
|
+ void deleteOldInfusionByPatient(String patNo, Integer times);
|
|
|
|
|
+
|
|
|
@Insert("insert into yz_act_occ_infusion_new(inpatient_no,admiss_times,ward_code,act_order_no,charge_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," +
|
|
"drug_flag,specification,drug_occ,frequ_code,supply_name,start_time,end_time,drug_name,instruction," +
|
|
|
"parent_no,yz_dose,yz_dose_unit,entrust) " +
|
|
"parent_no,yz_dose,yz_dose_unit,entrust) " +
|
|
@@ -147,4 +152,108 @@ public interface PrintInfusionCardDao {
|
|
|
|
|
|
|
|
@Update("update yz_act_occ set print_comment=#{status} where act_order_no in (${orderNos})")
|
|
@Update("update yz_act_occ set print_comment=#{status} where act_order_no in (${orderNos})")
|
|
|
void updateYzActOccPrintStatus(String status, String orderNos);
|
|
void updateYzActOccPrintStatus(String status, String orderNos);
|
|
|
|
|
+
|
|
|
|
|
+ @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,b.ward_code, " +
|
|
|
|
|
+ "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,yz_supply_type e " +
|
|
|
|
|
+ "where b.inpatient_no=#{patNo} and b.admiss_times=#{times} " +
|
|
|
|
|
+ "and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
|
|
|
|
|
+ "and b.execute_time is null " +
|
|
|
|
|
+ "and isnull(b.status_flag,'')!='d' " +
|
|
|
|
|
+ "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.frequ_code=c.code and a.act_order_no=b.act_order_no ")
|
|
|
|
|
+ void insertInfusionByPatNo(InfusionInsert insert);
|
|
|
|
|
+
|
|
|
|
|
+ @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,b.ward_code, " +
|
|
|
|
|
+ "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,yz_supply_type e " +
|
|
|
|
|
+ "where b.inpatient_no=#{patNo} and b.admiss_times=#{times} " +
|
|
|
|
|
+ "and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} " +
|
|
|
|
|
+ "and b.execute_time is not null and b.execute_staff is not null " +
|
|
|
|
|
+ "and isnull(b.status_flag,'')!='d' " +
|
|
|
|
|
+ "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.frequ_code=c.code and a.act_order_no=b.act_order_no ")
|
|
|
|
|
+ void insertInfusionByPatNo2(InfusionInsert insert);
|
|
|
|
|
+
|
|
|
|
|
+ @Select("SELECT distinct a.inpatient_no,a.drug_occ,b.occ_time as start_time,a.drug_name,a.frequ_code, " +
|
|
|
|
|
+ "a.act_order_no,a.instruction,a.specification,rtrim(b.charge_code) as chargeCode " +
|
|
|
|
|
+ "FROM yz_act_occ_infusion_new a,yz_act_occ b " +
|
|
|
|
|
+ "WHERE isnull(a.visible_flag,'0')!='1' " +
|
|
|
|
|
+ "and a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
|
|
|
|
|
+ "and b.execute_time is null " +
|
|
|
|
|
+ "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> selectMainDrugsByPatNo(InfusionInsert insert);
|
|
|
|
|
+
|
|
|
|
|
+ @Select("SELECT distinct a.inpatient_no,a.drug_occ,b.occ_time as start_time,a.drug_name,a.frequ_code, " +
|
|
|
|
|
+ "a.act_order_no,a.instruction,a.specification,rtrim(b.charge_code) as chargeCode " +
|
|
|
|
|
+ "FROM yz_act_occ_infusion_new a,yz_act_occ b " +
|
|
|
|
|
+ "WHERE isnull(a.visible_flag,'0')!='1' " +
|
|
|
|
|
+ "and a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
|
|
|
|
|
+ "and b.execute_time is not null and b.execute_staff is not null " +
|
|
|
|
|
+ "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> selectMainDrugsByPatNo2(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,rtrim(d.charge_code) as chargeCode, " +
|
|
|
|
|
+ "parentNo=cast(cast(a.parent_no as decimal) as varchar),d.occ_time as 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 d.execute_time is null " +
|
|
|
|
|
+ "AND a.status_flag<='5' AND d.occ_time>=#{startTime} AND d.occ_time<=#{endTime} " +
|
|
|
|
|
+ "AND isnull(d.status_flag,'')!='d' AND d.inpatient_no=#{patNo} and d.admiss_times=#{times} " +
|
|
|
|
|
+ "order by a.act_order_no")
|
|
|
|
|
+ List<YzActOccInfusionNew> selectSideDrugsByPatNo(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,rtrim(d.charge_code) as chargeCode, " +
|
|
|
|
|
+ "parentNo=cast(cast(a.parent_no as decimal) as varchar),d.occ_time as 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 d.execute_time is not null and d.execute_staff is not null " +
|
|
|
|
|
+ "AND a.status_flag<='5' AND d.occ_time>=#{startTime} AND d.occ_time<=#{endTime} " +
|
|
|
|
|
+ "AND isnull(d.status_flag,'')!='d' AND d.inpatient_no=#{patNo} and d.admiss_times=#{times} " +
|
|
|
|
|
+ "order by a.act_order_no")
|
|
|
|
|
+ List<YzActOccInfusionNew> selectSideDrugsByPatNo2(InfusionInsert insert);
|
|
|
|
|
+
|
|
|
|
|
+ @Select("select rtrim(charge_code) as chargeCode,drug_quan,execute_staff,execute_time " +
|
|
|
|
|
+ "from yz_act_occ where inpatient_no=#{patNo} and act_order_no=#{actOrderNo} " +
|
|
|
|
|
+ "and occ_time=#{occTime} " +
|
|
|
|
|
+ "union all " +
|
|
|
|
|
+ "select rtrim(charge_code) as chargeCode,drug_quan,execute_staff,execute_time " +
|
|
|
|
|
+ "from yz_act_occ where inpatient_no=#{patNo} and parent_no=#{actOrderNo} " +
|
|
|
|
|
+ "and occ_time=#{occTime} and act_order_no>0")
|
|
|
|
|
+ List<YzActOcc> getInfusionDrugsByScan(String patNo, String actOrderNo, Date occTime);
|
|
|
|
|
+
|
|
|
|
|
+ @Update("update yz_act_occ set execute_staff=#{staff},execute_time=getdate() " +
|
|
|
|
|
+ "where inpatient_no=#{patNo} and occ_time=#{occTime} and " +
|
|
|
|
|
+ "(act_order_no=#{actOrderNo} or parent_no=#{actOrderNo})")
|
|
|
|
|
+ int updateExecutor(String patNo, String actOrderNo, Date occTime, String staff);
|
|
|
}
|
|
}
|