SiManageDao.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. package thyyxxk.webserver.dao.his.medicalinsurance;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.apache.ibatis.annotations.Update;
  6. import thyyxxk.webserver.entity.inpatient.patient.Overview;
  7. import thyyxxk.webserver.entity.medicalinsurance.manage.InstSetlLdgChkBrf;
  8. import thyyxxk.webserver.entity.medicalinsurance.manage.clinicinfo.ClinicDiseinfo;
  9. import thyyxxk.webserver.entity.medicalinsurance.manage.clinicinfo.ClinicRegistration;
  10. import thyyxxk.webserver.entity.medicalinsurance.manage.clinicinfo.ClinicRxinfo;
  11. import thyyxxk.webserver.entity.medicalinsurance.manage.clinicinfo.EmergencyOprninfo;
  12. import thyyxxk.webserver.entity.medicalinsurance.manage.detailanalyse.FsiDiagnoseDtos;
  13. import thyyxxk.webserver.entity.medicalinsurance.manage.detailanalyse.FsiEncounterDtos;
  14. import thyyxxk.webserver.entity.medicalinsurance.manage.detailanalyse.FsiOrderDtos;
  15. import thyyxxk.webserver.entity.medicalinsurance.manage.detailanalyse.PatientDtos;
  16. import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Baseinfo;
  17. import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.BriefSheet;
  18. import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Diseinfo;
  19. import thyyxxk.webserver.entity.medicalinsurance.manage.frontsheet.Oprninfo;
  20. import thyyxxk.webserver.entity.medicalinsurance.manage.orderinfo.ActOrder;
  21. import java.util.List;
  22. import java.util.Map;
  23. /**
  24. * @author: DingJie
  25. * @create: 2021/8/99:45
  26. */
  27. @Mapper
  28. public interface SiManageDao {
  29. @Update("<script>" +
  30. "update ${table} set uploaded_flag=#{flag} where code in " +
  31. "<foreach collection='codes' item='code' separator=',' open='(' close=')'>" +
  32. "#{code}</foreach>" +
  33. "</script>")
  34. void updateUploadedFlag(@Param("table") String table,
  35. @Param("flag") int flag,
  36. @Param("codes") List<String> codes);
  37. @Update("update ${table} set uploaded_flag=0 where code=#{code}")
  38. void updateUploadedFlag2(@Param("table") String table,
  39. @Param("code") String codes);
  40. @Select("select pat_no,times,ledger_sn,medfee_sumamt,acct_pay,fund_pay_sumamt,hosp_part_amt " +
  41. "from t_si_setlinfo where insutype=#{insutype} and clr_type=#{clrType} and revoked=0 " +
  42. "and clr_optins=#{clrOptins} and setl_time>=#{start} and setl_time<=#{end} and " +
  43. "(fund_pay_sumamt+acct_pay)!=0 and insuplc_admdvs like '43%' ")
  44. List<InstSetlLdgChkBrf> selectSetlChkBrfsWithInsutype(@Param("clrType") String clrType,
  45. @Param("insutype") String insutype,
  46. @Param("clrOptins") String clrOptins,
  47. @Param("start") String start,
  48. @Param("end") String end);
  49. @Select("select visitId=pat_no+'_'+cast(times as varchar)+'_'+cast(ledger_sn as varchar), " +
  50. "setl_id,mdtrt_id,psn_no,medins_setl_id as msgId,medfee_sumamt,acct_pay,fund_pay_sumamt, " +
  51. "hosp_part_amt from t_si_setlinfo where setl_type=#{clrType} and revoked=0 and " +
  52. "endtime>=#{start} and endtime<=#{end} ")
  53. List<InstSetlLdgChkBrf> selectSetlinfoBrfsForHisCheck(@Param("clrType") String clrType,
  54. @Param("start") String start,
  55. @Param("end") String end);
  56. @Select("select visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
  57. "a.total_charge as medfee_sumamt,acct_pay,fund_pay_sumamt,hosp_part_amt from zy_ledger_file a, " +
  58. "zy_receipt b where b.date_2>=#{start} and b.date_2<=#{end} and a.responce_type in ('ad','ae','af','ag','ah','ak') " +
  59. "and a.ledger_sn>0 and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times " +
  60. "and a.ledger_sn=b.ledger_sn and receipt_sn=1")
  61. List<InstSetlLdgChkBrf> selectHisZyBrfsForHisCheck(@Param("start") String start,
  62. @Param("end") String end);
  63. @Select("select visitId=b.patient_id+'_'+cast(b.times as varchar)+'_0' from " +
  64. "(select patient_id,times from mz_deposit_file where charge_date>=#{start} and charge_date<=#{end} " +
  65. "and pay_mark=0 group by patient_id, times) a, " +
  66. "(select patient_id,times from t_mt_receipt where input_date>=#{start} and input_date<=#{end} " +
  67. "and yb_trans_flag=1 group by patient_id, times) " +
  68. "b where a.patient_id=b.patient_id and a.times=b.times")
  69. List<String> selectHisMzBrfsForHisCheck(@Param("start") String start,
  70. @Param("end") String end);
  71. @Select("select count(1) from mz_deposit_file where patient_id=#{patNo} and times=#{times} and pay_mark=0")
  72. int mzDepositCount(@Param("patNo") String patNo, @Param("times") String times);
  73. @Select("select pat_no,times,ledger_sn,setl_id,mdtrt_id,psn_no,medfee_sumamt,acct_pay,fund_pay_sumamt,psn_cash_pay,hosp_part_amt " +
  74. "from t_si_setlinfo where clr_type=#{clrType} and revoked=0 and clr_optins=#{clrOptins} and (fund_pay_sumamt+acct_pay)!=0 " +
  75. "and setl_time>=#{start} and setl_time<=#{end} and insuplc_admdvs like '43%' ")
  76. List<InstSetlLdgChkBrf> selectSetlChkBrfs(@Param("clrType") String clrType,
  77. @Param("clrOptins") String clrOptins,
  78. @Param("start") String start,
  79. @Param("end") String end);
  80. @Select("select count(1) from dj_user_role where user_code=#{code} and role_id=41")
  81. Integer recoveryTradePermission(@Param("code") String code);
  82. @Select("<script>" +
  83. "select bah as patNo, admiss_times as times,sign_date,name, " +
  84. "gender=(case when sex=1 then '男' else '女' end), " +
  85. "birth_date,nation=(select rtrim(name) from zd_nation_code where code=nation), " +
  86. "native_place_name,social_no,live_place_combo,phone, " +
  87. "admiss_date,admiss_dept,dismiss_date,dismiss_dept,admiss_days, " +
  88. "dept_leader,dept_leader_name,leader_doctor,leader_doctor_name,main_doctor,main_doctor_name, " +
  89. "admiss_doctor,admiss_doctor_name,duty_nurse,duty_nurse_name,coder,coder_name,quality_control_doctor, " +
  90. "quality_control_doctor_name,quality_control_nurse,quality_control_nurse_name " +
  91. "from t_case_frontsheet_main where dismiss_date &gt;= #{begin} " +
  92. "and dismiss_date &lt;= #{end} and isnull(med_type,'01') not in ('01','42') " +
  93. "<if test=\"status != -1 \">" +
  94. "and uploaded_flag=#{status} " +
  95. "</if> " +
  96. "</script>")
  97. List<BriefSheet> selectSheets(@Param("begin") String begin,
  98. @Param("end") String end,
  99. @Param("status") int status);
  100. @Select("select mdtrtSn='H43010500370'+bah+'_'+cast(admiss_times as varchar), " +
  101. "mdtrtId=(select top 1 mdtrt_id from t_si_setlinfo where pat_no=bah and times=admiss_times and revoked=0), " +
  102. "psnNo=(select top 1 psn_no from t_si_setlinfo where pat_no=bah and times=admiss_times and revoked=0), " +
  103. "admiss_times as patnIptCnt,bah as iptNo,medcasno=bah+'_'+cast(admiss_times as varchar), " +
  104. "name as psnName,sex as gend,birth_date as brdy, " +
  105. "ntly=(select si_code from zd_country_code where code=country), " +
  106. "ntlyName=(select rtrim(name) from zd_country_code where code=country), " +
  107. "nwbBirWt=case when new_born_weight='-' then '' else new_born_weight end, " +
  108. "nwbAdmWt=case when new_born_admiss_weight='-' then '' else new_born_admiss_weight end, " +
  109. "birth_place_name as birplc,native_place_name as napl, " +
  110. "naty=(select wjw_code from zd_nation_code where code=nation), " +
  111. "natyName=(select rtrim(name) from zd_nation_code where code=nation), " +
  112. "social_no as certno,occupation as prfs,self_pay as selfpayAmt, " +
  113. "mrgStas=(select si_code from zd_marital_status where code=marriage), " +
  114. "live_place as currAddr,phone as psnTel,hk_place_name as resdAddr, " +
  115. "unit_phone as emprTel,unit_place as emprAddr,contact_phone as conerTel, " +
  116. "contact_name as conerName,contact_addr_name as conerAddr,zy_admiss_way as admWayCode, " +
  117. "admWayName=(select name from zy_zd_admiss_way where code=zy_admiss_way), " +
  118. "admCaty=(select si_caty from zd_unit_code where code=admiss_dept_code), " +
  119. "admiss_ward as admWard,admiss_date as admDate,dismiss_date as dscgDate, " +
  120. "dscgCaty=(select si_caty from zd_unit_code where code=dismiss_dept_code), " +
  121. "dismiss_ward as dscgWard,admiss_days as iptDays,allergy as drugDicmFlag, " +
  122. "allergic_medicine as dicmDrugName,autopsy as dieAutpFlag,blood_type as aboCode, " +
  123. "aboName=(select rtrim(name) from zd_blood_type where code=blood_type), " +
  124. "rhCode=(select wjw_code from zd_hbsag where code=rh), " +
  125. "rhName=(select rtrim(name) from zd_hbsag where code=rh), " +
  126. "dept_leader_name as deptdrtName,leader_doctor_name as chfdrName, " +
  127. "main_doctor_name as atddrName,admiss_doctor_name as iptDrName, " +
  128. "duty_nurse_name as respNursName,study_doctor_name as trainDrName, " +
  129. "internship_doctor_name as intnDrName,coder_name as codrName, " +
  130. "quality_control_doctor_name as qltctrlDrName, " +
  131. "quality_control_nurse_name as qltctrlNursName, " +
  132. "quality_control_level as medcasQltCode, " +
  133. "quality_control_date as qltctrlDate, " +
  134. "dscgWay=(select wjw_code from zd_zy_dismiss_way where code=zy_dismiss_way), " +
  135. "dscgWayName=(select name from zd_zy_dismiss_way where code=zy_dismiss_way), " +
  136. "acpMedinsName=case when dismiss_destination='-' then '' else dismiss_destination end, " +
  137. "admiss_again_in_one_month as dscg31DaysRinpFlag, " +
  138. "dscg31DaysRinpPup=case when admiss_again_purpose='-' then '' else admiss_again_purpose end, " +
  139. "damgIntxExtRea=case when hurt_reason_name='-' then '' else hurt_reason_name end, " +
  140. "damgIntxExtReaDisecode=case when hurt_reason_code='-' then '' else hurt_reason_code end, " +
  141. "brn_damg_bfadm_coma_dura=coma_days_before_admiss+'/'+coma_hours_before_admiss+'/'+coma_minutes_before_admiss, " +
  142. "brn_damg_afadm_coma_dura=coma_days_after_admiss+'/'+coma_hours_after_admiss+'/'+coma_minutes_after_admiss, " +
  143. "fixmedinsCode='H43010500370',age,hbs_ag as hbsag,hcv_ab,hiv_ab, " +
  144. "rescue_times as rescCnt,rescue_success_times as rescSuccCnt,total_cost as medfeeSumamt, " +
  145. "valiFlag='1',case_classification as ctd," +
  146. "deptdrtCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=dept_leader)," +
  147. "chfdrCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=leader_doctor)," +
  148. "atddrCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=main_doctor)," +
  149. "iptDrCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=admiss_doctor)," +
  150. "respNursCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=duty_nurse)," +
  151. "qltctrlDrCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=quality_control_doctor)," +
  152. "qltctrlNursCode=(select top 1 rtrim(yb_code) from a_employee_mi t where t.code=quality_control_nurse) " +
  153. "from t_case_frontsheet_main where bah=#{patNo} and admiss_times=#{times}")
  154. Baseinfo selectFrontSheetBaseInfo(@Param("patNo") String patNo, @Param("times") int times);
  155. @Select("select maindiagFlag=case when dis_diag_no=1 then '1' else '0' end, " +
  156. "rtrim(dis_diag) as diagCode,rtrim(dis_diag) as inhospDiagCode, " +
  157. "rtrim(dis_diag_comment) as diagName,rtrim(dis_diag_comment) as inhospDiagName, " +
  158. "valiFlag='1',iptMedcasHmpgSn=rtrim(inpatient_no)+'_'+cast(admiss_times as varchar)+'_'+cast(dis_diag_no as varchar), " +
  159. "mdtrtSn='H43010500370'+rtrim(inpatient_no)+'_'+cast(admiss_times as varchar), " +
  160. "fixmedinsCode='H43010500370' " +
  161. "from zy_dis_diag_yb where inpatient_no=#{patNo} and admiss_times=#{times}")
  162. List<Diseinfo> selectYbDisdiags(@Param("patNo") String patNo, @Param("times") int times);
  163. @Select("select convert(varchar(10),date,21) as oprnOprtDate, " +
  164. "name as oprnOprtName, " +
  165. "code as oprnOprtCode, " +
  166. "no as oprnOprtSn, " +
  167. "level as oprnLvCode, " +
  168. "operator_name as operName, " +
  169. "assistant_one_name as asit1Name, " +
  170. "assistant_two_name as asitName2, " +
  171. "sincHealLvCode=(select si_code from t_si_cut_heal_lv where cut_lv=isnull(cut,-1) and heal_lv=isnull(heal, -1)), " +
  172. "sincHealLv=(select si_name from t_si_cut_heal_lv where cut_lv=isnull(cut,-1) and heal_lv=isnull(heal, -1)), " +
  173. "anstMtdCode=(select yb_code from zd_anaesthesia t where t.code=anaesthesia), " +
  174. "anaesthesiaor_name as anstDrName, " +
  175. "valiFlag='1' " +
  176. "from t_case_frontsheet_surgery where bah=#{patNo} and times=#{times} order by no")
  177. List<Oprninfo> selectFrontSheetSurgeries(@Param("patNo") String patNo, @Param("times") int times);
  178. @Select("select maindiagFlag=case when no=1 then '1' else '0' end, " +
  179. "code as diagCode,code as inhospDiagCode, " +
  180. "name as diagName,name as inhospDiagName, " +
  181. "valiFlag='1',iptMedcasHmpgSn=bah+'_'+cast(times as varchar)+'_'+cast(no as varchar), " +
  182. "mdtrtSn='H43010500370'+bah+'_'+cast(times as varchar), " +
  183. "fixmedinsCode='H43010500370' " +
  184. "from t_case_frontsheet_disdiag where bah=#{patNo} and times=#{times}")
  185. List<Diseinfo> selectFrontSheetDiseInfo(@Param("patNo") String patNo, @Param("times") int times);
  186. @Update("update t_case_frontsheet_main set uploaded_flag=1 where bah=#{patNo} and admiss_times=#{times}")
  187. void updateFrontSheetUploadedFlag(@Param("patNo") String patNo, @Param("times") int times);
  188. @Select("select mdtrtSn='H43010500370'+rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar), " +
  189. "mdtrtId=(select top 1 mdtrt_id from t_si_pat_info where " +
  190. "pat_no=a.inpatient_no and times=a.admiss_times and mdtrt_id is not null and med_type!='42' ), " +
  191. "psnNo=(select top 1 psn_no from t_si_pat_info where " +
  192. "pat_no=a.inpatient_no and times=a.admiss_times and mdtrt_id is not null and med_type!='42' ), " +
  193. "iptBedNo=rtrim(b.bed_no),drordNo=cast(cast(act_order_no as decimal) as varchar), " +
  194. "isuDeptCode=(select si_caty from zd_unit_code t where t.code=(select dept_code from a_employee_mi e where e.code=a.enter_oper)), " +
  195. "order_time as drordIsuNo,exeDeptCode=(select si_caty from zd_unit_code where code=exec_unit), " +
  196. "exeDeptCode=(select si_caty from zd_unit_code t where t.code=(select top 1 exec_unit from zy_detail_charge e where e.order_no=a.act_order_no)), " +
  197. "exedeptName=(select t.name from zd_unit_code t where t.code=(select top 1 exec_unit from zy_detail_charge e where e.order_no=a.act_order_no)), " +
  198. "drordPtrName=(select t.name from a_employee_mi t where t.code=a.executer1), " +
  199. "order_code as drordDetlCode,order_name as drordDetlName,valiFlag='1', " +
  200. "iptDeptCode=(select si_caty from zd_unit_code t where t.code=b.small_dept), " +
  201. "medcasDrordDetlId='H43010500370'+cast(cast(act_order_no as decimal) as varchar) " +
  202. "from yz_act_order a, zy_actpatient b where a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
  203. "and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times")
  204. List<ActOrder> selectActOrders(@Param("patNo") String patNo, @Param("times") int times);
  205. @Select("select psn_no as patnId, psn_name as patnName, gend, brdy, insuplc_admdvs as poolarea, mdtrt_id as currMdtrtId " +
  206. "from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
  207. PatientDtos selectPatientDto(@Param("patNo") String patNo, @Param("times") int times);
  208. @Select("select mdtrt_id,medinsAdmdvs='430105',medinsLv='03',begntime as adm_date,endtime as dscg_date, " +
  209. "dscgMainDiseCodg=(select rtrim(dis_diag) from zy_dis_diag_yb where inpatient_no=a.pat_no and " +
  210. " admiss_times=a.times and dis_diag_no=1), " +
  211. "dscgMainDiseName=(select rtrim(dis_diag_comment) from zy_dis_diag_yb where inpatient_no=a.pat_no and " +
  212. " admiss_times=a.times and dis_diag_no=1), " +
  213. "drCodg=(select rtrim(op_id_code) from zy_dis_diag_yb where inpatient_no=a.pat_no and " +
  214. " admiss_times=a.times and dis_diag_no=1), " +
  215. "admDeptCodg=(select rtrim(small_dept) from zy_inactpatient where inpatient_no=a.pat_no and admiss_times=a.times), " +
  216. "medMdtrtType=case when setl_type='11' then 1 else 2 end,med_type,medfee_sumamt,fulamt_ownpay_amt, " +
  217. "psn_cash_pay,insutype " +
  218. "from t_si_setlinfo a where a.pat_no=#{patNo} and a.times=#{times} and a.revoked=0")
  219. FsiEncounterDtos selectFsiEncounterDto(@Param("patNo") String patNo, @Param("times") int times);
  220. @Select("select dise_id=rtrim(inpatient_no)+'_'+cast(admiss_times as varchar)+'_'+cast(dis_diag_no as varchar), " +
  221. "inout_dise_type='2',maindise_flag=case when dis_diag_no=1 then 1 else 0 end, " +
  222. "dis_diag_no as dias_srt_no,rtrim(dis_diag) as dise_codg,rtrim(dis_diag_comment) as dise_name, " +
  223. "op_diag_date as dise_date " +
  224. "from zy_dis_diag_yb where inpatient_no=#{patNo} and admiss_times=#{times}")
  225. List<FsiDiagnoseDtos> selectFsiDiagnoseDtos(@Param("patNo") String patNo, @Param("times") int times);
  226. @Select("select " +
  227. " rxId=cast(cast(order_no as decimal) as varchar)+'_'+charge_code_mx, " +
  228. " rxno=cast(cast(order_no as decimal) as varchar), " +
  229. " longDrordFlag=case when (select frequ_code from yz_inact_order where act_order_no=order_no)='ONCE' then 0 else 1 end, " +
  230. " b.list_type, " +
  231. " chrgType=b.med_chrgitm_type, " +
  232. " drordBhvr=case when (select frequ_code from yz_inact_order where act_order_no=order_no)='ONCE' then 1 else 2 end, " +
  233. " b.hilist_code, " +
  234. " b.hilist_name, " +
  235. " hilist_lv=b.chrgitm_lv, " +
  236. " b.pric, " +
  237. " a.charge_code_mx as hosplist_code,a.charge_amount as cnt, " +
  238. " hosplistName=b.medins_list_name, " +
  239. " a.charge_fee as sumamt, " +
  240. " ownpayAmt=b.fulamt_ownpay_amt, " +
  241. " selfpayAmt=b.preselfpay_amt, " +
  242. " drord_begn_date=(select start_time from yz_inact_order where act_order_no=order_no), " +
  243. " drord_stop_date=(select end_time from yz_inact_order where act_order_no=order_no), " +
  244. " drord_dept_codg=b.bilg_dept_codg, " +
  245. " drord_dept_name=b.bilg_dept_name, " +
  246. " drord_dr_codg=b.bilg_dr_codg, " +
  247. " drord_dr_name=b.bilg_dr_name, " +
  248. " drord_dr_profttl=(select rtrim(emp_tit_code) from a_employee_mi where code=b.bilg_dr_codg), " +
  249. " curr_drord_flag='1' " +
  250. "from zy_detail_charge a, t_si_setl_fee_detl b where a.order_no>100 and a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
  251. "and a.ledger_sn>0 and b.setl_id=#{setlId} and b.feedetl_sn=a.detail_sn")
  252. List<FsiOrderDtos> selectFsiOrderDtos(@Param("patNo") String patNo, @Param("times") int times, @Param("setlId") String setlId);
  253. @Select("select setl_id from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and revoked=0")
  254. String selectSetlId(@Param("patNo") String patNo, @Param("times") int times);
  255. @Select("select mdtrtSn=pat_no+'_'+cast(times as varchar),valiFlag='1',mdtrt_id,psn_no,begntime as rgstRetnrTime " +
  256. "from t_si_setlinfo where pat_no=#{patNo} and times=#{times}")
  257. ClinicRegistration selectClinicRegistration(@Param("patNo") String patNo, @Param("times") int times);
  258. @Select("select maindiagFlag=case when diag_srt_no=1 then '1' else '0' end,diag_code,diag_name,vali_flag " +
  259. "from t_si_mz_diag where pat_no=#{patNo} and times=#{times} ")
  260. List<ClinicDiseinfo> selectClinicDiseinfo(@Param("patNo") String patNo, @Param("times") int times);
  261. @Select("select rxno=patient_id+'_'+cast(times as varchar)+'_'+cast(receipt_no as varchar)+'_'+cast(order_no as varchar)," +
  262. "fee_date as rxPrscTime,his_item_code as rxDetlId,his_item_name as rxDetlName,valiFlag='1' " +
  263. "from t_mt_receipt where patient_id=#{patNo} and times=#{times}")
  264. List<ClinicRxinfo> selectClinicRxinfo(@Param("patNo") String patNo, @Param("times") int times);
  265. @Select("select mdtrtSn=pat_no+'_'+cast(times as varchar),medrcdno=pat_no+'_'+cast(times as varchar) " +
  266. "from t_si_setlinfo where pat_no=#{patNo} and times=#{times}")
  267. List<EmergencyOprninfo> selectEmergencyOprninfos(@Param("patNo") String patNo, @Param("times") int times);
  268. @Select(" select mdtrt_id as mdtrtId, setl_id as setlId, hilist_name as hilistName, hilist_code as hilistCode, " +
  269. " fee_ocur_time as feeOcurTime, det_item_fee_sumamt as totalFee, pric, cnt, " +
  270. " bilg_dept_name as bilgDeptName, bilg_dr_name as bilgDrName, opter_name as opterName, " +
  271. " opt_time as optTime, chrgitm_lv_name as chrgitmLvName " +
  272. " from t_si_setl_fee_detl where mdtrt_id = #{mdtrtId} ")
  273. List<Map<String, Object>> selectSetlPrescription(@Param("mdtrtId") String mdtrtId);
  274. @Select(" select patient_id as patientId, times, emr_no as emrNo, visit_date as visitDate, " +
  275. " emr_chief_complaint as emrCC, emr_hpi as emrHpi, emr_ps as emrPs, " +
  276. " emr_pe as emrPe, emr_fzjc as emrFzjc, emr_bzfx as emrBzfx, emr_zf as emrZf, " +
  277. " emr_process as emrProcess, personal_history as personalHistory, family_history as familyHistory, " +
  278. " obsterical_history as obstericalHistory, weight, temperature, sphygmus, breathe," +
  279. " pressure_high as pressureHigh, pressure_floor as pressureFloor, " +
  280. " pressure_high_left as pressureHighLeft, pressure_floor_left as pressureFloorLeft, " +
  281. " tentative_diagnosis as tentativeDiagnosis, " +
  282. " rtrim(isnull(e.name, '其他')) as doctorName, rtrim(isnull(z.name, '其他')) as deptName " +
  283. " from mz_bl_record " +
  284. " left join zd_unit_code z on dept_code = z.code" +
  285. " left join a_employee_mi e on doctor_code = e.code " +
  286. " where patient_id = #{patNo} and times = #{times} ")
  287. Map<String, Object> selectMzBl(@Param("patNo") String patNo, @Param("times") int times);
  288. @Select("select rtrim(bah) as inpatientNo,admiss_times from t_case_frontsheet_main " +
  289. "where datediff(day, sign_date, getdate())=1 and isnull(uploaded_flag,0)=0")
  290. List<Overview> selectNotUploadedSheet();
  291. }