|
@@ -1,90 +0,0 @@
|
|
|
-package thyyxxk.webserver.dao.his.api;
|
|
|
-
|
|
|
-import org.apache.ibatis.annotations.Mapper;
|
|
|
-import org.apache.ibatis.annotations.Select;
|
|
|
-import org.apache.ibatis.annotations.Update;
|
|
|
-import thyyxxk.webserver.api.dpcc.model.MedicalPrescription;
|
|
|
-import thyyxxk.webserver.api.dpcc.model.PatientInfo;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-@Mapper
|
|
|
-public interface DpccDao {
|
|
|
-
|
|
|
- @Select("select " +
|
|
|
- "rtrim(a.inpatient_no) as patNo,a.admiss_times as times, " +
|
|
|
- "rtrim(b.social_no) as idCard,source='2' " +
|
|
|
- "from zy_actpatient a,a_patient_mi b where a.zk_ward='1020700' " +
|
|
|
- "and a.dpcc_upload_flag=0 and a.inpatient_no=b.inpatient_no")
|
|
|
- List<PatientInfo> getInpatientList();
|
|
|
-
|
|
|
- @Select("select " +
|
|
|
- "rtrim(a.patient_id) as patNo,a.times," +
|
|
|
- "rtrim(b.social_no) as idCard,source='1' " +
|
|
|
- "from mz_visit_table a,mz_patient_mi b where a.visit_dept_code='1020700' " +
|
|
|
- "and a.dpcc_upload_flag=0 and datediff(day,a.visit_date,getdate())=0 " +
|
|
|
- "and a.patient_id=b.patient_id")
|
|
|
- List<PatientInfo> getOutpatientList();
|
|
|
-
|
|
|
- @Select("select " +
|
|
|
- "rtrim(a.patient_id) as patNo,a.times," +
|
|
|
- "rtrim(b.social_no) as idCard,source='1' " +
|
|
|
- "from mz_visit_table a,mz_patient_mi b where a.visit_dept_code='1020700' " +
|
|
|
- "and a.dpcc_upload_flag=0 and datediff(day,a.visit_date,getdate())=${day} " +
|
|
|
- "and a.patient_id=b.patient_id")
|
|
|
- List<PatientInfo> getOutpatientList2(int day);
|
|
|
-
|
|
|
- @Select("select " +
|
|
|
- "patientNo=rtrim(b.inpatient_no), " +
|
|
|
- "prescriptionNo=cast(cast (order_no as decimal) as varchar), " +
|
|
|
- "hisDrugCode=rtrim(charge_code_mx), " +
|
|
|
- "hisDrugName=(select top 1 rtrim(d.name) from yp_zd_dict d where d.code=a.charge_code_mx), " +
|
|
|
- "hisDrugFrequencyCode=rtrim(b.frequ_code), " +
|
|
|
- "hisDrugFrequencyName=rtrim(b.frequ_code), " +
|
|
|
- "hisDrugUnit=(select rtrim(d.name) from yp_zd_unit d where d.code=b.dose_unit), " +
|
|
|
- "hisDrugUsage=(select rtrim(d.supply_name) from yz_supply_type d where d.supply_code=b.supply_code), " +
|
|
|
- "hisDrugDosage=b.dose, " +
|
|
|
- "prescriptionTime=convert(varchar(19),a.charge_date,21), " +
|
|
|
- "uniqueIndex=rtrim(b.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(detail_sn as varchar), " +
|
|
|
- "source='2',oecPrdesc=N'医嘱用药',isCydy='0' " +
|
|
|
- "from zy_detail_charge a,yz_act_order b " +
|
|
|
- "where a.inpatient_no=#{patNo} and a.admiss_times=#{times} " +
|
|
|
- "and a.charge_code in ('BILL01','BILL02','BILL28') " +
|
|
|
- "and a.charge_date<=getdate()" +
|
|
|
- "and datediff(minute,a.charge_date,getdate())<=180 " +
|
|
|
- "and a.order_no=b.act_order_no")
|
|
|
- List<MedicalPrescription> getInpatientDrugs(PatientInfo patient);
|
|
|
-
|
|
|
- @Select("select " +
|
|
|
- "patientNo=rtrim(a.patient_id), " +
|
|
|
- "prescriptionNo=rtrim(a.patient_id) + '_' + cast(a.times as varchar) + '_1', " +
|
|
|
- "hisDrugCode=rtrim(a.charge_item_code), " +
|
|
|
- "hisDrugName=(select top 1 rtrim(d.name) from yp_zd_dict d where d.code=a.charge_item_code), " +
|
|
|
- "hisDrugFrequencyCode=rtrim(a.frequency), " +
|
|
|
- "hisDrugFrequencyName=rtrim(a.frequency), " +
|
|
|
- "hisDrugUnit=(select rtrim(d.name) from yp_zd_unit d where d.code=a.drug_unit), " +
|
|
|
- "hisDrugUsage=(select rtrim(d.supply_name) from yz_supply_type d where d.supply_code=a.supply_code), " +
|
|
|
- "hisDrugDosage=a.quantity, " +
|
|
|
- "prescriptionTime=convert(varchar(19),a.charge_date,21), " +
|
|
|
- "uniqueIndex=rtrim(a.patient_id)+'_'+cast(a.times as varchar)+'_'+cast(receipt_no as varchar) " +
|
|
|
- "+'_'+cast(a.order_no as varchar)+'_'+cast(item_no as varchar), " +
|
|
|
- "source='1' " +
|
|
|
- "from mz_charge_detail a " +
|
|
|
- "where a.patient_id=#{patNo} and a.times=#{times} " +
|
|
|
- "and a.group_no!='00' and a.pay_mark!='5' ")
|
|
|
- List<MedicalPrescription> getOutpatientDrugs(PatientInfo patient);
|
|
|
-
|
|
|
- @Update("update mz_visit_table set dpcc_upload_flag=1 where " +
|
|
|
- "patient_id=#{patNo} and times=#{times}")
|
|
|
- void updateDpccFlag(String patNo, int times);
|
|
|
-
|
|
|
- @Select("select rtrim(social_no) from mz_patient_mi where patient_id=#{patNo}")
|
|
|
- String getSocialNo(String patNo);
|
|
|
-
|
|
|
- @Select("select " +
|
|
|
- "start=convert(varchar(10),visit_date,21)+' 00:00:00', " +
|
|
|
- "endd=convert(varchar(10),visit_date+1,21)+' 23:59:59' " +
|
|
|
- "from mz_visit_table where patient_id=#{patNo} and times=#{times}")
|
|
|
- Map<String, String> getStartAndEndDate(String patNo, int times);
|
|
|
-}
|