1、新增Message_Log表master_id、webservice_info字段;

2、死亡字段新增默认值为0;
3、新增长期、医嘱
master
leijx 5 years ago
parent 15c028f30e
commit ca9b5ed6ee

@ -1,17 +1,15 @@
package com.ann.demo.controller;
import com.ann.demo.entity.constant.InterfaceName;
import com.ann.demo.service.AnalysisService;
import com.ann.demo.service.impl.AnalysisService;
import com.ann.demo.service.UserService;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
/**
* @Author: LeiJiaXin

@ -86,6 +86,13 @@ public class AliasName {
// 20191021 申请单变更状态
public static final String EXAM_APPLY_STATE_CHANGE = "31";
// 20200701 长期医嘱
public static final String PRN = "122";
// 20200701 临时医嘱
public static final String SOS = "123";
static {
DOCTOR_MAP = new HashMap<String, String>();
DOCTOR_MAP.put("入院记录", "9");

@ -0,0 +1,121 @@
package com.ann.demo.entity.constant;
import lombok.Data;
@Data
public class WebserviceId {
/**
* V3
*/
public static final String HIP_MESSAGE_SERVER = "HIPMessageServer";
/**
*
*/
public static final String PARAMETER_REPORT = "1";
/**
*
*/
public static final String PARAMETER_EXAMAPPLY = "2";
/**
* 2019-10-21
*
*/
public static final String PARAMETER_EXAMAPPLYSTATECHANGE = "3";
/**
* 2020-3-3
*
*/
public static final String PARAMETER_VERIFICATIONEXAMAPPLY = "4";
/**
*
*/
public static final String PARAMETER_ADMISSION = "5";
/**
*
*/
public static final String PARAMETER_DISCHARGE = "6";
/**
*
*/
public static final String PARAMETER_TRANSFER = "7";
/**
*
*/
public static final String PARAMETER_CANCELLATION_DISCHARGE = "8";
/**
*
*/
public static final String PARAMETER_PATIENT_UPDATE = "9";
/**
* lis
*/
public static final String INSPECTION_REPORT_NAME = "10";
/**
* 2019-12-23
*
*/
public static final String PARAMETER_INSPECTIONAPPLY = "11";
/**
* 2020-2-28
*
*/
public static final String PARAMETER_VERIFICATIONINSPECTIONAPPLY = "12";
/**
*
*/
public static final String DOCTOR_DATA = "13";
/**
* 2
*/
public static final String NURSE_DATA = "14";
/**
*
*/
public static final String INP_SUMMARY = "15";
/**
*
*/
public static final String HANDNUMBNESS_REPORT = "16";
/**
* ICU
*/
public static final String ICU_REPORT = "17";
/**
*
*/
public static final String BLOODAPPLY_REPORT = "18";
/**
* ReceiveDict
*/
public static final String RECEIVE_DICT = "19";
/**
* 20200609
*/
public static final String BED_MANAGER = "20";
/**
* 20200609
*/
public static final String DIE_MEDICAL_ADVICE = "21";
}

@ -135,5 +135,5 @@ public class ArchiveMaster {
private String transferDept;
// 死亡字段
private String deathFlag;
private String deathFlag = "0";
}

