|
|
@@ -19,7 +19,7 @@ import java.util.Map;
|
|
|
|
|
|
@Mapper
|
|
|
public interface TcmFrontSheetMainDao extends BaseMapper<TcmFrontSheetMain> {
|
|
|
- @Select("select admiss_date from $table with(nolock) " +
|
|
|
+ @Select("select admiss_date from ${table} with(nolock) " +
|
|
|
"where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
Date getAdmDate(String table, String patNo, int times);
|
|
|
|
|
|
@@ -52,7 +52,6 @@ public interface TcmFrontSheetMainDao extends BaseMapper<TcmFrontSheetMain> {
|
|
|
"from ${table} with(nolock) where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
TcmFrontSheetMain getZyActPatient(String table, String patNo, int times);
|
|
|
|
|
|
-
|
|
|
@Select("select payWay=rtrim(pay_method),infAge=rtrim(age_days),nbWeight1=rtrim(new_born_weight)," +
|
|
|
"nbAdmWeight=rtrim(new_born_admiss_weight),zyAdmWay=rtrim(rytj)," +
|
|
|
"conAddr=rtrim(lxdz),conName=rtrim(lxdz2),hpZipCode=rtrim(hkyb) " +
|
|
|
@@ -120,295 +119,9 @@ public interface TcmFrontSheetMainDao extends BaseMapper<TcmFrontSheetMain> {
|
|
|
"from batj_ba4 with(nolock) where bah=#{patNo} and zycs=#{times} order by ssxh")
|
|
|
List<TcmFrontSheetSurgery> getSurgeries(String patNo, int times);
|
|
|
|
|
|
+ @Select("select * from tcm_front_sheet_disdiag where sheet_id=#{sheetId} ")
|
|
|
+ List<TcmFrontSheetDisdiag> selectSignedSheetDiags(String sheetId);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @Update("update a_patient_mi set name=#{name}, " +
|
|
|
- "sex=#{sex}, " +
|
|
|
- "health_card_no=#{healthCardNo}," +
|
|
|
- "birth_date=#{birthDate}, " +
|
|
|
- "country=#{country}, " +
|
|
|
- "birth_place=#{birthPlace}, " +
|
|
|
- "nation_code=#{nation}, " +
|
|
|
- "social_no=#{socialNo}, " +
|
|
|
- "occupation_code=#{occupation}, " +
|
|
|
- "marry_code=#{marriage}, " +
|
|
|
- "home_street=#{livePlace}, " + // max 32 char
|
|
|
- "home_tel=#{phone}, " +
|
|
|
- "home_zipcode=#{addrZipCode}, " +
|
|
|
- "account_street=#{hkPlaceName}, " + // max 20 char
|
|
|
- "account_zipcode=#{hkZipCode}, " +
|
|
|
- "employer_name=#{unitName}, " +
|
|
|
- "employer_street=#{unitPlace}, " + // max 32 char
|
|
|
- "employer_tel=#{unitPhone}, " +
|
|
|
- "employer_zipcode=#{unitZipCode}, " +
|
|
|
- "relation_name=#{contactName}, " +
|
|
|
- "relation_code=#{contactRelation}, " +
|
|
|
- "relation_street=#{contactAddrName}, " + // max 32 char
|
|
|
- "relation_tel=#{contactPhone} " +
|
|
|
- "where inpatient_no=#{patNo}")
|
|
|
- void updateAPatientMi(TcmFrontSheetMain sheet);
|
|
|
-
|
|
|
- @Update("update zy_actpatient set autopsy_mark=#{autopsy},clinic_diag_str=#{clinicDiagStr}, " +
|
|
|
- "diagnose_conform1=#{dc1},diagnose_conform2=#{dc2},diagnose_conform3=#{dc3}," +
|
|
|
- "diagnose_conform4=#{dc4}, diagnose_conform5=#{dc5}, operation=#{hasSurgery}," +
|
|
|
- "pathology_diag_comment=#{pathologicDiagStr},pathology_diag=#{pathologicDiagCode}, " +
|
|
|
- "clinic_diag=#{clinicDiagCode} where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- void updateZyActPatient(String patNo, int times, String autopsy, String dc1, String dc2,
|
|
|
- String dc3, String dc4, String dc5, String hasSurgery,
|
|
|
- String pathologicDiagStr, String pathologicDiagCode,
|
|
|
- String clinicDiagCode, String clinicDiagStr);
|
|
|
-
|
|
|
- @Update("update zy_inactpatient set autopsy_mark=#{autopsy},clinic_diag_str=#{clinicDiagStr}, " +
|
|
|
- "diagnose_conform1=#{dc1},diagnose_conform2=#{dc2},diagnose_conform3=#{dc3}," +
|
|
|
- "diagnose_conform4=#{dc4}, diagnose_conform5=#{dc5}, operation=#{hasSurgery}," +
|
|
|
- "pathology_diag_comment=#{pathologicDiagStr},pathology_diag=#{pathologicDiagCode}, " +
|
|
|
- "clinic_diag=#{clinicDiagCode} where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- void updateZyInActPatient(String patNo, int times, String autopsy, String dc1, String dc2,
|
|
|
- String dc3, String dc4, String dc5, String hasSurgery,
|
|
|
- String pathologicDiagStr, String pathologicDiagCode,
|
|
|
- String clinicDiagCode, String clinicDiagStr);
|
|
|
-
|
|
|
-
|
|
|
- @Select("select count(1) from batj_ba2 with(nolock) where bah=#{patNo} and zycs=#{times}")
|
|
|
- int isBatjBa2Exist(String patNo, int times);
|
|
|
-
|
|
|
- @Insert("insert into batj_ba1 (bah, zyh, zycs, xm, ryrq, ryks, rybf) values " +
|
|
|
- "(#{patNo}, #{patNo}, #{times}, #{name}, #{ryrq}, " +
|
|
|
- "(select code from zd_unit_code with(nolock) where name=#{dept} and isnull(del_flag,'')!='1'), " +
|
|
|
- "(select code from zd_unit_code with(nolock) where name=#{ward} and isnull(del_flag,'')!='1'))")
|
|
|
- void createBatjBa1(String patNo, int times, String name, Date ryrq, String dept, String ward);
|
|
|
-
|
|
|
- @Insert("insert into batj_ba2 (bah, zyh, zycs) values (#{patNo}, #{patNo}, #{times})")
|
|
|
- void createBatjBa2(String patNo, int times);
|
|
|
-
|
|
|
- @Insert("insert into t_frontsheet_supplement (bah, times) values (#{patNo}, #{times})")
|
|
|
- void createSheetSupplement(String patNo, int times);
|
|
|
-
|
|
|
- @Update("update batj_ba1 set " +
|
|
|
- "pay_method=#{payMethod}," +
|
|
|
- "age_days=#{ageDays}," +
|
|
|
- "jg=#{nativePlace}," +
|
|
|
- "new_born_weight=#{newBornWeight}," +
|
|
|
- "new_born_admiss_weight=#{newBornAdmissWeight}," +
|
|
|
- "xm=#{name}, " +
|
|
|
- "xb=#{sex}, " +
|
|
|
- "csrq=#{birthDate}, " +
|
|
|
- "hyzk=#{marriage}, " +
|
|
|
- "zy=#{occupation}, " +
|
|
|
- "csd=#{birthPlace}, " +
|
|
|
- "mz=#{nation}, " +
|
|
|
- "gj=#{country}, " +
|
|
|
- "sfzh=#{socialNo}, " +
|
|
|
- "gzdw=#{unitName}, " +
|
|
|
- "gzdh=#{unitPhone}, " +
|
|
|
- "gzyb=#{unitZipCode}, " +
|
|
|
- "hkdz=#{hkPlace}, " +
|
|
|
- "hkdz2=#{hkPlaceName}," +
|
|
|
- "hkyb=#{hkZipCode}, " +
|
|
|
- "lxr=#{contactName}, " +
|
|
|
- "lxrgx=#{contactRelation}, " +
|
|
|
- "lxdh=#{contactPhone}, " +
|
|
|
- "lxdz=#{contactAddr}, " +
|
|
|
- "lxdz2=#{contactAddrName}," +
|
|
|
- "rytj=#{zyAdmissWay}, " +
|
|
|
- "xzz=#{livePlace}, " +
|
|
|
- "xdh=#{phone} " +
|
|
|
- "where bah=#{patNo} and zycs=#{admissTimes}")
|
|
|
- void updateBatjBa1(TcmFrontSheetMain info);
|
|
|
-
|
|
|
- @Update("update batj_ba2 set " +
|
|
|
- "blzd_qph=#{blh}," +
|
|
|
- "gm_flag=#{allergy}," +
|
|
|
- "gmwy=#{allergicMedicine}," +
|
|
|
- "hbsag=#{hbsAg}," +
|
|
|
- "hcv_vb=#{hcvAb}," +
|
|
|
- "hiv_vb=#{hivAb}," +
|
|
|
- "tp_ab=#{tpAb}," +
|
|
|
- "xx=#{bloodType}," +
|
|
|
- "xx_rh=#{rh}," +
|
|
|
- "kzr=#{deptLeader}," +
|
|
|
- "zrys=#{leaderDoctor}," +
|
|
|
- "zzys=#{mainDoctor}," +
|
|
|
- "zyys=#{admissDoctor}," +
|
|
|
- "job_nurse=#{dutyNurse}," +
|
|
|
- "jxys=#{studyDoctor}," +
|
|
|
- "sxys=#{internshipDoctor}," +
|
|
|
- "bmy=#{coder}," +
|
|
|
- "bazl=#{qualityControlLevel}," +
|
|
|
- "zkys=#{qualityControlDoctor}," +
|
|
|
- "zkhs=#{qualityControlNurse}," +
|
|
|
- "barq=#{qualityControlDate}," +
|
|
|
- "lyfs=#{zyDismissWay}," +
|
|
|
- "jsjg=#{dismissDestination}," +
|
|
|
- "zzy_flag=#{admissAgainInOneMonth}," +
|
|
|
- "zzy_md=#{admissAgainPurpose}," +
|
|
|
- "ryq_hmsj_day=#{comaDaysBeforeAdmiss}," +
|
|
|
- "ryq_hmsj_hour=#{comaHoursBeforeAdmiss}," +
|
|
|
- "ryq_hmsj_min=#{comaMinutesBeforeAdmiss}," +
|
|
|
- "ryh_hmsj_day=#{comaDaysAfterAdmiss}," +
|
|
|
- "ryh_hmsj_hour=#{comaHoursAfterAdmiss}," +
|
|
|
- "ryh_hmsj_min=#{comaMinutesAfterAdmiss}," +
|
|
|
- "qjcs=#{rescueTimes}," +
|
|
|
- "cgcs=#{rescueSuccessTimes}," +
|
|
|
- "blfx=#{caseClassification}," +
|
|
|
- "zzjh=#{hasIcu}," +
|
|
|
- "zzjh_day=#{icuDays}," +
|
|
|
- "zzjh_hour=#{icuHours}," +
|
|
|
- "dbz=#{monopathyManagement}," +
|
|
|
- "lclj=#{clinicalPathwayManagement}," +
|
|
|
- "drgs=#{drgsManagement}," +
|
|
|
- "kss=#{useAntibiotic}," +
|
|
|
- "xjpy=#{bacilliculture}," +
|
|
|
- "fdcrb=#{statutoryEpidemic}," +
|
|
|
- "hurt_reason_name=#{hurtReasonName}," +
|
|
|
- "hurt_reason_code=#{hurtReasonCode}," +
|
|
|
- "tumor_level_t=#{tumorLevelT}," +
|
|
|
- "tumor_level_n=#{tumorLevelN}," +
|
|
|
- "tumor_level_m=#{tumorLevelM}," +
|
|
|
- "tumor_level=#{tumorLevel}, " +
|
|
|
- "apgar=#{xxeApgar} " +
|
|
|
- "where bah=#{patNo} and zycs=#{admissTimes}")
|
|
|
- void updateBatjBa2(TcmFrontSheetMain info);
|
|
|
-
|
|
|
- @Delete("delete from ba_first_page1 where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- void deleteOldDisdiag(String patNo, int times);
|
|
|
-
|
|
|
- @Delete("delete from batj_ba4 where bah=#{patNo} and zycs=#{times}")
|
|
|
- void deleteOldSurgeryRecord(String patNo, int times);
|
|
|
-
|
|
|
- @Insert("insert into ba_op_log (op_type, op_id, op_time, inpatient_no, admiss_times) values " +
|
|
|
- "(#{opType}, #{staffId}, getDate(), #{patNo}, #{times})")
|
|
|
- void writeBaOpLog(int opType, String staffId, String patNo, int times);
|
|
|
-
|
|
|
- @Select("select rtrim(dis_diag_no) no, rtrim(dis_diag) code, " +
|
|
|
- "rtrim(dis_diag_comment) name, rtrim(dis_diag_status) cyzg, " +
|
|
|
- "rtrim(op_id_code) operId, convert(varchar(19), op_diag_date, 21) opDate, " +
|
|
|
- "diagType='13',si_diag_type,bzfx='普通', admiss_cond " +
|
|
|
- "from zy_dis_diag_yb with(nolock) where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- List<YiBaoDisdiag> getYbDiags(String patNo, int times);
|
|
|
-
|
|
|
- @Delete("delete from zy_dis_diag_yb where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- void deleteOldYbDiag(String patNo, int times);
|
|
|
-
|
|
|
- @Insert("insert into zy_dis_diag_yb (inpatient_no, admiss_times, dis_diag_no, dis_diag_type, dis_diag, " +
|
|
|
- "dis_diag_comment, op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, si_diag_type, admiss_cond) " +
|
|
|
- "values (#{patNo},#{times},#{no},13,#{code},#{name},#{operId},#{opDate},'普通',#{cyzg},#{siDiagType},#{admissCond}) ")
|
|
|
- void insertNewYbDiag(YiBaoDisdiag diag);
|
|
|
-
|
|
|
-
|
|
|
- @Select("select file_status from t_case_frontsheet_main with(nolock) where bah=#{patNo} and admiss_times=#{times}")
|
|
|
- Integer selectFileStatus(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select min(op_time) from ba_op_log with(nolock) where " +
|
|
|
- "inpatient_no=#{patNo} and admiss_times=#{times} and op_type=2")
|
|
|
- Date selectFirstSignDate(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select sign_staff from t_case_frontsheet_main with(nolock) where bah=#{patNo} and admiss_times=#{times}")
|
|
|
- String selectSignStaff(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select role_id from dj_user_role where user_code=#{code}")
|
|
|
- List<Integer> getUserRoles(String code);
|
|
|
-
|
|
|
- @Select("select count(1) from t_yb_setl_modify_req where pat_no=#{patNo} and times=#{times}")
|
|
|
- Integer selectModified(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select top 1 * from t_si_disefamily_diagnose with(nolock) where dise_code=#{code} ")
|
|
|
- DisefamilyGrade selectDisefamilyGrade(String code);
|
|
|
-
|
|
|
- @Select("select yb_code from zd_icd9_cm3 where code in " +
|
|
|
- "(select ssbm from ${table} with(nolock) where zyh=#{patNo} and zycs=#{times} and isnull(ssbm,'')!='') " +
|
|
|
- "union select ssbm from ${table} with(nolock) where zyh=#{patNo} and zycs=#{times} and isnull(ssbm,'')!=''")
|
|
|
- List<String> selectPatientSurgeryCodes(String patNo, int times, String table);
|
|
|
-
|
|
|
- @Select("select *, " +
|
|
|
- "duplicated=(select count(1) from t_case_frontsheet_duplicate where bah=#{patNo} and times=#{times})," +
|
|
|
- "lendout=(select count(1) from t_case_frontsheet_lendout where bah=#{patNo} and times=#{times} and state='LEND_OUT')," +
|
|
|
- "closedown=(select count(1) from t_case_frontsheet_closedown where bah=#{patNo} and times=#{times}) " +
|
|
|
- "from t_case_frontsheet_main where bah=#{patNo} and admiss_times=#{times} and file_status=1")
|
|
|
- TcmFrontSheetMain selectStoredSheetMain(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select * from tcm_front_sheet_disdiag where bah=#{patNo} and times=#{times} ")
|
|
|
- List<TcmFrontSheetDisdiag> selectSignedSheetDiags(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select * from tcm_front_sheet_surgery where bah=#{patNo} and times=#{times} ")
|
|
|
- List<TcmFrontSheetSurgery> selectSignedSheetSurgeries(String patNo, int times);
|
|
|
-
|
|
|
- @Update("update t_case_frontsheet_main set age_days=#{agedays} where bah=#{patNo} and admiss_times=#{times}")
|
|
|
- void updateNewBornAge(String patNo, int times, Integer agedays);
|
|
|
-
|
|
|
- @Select("select rtrim(yb_code) as code, rtrim(yb_name) as name from zd_icd_code_new where code=#{code} and del_flag=0")
|
|
|
- CodeName selectSiDiagByBaDiag(String code);
|
|
|
-
|
|
|
- @Select("select province_code,city_code,district_code," +
|
|
|
- "provinceName=(select name from t_region where code=province_code), " +
|
|
|
- "cityName=(select name from t_region where code=city_code), " +
|
|
|
- "districtName=(select name from t_region where code=district_code) " +
|
|
|
- "from a_patient_mi where inpatient_no=#{patNo}")
|
|
|
- StandardAddressMember selectStandardAddressMember(String patNo);
|
|
|
-
|
|
|
- @Select("select rtrim(social_no) from a_patient_mi where inpatient_no=#{patNo}")
|
|
|
- String selectSocialNo(String patNo);
|
|
|
-
|
|
|
- @Select("select parent_code as code, name=(select t.name from t_region t where t.code=a.parent_code) " +
|
|
|
- "from t_region a where code=#{region}")
|
|
|
- Region selectParentRegion(Integer region);
|
|
|
-
|
|
|
- @Select("select name from t_region where code=#{region}")
|
|
|
- String selectRegionName(Integer region);
|
|
|
-
|
|
|
- @Select("select name from zd_district_code where code=#{code}")
|
|
|
- String getDistrictName(String code);
|
|
|
-
|
|
|
- @Select("select top 1 med_type from t_si_pat_info where pat_no=#{patNo} and times=#{times} order by " +
|
|
|
- "ledger_sn desc")
|
|
|
- String selectMedType(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select provinceName=(select name from t_region where code=#{province}), " +
|
|
|
- "cityName=(select name from t_region where code=#{city}), " +
|
|
|
- "districtName=(select name from t_region where code=#{district}) ")
|
|
|
- StandardAddressMember selectStandardAddressMember2(int province, int city, int district);
|
|
|
-
|
|
|
- @Select("select audit_flag from t_yb_setl_modify_req where pat_no=#{patNo} and times=#{times} ")
|
|
|
- Integer qualityPass(String patNo, int times);
|
|
|
-
|
|
|
- @Select("<script>" +
|
|
|
- "select rtrim(yb_code) as code,rtrim(yb_name) as name,charge_code as wjwCode," +
|
|
|
- "charge_name as wjwName from zd_icd9_cm3 where yb_code in " +
|
|
|
- "<foreach collection='surgeries' item='surgery' open='(' separator=',' close=')'>" +
|
|
|
- "#{surgery.code}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- List<HisWjwMatchEntity> selectSurgeryChargeCode(List<CaseFrontsheetSurgery> surgeries);
|
|
|
-
|
|
|
- @Select("<script>" +
|
|
|
- "select sum(charge_amount) from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} " +
|
|
|
- "and charge_code_mx in " +
|
|
|
- "<foreach collection='list' item='code' open='(' separator=',' close=')'>" +
|
|
|
- "#{code}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- Integer selectChargeSumamt(String patNo, int times, String[] list);
|
|
|
-
|
|
|
- @Select("select code,yb_name as name,yb_code from zd_anaesthesia where yb_code is not null")
|
|
|
- List<CodeName> selectZdAnstWays();
|
|
|
-
|
|
|
- @Select("select code,rtrim(name) as name,si_code as ybCode from zd_country_code where si_code is not null")
|
|
|
- List<CodeName> selectZdCountries();
|
|
|
-
|
|
|
- @Select("select code,rtrim(name) as name,code2 as ybCode from zd_nation_code where code2 is not null ")
|
|
|
- List<CodeName> selectZdNations();
|
|
|
-
|
|
|
- @Select("select top 1 insuplc_admdvs from t_si_setlinfo where pat_no=#{patNo} and times=#{times} and revoked=0")
|
|
|
- String selectSetlInsuplcAdmdvs(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select top 1 isnull(op_type,9) from zd_icd9_cm3 where yb_code=#{code}")
|
|
|
- Integer selectOperationType(String code);
|
|
|
-
|
|
|
- int selectAntibiotics(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select top 1 audit_state from t_frontsheet_quality_verification " +
|
|
|
- "where pat_no=#{patNo} and times=#{times} order by application_time desc ")
|
|
|
- AuditState selectStates(String patNo, int times);
|
|
|
+ @Select("select * from tcm_front_sheet_surgery where sheet_id=#{sheetId} ")
|
|
|
+ List<TcmFrontSheetSurgery> selectSignedSheetSurgeries(String sheetId);
|
|
|
}
|