死亡病历页面

master
linjj 6 months ago
parent a8beac35a3
commit 203a5a3560

@ -0,0 +1,50 @@
package com.emr.controller;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.Archive_MasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @ClassName DeathRecords
* @Description
* @Author linjj
* @Date 2025/1/8 15:32
* @Version 1.0
*/
@Controller
@RequestMapping("/death")
public class DeathRecordsController {
@Autowired
private Archive_MasterService archiveMasterService;
/**
* @description:
* @author linjj
* @date: 2025/1/8 15:33
*/
@RequestMapping(value = "/deathRecords")
public String faults(Model model) {
return "deathRecordsDir/deathRecords";
}
/**
* @description:
* @params:
* @return:
* @author linjj
* @date: 2025/1/8 15:38
*/
@ResponseBody
@RequestMapping(value = "/deathRecordList")
public OffsetLimitPage deathRecordList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) {
OffsetLimitPage result = archiveMasterService.deathRecordList(archiveMasterVo, offset, limit);
return result;
}
}

@ -11,13 +11,11 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.emr.entity.*;
import com.emr.service.*;
import com.emr.util.HttpClientTool;
import com.emr.util.IDHelper;
import com.emr.util.ThreadExcelUtils;
import com.emr.util.XMLUtil;
import com.emr.util.*;
import com.emr.vo.CollectionVo;
import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_CALLBACK_RECORD;
import com.emr.webservice.MedicalRecordShowBackContent.MR_FILE_INDEX_CALLBACK;
import lombok.extern.slf4j.Slf4j;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
@ -44,9 +42,10 @@ import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;
import java.io.*;
import java.math.BigDecimal;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -60,7 +59,7 @@ public class signListController {
private String EMRQualityControl;
@Value("${EMRQualityControlParamName}")
private String EMRQualityControlParamName;
private static Logger logger = new Logger();
@Autowired
private Sign_ListService signListService;
@ -875,20 +874,55 @@ public class signListController {
@ResponseBody
@RequestMapping(value = "/collection")
public JSONObject collection(HttpServletRequest request, HttpServletResponse response, String flagNum, String id) throws Exception {
// String taskId = afCollectTaskService.getTaskId(flagNum, id);
// String url="http://127.0.0.1:9296/api/noviewtask/UrgentMakeUp";
// String s = sendGet(url, taskId);
// 从session获取用户名
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String username = user.getUserName();//获取前面登录的用户名
//获取ip来源
String ipAddress = getAddressIp(request);
logger.log("按需采集用户名:"+username+"接口来源ip"+ipAddress);
CollectionVo collectionVo = new CollectionVo();
List<String> patientIds=new ArrayList<>();
patientIds.add(id);
collectionVo.setPatientIds(patientIds);
collectionVo.setSysCodes(flagNum);
collectionVo.setCaller("guidang");
logger.log("本次参数为:"+collectionVo.toString());
String url="http://10.6.1.127:9295/api/NoViewCollect/generateTaskByPatientIdAndSysCodes";
JSONObject jsonParam= (JSONObject) JSONObject.toJSON(collectionVo);
JSONObject jsonObject = httpPost(url, jsonParam);
//查询新任务表id
return jsonObject;
}
private String getAddressIp( HttpServletRequest request){
// 获取访问真实IP
String ipAddress = request.getHeader("x-forwarded-for");
if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if(ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")){
//根据网卡取本机配置的IP
InetAddress inet=null;
try {
inet = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
ipAddress= inet.getHostAddress();
}
}
//对于通过多个代理的情况第一个IP为客户端真实IP,多个IP按照','分割
if(ipAddress!=null && ipAddress.length()>15){ //"***.***.***.***".length() = 15
if(ipAddress.indexOf(",")>0){
ipAddress = ipAddress.substring(0,ipAddress.indexOf(","));
}
}
return ipAddress;
}
public static JSONObject httpPost(String url, JSONObject jsonParam) {
// post请求返回结果

@ -277,4 +277,12 @@ public interface Archive_MasterMapper {
* @date: 2023/6/29 17:17
*/
List<Archive_Master_Vo> getNurseDefectNum(@Param(value = "ids")String ids);
/**
* @description:
* @params: archiveMasterVo
* @return: Archive_Master_Vo
* @author linjj
* @date: 2025/1/8 15:41
*/
List<Archive_Master> getDeathRecordList(Archive_Master_Vo archiveMasterVo);
}

@ -386,6 +386,17 @@ public interface Archive_MasterService {
* @return
*/
Integer selectCountNum(Archive_Master_Vo archiveMasterVo);
/**
* @description:
* @params: record
* @params: offset
* @params: limit
* @author linjj
* @date: 2025/1/8 15:40
*/
OffsetLimitPage deathRecordList(Archive_Master_Vo record, Integer offset, Integer limit);
}

@ -1836,6 +1836,34 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
public Integer selectCountNum(Archive_Master_Vo archiveMasterVo) {
return archiveMasterMapper.selectCountNum(archiveMasterVo);
}
@Override
public OffsetLimitPage deathRecordList(Archive_Master_Vo record, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Master> list = archiveMasterMapper.getDeathRecordList(record);
if(list!=null && list.size()>0) {
//获取科室列表
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 = ListUtil.toMap(dicList, Emr_Dictionary::getCode);
Setters.<Archive_Master>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);
}
});
}
return new OffsetLimitPage((Page) list);
}
}

