123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- package thyyxxk.webserver.dao.his.zhuyuanyisheng;
- import org.apache.ibatis.annotations.*;
- import org.springframework.web.bind.annotation.RequestParam;
- import thyyxxk.webserver.entity.drg.AuxiliaryFillingOfDiagnosis;
- import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrDataElement;
- import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrDataExtract;
- import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrPatientData;
- import java.util.List;
- import java.util.Map;
- @Mapper
- public interface EmrPatientDao {
- @Select("select id, " +
- " pat_no, " +
- " times, " +
- " emr_document_id, " +
- " emr_category_code, " +
- " del_flag, " +
- " emr_name, " +
- " create_id, " +
- " create_date, " +
- " modify_id, " +
- " modify_date, " +
- " name," +
- " submit " +
- "from emr_patient_data " +
- "where pat_no = #{patNo} " +
- " and times = #{times}" +
- " and del_flag = 0 ")
- List<EmrPatientData> getPatientData(@Param("patNo") String patNo,
- @Param("times") Integer times);
- @Select("select count(1) " +
- "from emr_patient_data " +
- "where pat_no = #{patNo} " +
- " and times = #{times} " +
- " and emr_document_id = #{docmentId} ")
- Integer whetherThereIsAMedicalRecord(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("docmentId") String docmentId);
- @Insert("insert into emr_patient_data (pat_no, times, emr_document_id, emr_category_code, emr_name,create_id,name) " +
- "values (#{patNo},#{times},#{emrDocumentId},#{emrCategoryCode},#{emrName},#{createId},#{name})")
- void emrInsertForTheFirstTime(EmrPatientData param);
- @Update("update emr_patient_data " +
- "set name = #{name}, " +
- " modify_date = getdate() , " +
- " modify_id = #{createId} " +
- "where pat_no = #{patNo} " +
- " and times = #{times} " +
- " and emr_document_id = #{emrDocumentId} ")
- void updateCreatedTemplate(EmrPatientData param);
- @Select("select emr_category_code,pat_no,times,create_id from emr_patient_data where emr_document_id = #{id} ")
- EmrPatientData getCategoryCodeByDocumentId(String id);
- @Update("update emr_patient_data " +
- "set del_flag = 1," +
- " modify_id = #{userCode}," +
- " modify_date = getdate() " +
- "where emr_document_id = #{documentId}")
- void deletePatientEmrByDocumentId(@Param("documentId") String documentId,
- @Param("userCode") String userCode);
- @Select("select count(1) " +
- "from emr_patient_data " +
- "where pat_no = #{patNo} " +
- " and times = #{times} " +
- " and del_flag = 0 " +
- " and emr_category_code = #{emrCategoryCode} ")
- Integer queryWhetherThePatientHasASpecifiedMedicalRecord(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("emrCategoryCode") String emrCategoryCode);
- @Select("select * " +
- "from emr_data_extract " +
- "where emr_category_code = #{code} ")
- EmrDataExtract extractDataSource(String code);
- @Select("select pat_no,times,data_element from emr_data_element where pat_no = #{patNo} and times = #{times}")
- EmrDataElement obtainPatientSOriginalData(@Param("patNo") String patNo,
- @Param("times") Integer times);
- @Insert("insert into emr_data_element (pat_no, times, data_element) " +
- "values (#{patNo},#{times},#{dataElement});")
- void insertDataSource(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("dataElement") String dataElement);
- @Update("update emr_data_element set data_element = #{dataElement} where " +
- "pat_no = #{patNo} and times = #{times}")
- void updatePatientDataSource(@Param("patNo") String patNo,
- @Param("times") Integer times,
- @Param("dataElement") String dataElement);
- @Select("select count(1) from hot_search_sorting where user_code = #{userCode} and code = #{code} and table_name = #{tableName}")
- Integer queryWhetherThereIsHotSearch(@Param("userCode") String userCode,
- @Param("code") String code,
- @Param("tableName") String tableName);
- @Insert("insert into hot_search_sorting (user_code, code, table_name, count) values (#{userCode}, #{code}, #{tableName}, 1)")
- void hotSearchSorting(@Param("userCode") String userCode,
- @Param("code") String code,
- @Param("tableName") String tableName);
- @Update("update hot_search_sorting set count = count + 1 where user_code = #{userCode} and code = #{code} and table_name = #{tableName}")
- void updateHotSearch(@Param("userCode") String userCode,
- @Param("code") String code,
- @Param("tableName") String tableName);
- @Select("select create_id from emr_patient_data where emr_document_id = #{id}")
- String getDocumentIdCreatedBy(String id);
- @Update("update emr_patient_data set submit = 1 where emr_document_id = #{id}")
- void updateSubmissionFlag(String id);
- @Select("select emr_document_id from emr_patient_data where pat_no = #{patNo} and times = #{times} and emr_category_code = #{categoryCode} and del_flag = 0")
- List<String> getDocumentIdByPatietn(String patNo, int times, String categoryCode);
- @Select("select rtrim(a.name) as xm, " +
- " dis_date as cysj, " +
- " a.sex as xb, " +
- " (select DATEDIFF(yy, birth_date, GETDATE()) from a_patient_mi b where b.inpatient_no = a.inpatient_no) as nl, " +
- " (select sum(charge_fee) " +
- " from zy_detail_charge " +
- " where zy_detail_charge.inpatient_no = a.inpatient_no " +
- " and zy_detail_charge.admiss_times = a.admiss_times " +
- " and ledger_sn = #{ledgerSn}) as zfy, " +
- " datediff(day, admiss_date, isnull(dis_date, getdate())) as sjzyts, " +
- " condition_code as rybq, " +
- " route_of_admission as rytj, " +
- " '' as lyfs, " +
- " (select insutype " +
- " from t_si_setlinfo " +
- " where a.inpatient_no = pat_no " +
- " and admiss_times = times) as insur_type_id, " +
- " '' as xsecstz, " +
- " '' as xserytz, " +
- " '' as bzyzsnl " +
- "from zy_actpatient a, " +
- " a_patient_mi b, " +
- " mz_zy_req c " +
- "where a.inpatient_no = #{patNo} " +
- " and admiss_times = #{times} " +
- " and a.inpatient_no = b.inpatient_no " +
- " and b.mz_no = c.patient_id")
- Map<String, String> drgPatientInfo(String patNo, int times, int ledgerSn);
- @Select("select max(admiss_times) " +
- "from zy_inactpatient " +
- "where inpatient_no = #{patNo} ")
- Integer getMaxTimes(String patNo);
- @Select("select data_element from emr_data_element where pat_no = #{patNo} and times = #{times}")
- Map<String, String> selectEmrDataElement(String patNo, Integer times);
- }
|