纸质病历签收和病案室终审优化

master
linjj 2 years ago
parent 17508414e7
commit 49dcd2bdd1

@ -521,23 +521,7 @@ public class faultController {
return result;
}
/*@ResponseBody
@RequestMapping(value = "/exportExcel2")
public void exportExcel2(HttpServletResponse response, Emr_Fault_Vo emrFaultVo) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String[] header = {"病历清单id","住院号","住院次数","姓名","出院科室","出院日期","归档状态","评分","退回次数","退回时间","退回人"};
String[] fileNames = {"archiveDetailId","inpNo","visitId","name","deptName","dischargeDateTime","archivestate","score","backNum","createTime","creater"};
//文件名
String fileName = "病案退回次数及评分信息" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//构造excel的数据
List<Emr_Fault_Vo> list = emrFaultDetailService.faultBackScoreList(emrFaultVo);
ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames);
*//* System.out.println("开始执行导出.......");
long start = System.currentTimeMillis();*//*
String result=utils.exportExcelToFilePath(response,utils.listConvert(list));
*//* long end = System.currentTimeMillis();
System.out.println("耗时:" + (end - start) / 1000 + "秒");*//*
}*/
@ResponseBody
@RequestMapping(value = "/faultListByTj")

@ -87,13 +87,7 @@ public class signListController {
@Autowired(required = false)
private Archive_Master_FollowingService archive_master_followingService;
@Autowired
private ArchiveOtherExtService archiveOtherExtService;
@Autowired
private FinishedDateTimeService finishedDateTimeService;
@Autowired
private AfCollectTaskService afCollectTaskService;
@RequestMapping(value = "/signLists")
public String faults(Model model) {

@ -12,6 +12,8 @@ public interface Sign_ListMapper {
*/
List<Sign_List_Vo> selectSignList(Sign_List_Vo signListVo);
//签收次数
List<Sign_List_Vo> getSignNum(@Param(value = "ids")String ids);
/**
*
* @return

@ -180,8 +180,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
@Override
public List<Archive_Master_Vo> selectByLastByColumn(Archive_Master_Vo archiveMasterVo,Integer offset, Integer limit) {
// //判断并设置查询是否打印权限
// setIdByPrintNum(archiveMasterVo);
//根据条件查询记录
if(null != offset && null != limit) {
PageHelper.offsetPage(offset, limit);

@ -15,6 +15,8 @@ import com.emr.service.Archive_MasterService;
import com.emr.service.Emr_DictionaryService;
import com.emr.service.PowerUserService;
import com.emr.service.Sign_ListService;
import com.emr.util.ListUtils;
import com.emr.util.Setters;
import com.emr.vo.Power_User_Dto;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -45,15 +47,25 @@ public class Sign_ListServiceImpl implements Sign_ListService {
PageHelper.offsetPage(offset, limit);
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);
//转换科室
Map<String, Emr_Dictionary> codeMap = ListUtils.toMap(dicList, Emr_Dictionary::getCode);
Setters.<Sign_List_Vo>instance().list(list).cycleSetProperties(p -> {
String deptCode = p.getDeptName();
String deptAdmissionCode = p.getDeptAdmissionTo();
if(StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)){
String deptName = codeMap.get(deptCode).getName();
p.setDeptName(deptName);
}
if(StringUtils.isNotBlank(deptAdmissionCode) && codeMap.containsKey(deptAdmissionCode)){
String deptAdmissionTo = codeMap.get(deptAdmissionCode).getName();
p.setDeptAdmissionTo(deptAdmissionTo);
}
});
//查询用户集合
JSONArray powerUsers = powerUserService.getPowerUserList("1");
List<Power_User_Dto> powerUserList = null;
@ -75,21 +87,23 @@ public class Sign_ListServiceImpl implements Sign_ListService {
}
}
}
//转换科室
for (int k = 0; k < dicList.size(); k++) {
if (StringUtils.isNotBlank(sign_list_vo.getDeptName())){
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;
}
}
}
}
//查询签收次数
//masterIds集合
List<String> masterIds = ListUtils.distinctSelect(list, Sign_List_Vo::getMasterID);
//转成逗号拼接
String ids = String.join(",", masterIds);
List<Sign_List_Vo> signNum = signListMapper.getSignNum(ids);
//遍历签收次数
Map<String, Sign_List_Vo> signNumMap = ListUtils.toMap(signNum, Sign_List_Vo::getMasterID);
Setters.<Sign_List_Vo>instance().list(list).cycleSetProperties(p -> {
String masterID = p.getMasterID();
if (signNumMap.containsKey(masterID)){
String num = signNumMap.get(masterID).getNum();
p.setNum(num);
}
});
}
return new OffsetLimitPage((Page) list);
}

@ -381,158 +381,6 @@
ORDER BY discharge_date_time desc
</select>
<!-- <select id="selectByLast" 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,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.first_instance,-->
<!-- m.is_scanning,m.bed_number,ISNULL(s.numb, 0) numb,ao.C5 is_sign,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(sDoctor.numb, 0) faultDoctorNum-->
<!-- ,case when emr_fault_detail.archive_detail_id is not null then '是' else '否' end isFault,ISNULL(printTable.num, 0) printNum-->
<!-- from archive_master m-->
<!-- left join (select distinct archive_detail_id from emr_fault_detail where back_flag in ('6','5')) emr_fault_detail-->
<!-- on emr_fault_detail.archive_detail_id = m.ID-->
<!-- 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 distinct masterID,C5 FROM archive_other where sysFlag = '1') ao-->
<!-- on m.id=ao.masterID-->
<!-- 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 archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('1','5') GROUP BY archive_detail_id) sDoctor-->
<!-- on m.id=sDoctor.archive_detail_id-->
<!-- LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable-->
<!-- on m.id=printTable.MasterID-->
<!-- where 1=1 and ArchiveState in('初审') and m.Is_Valid!=1-->
<!-- and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%'-->
<!-- <if test="isFault != null and isFault != ''">-->
<!-- <if test="isFault == 1">-->
<!-- AND emr_fault_detail.archive_detail_id is not null-->
<!-- </if>-->
<!-- <if test="isFault == 0">-->
<!-- AND emr_fault_detail.archive_detail_id is null-->
<!-- </if>-->
<!-- </if>-->
<!-- <if test="printNum != null and printNum != ''">-->
<!-- <choose>-->
<!-- <when test="printNum == 1">-->
<!-- and printTable.MasterID is not null-->
<!-- </when>-->
<!-- <otherwise>and printTable.MasterID is null</otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- <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>-->
<!-- <if test="name != null and name != ''">-->
<!-- and m.name like '%'+#{name,jdbcType=NCHAR}+'%'-->
<!-- </if>-->
<!-- <if test="archivestate != null and archivestate != ''">-->
<!-- and m.ArchiveState in(#{archivestate,jdbcType=NVARCHAR})-->
<!-- </if>-->
<!-- <if test="idNo != null and idNo != ''">-->
<!-- and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%'-->
<!-- </if>-->
<!-- <if test="sex != null">-->
<!-- and m.sex = #{sex,jdbcType=NVARCHAR}-->
<!-- </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 = #{deptAdmissionTo,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="dischargeDateTime != null">-->
<!-- and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <choose>-->
<!-- <when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">-->
<!-- and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and-->
<!-- #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- <when test="startDateTo != null and startDateTo != ''">-->
<!-- and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)-->
<!-- </when>-->
<!-- <when test="endDateTo != null and endDateTo != ''">-->
<!-- and m.discharge_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- </choose>-->
<!-- <choose>-->
<!-- <when test="startDate != null and startDate != '' and endDate != null and endDate != ''">-->
<!-- and m.admission_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and-->
<!-- #{endDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- <when test="startDate != null and startDate != ''">-->
<!-- and m.admission_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)-->
<!-- </when>-->
<!-- <when test="endDate != null and endDate != ''">-->
<!-- and m.admission_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- </choose>-->
<!-- <if test="checkDoctor != null">-->
<!-- and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="checkDatetime != null">-->
<!-- and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="checkedDoctor != null">-->
<!-- and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="checkedDatetime != null">-->
<!-- and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="lockinfo != null">-->
<!-- and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="doctorInCharge != null">-->
<!-- and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="dischargeDisposition != null">-->
<!-- and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="deptCodeLend != null">-->
<!-- and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="isscaned != null and isscaned != ''">-->
<!-- and m.isscaned = #{isscaned,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="deathFlag != null and deathFlag != ''">-->
<!-- and m.death_flag = #{deathFlag,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="isScanning != null and isScanning != ''">-->
<!-- and m.is_scanning = #{isScanning,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="isSign != null ">-->
<!-- and ao.C5 = #{isSign,jdbcType=NVARCHAR}-->
<!-- </if>-->
<!-- <if test="signer != null and signer != ''">-->
<!-- and ao.C1 like '%'+#{signer,jdbcType=NCHAR}+'%'-->
<!-- </if>-->
<!-- <choose>-->
<!-- <when test="startSignDate != null and startSignDate != '' and endSignDate != null and endSignDate != ''">-->
<!-- and m.sign_time between CONVERT(VARCHAR(10),#{startSignDate,jdbcType=NCHAR},120) and-->
<!-- #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- <when test="startSignDate != null and startSignDate != ''">-->
<!-- and m.sign_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)-->
<!-- </when>-->
<!-- <when test="endSignDate != null and endSignDate != ''">-->
<!-- and m.sign_time &lt;= #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!-- </when>-->
<!-- </choose>-->
<!-- ORDER BY discharge_date_time desc-->
<!-- </select>-->
<select id="selectByLast" 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,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,

@ -1188,9 +1188,6 @@
<if test="name != null and name != ''">
and m.name like '%'+#{name,jdbcType=NCHAR}+'%'
</if>
<!--<if test="archivestate != null and archivestate != ''">-->
<!--and m.ArchiveState=#{archivestate,jdbcType=NCHAR}-->
<!--</if>-->
<if test="archivestate!= null and archivestate!= ''">
and m.ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">

@ -68,7 +68,7 @@
<select id="selectSignList" parameterType="Sign_List_Vo" resultMap="BaseResultMapNew">
SELECT
m.id,
CONVERT ( VARCHAR ( 10 ), m.discharge_date_time, 120 ) discharge_date_time,
m.discharge_date_time,
s.pid,
s.createdtime,
s.otherInfo,
@ -92,11 +92,10 @@
m.inp_no,
m.visit_id,
m.name,
CONVERT ( VARCHAR ( 10 ), m.admission_date_time, 120 ) admissionDateTime,
m.admission_date_time,
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
m.dept_admission_to
FROM
archive_other s
INNER JOIN archive_master m ON s.masterID= m.id
@ -222,6 +221,19 @@
order by createdtime desc
</where>
</select>
<select id="getSignNum" resultType="com.emr.entity.Sign_List_Vo">
SELECT COUNT( ID ) AS num,masterID
FROM
archive_other
WHERE
masterID IN
<foreach item="item" collection="ids.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND sysFlag = 1
GROUP BY
masterID
</select>
<insert id="insertSignList" parameterType="Sign_List" useGeneratedKeys="true" keyProperty="id">
insert into archive_other

Loading…
Cancel
Save