@ -10,6 +10,7 @@ import java.util.Date;
public class Logger {
public void log(String info) {
SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
SimpleDateFormat dateFormat1 = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
String format = dateFormat.format (new Date());
File file = new File ("D:\\emr_medical_record\\logs\\"+format);
if(!file.isDirectory ()){
@ -18,6 +19,8 @@ public class Logger {
OutputStream out = null;
try {
out = getOutputStream(file.getAbsolutePath ()+"\\log.log");
// 写入日期和日志信息
out.write(dateFormat1.format(new Date()).getBytes("utf-8")); // 添加
out.write(info.getBytes("utf-8"));
out.write("\r\n".getBytes());
out.close();

@ -17,4 +17,14 @@ public class CollectionVo {
private List<String> patientIds;
private String sysCodes;
private String caller;
@Override
public String toString() {
return "CollectionVo{" +
"patientIds=" + patientIds +
", sysCodes='" + sysCodes + '\'' +
", caller='" + caller + '\'' +
'}';
}
}

@ -2514,4 +2514,52 @@
</foreach>
AND RowNum = 1
</select>
<select id="getDeathRecordList" resultType="com.emr.entity.Archive_Master" resultMap="BaseResultMap">
select * from Archive_Master
<where>
inp_no like 'SW%'
<if test="inpNo != null and inpNo != ''">
AND inp_no LIKE '%' + #{inpNo} + '%'
</if>
<if test="name != null and name != ''">
AND name LIKE '%' + #{name} + '%'
</if>
<if test="visitId != null and visitId != ''">
AND visit_id LIKE '%' + #{visitId} + '%'
</if>
<if test="dischargeDateTime != null">
and discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}
</if>
<if test="deptName!= null and deptName!= ''">
and dept_name in
<foreach item="item" collection="deptName.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="deptAdmissionTo != null and deptAdmissionTo!=''">
and dept_admission_to in
<foreach item="item" collection="deptAdmissionTo.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="archivestate != null and archivestate!=''">
and ArchiveState in
<foreach item="item" collection="archivestate.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<choose>
<when test="startDateTo != null and startDateTo != '' and endDateTo != null and endDateTo != ''">
and 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 discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120)
</when>
<when test="endDateTo != null and endDateTo != ''">
and discharge_date_time &lt;= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59'
</when>
</choose>
</where>
</select>
</mapper>

@ -3983,7 +3983,6 @@
$("#isScaned2").val(row.isscaned);
$("#isSign2").val(row.isSign);
$("#verifyText").val("");
} else {
toastr.warning("病案室已经审核!");
//刷新

Loading…
Cancel
Save