|
@@ -0,0 +1,340 @@
|
|
|
+package thyyxxk.webserver.dao.his.medicaladvice.medicamanage;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
|
+import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import thyyxxk.webserver.entity.inpatient.patient.Patient;
|
|
|
+import thyyxxk.webserver.entity.medicaladvice.medicamanage.YzPrintVO;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description:医嘱管理
|
|
|
+ * @Author:lihong
|
|
|
+ * @Date: 2023/3/13
|
|
|
+ */
|
|
|
+@Mapper
|
|
|
+public interface MedicalManagementDao {
|
|
|
+ @Select("SELECT act_order_no=a.act_order_no,\n" +
|
|
|
+ " inpatient_no=a.inpatient_no,\n" +
|
|
|
+ " name =c.name,\n" +
|
|
|
+ " dept_code =a.ward_code,\n" +
|
|
|
+ " bed_no =c.bed_no,\n" +
|
|
|
+ " sex =c.sex,\n" +
|
|
|
+ " age =space(10),\n" +
|
|
|
+ " order_name =rtrim(a.order_name),\n" +
|
|
|
+ " start_time =case when isnull(a.parent_no,'')='' then a.start_time else (select start_time from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " print_page =a.print_page,\n" +
|
|
|
+ " doctor_code =physician,\n" +
|
|
|
+ " nurse_code =executer1,\n" +
|
|
|
+ " self_buy =a.self_buy,\n" +
|
|
|
+ " page_no =isnull(print_page,0),\n" +
|
|
|
+ " page_no_old =0,\n" +
|
|
|
+ " last_rows =0,\n" +
|
|
|
+ " modifier =case when exclu_group_type='1' then null else a.modifier end,\n" +
|
|
|
+ " executer2 =case when exclu_group_type='1' then null else a.executer2 end,\n" +
|
|
|
+ " drug_quan =a.drug_quan,\n" +
|
|
|
+ " dose =a.dose ,\n" +
|
|
|
+ " dose_unit =a.dose_unit,\n" +
|
|
|
+ " frequ_code =a.frequ_code,\n" +
|
|
|
+ " supply_code =a.supply_code,\n" +
|
|
|
+ " spec =a.drug_specification,\n" +
|
|
|
+ " group_no =a.group_no,\n" +
|
|
|
+ " parent_no =a.parent_no,\n" +
|
|
|
+ " instruction =a.instruction,\n" +
|
|
|
+ " parent_flag =space(2),\n" +
|
|
|
+ " parent_flag2 =space(2),\n" +
|
|
|
+ " end_time =case when exclu_group_type='1' then null else a.end_time end,\n" +
|
|
|
+ " ps_status='',\n" +
|
|
|
+ " ps_oper='',\n" +
|
|
|
+ " ps_time='',\n" +
|
|
|
+ " act_order_no_b=a.act_order_no,\n" +
|
|
|
+ " order_time_b= case when isnull(a.parent_no,'')='' then convert(char(16),a.confirm_time,121) else (select convert(char(16),confirm_time,121) from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " order_name2 =space(32),\n" +
|
|
|
+ " exec_id,\n" +
|
|
|
+ " exec_id2 = case when exclu_group_type='1' then null else a.executer2 end,\n" +
|
|
|
+ " cx_flag='0',\n" +
|
|
|
+ " sort_no=0,\n" +
|
|
|
+ " a.confirm_time,\n" +
|
|
|
+ " new_order_name_code = isnull(a.instruction,'') +(case when isnull(ps_status,'')='' then '' when ps_status='0'then '皮试:阴性'else '皮试:阳性'end) + ' ' +\n" +
|
|
|
+ " (case when a.self_buy = '1' then '自备'when a.self_buy = '2' then '嘱托' else '' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.supply_code,'') = '' then '' else (select print_name from yz_supply_type where supply_code = a.supply_code) end ),\n" +
|
|
|
+ " new_order_name = rtrim(a.order_name) + (case when a.group_no <> '00' then (case when isnull(a.drug_specification,'')=''then '' else '(' + isnull(a.drug_specification,'')+')' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else rtrim(a.dose) + (select name from yp_zd_unit where code=a.dose_unit) end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else '共'+ rtrim(a.drug_quan) + (select name from yp_zd_unit where code=a.mini_unit) end) else isnull(a.drug_specification,'') end )"+
|
|
|
+ " FROM yz_act_order a, yz_order_item b , view_zy_patient_all c\n" +
|
|
|
+ " WHERE a.inpatient_no = #{patNo} and\n" +
|
|
|
+ " a.admiss_times = #{times} AND\n" +
|
|
|
+ " (isnull(a.print_page,0)=0 or\n" +
|
|
|
+ " isnull(a.print_page,0) >9999) and\n" +
|
|
|
+ " (a.frequ_code <> 'ONCE' or isnull(b.frequ_type,'')='1') and\n" +
|
|
|
+ " a.status_flag > '1' and\n" +
|
|
|
+ " a.inpatient_no = c.inpatient_no and\n" +
|
|
|
+ " a.admiss_times = c.admiss_times and\n" +
|
|
|
+ " a.order_code = b.order_code and\n" +
|
|
|
+ " a.group_no ='00' and\n" +
|
|
|
+ " a.doctor_flag='1'\n" +
|
|
|
+ " union all\n" +
|
|
|
+ " SELECT act_order_no=a.act_order_no,\n" +
|
|
|
+ " inpatient_no=a.inpatient_no,\n" +
|
|
|
+ " name =c.name,\n" +
|
|
|
+ " dept_code =a.ward_code,\n" +
|
|
|
+ " bed_no =c.bed_no,\n" +
|
|
|
+ " sex =c.sex,\n" +
|
|
|
+ " age =space(10),\n" +
|
|
|
+ " order_name =rtrim(a.order_name),\n" +
|
|
|
+ " start_time =case when isnull(a.parent_no,'')='' then a.start_time else (select start_time from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " print_page =a.print_page,\n" +
|
|
|
+ " doctor_code =physician,\n" +
|
|
|
+ " nurse_code =executer1,\n" +
|
|
|
+ " self_buy =a.self_buy,\n" +
|
|
|
+ " page_no =isnull(print_page,'0'),\n" +
|
|
|
+ " page_no_old =0,\n" +
|
|
|
+ " last_rows =0,\n" +
|
|
|
+ " modifier =a.modifier,\n" +
|
|
|
+ " executer2 =a.executer2,\n" +
|
|
|
+ " drug_quan =a.drug_quan,\n" +
|
|
|
+ " dose =a.dose,\n" +
|
|
|
+ " dose_unit =a.dose_unit,\n" +
|
|
|
+ " frequ_code =a.frequ_code,\n" +
|
|
|
+ " supply_code =a.supply_code,\n" +
|
|
|
+ " spec =a.drug_specification,\n" +
|
|
|
+ " group_no =a.group_no,\n" +
|
|
|
+ " parent_no =a.parent_no,\n" +
|
|
|
+ " instruction =a.instruction,\n" +
|
|
|
+ " parent_flag =space(2),\n" +
|
|
|
+ " parent_flag2 =space(2),\n" +
|
|
|
+ " end_time =a.end_time,\n" +
|
|
|
+ " ps_status=case when a.ps_status is null then ''\n" +
|
|
|
+ " when a.ps_status='0'then '皮试:阴性'else '皮试:阳性'end,\n" +
|
|
|
+ " a.ps_oper,\n" +
|
|
|
+ " a.ps_time,\n" +
|
|
|
+ " act_order_no_b=case when parent_no is null then act_order_no else parent_no end ,\n" +
|
|
|
+ " order_time_b= case when isnull(a.parent_no,'')='' then convert(char(16),a.confirm_time,121) else (select convert(char(16),confirm_time,121) from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " order_name2 =space(32),\n" +
|
|
|
+ " exec_id,\n" +
|
|
|
+ " exec_id2 = a.executer2 ,\n" +
|
|
|
+ " cx_flag='0',\n" +
|
|
|
+ " sort_no=0,\n" +
|
|
|
+ " a.confirm_time,\n" +
|
|
|
+ " new_order_name_code = isnull(a.instruction,'') +(case when isnull(ps_status,'')='' then '' when ps_status='0'then '皮试:阴性'else '皮试:阳性'end) + ' ' +\n" +
|
|
|
+ " (case when a.self_buy = '1' then '自备'when a.self_buy = '2' then '嘱托' else '' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.supply_code,'') = '' then '' else (select print_name from yz_supply_type where supply_code = a.supply_code) end ),\n" +
|
|
|
+ " new_order_name = rtrim(a.order_name) + (case when a.group_no <> '00' then (case when isnull(a.drug_specification,'')=''then '' else '(' + isnull(a.drug_specification,'')+')' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else rtrim(a.dose) + (select name from yp_zd_unit where code=a.dose_unit) end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else '共'+ rtrim(a.drug_quan) + (select name from yp_zd_unit where code=a.mini_unit) end) else isnull(a.drug_specification,'') end )"+
|
|
|
+ " FROM yz_act_order a, view_zy_patient_all c\n" +
|
|
|
+ " WHERE a.inpatient_no = #{patNo} and\n" +
|
|
|
+ " a.admiss_times = #{times} AND\n" +
|
|
|
+ " (isnull(a.print_page,0)=0 or\n" +
|
|
|
+ " isnull(a.print_page,0) >9999) and\n" +
|
|
|
+ " (a.frequ_code <> 'ONCE' ) and\n" +
|
|
|
+ " a.status_flag > '1' and\n" +
|
|
|
+ " a.inpatient_no = c.inpatient_no and\n" +
|
|
|
+ " a.admiss_times = c.admiss_times and\n" +
|
|
|
+ " a.group_no <> '00' and\n" +
|
|
|
+ " a.doctor_flag='1'\n" +
|
|
|
+ "order by page_no,confirm_time,act_order_no_b,act_order_no")
|
|
|
+ List<YzPrintVO> getcqYzPrint(@Param("patNo") String patNo, @Param("times")Integer times);
|
|
|
+ @Select("SELECT act_order_no=a.act_order_no,\n" +
|
|
|
+ " inpatient_no=a.inpatient_no,\n" +
|
|
|
+ " name =c.name,\n" +
|
|
|
+ " dept_code =a.dept_code,\n" +
|
|
|
+ " bed_no =c.bed_no,\n" +
|
|
|
+ " sex =c.sex,\n" +
|
|
|
+ " age =space(10),\n" +
|
|
|
+ " order_name =rtrim(a.order_name),\n" +
|
|
|
+ " order_name1 =rtrim(a.order_name),\n" +
|
|
|
+ " start_time =case when isnull(a.parent_no,'')='' then a.start_time else (select start_time from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " print_page_once=a.print_page_once,\n" +
|
|
|
+ " doctor_code =physician,\n" +
|
|
|
+ " nurse_code =executer1,\n" +
|
|
|
+ " self_buy =a.self_buy,\n" +
|
|
|
+ " page_no =isnull(print_page_once,0),\n" +
|
|
|
+ " page_no_old =0,\n" +
|
|
|
+ " last_rows =0,\n" +
|
|
|
+ " modifier =a.modifier,\n" +
|
|
|
+ " executer2 =a.executer2,\n" +
|
|
|
+ " drug_quan =a.drug_quan,\n" +
|
|
|
+ " dose =a.dose ,\n" +
|
|
|
+ " dose_unit =a.dose_unit,\n" +
|
|
|
+ " frequ_code =a.frequ_code,\n" +
|
|
|
+ " supply_code =a.supply_code,\n" +
|
|
|
+ " spec =a.drug_specification,\n" +
|
|
|
+ " group_no =a.group_no,\n" +
|
|
|
+ " parent_no =a.parent_no,\n" +
|
|
|
+ " instruction =a.instruction,\n" +
|
|
|
+ " parent_flag =space(2),\n" +
|
|
|
+ " parent_flag2 =space(2),\n" +
|
|
|
+ " end_time =a.end_time,\n" +
|
|
|
+ " exec_time=a.exec_time,\n" +
|
|
|
+ " exec_id =a.exec_id,\n" +
|
|
|
+ " ps_status=case when isnull(ps_status,'')='' then ''\n" +
|
|
|
+ " when ps_status='0'then '皮试:阴性'else '皮试:阳性'end,\n" +
|
|
|
+ " a.ps_oper,\n" +
|
|
|
+ " a.ps_time,\n" +
|
|
|
+ " act_order_no_b=case when isnull(a.parent_no,'')='' then a.act_order_no else a.parent_no end,\n" +
|
|
|
+ " exec_id2 = a.exec_id2 ,\n" +
|
|
|
+ " order_time_b= case when isnull(a.parent_no,'')='' then convert(char(16),a.confirm_time,121) else (select convert(char(16),confirm_time,121) from yz_act_order where a.parent_no=act_order_no) end,a.drug_occ,a.ward_code,\n" +
|
|
|
+ " cx_flag='0',\n" +
|
|
|
+ " sort_no=0,\n" +
|
|
|
+ " mini_unit = a.mini_unit,\n" +
|
|
|
+ " new_order_name_code = isnull(a.instruction,'') +(case when isnull(ps_status,'')='' then '' when ps_status='0'then '皮试:阴性'else '皮试:阳性'end) + ' ' +\n" +
|
|
|
+ " (case when a.self_buy = '1' then '自备'when a.self_buy = '2' then '嘱托' else '' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.supply_code,'') = '' then '' else (select print_name from yz_supply_type where supply_code = a.supply_code) end ),\n" +
|
|
|
+ " new_order_name = rtrim(a.order_name) + (case when a.group_no <> '00' or a.order_code = '06248' then (case when isnull(a.drug_specification,'')=''then '' else '(' + isnull(a.drug_specification,'')+')' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else rtrim(a.dose) + (select name from yp_zd_unit where code=a.dose_unit) end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else '共'+ rtrim(a.drug_quan) + (select name from yp_zd_unit where code=a.mini_unit) end) else ' ' end),\n" +
|
|
|
+ " a.confirm_time\n" +
|
|
|
+ " FROM yz_act_order a, yz_order_item b,view_zy_patient_all c\n" +
|
|
|
+ " WHERE a.inpatient_no = #{patNo} and\n" +
|
|
|
+ " a.admiss_times = #{times} AND\n" +
|
|
|
+ " (isnull(a.print_page_once,0)=0 or\n" +
|
|
|
+ " isnull(a.print_page_once,0) >9999) and\n" +
|
|
|
+ " (a.frequ_code = 'ONCE' ) and\n" +
|
|
|
+ " a.status_flag > '1' and\n" +
|
|
|
+ " a.inpatient_no = c.inpatient_no and\n" +
|
|
|
+ " a.admiss_times = c.admiss_times and\n" +
|
|
|
+ " a.doctor_flag='1' and\n" +
|
|
|
+ " a.group_no='00' and\n" +
|
|
|
+ " a.order_code =b.order_code and\n" +
|
|
|
+ " isnull(b.frequ_type,'') <> '1'\n" +
|
|
|
+ " union\n" +
|
|
|
+ " SELECT act_order_no=a.act_order_no,\n" +
|
|
|
+ " inpatient_no=a.inpatient_no,\n" +
|
|
|
+ " name =c.name,\n" +
|
|
|
+ " dept_code =a.dept_code,\n" +
|
|
|
+ " bed_no =c.bed_no,\n" +
|
|
|
+ " sex =c.sex,\n" +
|
|
|
+ " age =space(10),\n" +
|
|
|
+ " order_name =rtrim(a.order_name),\n" +
|
|
|
+ " order_name1 =rtrim(a.order_name),\n" +
|
|
|
+ " start_time =case when isnull(a.parent_no,'')='' then a.start_time else (select start_time from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " print_page_once=a.print_page_once,\n" +
|
|
|
+ " doctor_code =physician,\n" +
|
|
|
+ " nurse_code =executer1,\n" +
|
|
|
+ " self_buy =a.self_buy,\n" +
|
|
|
+ " page_no =isnull(print_page_once,0),\n" +
|
|
|
+ " page_no_old =0,\n" +
|
|
|
+ " last_rows =0,\n" +
|
|
|
+ " modifier =a.modifier,\n" +
|
|
|
+ " executer2 =a.executer2,\n" +
|
|
|
+ " drug_quan =a.drug_quan,\n" +
|
|
|
+ " dose =a.dose ,\n" +
|
|
|
+ " dose_unit =a.dose_unit,\n" +
|
|
|
+ " frequ_code =a.frequ_code,\n" +
|
|
|
+ " supply_code =a.supply_code,\n" +
|
|
|
+ " spec =a.drug_specification,\n" +
|
|
|
+ " group_no =a.group_no,\n" +
|
|
|
+ " parent_no =a.parent_no,\n" +
|
|
|
+ " instruction =a.instruction,\n" +
|
|
|
+ " parent_flag =space(2),\n" +
|
|
|
+ " parent_flag2 =space(2),\n" +
|
|
|
+ " end_time =a.end_time,\n" +
|
|
|
+ " exec_time=a.exec_time,\n" +
|
|
|
+ " exec_id =a.exec_id,\n" +
|
|
|
+ " ps_status=case when isnull(ps_status,'')='' then ''\n" +
|
|
|
+ " when ps_status='0'then '皮试:阴性'else '皮试:阳性'end,\n" +
|
|
|
+ " a.ps_oper,\n" +
|
|
|
+ " a.ps_time,\n" +
|
|
|
+ " act_order_no_b=case when isnull(a.parent_no,'')='' then a.act_order_no else a.parent_no end,\n" +
|
|
|
+ " exec_id2 = a.exec_id2 ,\n" +
|
|
|
+ " order_time_b= case when isnull(a.parent_no,'')='' then convert(char(16),a.confirm_time,121) else (select convert(char(16),confirm_time,121) from yz_act_order where a.parent_no=act_order_no) end,a.drug_occ,a.ward_code,\n" +
|
|
|
+ " cx_flag='0',\n" +
|
|
|
+ " sort_no=0,\n" +
|
|
|
+ " mini_unit = a.mini_unit,\n" +
|
|
|
+ " new_order_name_code = isnull(a.instruction,'') +(case when isnull(ps_status,'')='' then '' when ps_status='0'then '皮试:阴性'else '皮试:阳性'end) + ' ' +\n" +
|
|
|
+ " (case when a.self_buy = '1' then '自备'when a.self_buy = '2' then '嘱托' else '' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.supply_code,'') = '' then '' else (select print_name from yz_supply_type where supply_code = a.supply_code) end ),\n" +
|
|
|
+ " new_order_name = rtrim(a.order_name) + (case when a.group_no <> '00' then (case when isnull(a.drug_specification,'')=''then '' else '(' + isnull(a.drug_specification,'')+')' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else rtrim(a.dose) + (select name from yp_zd_unit where code=a.dose_unit) end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else '共'+ rtrim(a.drug_quan) + (select name from yp_zd_unit where code=a.mini_unit) end) else isnull(a.drug_specification,'') end ),\n" +
|
|
|
+ " a.confirm_time\n" +
|
|
|
+ " FROM yz_act_order a, view_zy_patient_all c\n" +
|
|
|
+ " WHERE a.inpatient_no = #{patNo} and\n" +
|
|
|
+ " a.admiss_times = #{times} AND\n" +
|
|
|
+ " (isnull(a.print_page_once,0)=0 or\n" +
|
|
|
+ " isnull(a.print_page_once,0) >9999) and\n" +
|
|
|
+ " (a.frequ_code = 'ONCE' ) and\n" +
|
|
|
+ " a.status_flag > '1' and\n" +
|
|
|
+ " a.inpatient_no = c.inpatient_no and\n" +
|
|
|
+ " a.admiss_times = c.admiss_times and\n" +
|
|
|
+ " a.doctor_flag='1' and\n" +
|
|
|
+ " a.group_no <> '00'\n" +
|
|
|
+ " union\n" +
|
|
|
+ " SELECT act_order_no=a.act_order_no,\n" +
|
|
|
+ " inpatient_no=a.inpatient_no,\n" +
|
|
|
+ " name =c.name,\n" +
|
|
|
+ " dept_code =a.dept_code,\n" +
|
|
|
+ " bed_no =c.bed_no,\n" +
|
|
|
+ " sex =c.sex,\n" +
|
|
|
+ " age =space(10),\n" +
|
|
|
+ " order_name =rtrim(a.order_name),\n" +
|
|
|
+ " order_name1 =rtrim(a.order_name),\n" +
|
|
|
+ " start_time =case when isnull(a.parent_no,'')='' then a.start_time else (select start_time from yz_act_order where a.parent_no=act_order_no) end,\n" +
|
|
|
+ " print_page_once=a.print_page_once,\n" +
|
|
|
+ " doctor_code =physician,\n" +
|
|
|
+ " nurse_code =executer1,\n" +
|
|
|
+ " self_buy =a.self_buy,\n" +
|
|
|
+ " page_no =isnull(print_page_once,0),\n" +
|
|
|
+ " page_no_old =0,\n" +
|
|
|
+ " last_rows =0,\n" +
|
|
|
+ " modifier =a.modifier,\n" +
|
|
|
+ " executer2 =a.executer2,\n" +
|
|
|
+ " drug_quan =a.drug_quan,\n" +
|
|
|
+ " dose =a.dose ,\n" +
|
|
|
+ " dose_unit =a.dose_unit,\n" +
|
|
|
+ " frequ_code =a.frequ_code,\n" +
|
|
|
+ " supply_code =a.supply_code,\n" +
|
|
|
+ " spec =a.drug_specification,\n" +
|
|
|
+ " group_no =a.group_no,\n" +
|
|
|
+ " parent_no =a.parent_no,\n" +
|
|
|
+ " instruction =a.instruction,\n" +
|
|
|
+ " parent_flag =space(2),\n" +
|
|
|
+ " parent_flag2 =space(2),\n" +
|
|
|
+ " end_time =a.end_time,\n" +
|
|
|
+ " exec_time=a.exec_time,\n" +
|
|
|
+ " exec_id =a.exec_id,\n" +
|
|
|
+ " ps_status=case when isnull(ps_status,'')='' then ''\n" +
|
|
|
+ " when ps_status='0'then '皮试:阴性'else '皮试:阳性'end,\n" +
|
|
|
+ " a.ps_oper,\n" +
|
|
|
+ " a.ps_time,\n" +
|
|
|
+ " act_order_no_b=case when isnull(a.parent_no,'')='' then a.act_order_no else a.parent_no end,\n" +
|
|
|
+ " exec_id2 = a.exec_id2 ,\n" +
|
|
|
+ " order_time_b= case when isnull(a.parent_no,'')='' then convert(char(16),a.confirm_time,121) else (select convert(char(16),confirm_time,121) from yz_act_order where a.parent_no=act_order_no) end,a.drug_occ,a.ward_code,\n" +
|
|
|
+ " cx_flag='0',\n" +
|
|
|
+ " sort_no=0,\n" +
|
|
|
+ " mini_unit = a.mini_unit,\n" +
|
|
|
+ " new_order_name_code = isnull(a.instruction,'') +(case when isnull(ps_status,'')='' then '' when ps_status='0'then '皮试:阴性'else '皮试:阳性'end) + ' ' +\n" +
|
|
|
+ " (case when a.self_buy = '1' then '自备'when a.self_buy = '2' then '嘱托' else '' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.supply_code,'') = '' then '' else (select print_name from yz_supply_type where supply_code = a.supply_code) end ),\n" +
|
|
|
+ " new_order_name = rtrim(a.order_name) + (case when a.group_no <> '00' then (case when isnull(a.drug_specification,'')=''then '' else '(' + isnull(a.drug_specification,'')+')' end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else rtrim(a.dose) + (select name from yp_zd_unit where code=a.dose_unit) end) + ' ' +\n" +
|
|
|
+ " (case when isnull(a.dose_unit,'') = '' then '' else '共'+ rtrim(a.drug_quan) + (select name from yp_zd_unit where code=a.mini_unit) end) else isnull(a.drug_specification,'') end ),\n" +
|
|
|
+ " a.confirm_time\n" +
|
|
|
+ " FROM yz_act_order a, view_zy_patient_all c\n" +
|
|
|
+ " WHERE a.inpatient_no = #{patNo} and\n" +
|
|
|
+ " a.admiss_times = #{times} AND\n" +
|
|
|
+ " (isnull(a.print_page_once,0)=0 or\n" +
|
|
|
+ " isnull(a.print_page_once,0) >9999) and\n" +
|
|
|
+ " (a.frequ_code = 'ONCE' ) and\n" +
|
|
|
+ " a.status_flag > '1' and\n" +
|
|
|
+ " a.inpatient_no = c.inpatient_no and\n" +
|
|
|
+ " a.admiss_times = c.admiss_times and\n" +
|
|
|
+ " a.doctor_flag='1' and\n" +
|
|
|
+ " a.group_no = '00' and\n" +
|
|
|
+ " (a.order_name like '%草药%' or a.order_name like '%会诊%')\n" +
|
|
|
+ "order by page_no,confirm_time,act_order_no_b")
|
|
|
+ List<YzPrintVO> getlsYzPrint(@Param("patNo") String patNo, @Param("times")Integer times);
|
|
|
+ @Select("select\n" +
|
|
|
+ " RTRIM(a.bed_no) bedNo,\n" +
|
|
|
+ " RTRIM(a.inpatient_no) inpatientNo,\n" +
|
|
|
+ " a.admiss_times,\n" +
|
|
|
+ " RTRIM(a.name) as name,\n" +
|
|
|
+ " sex=isnull(a.sex, 9)\n" +
|
|
|
+ " from zy_actpatient a ${ew.customSqlSegment}" +
|
|
|
+ " ORDER BY cast(a.bed_no AS int)")
|
|
|
+ List<Patient> queryPatientInfo(@Param(Constants.WRAPPER)QueryWrapper<?> query);
|
|
|
+}
|