DigitalReceiptDao.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package thyyxxk.webserver.dao.his.medicalinsurance;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Select;
  4. import thyyxxk.webserver.entity.dictionary.CodeName;
  5. import thyyxxk.webserver.entity.medicalinsurance.digitalreceipt.RxDiseInfo;
  6. import thyyxxk.webserver.entity.medicalinsurance.digitalreceipt.RxDrugDetail;
  7. import thyyxxk.webserver.entity.medicalinsurance.digitalreceipt.RxMdtrtInfo;
  8. import thyyxxk.webserver.entity.medicalinsurance.digitalreceipt.RxPreCheck;
  9. import java.util.List;
  10. @Mapper
  11. public interface DigitalReceiptDao {
  12. @Select("select visit_date as prscTime, " +
  13. "hospRxno=rtrim(patient_id)+'_'+cast(times as varchar)+'_1' " +
  14. "from mz_visit_table where patient_id=#{patientId} and times=#{times}")
  15. RxPreCheck selectRxPreCheck(String patientId, int times);
  16. @Select("select fixmedinsCode='H43010500370',fixmedinsName='长沙泰和医院', " +
  17. "mdtrt_id,med_type,iptOtpNo=pat_no,psn_no,psn_name,psn_cert_type, " +
  18. "certno,age as patnAge,gend,dise_code as diseCodg,dise_name, " +
  19. "spDiseFlag=case when med_type='14' then '1' else '0' end, " +
  20. "prscDeptName=(select d.name from zd_unit_code d where d.code=b.visit_dept_code), " +
  21. "prscDeptCode=rtrim(b.visit_dept_code), " +
  22. "drCode=(select d.yb_code from a_employee_mi d where d.code=b.doctor_code), " +
  23. "prscDrName=(select rtrim(d.name) from a_employee_mi d where d.code=b.doctor_code), " +
  24. "drProfttlCodg=(select rtrim(d.emp_tit_code) from a_employee_mi d where d.code=b.doctor_code), " +
  25. "drDeptCode=(select rtrim(d.dept_code) from a_employee_mi d where d.code=b.doctor_code), " +
  26. "caty=(select d.si_caty from zd_unit_code d where d.code=b.visit_dept_code), " +
  27. "mdtrtTime=b.visit_date,maindiagCode=b.icd_code_new,maindiagName=b.icd_text_new " +
  28. "from t_si_pat_info a,mz_visit_table b " +
  29. "where a.pat_no=#{patientId} and a.times=#{times} and a.ledger_sn=0 " +
  30. "and a.pat_no=b.patient_id and a.times=b.times")
  31. RxMdtrtInfo selectRxMdtrtInfo(String patientId, int times);
  32. @Select("select diag_code as code,diag_name as name from t_si_mz_diag " +
  33. "where pat_no=#{patientId} and times=#{times} and diag_srt_no=1")
  34. CodeName selectMaindiag(String patientId, int times);
  35. @Select("select " +
  36. "medListCodg=case when medi_item_type=0 then " +
  37. " (select d.national_code from zd_charge_item d where d.code=a.his_item_code) " +
  38. "else (select max(d.national_code) from yp_zd_dict d where d.code=a.his_item_code) end, " +
  39. "fixmedinsHilistId=a.his_item_code,rxItemTypeCode=med_chrgitm_type,drugGenname=a.his_item_name, " +
  40. "drugDosform=case when medi_item_type=0 then '' else " +
  41. "(select d.name from yp_zd_dosage d where d.code= " +
  42. "(select max(e.dosage) from yp_zd_dict e where e.code=a.his_item_code)) end, " +
  43. "drugSpec=case when medi_item_type=0 then '' else " +
  44. "(select max(d.specification) from yp_zd_dict d where d.code=a.his_item_code) end, " +
  45. "drugDosunt=case when medi_item_type=0 then '' else " +
  46. "(select d.name from yp_zd_unit d where d.code= " +
  47. "(select max(e.dosage_unit) from yp_zd_dict e where e.code=a.his_item_code)) end, " +
  48. "medcWayCodg=case when medi_item_type=0 then '' else 1 end, " +
  49. "medcWayDscr=case when medi_item_type=0 then '' else N'口服' end, " +
  50. "drugCnt=quantity,medcBegntime=a.fee_date,medcEndtime=a.fee_date+3,medcDays=3, " +
  51. "sinDoscnt=1,usedFrquCodg=12,usedFrquName='BID',hospApprFlag='1' " +
  52. "from t_mt_receipt a where a.patient_id=#{patientId} and a.times=#{times}")
  53. List<RxDrugDetail> selectRxDrugDetailList(String patientId, int times);
  54. @Select("select " +
  55. "diag_type,diag_srt_no,diag_code,diag_name,diag_dept, " +
  56. "maindiagFlag=case when diag_srt_no=1 then '1' else '0' end, " +
  57. "diagDrNo=(select d.yb_code from a_employee_mi d where d.code=a.dise_dor_no), " +
  58. "diagDrName=dise_dor_name,diag_time from t_si_mz_diag a " +
  59. "where pat_no=#{patientId} and a.times=#{times} order by diag_srt_no")
  60. List<RxDiseInfo> selectRxDiseInfo(String patientId, int times);
  61. }