|
|
|
@ -24,7 +24,7 @@
|
|
|
|
|
<result column="dept_code_lend" jdbcType="NVARCHAR" property="deptCodeLend" />
|
|
|
|
|
<result column="isscaned" jdbcType="NVARCHAR" property="isscaned" />
|
|
|
|
|
<result column="isScanning" jdbcType="NVARCHAR" property="is_scanning" />
|
|
|
|
|
|
|
|
|
|
<result column="bed_number" jdbcType="NVARCHAR" property="bedNumber" />
|
|
|
|
|
|
|
|
|
|
<result column="cmt_doctor" jdbcType="INTEGER" property="cmtDoctor"/>
|
|
|
|
|
<result column="cmt_nurse" jdbcType="INTEGER" property="cmtNurse"/>
|
|
|
|
@ -69,7 +69,7 @@
|
|
|
|
|
id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState,
|
|
|
|
|
admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept,
|
|
|
|
|
checked_datetime, LockInfo, DOCTOR_IN_CHARGE, ID_NO, DISCHARGE_DISPOSITION, dept_code_lend,isscaned,is_scanning,
|
|
|
|
|
cmt_doctor,cmt_nurse,doctor_name,nurse_name,cmt_doctor_date,cmt_nurse_date,emr_doctor_cmt,emr_nure_cmt,death_flag
|
|
|
|
|
cmt_doctor,cmt_nurse,doctor_name,nurse_name,cmt_doctor_date,cmt_nurse_date,emr_doctor_cmt,emr_nure_cmt,death_flag,bed_number
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectById" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
@ -80,7 +80,7 @@
|
|
|
|
|
<select id="selectByCol" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap">
|
|
|
|
|
select distinct m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
|
|
|
|
|
dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,d.name dept_admission_to
|
|
|
|
|
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,m.is_scanning
|
|
|
|
|
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,m.is_scanning,bed_number
|
|
|
|
|
from archive_master m
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' )) d
|
|
|
|
@ -107,6 +107,11 @@
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="bedNumber != null and bedNumber != ''">
|
|
|
|
|
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="visitId != null and visitId != ''">
|
|
|
|
|
and m.visit_id=#{visitId,jdbcType=NCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -182,7 +187,7 @@
|
|
|
|
|
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
|
|
|
|
|
dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,d.name dept_admission_to
|
|
|
|
|
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,m.is_scanning,
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.bed_number
|
|
|
|
|
from archive_master m
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' )) d
|
|
|
|
@ -205,6 +210,9 @@
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bedNumber != null and bedNumber != ''">
|
|
|
|
|
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="visitId != null and visitId != ''">
|
|
|
|
|
and m.visit_id=#{visitId,jdbcType=NCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -287,7 +295,7 @@
|
|
|
|
|
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
|
|
|
|
|
dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,d.name dept_admission_to
|
|
|
|
|
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.first_instance,m.is_scanning
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.first_instance,m.is_scanning,bed_number
|
|
|
|
|
from archive_master m
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' )) d
|
|
|
|
@ -302,6 +310,9 @@
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bedNumber != null and bedNumber != ''">
|
|
|
|
|
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="visitId != null and visitId != ''">
|
|
|
|
|
and m.visit_id=#{visitId,jdbcType=NCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -391,7 +402,7 @@
|
|
|
|
|
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
|
|
|
|
|
dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,d.name dept_admission_to
|
|
|
|
|
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.is_scanning
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.is_scanning,bed_number
|
|
|
|
|
from archive_master m
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' )) d
|
|
|
|
@ -407,6 +418,9 @@
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bedNumber != null and bedNumber != ''">
|
|
|
|
|
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="visitId != null and visitId != ''">
|
|
|
|
|
and m.visit_id=#{visitId,jdbcType=NCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -495,6 +509,9 @@
|
|
|
|
|
<if test="isScanning != null and isScanning != ''">
|
|
|
|
|
and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deathFlag != null and deathFlag != ''">
|
|
|
|
|
and m.death_flag = #{deathFlag,jdbcType=NVARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY m.discharge_date_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -505,7 +522,7 @@
|
|
|
|
|
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,f.name
|
|
|
|
|
dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,d.name dept_admission_to
|
|
|
|
|
,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned,m.is_scanning,
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag
|
|
|
|
|
m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,bed_number
|
|
|
|
|
from archive_master m
|
|
|
|
|
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
|
|
|
|
|
typeCode='dept_code' )) d
|
|
|
|
@ -520,6 +537,9 @@
|
|
|
|
|
<if test="inpNo != null and inpNo != ''">
|
|
|
|
|
and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bedNumber != null and bedNumber != ''">
|
|
|
|
|
and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="visitId != null and visitId != ''">
|
|
|
|
|
and m.visit_id=#{visitId,jdbcType=NCHAR}
|
|
|
|
|
</if>
|
|
|
|
@ -650,7 +670,7 @@
|
|
|
|
|
</choose>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="bbSel2" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap">
|
|
|
|
|
select id,inp_no,visit_id,U.name,dept_name,E.name doctor_name,DOCTOR_IN_CHARGE,ArchiveState,CONVERT(varchar(100),admission_date_time, 120) admission_date_time,CONVERT(varchar(100),U.discharge_date_time, 120) discharge_date_time,GETDATE() nowt,CEILING(DATEDIFF(hour,U.discharge_date_time,GETDATE())/24.00)-3 nurse_name
|
|
|
|
|
select id,inp_no,visit_id,U.name,dept_name,E.name doctor_name,DOCTOR_IN_CHARGE,ArchiveState,CONVERT(varchar(100),admission_date_time, 120) admission_date_time,CONVERT(varchar(100),U.discharge_date_time, 120) discharge_date_time,GETDATE() nowt,CEILING(DATEDIFF(hour,U.discharge_date_time,GETDATE())/24.00)-3 nurse_name,bed_number
|
|
|
|
|
from archive_master U
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
select code,name from emr_dictionary
|
|
|
|
@ -955,6 +975,7 @@
|
|
|
|
|
isscaned = #{isscaned,jdbcType=NVARCHAR},
|
|
|
|
|
is_scanning = #{isScanning,jdbcType=NVARCHAR},
|
|
|
|
|
first_instance=#{firstInstance,jdbcType=NVARCHAR}
|
|
|
|
|
bed_number=#{bedNumber,jdbcType=NVARCHAR}
|
|
|
|
|
where id = #{id,jdbcType=NVARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
<select id="getFName" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
|
|