优化纸质病例页面,病案召回等

master
linjj 2 years ago
parent 4f601131ab
commit 0e8a3b6241

@ -103,20 +103,8 @@ public class signListController {
@ResponseBody
@RequestMapping(value = "/signList")
public OffsetLimitPage signList(HttpServletRequest request, HttpServletResponse response, Sign_List_Vo signListVo, Integer offset, Integer limit) throws UnsupportedEncodingException {
System.out.println("signListVo:::" + signListVo.getOperateName1());
response.setCharacterEncoding("utf-8");
request.setCharacterEncoding("utf-8");
//判断所有都为空则签收日期按当前日期
/*if(StringUtils.isBlank(signListVo.getInpNo())&&StringUtils.isBlank(signListVo.getVisitId())&&signListVo.getC1()==null){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//签收日期没进行选择的话则默认显示的是当前日期的数据
if (StringUtils.isBlank(signListVo.getStartSignDate())) {
signListVo.setStartSignDate(sdf.format(new Date()));
}
if (StringUtils.isBlank(signListVo.getEndSignDate())) {
signListVo.setEndSignDate(sdf.format(new Date()));
}
}*/
OffsetLimitPage result = signListService.selectSignList(signListVo, offset, limit);
return result;
}

@ -84,6 +84,8 @@ public interface Emr_Fault_DetailMapper {
*/
List<Emr_Fault_Vo> selectByCol(Emr_Fault_Vo record);
/**
* id
* @param id

@ -453,6 +453,28 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
PageHelper.offsetPage(offset, limit);
}
List<Archive_Master_Vo> list = archiveMasterMapper.selectByUnfileNew(archiveMasterVo);
//转换科室
Emr_Dictionary dic = new Emr_Dictionary();
dic.setEffective(1);
dic.setTypecode("dept_code");
//科室列表
List<Emr_Dictionary> dicList = emrDictionaryService.dicByTypeCode(dic);
for (Archive_Master_Vo archiveMaster:list)
//转换科室
for (int k = 0; k < dicList.size(); k++) {
String deptName = archiveMaster.getDeptName();
String dept2 = archiveMaster.getDeptAdmissionTo();
if (deptName.equals(dicList.get(k).getCode())) {
//出院科室
deptName = deptName.replace(deptName, dicList.get(k).getName());
archiveMaster.setDeptName(deptName);
}
if(dept2 != null && dept2.equals(dicList.get(k).getCode())) {
//入院科室dept_admission_to
dept2 = dept2.replace(dept2, dicList.get(k).getName());
archiveMaster.setDeptAdmissionTo(dept2);
}
}
//设置医生、护士名称和打印标识
setNameAndPrintFlag(archiveMasterVo, list);
return list;
@ -463,6 +485,27 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
public OffsetLimitPage selectStorageByCol(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Master_Vo> list = archiveMasterMapper.selectStorageByCol(archiveMasterVo);
Emr_Dictionary dic = new Emr_Dictionary();
dic.setEffective(1);
dic.setTypecode("dept_code");
List<Emr_Dictionary> dicList = emrDictionaryService.dicByTypeCode(dic);
//转换科室
for (Archive_Master_Vo archiveMaster:list){
for (int k = 0; k < dicList.size(); k++) {
String deptName = archiveMaster.getDeptName();
String dept2 = archiveMaster.getDeptAdmissionTo();
if (deptName.equals(dicList.get(k).getCode())) {
//出院科室
deptName = deptName.replace(deptName, dicList.get(k).getName());
archiveMaster.setDeptName(deptName);
}
if(dept2 != null && dept2.equals(dicList.get(k).getCode())) {
//入院科室dept_admission_to
dept2 = dept2.replace(dept2, dicList.get(k).getName());
archiveMaster.setDeptAdmissionTo(dept2);
}
}
}
return new OffsetLimitPage((Page) list);
}
@ -641,7 +684,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
String s=String.valueOf(inum2);
archiveMasterVo.setOverdueDaysTwo(s);
}
List<Archive_Master_Vo> list = archiveMasterMapper.selectOverdue(archiveMasterVo);
if(list!=null && list.size()>0) {
//查询用户集合

@ -91,7 +91,6 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService {
list.get(i).setDeptAdmissionTo(dept2);
}
}
String assortId = list.get(i).getAssortId();
if(assortId!="" && assortId!=null) {
String[] assorArr = assortId.split(",");
@ -101,6 +100,7 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService {
if (Arrays.asList(assorArr).contains(id)) {
assortId = assortId.replace(id, typeLis.get(j).getTypeName());
list.get(i).setAssortId(assortId);
break;
}
}
}

@ -25,8 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class Sign_ListServiceImpl implements Sign_ListService {
@ -43,8 +43,17 @@ public class Sign_ListServiceImpl implements Sign_ListService {
@Override
public OffsetLimitPage selectSignList(Sign_List_Vo signListVo, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Sign_List_Vo> list =signListMapper.selectSignList(signListVo);
if(list!=null && list.size()>0){
List<Sign_List_Vo> list = signListMapper.selectSignList(signListVo);
if (list != null && list.size() > 0) {
// //根据id去重
// list = list.stream().collect(Collectors.collectingAndThen(
// Collectors.toCollection(() -> new TreeSet<>(
// Comparator.comparing(Sign_List_Vo::getMasterID))), ArrayList::new));
//获取科室列表
Emr_Dictionary dic = new Emr_Dictionary();
dic.setEffective(1);
dic.setTypecode("dept_code");
List<Emr_Dictionary> dicList = emrDictionaryService.dicByTypeCode(dic);
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
@ -62,19 +71,30 @@ public class Sign_ListServiceImpl implements Sign_ListService {
String name = powerUserDto.getName();
if (StringUtils.isNotBlank(singer) && powerUserDto.getUserName().equals(singer)) {
sign_list_vo.setC1(name);
break;
}
}
}
//转换科室
for (int k = 0; k < dicList.size(); k++) {
String deptName = sign_list_vo.getDeptName();
if (deptName.equals(dicList.get(k).getCode())) {
//出院科室
deptName = deptName.replace(deptName, dicList.get(k).getName());
sign_list_vo.setDeptName(deptName);
break;
}
}
}
}
return new OffsetLimitPage((Page) list);
}
@Override
public List<Sign_List_Vo> selectSignList(Sign_List_Vo signListVo) {
List<Sign_List_Vo> list =signListMapper.selectSignList(signListVo);
if(list!=null && list.size()>0){
List<Sign_List_Vo> list = signListMapper.selectSignList(signListVo);
if (list != null && list.size() > 0) {
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
@ -102,7 +122,7 @@ public class Sign_ListServiceImpl implements Sign_ListService {
}
@Override
public List<Sign_List> selectSignListWith(Sign_List signList) {
public List<Sign_List> selectSignListWith(Sign_List signList) {
return signListMapper.selectSignListWith(signList);
}
@ -133,8 +153,8 @@ public class Sign_ListServiceImpl implements Sign_ListService {
@Override
public List<Sign_List> selSignByColm(Sign_List_Vo signListVo) {
List<Sign_List> list=signListMapper.selSignByColm(signListVo);
if(list!=null && list.size()>0){
List<Sign_List> list = signListMapper.selSignByColm(signListVo);
if (list != null && list.size() > 0) {
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
@ -163,16 +183,15 @@ public class Sign_ListServiceImpl implements Sign_ListService {
@Override
public OffsetLimitPage selSignByColm(SignList signList, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<SignList> list= selSignByColm1(signList);
List<SignList> list = selSignByColm1(signList);
return new OffsetLimitPage((Page) list);
}
@Override
public List<SignList> selSignByColm1(SignList signList) {
List<SignList> list=signListMapper.selSignByColm1(signList);
if(list!=null && list.size()>0){
List<SignList> list = signListMapper.selSignByColm1(signList);
if (list != null && list.size() > 0) {
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
@ -199,6 +218,8 @@ public class Sign_ListServiceImpl implements Sign_ListService {
}
return list;
}
}

@ -16,3 +16,4 @@ sqlServerPassword=xjgs+docus911
oracleUrl = 10.6.0.150:1521/jhemr
oracleUserName = jswzh
oraclePassWord = jswzh123

@ -836,12 +836,12 @@
</select>
<select id="selectByUnfileNew" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,ISNULL(f.name,m.dept_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,ISNULL(d.name,m.dept_admission_to) dept_admission_to
select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,m.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,m.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.bed_number,ISNULL(s.numb, 0) numb,ISNULL(amf.num, 5) checkFlag
,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(printTable.num, 0) printNum
,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(m.print_flag, 0) printNum
from archive_master m
LEFT JOIN(SELECT amfa.id ,amfa.master_id, amfa.following_type num FROM Archive_Master_Following amfa left join
(SELECT amfb.master_id ida,max(handle_time) t FROM Archive_Master_Following amfb GROUP BY master_id) amfc
@ -855,12 +855,6 @@
on m.id=sDoctor.archive_detail_id
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('2','6') GROUP BY archive_detail_id) sNurse
on m.id=sNurse.archive_detail_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) d
on m.dept_admission_to=d.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) f
on m.dept_name=f.code
LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag is not null GROUP BY archive_detail_id) s
on m.id=s.archive_detail_id
LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable
@ -871,9 +865,9 @@
<if test="printNum != null and printNum != ''">
<choose>
<when test="printNum == 1">
and printTable.MasterID is not null
and m.print_flag is not null
</when>
<otherwise>and printTable.MasterID is null</otherwise>
<otherwise>and m.print_flag is null</otherwise>
</choose>
</if>
<if test="inpNo != null and inpNo != ''">
@ -1802,43 +1796,13 @@
VARCHAR (10),
f1.handle_time,
120
) and flag= 1 order by date asc) as b) as overTime1,
<if test="overdueDays != null and overdueDays != ''">
case
when ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)&lt;=0
then '0'
when ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)+ISNULL(f2.dayOne,0)-1-cast(#{overdueDays,jdbcType=NCHAR} as int)&lt;0
then '0'
when ISNULL(f2.dayOne,0)>=0 and ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)>=0
then ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)+ISNULL(f2.dayOne,0)-1-cast(#{overdueDays,jdbcType=NCHAR} as int)
else '0'
end overdue
</if>
<if test="overdueDays == null or overdueDays == ''">
case
when ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)&lt;=0
then '0'
when ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)+ISNULL(f2.dayOne,0)-1-3&lt;0
then '0'
when ISNULL(f2.dayOne,0)>=0 and ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)>=0
then ISNULL( datediff(day,convert(varchar(100),f2.mid_date,23),convert(varchar(100),f1.handle_time,23)),0)+ISNULL(f2.dayOne,0)-1-3
else '0'
end overdue
</if>
,m.master_id,m.patient_id,m.inp_no,m.visit_id,m.name,ISNULL(c.name,m.dept_name) dept_name,m.discharge_date_time,m.DOCTOR_IN_CHARGE,m.first_instance,m.death_flag,ISNULL(e.name,m.dept_admission_to) dept_admission_to,admission_date_time
) and flag= 1 order by date asc) as b) as overTime1
,m.master_id,m.patient_id,m.inp_no,m.visit_id,m.name,m.dept_name,m.discharge_date_time,m.DOCTOR_IN_CHARGE,m.first_instance,m.death_flag,m.dept_admission_to,admission_date_time
from(
select id,master_id,following_type,following_content,handle_name,handle_time,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='9'
)f1
LEFT JOIN (
select *,
<if test="overdueDays != null and overdueDays != ''">
convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int)-1,convert(varchar(10),handle_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),handle_time,23),convert(varchar(10),(DATEADD(DAY,cast(#{overdueDays,jdbcType=NCHAR} as int),convert(varchar(10),handle_time,23))),23)) , 0) dayOne
</if>
<if test="overdueDays == null or overdueDays == ''">
convert(varchar(10),(DATEADD(DAY,cast('2' as int),convert(varchar(10),handle_time,23))),23) mid_date
,ISNULL(dbo.getWorkday(convert(varchar(10),handle_time,23),convert(varchar(10),(DATEADD(DAY,cast('3' as int),convert(varchar(10),handle_time,23))),23)) , 0) dayOne
</if>
select *
from(
select *,ROW_NUMBER() OVER (partition by master_id ORDER BY master_id,handle_time) as rowNumb from Archive_Master_Following where following_type='5'
)a
@ -1849,10 +1813,6 @@
from archive_master where 1=1 and ArchiveState not in('作废','已封存','取消入院') and Is_Valid!=1
) m
on f1.master_id=m.master_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) c
on m.dept_name=c.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where typeCode='dept_code' )) e
on m.dept_admission_to=e.code
<where> 1=1 and m.master_id!='' and m.master_id is not null and f2.handle_time is not null
<!--<if test="(overdueDaysTwo != null and overdueDaysTwo != '') ">-->
<!--and-->
@ -2268,8 +2228,8 @@
</select>
<!--封存查询-->
<select id="selectStorageByCol" parameterType="com.emr.entity.Archive_Master_Vo" resultMap="BaseResultMap2">
select m.id ,m.inp_no,m.visit_id,m.name,ISNULL(f.name, m.dept_name) dept_name,CONVERT(VARCHAR(20),m.discharge_date_time,120) discharge_date_time,m.ArchiveState,m.sex,m.ID_NO,
ISNULL(c.name, m.dept_admission_to) dept_admission_to
select m.id ,m.inp_no,m.visit_id,m.name,m.dept_name,CONVERT(VARCHAR(20),m.discharge_date_time,120) discharge_date_time,m.ArchiveState,m.sex,m.ID_NO,
m.dept_admission_to
,CONVERT(VARCHAR(20),m.admission_date_time,120) admission_date_time,m.DISCHARGE_DISPOSITION,d.handle_time,d.handle_name,d.following_type
from(select * from Archive_Master where ArchiveState!='作废' and Is_Valid!=1 ) m
LEFT JOIN(
@ -2279,12 +2239,6 @@
from Archive_Master_Following where 1=1 ) as t1 where 1=1 and RowNum = 1 and following_type='11'
) d
on m.id=d.master_id
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) c
on m.dept_admission_to=c.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) f
on m.dept_name=f.code
where 1=1
<if test="id != null and id != ''">
and m.id = #{id,jdbcType=NVARCHAR}
@ -2642,7 +2596,7 @@
select * from archive_master where id =#{id}
</select>
<select id="selectByInpAndVisitId" resultType="com.emr.entity.Archive_Master">
select patient_id from archive_master where inp_no=#{inpNo} and visit_id=#{visitId}
select patient_id,ID from archive_master where inp_no=#{inpNo} and visit_id=#{visitId}
</select>
<select id="selectChildMasterId" resultType="com.emr.dto.Archive_MasterDto">
select id,inp_no from Archive_Master where admission_date_time = #{time}

@ -445,99 +445,208 @@
</if>
</select>
<select id="selectByCol" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">
select m.id as archive_detail_id,ISNULL(f.state, '未召回') state,f.recall_reason,m.inp_no,m.visit_id,m.name,m.dept_name,CONVERT(VARCHAR(20),m.discharge_date_time,120) discharge_date_time,m.ArchiveState,m.sex,m.ID_NO,m.dept_admission_to,CONVERT(VARCHAR(20),m.admission_date_time,120) admission_date_time,m.DISCHARGE_DISPOSITION,
p.id as v_printinfo_id
from archive_master m
left join(select * from emr_fault_detail t where id = (select top 1 id from emr_fault_detail where archive_detail_id = t.archive_detail_id order by create_time desc )
and state in('已召回','未召回')) f
ON f.archive_detail_id=m.id
left join archive_printinfo p ON m.id=p.MasterID
where 1=1 and m.Is_Valid!=1
<if test="archiveDetailId != null">
and f.archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="assortId != null">
and f.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
<if test="parentId != null">
and m.parent_id = #{parentId,jdbcType=INTEGER}
</if>
<if test="content != null">
and f.content = #{content,jdbcType=NVARCHAR}
</if>
<if test="score != null">
and f.score = #{score,jdbcType=DECIMAL}
</if>
<if test="backContent != null">
and f.back_content = #{backContent,jdbcType=NVARCHAR}
</if>
<if test="firstTrial != null">
and f.first_trial = #{firstTrial,jdbcType=NVARCHAR}
</if>
<if test="creater != null">
and f.creater = #{creater,jdbcType=NVARCHAR}
</if>
<if test="createTime != null">
and f.create_time = #{createTime,jdbcType=NCHAR}
</if>
<if test="updater != null">
and f.updater = #{updater,jdbcType=NVARCHAR}
</if>
<if test="updateTime != null">
and f.update_time = #{updateTime,jdbcType=NCHAR}
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no = #{inpNo,jdbcType=NCHAR}
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="archivestate!= null and archivestate!= ''">
and m.ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="state=='已召回'">
and f.state=#{state,jdbcType=NCHAR}
</when>
<when test="state=='未召回'">
AND (f.state='未召回' or f.state is null)
</when>
</choose>
<if test="idNo != null and idNo != ''">
and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo!= null and deptAdmissionTo!= ''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and CONVERT(VARCHAR(100),m.discharge_date_time,23) between CONVERT(VARCHAR(100),#{startDate,jdbcType=NCHAR},23) and
CONVERT(VARCHAR(100),#{endDate,jdbcType=NCHAR},23)
</when>
<when test="startDate != null and startDate != ''">
and CONVERT(VARCHAR(100),m.discharge_date_time,23) >= CONVERT(VARCHAR(100),#{startDate,jdbcType=NCHAR},23)
</when>
<when test="endDate != null and endDate != ''">
and CONVERT(VARCHAR(100),m.discharge_date_time,23) &lt;=CONVERT(VARCHAR(100),#{endDate,jdbcType=NCHAR},23)
</when>
</choose>
</select>
<!-- <select id="selectByCol" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">2023-6-25优化注释-->
<!-- select m.id as archive_detail_id,ISNULL(f.state, '未召回') state,f.recall_reason,m.inp_no,m.visit_id,m.name,m.dept_name,CONVERT(VARCHAR(20),m.discharge_date_time,120) discharge_date_time,m.ArchiveState,m.sex,m.ID_NO,m.dept_admission_to,CONVERT(VARCHAR(20),m.admission_date_time,120) admission_date_time,m.DISCHARGE_DISPOSITION,-->
<!-- p.id as v_printinfo_id-->
<!-- from archive_master m-->
<!-- left join(select t.state,t.recall_reason,t.archive_detail_id from emr_fault_detail t where id = (select top 1 id from emr_fault_detail where archive_detail_id = t.archive_detail_id order by create_time desc )-->
<!-- and state in('已召回','未召回')) f-->
<!-- ON f.archive_detail_id=m.id-->
<!-- left join archive_printinfo p ON m.id=p.MasterID-->
<!-- where 1=1 and m.Is_Valid!=1-->
<!-- <if test="archiveDetailId != null">-->
<!-- and f.archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="assortId != null">-->
<!-- and f.assort_id = #{assortId,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="parentId != null">-->
<!-- and m.parent_id = #{parentId,jdbcType=INTEGER}-->
<!-- </if>-->
<!-- <if test="content != null">-->
<!-- and f.content = #{content,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="score != null">-->
<!-- and f.score = #{score,jdbcType=DECIMAL}-->
<!-- </if>-->
<!-- <if test="backContent != null">-->
<!-- and f.back_content = #{backContent,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="firstTrial != null">-->
<!-- and f.first_trial = #{firstTrial,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="creater != null">-->
<!-- and f.creater = #{creater,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="createTime != null">-->
<!-- and f.create_time = #{createTime,jdbcType=NCHAR}-->
<!-- </if>-->
<!-- <if test="updater != null">-->
<!-- and f.updater = #{updater,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="updateTime != null">-->
<!-- and f.update_time = #{updateTime,jdbcType=NCHAR}-->
<!-- </if>-->
<!-- <if test="inpNo != null and inpNo != ''">-->
<!-- and m.inp_no = #{inpNo,jdbcType=NCHAR}-->
<!-- </if>-->
<!-- <if test="visitId != null and visitId != ''">-->
<!-- and m.visit_id=#{visitId,jdbcType=NCHAR}-->
<!-- </if>-->
<!-- <if test="name != null and name != ''">-->
<!-- and m.name like '%'+#{name,jdbcType=NCHAR}+'%'-->
<!-- </if>-->
<!-- <if test="archivestate!= null and archivestate!= ''">-->
<!-- and m.ArchiveState in-->
<!-- <foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <choose>-->
<!-- <when test="state=='已召回'">-->
<!-- and f.state=#{state,jdbcType=NCHAR}-->
<!-- </when>-->
<!-- <when test="state=='未召回'">-->
<!-- AND (f.state='未召回' or f.state is null)-->
<!-- </when>-->
<!-- </choose>-->
<!-- <if test="idNo != null and idNo != ''">-->
<!-- and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%'-->
<!-- </if>-->
<!-- <if test="deptName!= null and deptName!= ''">-->
<!-- and m.dept_name in-->
<!-- <foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="deptAdmissionTo!= null and deptAdmissionTo!= ''">-->
<!-- and m.dept_admission_to in-->
<!-- <foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <choose>-->
<!-- <when test="startDate != null and startDate != '' and endDate != null and endDate != ''">-->
<!-- and CONVERT(VARCHAR(100),m.discharge_date_time,23) between CONVERT(VARCHAR(100),#{startDate,jdbcType=NCHAR},23) and-->
<!-- CONVERT(VARCHAR(100),#{endDate,jdbcType=NCHAR},23)-->
<!-- </when>-->
<!-- <when test="startDate != null and startDate != ''">-->
<!-- and CONVERT(VARCHAR(100),m.discharge_date_time,23) >= CONVERT(VARCHAR(100),#{startDate,jdbcType=NCHAR},23)-->
<!-- </when>-->
<!-- <when test="endDate != null and endDate != ''">-->
<!-- and CONVERT(VARCHAR(100),m.discharge_date_time,23) &lt;=CONVERT(VARCHAR(100),#{endDate,jdbcType=NCHAR},23)-->
<!-- </when>-->
<!-- </choose>-->
<!-- </select>-->
<select id="selectByCol" parameterType="com.emr.entity.Emr_Fault_Vo" resultMap="BaseResultMap2">
SELECT distinct
m.id AS archive_detail_id,
ISNULL( f.state, '未召回' ) state,
m.inp_no,
m.visit_id,
m.name,
m.dept_name,
CONVERT ( VARCHAR ( 20 ), m.discharge_date_time, 120 ) discharge_date_time,
m.ArchiveState,
m.sex,
m.ID_NO,
m.dept_admission_to,
CONVERT ( VARCHAR ( 20 ), m.admission_date_time, 120 ) admission_date_time,
m.DISCHARGE_DISPOSITION
FROM
archive_master m
LEFT JOIN emr_fault_detail f ON f.archive_detail_id= m.id AND state ='未召回'
WHERE
1 = 1
AND m.Is_Valid!= 1
<if test="archiveDetailId != null">
and f.archive_detail_id = #{archiveDetailId,jdbcType=NVARCHAR}
</if>
<if test="assortId != null">
and f.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
<if test="parentId != null">
and m.parent_id = #{parentId,jdbcType=INTEGER}
</if>
<if test="content != null">
and f.content = #{content,jdbcType=NVARCHAR}
</if>
<if test="score != null">
and f.score = #{score,jdbcType=DECIMAL}
</if>
<if test="backContent != null">
and f.back_content = #{backContent,jdbcType=NVARCHAR}
</if>
<if test="firstTrial != null">
and f.first_trial = #{firstTrial,jdbcType=NVARCHAR}
</if>
<if test="creater != null">
and f.creater = #{creater,jdbcType=NVARCHAR}
</if>
<if test="createTime != null">
and f.create_time = #{createTime,jdbcType=NCHAR}
</if>
<if test="updater != null">
and f.updater = #{updater,jdbcType=NVARCHAR}
</if>
<if test="updateTime != null">
and f.update_time = #{updateTime,jdbcType=NCHAR}
</if>
<if test="inpNo != null and inpNo != ''">
and m.inp_no = #{inpNo,jdbcType=NCHAR}
</if>
<if test="visitId != null and visitId != ''">
and m.visit_id=#{visitId,jdbcType=NCHAR}
</if>
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<if test="archivestate!= null and archivestate!= ''">
and m.ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="state=='已召回'">
and f.state=#{state,jdbcType=NCHAR}
</when>
<when test="state=='未召回'">
AND (f.state='未召回' or f.state is null)
</when>
</choose>
<if test="idNo != null and idNo != ''">
and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%'
</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo!= null and deptAdmissionTo!= ''">
and m.dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and CONVERT(VARCHAR(100),m.discharge_date_time,23) between CONVERT(VARCHAR(100),#{startDate,jdbcType=NCHAR},23) and
CONVERT(VARCHAR(100),#{endDate,jdbcType=NCHAR},23)
</when>
<when test="startDate != null and startDate != ''">
and CONVERT(VARCHAR(100),m.discharge_date_time,23) >= CONVERT(VARCHAR(100),#{startDate,jdbcType=NCHAR},23)
</when>
<when test="endDate != null and endDate != ''">
and CONVERT(VARCHAR(100),m.discharge_date_time,23) &lt;=CONVERT(VARCHAR(100),#{endDate,jdbcType=NCHAR},23)
</when>
</choose>
</select>
<delete id="deleteById" parameterType="java.lang.Integer">
delete from emr_fault_detail

@ -66,71 +66,91 @@
</sql>
<select id="selectSignList" parameterType="Sign_List_Vo" resultMap="BaseResultMapNew">
select DISTINCT s.id,f.name dept_name,s.discharge_date_time, s.pid,s.createdtime, s.otherInfo, s.masterID, s.detailID, s.dTime,s.sysFlag, s.C1, s.C2, s.C3, s.C4, s.C5, s.N1, s.N2, s.N3, s.T1,
s.T2,s.T3,s.IsFullText,s.inp_no,s.visit_id,s.name,s.admissionDateTime,d.name as deptAdmissionTo,s.isscaned,s.num,s.operateName
from (
select
DISTINCT m.id,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time, s.pid,s.createdtime, s.otherInfo, s.masterID, s.detailID, s.dTime,s.sysFlag, s.C1, s.C2, s.C3, s.C4, s.C5, s.N1, s.N2, s.N3, s.T1,
s.T2,s.T3,s.IsFullText,s.operateName,m.inp_no,m.visit_id,m.name,CONVERT(varchar(10),m.admission_date_time, 120) admissionDateTime,m.dept_name, m.isscaned,m.dept_admission_to,(select COUNT(1) from archive_other where archive_other.masterID=s.masterID and archive_other.sysFlag = 1)as num
from archive_other s
left join archive_master m
on s.masterID=m.id
where s.id in(
(select top 1 id from archive_other a where a.pid=s.pid and a.masterID=s.masterID ORDER BY createdtime desc)
)
and m.is_sign =1
<if test="id != null and id != ''"> and s.ID = #{id}</if>
<if test="pid != null and pid != ''"> and s.pid = #{pid}</if>
<choose>
<when test="startSignDate != null and startSignDate != '' and endSignDate != null and endSignDate != ''">
SELECT
m.id,
CONVERT ( VARCHAR ( 10 ), m.discharge_date_time, 120 ) discharge_date_time,
s.pid,
s.createdtime,
s.otherInfo,
s.masterID,
s.detailID,
s.dTime,
s.sysFlag,
s.C1,
s.C2,
s.C3,
s.C4,
s.C5,
s.N1,
s.N2,
s.N3,
s.T1,
s.T2,
s.T3,
s.IsFullText,
s.operateName,
m.inp_no,
m.visit_id,
m.name,
CONVERT ( VARCHAR ( 10 ), m.admission_date_time, 120 ) admissionDateTime,
m.dept_name,
m.isscaned,
m.dept_admission_to,
( SELECT COUNT ( 1 ) FROM archive_other WHERE archive_other.masterID= s.masterID AND archive_other.sysFlag = 1 ) AS num
FROM
archive_other s
INNER JOIN archive_master m ON s.masterID= m.id
WHERE
s.id IN (
( SELECT TOP 1 id FROM archive_other a WHERE a.pid= s.pid AND a.masterID= s.masterID ORDER BY createdtime DESC )
)
AND m.is_sign = 1
AND s.sysFlag = 1
<if test="id != null and id != ''"> and m.ID = #{id}</if>
<if test="pid != null and pid != ''"> and s.pid = #{pid}</if>
<choose>
<when test="startSignDate != null and startSignDate != '' and endSignDate != null and endSignDate != ''">
and s.createdtime between CONVERT(VARCHAR(10),#{startSignDate,jdbcType=NCHAR},120) and
#{endSignDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
<when test="startSignDate != null and startSignDate != ''">
</when>
<when test="startSignDate != null and startSignDate != ''">
and s.createdtime >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</when>
<when test="endSignDate != null and endSignDate != ''">
</when>
<when test="endSignDate != null and endSignDate != ''">
and s.createdtime &lt;= #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
<if test="otherInfo != null and otherInfo != ''"> and s.otherInfo = #{otherInfo}</if>
<if test="masterID != null and masterID != ''"> and s.masterID = #{masterID}</if>
<if test="detailID != null and detailID != ''"> and s.detailID = #{detailID}</if>
<if test="dTime != null and dTime != ''"> and s.dTime = #{dTime}</if>
<if test="c1 != null and c1 != ''">
and s.C1 in
<foreach item="item" collection="c1.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="c2 != null and c2 != ''"> and s.C2 = #{c2}</if>
<if test="deptName!= null and deptName!= ''">
</when>
</choose>
<if test="otherInfo != null and otherInfo != ''"> and s.otherInfo = #{otherInfo}</if>
<if test="masterID != null and masterID != ''"> and s.masterID = #{masterID}</if>
<if test="detailID != null and detailID != ''"> and s.detailID = #{detailID}</if>
<if test="dTime != null and dTime != ''"> and s.dTime = #{dTime}</if>
<if test="c1 != null and c1 != ''">
and s.C1 in
<foreach item="item" collection="c1.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="c2 != null and c2 != ''"> and s.C2 = #{c2}</if>
<if test="deptName!= null and deptName!= ''">
and m.dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="c3 != null and c3 != ''"> and s.C3 = #{c3}</if>
<if test="c4 != null and c4 != ''"> and s.C4 = #{c4}</if>
<if test="c5 != null and c5 != ''"> and s.C5 = #{c5}</if>
<if test="n1 != null and n1 != '' "> and s.N1 = #{n1}</if>
<if test="operateName1 != null and operateName1 != '' "> and s.operateName = #{operateName1}</if>
<if test="n2 != null and n2 != ''"> and s.N2 = #{n2}</if>
<if test="n3 != null and n3 != ''"> and s.N3 = #{n3} </if>
<if test="t1 != null and t1 != ''"> and s.T1 = #{t1}</if>
<if test="t2 != null and t2 != ''"> and s.T2 = #{t2}</if>
<if test="t3 != null and t3 != ''"> and s.T3 = #{t3}</if>
<if test="isFullText != null and isFullText != ''"> and s.IsFullText = #{isFullText}</if>
<if test="inpNo != null and inpNo != ''"> and m.inp_no = #{inpNo}</if>
<if test="visitId != null and visitId != ''"> and m.visit_id = #{visitId}</if>
<if test="name != null and name != ''"> and m.name like '%'+#{name}+'%'</if>
and s.sysFlag =1
)s
LEFT JOIN emr_dictionary d
on s.dept_admission_to=d.code
LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where
typeCode='dept_code' )) f
on s.dept_name=f.code
#{item}
</foreach>
</if>
<if test="c3 != null and c3 != ''"> and s.C3 = #{c3}</if>
<if test="c4 != null and c4 != ''"> and s.C4 = #{c4}</if>
<if test="c5 != null and c5 != ''"> and s.C5 = #{c5}</if>
<if test="n1 != null and n1 != '' "> and s.N1 = #{n1}</if>
<if test="operateName1 != null and operateName1 != '' "> and s.operateName = #{operateName1}</if>
<if test="n2 != null and n2 != ''"> and s.N2 = #{n2}</if>
<if test="n3 != null and n3 != ''"> and s.N3 = #{n3} </if>
<if test="t1 != null and t1 != ''"> and s.T1 = #{t1}</if>
<if test="t2 != null and t2 != ''"> and s.T2 = #{t2}</if>
<if test="t3 != null and t3 != ''"> and s.T3 = #{t3}</if>
<if test="isFullText != null and isFullText != ''"> and s.IsFullText = #{isFullText}</if>
<if test="inpNo != null and inpNo != ''"> and m.inp_no = #{inpNo}</if>
<if test="visitId != null and visitId != ''"> and m.visit_id = #{visitId}</if>
<if test="name != null and name != ''"> and m.name like '%'+#{name}+'%'</if>
ORDER BY s.dTime desc
</select>

@ -2727,7 +2727,6 @@
});
}
initTable2();
//点击扫描全选分段列表,查询来源为嘉时扫描系统
/*$("#pdfBtn3").click(function () {

@ -559,13 +559,13 @@
align: 'left',
valign: 'middle'
},
{
title: '打印ID',
field: 'vprintinfoId',
align: 'left',
valign: 'middle',
visible: false
},
// {
// title: '打印ID',
// field: 'vprintinfoId',
// align: 'left',
// valign: 'middle',
// visible: false
// },
{
title: '入院日期',
field: 'admissionDateTime',

Loading…
Cancel
Save