@ -84,24 +84,30 @@ public class MessageLog {
* xml
*/
private Long xmlExecutionTime;
//
// /*
// * 2020-3-20 新增masterId
// * */
// private String masterId;
/*
* id
* */
private String masterId;
/*
* 2020-3-20 webserviceInfo
* */
private String webserviceInfo;
// ---------------------------时间怎么变成了毫秒数
public MessageLog(String inputContent, String interfaceName, Date createTime) {
public MessageLog(String inputContent, String interfaceName, Date createTime,String webserviceInfo) {
this.inputContent = inputContent;
this.interfaceName = interfaceName;
this.createTime = createTime;
this.webserviceInfo = webserviceInfo;
}
public MessageLog() {
}
public void setValue(String outContent, Integer result, String outJson, Date xmlCreateTime, Long executionTime, Date endTime, String type, String remark) {
public void setValue(String masterId,String outContent, Integer result, String outJson, Date xmlCreateTime, Long executionTime, Date endTime, String type, String remark) {
this.masterId = masterId;
this.outContent = outContent;
this.result = result;
this.outJson = outJson;
@ -112,20 +118,4 @@ public class MessageLog {
this.remark = remark;
}
public void setValue(String outContent, Integer result, String outJson, Date xmlCreateTime, Long executionTime, Date endTime, String type) {
this.outContent = outContent;
this.result = result;
this.outJson = outJson;
this.xmlCreateTime = xmlCreateTime;
this.executionTime = executionTime;
this.endTime = endTime;
this.type = type;
}
public void setValue1(String outContent, Integer result, Long executionTime, Date endTime) {
this.outContent = outContent;
this.result = result;
this.executionTime = executionTime;
this.endTime = endTime;
}
}

@ -1,24 +1,16 @@
package com.ann.demo.interfaces.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.ann.demo.entity.constant.AliasName;
import com.ann.demo.entity.constant.InterfaceName;
import com.ann.demo.entity.filing.MessageSubordinate;
import com.ann.demo.entity.filing.dto.MessageDto;
import com.ann.demo.entity.filing.dto.PatientMainDto;
import com.ann.demo.entity.constant.WebserviceId;
import com.ann.demo.entity.interfaceEntity.*;
import com.ann.demo.entity.normalEntity.*;
import com.ann.demo.interfaces.HomepageDictionary;
import com.ann.demo.service.*;
import com.ann.demo.utils.XMLUtils;
import com.ann.demo.service.impl.AnalysisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.jws.WebService;
import java.util.Date;
import java.util.Objects;
/**
* @Author: LeiJiaXin
@ -33,21 +25,9 @@ public class HomepageDictionaryImpl implements HomepageDictionary {
private static final Logger logger = LoggerFactory.getLogger(HomepageDictionaryImpl.class);
@Autowired
private MessageService messageService;
@Autowired
private MedicalRecordHomepageCacheService medicalRecordHomepageCacheService;
@Autowired
private MessageSubordinateService messageSubordinateService;
@Autowired
private AnalysisService analysisService;
@Autowired
private ArchiveDetailService archiveDetailService;
@Autowired
ExamApplyService examApplyService;
@ -59,35 +39,36 @@ public class HomepageDictionaryImpl implements HomepageDictionary {
switch (action) {
case InterfaceName.PARAMETER_ADMISSION:
// 入院
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_ADMISSION);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_ADMISSION, WebserviceId.PARAMETER_ADMISSION);
break;
case InterfaceName.PARAMETER_DISCHARGE:
// 出院
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_DISCHARGE);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_DISCHARGE, WebserviceId.PARAMETER_DISCHARGE);
break;
case InterfaceName.PARAMETER_TRANSFER:
// 转科
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_TRANSFER);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_TRANSFER, WebserviceId.PARAMETER_TRANSFER);
break;
case InterfaceName.PARAMETER_CANCELLATION_DISCHARGE:
// 取消入院
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_CANCELLATION_DISCHARGE);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_CANCELLATION_DISCHARGE, WebserviceId.PARAMETER_CANCELLATION_DISCHARGE);
break;
case InterfaceName.PARAMETER_PATIENT_UPDATE:
// 患者信息更新
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_PATIENT_UPDATE);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.PARAMETER_PATIENT_UPDATE, WebserviceId.PARAMETER_PATIENT_UPDATE);
break;
case InterfaceName.BED_MANAGER:
// 同步主管医生
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.BED_MANAGER);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.BED_MANAGER, WebserviceId.BED_MANAGER);
break;
case InterfaceName.DIE_MEDICAL_ADVICE:
// 同步死亡医嘱
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.DIE_MEDICAL_ADVICE);
result = analysisService.getHIPMessageServerResult(message, ArchiveMaster.class, InterfaceName.DIE_MEDICAL_ADVICE, WebserviceId.DIE_MEDICAL_ADVICE);
break;
}
}
}catch (Exception e){
logger.error("当前参数:{},报错信息:{}",action,e.getMessage());
return "";
}
// ---------------------------------------这里捕捉 参数为空

@ -1,265 +0,0 @@
package com.ann.demo.service;
import com.alibaba.fastjson.JSON;
import com.ann.demo.entity.constant.AliasName;
import com.ann.demo.entity.constant.InterfaceName;
import com.ann.demo.entity.filing.dto.MessageDto;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.entity.interfaceEntity.ExamApply;
import com.ann.demo.entity.interfaceEntity.MessageLog;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepage;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepageCache;
import com.ann.demo.entity.normalEntity.OutPara;
import com.ann.demo.utils.XMLUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
*
*
* @Author: LeiJiaXin
* @Date: 2019/8/20 16:29
*/
@Component
public class AnalysisService {
static final Logger logger = LoggerFactory.getLogger(AnalysisService.class);
@Autowired
MessageService messageService;
@Autowired
MessageSubordinateService messageSubordinateService;
@Autowired
ArchiveMasterService archiveMasterService;
@Autowired
ExamApplyService examApplyService;
@Autowired
MedicalRecordHomepageCacheService medicalRecordHomepageCacheService;
/**
* 2019-7-8
*
* @Param xmlStr
* @Param tClass
* @Param parameter
* xml
*/
public String getHIPMessageServerResult(String message, Class tClass, String parameter) throws Exception{
long startTime = System.currentTimeMillis();
String textContent = "成功啦~", type = "", typeCodeValue = "AE", outContent = "", patientMainStr = "";
Date xmlCreateTime = null;
Integer result = 0;
long endTime = 0;
MessageLog messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date());
// 只要没有传过 才会插入新的
messageService.save(messageLog);
MessageDto messageDto = XMLUtils.xpathToBean(message, tClass, parameter);
if (messageDto != null) {
String textContentTemp = null;
if (Objects.equals(messageDto.getEntity(), ArchiveMaster.class.getName())) { // 患者信息
ArchiveMaster archiveMaster = JSON.parseObject(messageDto.getObject().toString(), ArchiveMaster.class);
textContentTemp = changeArchiveMaster(archiveMaster, messageDto.getAddFlag(), messageDto.getType());
}
if (textContentTemp != null) {
textContent = textContentTemp;
} else {
xmlCreateTime = messageDto.getXmlCreateTime();
type = messageDto.getType();
typeCodeValue = "AA";
result = 1;
}
} else {
textContent = "传过来的消息无法解析。。";
}
outContent = XMLUtils.generateV3XmlStr(typeCodeValue, textContent);
endTime = System.currentTimeMillis();
messageLog.setValue(outContent, result, messageDto == null ? "" : JSON.toJSONString(messageDto), xmlCreateTime, (endTime - startTime), new Date(), type, textContent);
messageService.save(messageLog);
logger.info("-----------------------" + type + ":" + (endTime - startTime) + "-------------------------");
return outContent;
}
private String changeArchiveMaster(ArchiveMaster archiveMaster, String changeStatus, String aliasName) {
String textContent = null;
if (changeStatus != null || aliasName != null) {
String archiveMasterId = archiveMasterService.findArchiveMasterId(archiveMaster.getPatientId(), archiveMaster.getVisitId(), archiveMaster.getInpNo());
if (archiveMasterId != null) {
// 如果不是新增 都会查询id
archiveMaster.setId(archiveMasterId);
if (aliasName.equals(AliasName.ADMISSION_RECORD) && Objects.equals(changeStatus, "update") ) { //入院消息 更新患者住院信息
archiveMasterService.save(archiveMaster); //
}else if (aliasName.equals(AliasName.CANCELLATION_DISCHARGE) && Objects.equals(changeStatus, "delete")) { // 取消入院
archiveMasterService.updateArchiveMasterValid(archiveMasterId);
}else if (aliasName.equals(AliasName.TRANSFER_RECORD)) { // 转科
archiveMasterService.transferDepartment(archiveMaster);
} else if (aliasName.equals(AliasName.DISCHARGE_RECORD)) { // 出院
archiveMasterService.discharge(archiveMaster);
}else if(aliasName.equals(AliasName.PATIENT_UPDATE)){ //患者信息修改
if(!archiveMasterService.updateArchiveMaster(archiveMaster)){
textContent = "患者更新失败";
}
}else if(aliasName.equals(AliasName.DIE_MEDICAL_ADVICE)){ //死亡信息同步
String deathFlag = "0";
if(Objects.equals(changeStatus,"new")){
deathFlag = "1";
}
archiveMaster.setDeathFlag(deathFlag);
if(!archiveMasterService.updateArchiveMasterByDeathFlag(archiveMaster)){
textContent = "死亡信息同步失败";
}
}else if(aliasName.equals(AliasName.BED_MANAGER)){ //管床医师同步
if(!archiveMasterService.updateArchiveMasterBydoctorInCharge(archiveMaster)){
textContent = "管床医师同步失败";
}
} else {
textContent = "信息有错";
}
}else {
if (Objects.equals(changeStatus, "new")) { //入院消息 新增患者住院信息
archiveMasterService.save(archiveMaster);
}else{
textContent = "没有入院信息";
}
}
} else {
textContent = "信息解析错误";
}
return textContent;
}
private String changeExamApply(ExamApply examApply) {
String textContent = null;
Integer count = examApplyService.countExamApply(examApply.getApplyId());
// 如果 id存在 说明已经存了 就不能再存了
if (count > 0) {
if (Objects.equals(examApply.getResult(), "delete")) {
if (!examApplyService.updateExamApplyIsValid(examApply.getApplyId())) {
textContent = "检查申请单删除失败了";
}
} else {
textContent = "已经存在申请单了";
}
} else {
if (Objects.equals(examApply.getResult(), "new")) {
// 转换
if (examApply.getReportType() != null) {
switch (examApply.getReportType()) {
case "病理":
examApply.setReportType(AliasName.PATHOLOGY_REPORT);
break;
case "超声":
examApply.setReportType(AliasName.ULTRASONIC_REPORT);
break;
case "心电":
examApply.setReportType(AliasName.EKG_REPORT);
break;
case "放射":
examApply.setReportType(AliasName.RADIATION_REPORT);
break;
}
}
examApplyService.save(examApply);
} else {
textContent = "该申请单不存在:" + examApply.getApplyId();
}
}
return textContent;
}
private String changeApply(ExamApply examApply) {
String textContent = null;
ExamApply examApplyTemp = examApplyService.findExamApply(examApply.getApplyId());
if(examApplyTemp != null){
if (Objects.equals(examApply.getResult(), "delete")) {
if (!examApplyService.updateExamApplyIsValid(examApply.getApplyId())) {
textContent = "申请单删除失败了";
}
}else if (Objects.equals(examApply.getIsOpen(), "F")) {
examApplyTemp.setIsValid(1);
examApplyTemp.setIsOpen("F");
examApplyService.save(examApplyTemp);
}else {
textContent = "该申请单已存在";
}
}else{
if (Objects.equals(examApply.getResult(), "new")) {
if (examApply.getReportType() != null) {
switch (examApply.getReportType()) {
case "病理":
examApply.setReportType(AliasName.PATHOLOGY_REPORT);
break;
case "超声":
examApply.setReportType(AliasName.ULTRASONIC_REPORT);
break;
case "心电":
examApply.setReportType(AliasName.EKG_REPORT);
break;
case "放射":
examApply.setReportType(AliasName.RADIATION_REPORT);
break;
default:
examApply.setReportType(AliasName.INSPECTION_REPORT);
break;
}
}
examApplyService.save(examApply);
} else {
textContent = "该申请单不存在";
}
}
return textContent;
}
public static String getReturnResult(boolean resultCode) throws Exception{
OutPara outPara = new OutPara();
if (!resultCode) {
outPara.setRESULT_CODE(false);
outPara.setRESULT_CONTENT("失败");
} else {
outPara.setRESULT_CODE(true);
outPara.setRESULT_CONTENT("成功");
}
return XMLUtils.generateXmlStr(outPara);
}
public void delete() {
try {
String type = "", patientMainStr = "", json = "";
MessageDto messageDto = null;
System.out.println("我开始查询数据了。。。。");
List<MessageLog> messageLogs = messageService.findAllMessage();
for (MessageLog messageLog : messageLogs) {
MedicalRecordHomepage medicalRecordHomepage = XMLUtils.xmlStrToObject1(messageLog.getInputContent(), MedicalRecordHomepage.class);
if (medicalRecordHomepage != null) {
MedicalRecordHomepageCache medicalRecordHomepageCache = medicalRecordHomepageCacheService.handleMedicalRecordHomepageCache(medicalRecordHomepage);
if (medicalRecordHomepageCache != null) {
if (medicalRecordHomepageCacheService.save(medicalRecordHomepageCache)) {
}
}
}
}
}catch (Exception e){
}
}
}

@ -1,46 +0,0 @@
package com.ann.demo.service;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: LeiJiaXin
* @Date: 2019/9/26 9:52
*/
@Service
public class TimerService {
private static final Logger logger = LoggerFactory.getLogger(TimerService.class);
@Autowired
private MedicalRecordHomepageCacheService medicalRecordHomepageCacheService;
@Autowired
private ArchiveMasterService archiveMasterService;
public void doSomethingByMedicalRecordHomepageCache() {
try {
List<ArchiveMaster> allArchiveMaster = archiveMasterService.findAllArchiveMaster();
if (allArchiveMaster.size() > 0) {
for (ArchiveMaster archiveMaster : allArchiveMaster) {
// 新增病案首页
if (medicalRecordHomepageCacheService.save(archiveMaster.getId())) {
// 清空master 当前已归档信息
if (archiveMasterService.updateCheckedDatetime(archiveMaster.getId())) {
//删除病案首页缓存信息
medicalRecordHomepageCacheService.delete(archiveMaster.getId());
}
}
}
}
}catch (Exception e){
logger.error("出错咯!错误信息为{},以及错误行数为:{}" ,e,e.getStackTrace()[0]);
}
}
}

@ -0,0 +1,156 @@
package com.ann.demo.service.impl;
import com.alibaba.fastjson.JSON;
import com.ann.demo.entity.constant.AliasName;
import com.ann.demo.entity.constant.InterfaceName;
import com.ann.demo.entity.filing.dto.MessageDto;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.entity.interfaceEntity.ExamApply;
import com.ann.demo.entity.interfaceEntity.MessageLog;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepage;
import com.ann.demo.entity.normalEntity.MedicalRecordHomepageCache;
import com.ann.demo.entity.normalEntity.OutPara;
import com.ann.demo.service.*;
import com.ann.demo.utils.XMLUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
*
*
* @Author: LeiJiaXin
* @Date: 2019/8/20 16:29
*/
@Component
public class AnalysisService {
static final Logger logger = LoggerFactory.getLogger(AnalysisService.class);
@Autowired
MessageService messageService;
@Autowired
MessageSubordinateService messageSubordinateService;
@Autowired
ArchiveMasterService archiveMasterService;
@Autowired
ExamApplyService examApplyService;
@Autowired
MedicalRecordHomepageCacheService medicalRecordHomepageCacheService;
/**
* 2019-7-8
*
* @Param xmlStr
* @Param tClass
* @Param parameter
* xml
*/
public String getHIPMessageServerResult(String message, Class tClass, String parameter,String webserviceId) throws Exception{
long startTime = System.currentTimeMillis();
String textContent = "成功啦~", type = "", typeCodeValue = "AE", outContent = "", patientMainStr = "";
Date xmlCreateTime = null;
Integer result = 0;
long endTime = 0;
String archiveMasterId = null;
MessageLog messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date(),webserviceId);
// 只要没有传过 才会插入新的
messageService.save(messageLog);
MessageDto messageDto = XMLUtils.xpathToBean(message, tClass, parameter);
if (messageDto != null) {
String textContentTemp = null;
if (Objects.equals(messageDto.getEntity(), ArchiveMaster.class.getName())) { // 患者信息
ArchiveMaster archiveMaster = JSON.parseObject(messageDto.getObject().toString(), ArchiveMaster.class);
//查询患者是否存在
archiveMasterId = archiveMasterService.findArchiveMasterId(archiveMaster.getPatientId(), archiveMaster.getVisitId(), archiveMaster.getInpNo());
if (archiveMasterId != null) {
// 如果不是新增 都会查询id
archiveMaster.setId(archiveMasterId);
}
textContentTemp = changeArchiveMaster(archiveMaster, messageDto.getAddFlag(), messageDto.getType());
}
// textContentTemp 1.错误信息 2.archiveMasterId 3.null
if (textContentTemp != null && textContentTemp.indexOf("-") == -1) {
textContent = textContentTemp;
} else {
//textContentTemp 如果是成功
if (textContentTemp != null && textContentTemp.indexOf("-") != -1) {
archiveMasterId = textContentTemp;
}
xmlCreateTime = messageDto.getXmlCreateTime();
type = messageDto.getType();
typeCodeValue = "AA";
result = 1;
}
} else {
textContent = "传过来的消息无法解析。。";
}
outContent = XMLUtils.generateV3XmlStr(typeCodeValue, textContent);
endTime = System.currentTimeMillis();
messageLog.setValue(archiveMasterId,outContent, result, messageDto == null ? "" : JSON.toJSONString(messageDto), xmlCreateTime, (endTime - startTime), new Date(), type, textContent);
messageService.save(messageLog);
logger.info("-----------------------" + type + ":" + (endTime - startTime) + "-------------------------");
return outContent;
}
private String changeArchiveMaster(ArchiveMaster archiveMaster, String changeStatus, String aliasName) throws Exception{
String textContent = null;
if (changeStatus != null || aliasName != null) {
String archiveMasterId = archiveMaster.getId();
if (archiveMasterId != null) {
if (aliasName.equals(AliasName.ADMISSION_RECORD) && Objects.equals(changeStatus, "update") ) { //入院消息 更新患者住院信息
archiveMasterService.save(archiveMaster); //
}else if (aliasName.equals(AliasName.CANCELLATION_DISCHARGE) && Objects.equals(changeStatus, "delete")) { // 取消入院
archiveMasterService.updateArchiveMasterValid(archiveMasterId);
}else if (aliasName.equals(AliasName.TRANSFER_RECORD)) { // 转科
archiveMasterService.transferDepartment(archiveMaster);
} else if (aliasName.equals(AliasName.DISCHARGE_RECORD)) { // 出院
archiveMasterService.discharge(archiveMaster);
}else if(aliasName.equals(AliasName.PATIENT_UPDATE)){ //患者信息修改
if(!archiveMasterService.updateArchiveMaster(archiveMaster)){
textContent = "患者更新失败";
}
}else if(aliasName.equals(AliasName.DIE_MEDICAL_ADVICE)){ //死亡信息同步
String deathFlag = "0";
if(Objects.equals(changeStatus,"new")){
deathFlag = "1";
}
archiveMaster.setDeathFlag(deathFlag);
if(!archiveMasterService.updateArchiveMasterByDeathFlag(archiveMaster)){
textContent = "死亡信息同步失败";
}
}else if(aliasName.equals(AliasName.BED_MANAGER)){ //管床医师同步
if(!archiveMasterService.updateArchiveMasterBydoctorInCharge(archiveMaster)){
textContent = "管床医师同步失败";
}
} else {
textContent = "信息有错(存在患者入院消息可能已发送)";
}
}else {
if (Objects.equals(changeStatus, "new")) { //入院消息 新增患者住院信息
archiveMasterService.save(archiveMaster);
textContent = archiveMaster.getId();
}else{
textContent = "没有入院信息";
}
}
} else {
textContent = "信息解析错误";
}
return textContent;
}
}

@ -3,6 +3,8 @@ package com.ann.demo.service.impl;
import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.repository.ArchiveMasterRepository;
import com.ann.demo.service.ArchiveMasterService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -15,9 +17,14 @@ import java.util.List;
@Service
public class ArchiveMasterServiceImpl implements ArchiveMasterService {
static final Logger logger = LoggerFactory.getLogger(ArchiveMasterServiceImpl.class);
@Autowired
private ArchiveMasterRepository archiveMasterRepository;
@Autowired
private InterfaceHisCacheService interfaceHisCacheService;
@Override
public void save(ArchiveMaster archiveMaster) {
if (archiveMaster.getSex() != null) {
@ -76,6 +83,15 @@ public class ArchiveMasterServiceImpl implements ArchiveMasterService {
if(master.getArchiveState().equals("在院")){
master.setArchiveState("归档中");
}
//20200703 出院写入医嘱数据
for (int type = 0; type<2;type++){
InterfaceHisCache interfaceHisCache =
interfaceHisCacheService.findInterfaceHisCache(archiveMaster.getInpNo(), archiveMaster.getVisitId(), "1");
if(interfaceHisCache == null){
interfaceHisCache = new InterfaceHisCache(archiveMaster.getInpNo(),archiveMaster.getVisitId(),type+"");
interfaceHisCacheService.save(interfaceHisCache);
}
}
archiveMasterRepository.save(master);
}
}

@ -1,25 +1,25 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/test
# url: jdbc:mysql://10.6.1.127:3306/test
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/test
# # url: jdbc:mysql://10.6.1.127:3306/test
# username: root
# password: 123456
# driver-class-name: com.mysql.jdbc.Driver
# jpa:
# database: mysql
# show-sql: false
# hibernate:
# ddl-auto: update
# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
username: sa
password: docus@702
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa:
database: mysql
database: sql_server
show-sql: false
hibernate:
ddl-auto: update
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
# username: sa
# password: docus@702
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# jpa:
# database: sql_server
# show-sql: false
# hibernate:
# dialect: org.hibernate.dialect.SQLServer2008Dialect
dialect: org.hibernate.dialect.SQLServer2008Dialect
hikari:
#是否为只读数据库
read-only: false

@ -1,56 +0,0 @@
spring:
datasource:
# url: jdbc:mysql://localhost:3306/test
# # url: jdbc:mysql://10.6.1.127:3306/test
# username: root
# password: 123456
# driver-class-name: com.mysql.jdbc.Driver
# jpa:
# database: mysql
# show-sql: false
# hibernate:
# ddl-auto: update
# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
username: sa
password: docus@702
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa:
database: sql_server
show-sql: false
hibernate:
dialect: org.hibernate.dialect.SQLServer2008Dialect
hikari:
#是否为只读数据库
read-only: false
# 等待连接池分配链接的最大时长
connection-timeout: 60000
# 一个链接idle状态最大时长
idle-timeout: 60000
validation-timeout: 3000
# 一个链接最长的生命时长,超时没有被使用则被释放掉 简易比数据库超时时长少 30s
max-lifetime: 70000
login-timeout: 5
# 连接池允许的最大连接数
maximum-pool-size: 60
# 连接池维护的最小空闲连接数
minimum-idle: 10
thymeleaf:
prefix: classpath:/templates/
suffix: .html
encoding: utf-8
mode: HTML5
cache: false
file:
path: D:\\1\MCCI_IN000002UV01.xml
dischargeRecordPath: D:\\1\dischargeRecord.properties
transferRecordPath: D:\\1\transferRecord.properties
admissionRecordPath: D:\\1\admissionRecord.properties
handNumbnessReportPath: D:\\1\handNumbnessReport.properties
ICUReportPath: D:\\1\ICUReport.properties
bloodApplyPath: D:\\1\bloodApply.properties
patientUpdatePath: D:\\1\patientUpdate.properties
pinyinPath: D:\\1\pinyin.properties
dieMedicalAdvicePath: D:\\1\dieMedicalAdvice.properties
bedManagerPath: D:\\1\bedManager.properties

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save