|
@@ -222,34 +222,30 @@ public interface DrgDipDao {
|
|
|
@Select("select count(1) from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
int selectInHospCount(String patNo, int times);
|
|
|
|
|
|
- @Select("select " +
|
|
|
+ @Select("select *," +
|
|
|
+ "precrAdviceDept=(select rtrim(d.name) from zd_unit_code d where d.code=t.precrAdviceDeptId) " +
|
|
|
+ "from (select visitId=#{visitId},rtrim(physician) as precrAdviceDoctorId, " +
|
|
|
"cast(cast(act_order_no as decimal) as varchar) as mdclAdviceId, " +
|
|
|
"mdclAdviceType=case when frequ_code='ALWAYS' then '00' else '10' end, " +
|
|
|
- "rtrim(order_code) as mdclAdviceCode, " +
|
|
|
+ "rtrim(order_code) as mdclAdviceCode,rtrim(modifier) as ceaseAdviceDoctorId, " +
|
|
|
"mdclAdviceSource=case when order_code='06054' then '3' else " +
|
|
|
"(case when serial in ('01','99') then 1 else 2 end) end, " +
|
|
|
- "cast(parent_no as varchar) as mdclAdviceNo, " +
|
|
|
- "rtrim(order_name) as mdclAdviceContent, " +
|
|
|
- "dosForms='', " +
|
|
|
- "rtrim(drug_specification) as stand, " +
|
|
|
- "rtrim(frequ_code) as hz, " +
|
|
|
- "drug_weight as dosage, " +
|
|
|
+ "cast(cast(parent_no as decimal) as varchar) as mdclAdviceNo, " +
|
|
|
+ "rtrim(order_name) as mdclAdviceContent,dosForms='',rtrim(drug_specification) as stand, " +
|
|
|
+ "rtrim(frequ_code) as hz,drug_weight as dosage,rtrim(signer) as checkDoctorId, " +
|
|
|
"dosageUnit=(select d.name from yp_zd_unit d where d.code=drug_weight_unit), " +
|
|
|
"entiyTime=convert(varchar(19), enter_time, 21),start_time as mdclAdviceStartTime, " +
|
|
|
"precrAdviceDeptId=(select rtrim(d.dept_code) from a_employee_mi d where d.code=physician), " +
|
|
|
- "rtrim(physician) as precrAdviceDoctorId, " +
|
|
|
"precrAdviceDoctor=(select rtrim(d.name) from a_employee_mi d where d.code=physician), " +
|
|
|
"checkFlag=case when status_flag=1 then 0 else 1 end, " +
|
|
|
- "rtrim(signer) as checkDoctorId, " +
|
|
|
"checkDoctor=(select rtrim(d.name) from a_employee_mi d where d.code=signer), " +
|
|
|
- "confirm_time as precrAdviceCheckTime, " +
|
|
|
+ "confirm_time as precrAdviceCheckTime,end_time as ceaseAdviceTime, " +
|
|
|
"execStatus=case when status_flag in ('1','2') then 0 else 1 end, " +
|
|
|
- "end_time as ceaseAdviceTime, " +
|
|
|
- "rtrim(modifier) as ceaseAdviceDoctorId, " +
|
|
|
"ceaseAdviceDoctor=(select rtrim(d.name) from a_employee_mi d where d.code=modifier), " +
|
|
|
"mdclAdviceStatus=case when end_time is null then 1 else 2 end " +
|
|
|
- "from ${table} where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- List<HisHsptzdMdclAdvice> selectHisHsptzdMdclAdvice(String patNo, int times, String table);
|
|
|
+ "from ${table} where inpatient_no=#{patNo} and admiss_times=#{times} " +
|
|
|
+ ") t")
|
|
|
+ List<HisHsptzdMdclAdvice> selectHisHsptzdMdclAdvice(String patNo, int times, String table, String visitId);
|
|
|
|
|
|
@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_type=21 " +
|