1、新增检查报告通用接口

2、先判断入院消息,再处理申请单
master
leijx 5 years ago
parent af6edd3a3d
commit 407b1186e0

@ -10,10 +10,6 @@ import java.util.Map;
*/
public class AliasName {
public static final String USER = "用户字典";
public static final String DEPARTMENT = "科室字典";
// 超声报告
public static final String ULTRASONIC_REPORT = "57";
@ -26,99 +22,118 @@ public class AliasName {
// 心电图报告单 59
public static final String EKG_REPORT = "59";
// 入院记录
public static final String ADMISSION_RECORD = "9";
// 检查申请单
public static final String PARAMETER_EXAMAPPLY = "119";
// 出院记录
public static final String DISCHARGE_RECORD = "113";
// 检查申请单 状态变更
public static final String PARAMETER_EXAMAPPLYSTATECHANGE = "125";
// 转科记录
public static final String TRANSFER_RECORD = "114";
// PET/CT报告单
public static final String PETCT_REPORT = "60";
// 取消入院
public static final String CANCELLATION_DISCHARGE = "115";
// 20200703 新增其他报告
public static final String OTHER_REPORT = "110";
// 手麻
public static final String HANDNUMBNESS_REPORT = "117";
// ICU报告
public static final String ICU_REPORT = "121";
// 其他类型 目前来说 是手麻系统的其他三个
public static final String OTHER = "18";
// 检查申请单
public static final String PARAMETER_EXAMAPPLY = "119";
// 检查申请单 状态变更
public static final String PARAMETER_EXAMAPPLYSTATECHANGE = "124";
// public static final String USER = "用户字典";
//
// public static final String DEPARTMENT = "科室字典";
//
// // 入院记录
// public static final String ADMISSION_RECORD = "9";
//
// // 出院记录
// public static final String DISCHARGE_RECORD = "113";
//
// // 转科记录
// public static final String TRANSFER_RECORD = "114";
//
// // 取消入院
// public static final String CANCELLATION_DISCHARGE = "115";
//
// // 手麻
// public static final String HANDNUMBNESS_REPORT = "117";
//
// // ICU报告
// public static final String ICU_REPORT = "121";
// // 其他类型 目前来说 是手麻系统的其他三个
// public static final String OTHER = "18";
// 输血单
public static final String BLOODAPPLY_REPORT = "120";
// public static final String BLOODAPPLY_REPORT = "120";
// PET/CT报告单
public static final String PETCT_REPORT = "60";
// 检验申请单
//public static final String PARAMETER_EXAMAPPLY = "118";
// 检验报告
public static final String INSPECTION_REPORT = "10";
// public static final String INSPECTION_REPORT = "10";
// 扫描文件
public static final String SCANNING_FILE = "30";
// public static final String SCANNING_FILE = "30";
// 护理、医生
public static final Map<String, String> DOCTOR_MAP;
public static final Map<String, String> NURSE_MAP;
// // 护理、医生
// public static final Map<String, String> DOCTOR_MAP;
// public static final Map<String, String> NURSE_MAP;
// 病案首页
public static final String MEDICAL_RECORD_HOMEPAGE = "3";
// 20200605新增申请单
// 核医学
public static final String PET_CT_REPORT = "125";
//肌电图
public static final String ELECTROMYOGRAPHY = "126";
//临床试验
public static final String CLINICAL_TRIALS = "127";
//内镜
public static final String ENDOSCOPIC_REPORT = "128";
//脑彩超
public static final String BRAIN_COLOR_ULTRASOUND = "129";
//脑电图
public static final String BRAIN_ELECTRIC_REPORT = "130";
static {
DOCTOR_MAP = new HashMap<String, String>();
DOCTOR_MAP.put("入院记录", "9");
DOCTOR_MAP.put("病程记录", "11");
DOCTOR_MAP.put("术前文书", "12");
DOCTOR_MAP.put("手术资料", "13");
DOCTOR_MAP.put("讨论记录", "14");
DOCTOR_MAP.put("会诊记录", "15");
DOCTOR_MAP.put("出院记录", "113");
DOCTOR_MAP.put("死亡记录", "17");
DOCTOR_MAP.put("VTE文书", "23");
DOCTOR_MAP.put("其他记录", "18");
DOCTOR_MAP.put("医护共用", "19");
DOCTOR_MAP.put("知情同意", "20");
DOCTOR_MAP.put("疾病危重", "21");
DOCTOR_MAP.put("VTE记录", "22");
DOCTOR_MAP.put("病案首页", "3");
DOCTOR_MAP.put("病历文书", "");
NURSE_MAP = new HashMap<String, String>();
NURSE_MAP.put("首次护理记录", "7");
NURSE_MAP.put("护理文书", "6");
NURSE_MAP.put("专科单护理", "24");
NURSE_MAP.put("知情文件", "8");
NURSE_MAP.put("体温单", "5");
NURSE_MAP.put("护理记录", "2");
NURSE_MAP.put("评估单", "4");
NURSE_MAP.put("病历护理文书", "");
}
// public static final String MEDICAL_RECORD_HOMEPAGE = "3";
// // 20200605新增申请单
// // 核医学
// public static final String PET_CT_REPORT = "125";
// //肌电图
// public static final String ELECTROMYOGRAPHY = "126";
// //临床试验
// public static final String CLINICAL_TRIALS = "127";
// //内镜
// public static final String ENDOSCOPIC_REPORT = "128";
// //脑彩超
// public static final String BRAIN_COLOR_ULTRASOUND = "129";
// //脑电图
// public static final String BRAIN_ELECTRIC_REPORT = "130";
// static {
// DOCTOR_MAP = new HashMap<String, String>();
// DOCTOR_MAP.put("入院记录", "9");
// DOCTOR_MAP.put("病程记录", "11");
// DOCTOR_MAP.put("术前文书", "12");
// DOCTOR_MAP.put("手术资料", "13");
// DOCTOR_MAP.put("讨论记录", "14");
// DOCTOR_MAP.put("会诊记录", "15");
// DOCTOR_MAP.put("出院记录", "113");
// DOCTOR_MAP.put("死亡记录", "17");
// DOCTOR_MAP.put("VTE文书", "23");
// DOCTOR_MAP.put("其他记录", "18");
// DOCTOR_MAP.put("医护共用", "19");
// DOCTOR_MAP.put("知情同意", "20");
// DOCTOR_MAP.put("疾病危重", "21");
// DOCTOR_MAP.put("VTE记录", "22");
// DOCTOR_MAP.put("病案首页", "3");
// DOCTOR_MAP.put("病历文书", "");
//
// NURSE_MAP = new HashMap<String, String>();
// NURSE_MAP.put("首次护理记录", "7");
// NURSE_MAP.put("护理文书", "6");
// NURSE_MAP.put("专科单护理", "24");
// NURSE_MAP.put("知情文件", "8");
// NURSE_MAP.put("体温单", "5");
// NURSE_MAP.put("护理记录", "2");
// NURSE_MAP.put("评估单", "4");
// NURSE_MAP.put("病历护理文书", "");
// }
}

@ -123,4 +123,12 @@ public class InterfaceName {
*/
public static final String SCANNING_FILE = "扫描系统";
/**
* 2020-7-3
*
*/
public static final String OTHER_SYSTEM = "其他系统";
}

@ -5,11 +5,6 @@ import lombok.Data;
@Data
public class WebserviceId {
/**
* ReceiveDict
*/
public static final String RECEIVE_DICT = "ReceiveDict";
/**
* V3
*/
@ -21,93 +16,106 @@ public class WebserviceId {
public static final String PARAMETER_REPORT = "1";
/**
*
*
*/
public static final String PARAMETER_ADMISSION = "InPatientAddRequest";
public static final String PARAMETER_EXAMAPPLY = "2";
/**
*
* 2019-10-21
*
*/
public static final String PARAMETER_DISCHARGE = "PatientOutRequest";
public static final String PARAMETER_EXAMAPPLYSTATECHANGE = "3";
/**
*
* 2020-3-3
*
*/
public static final String PARAMETER_TRANSFER = "InpatientTransferRequest";
public static final String PARAMETER_VERIFICATIONEXAMAPPLY = "4";
/**
*
*
*/
public static final String PARAMETER_CANCELLATION_DISCHARGE = "CalPatientRequest";
public static final String PARAMETER_ADMISSION = "5";
/**
*
*
*/
public static final String PARAMETER_EXAMAPPLY = "2";
public static final String PARAMETER_DISCHARGE = "6";
/**
* 2019-10-21
*
*
*/
public static final String PARAMETER_EXAMAPPLYSTATECHANGE = "3";
public static final String PARAMETER_TRANSFER = "7";
/**
* 2020-3-3
*
*
*/
public static final String PARAMETER_VERIFICATIONEXAMAPPLY = "4";
public static final String PARAMETER_CANCELLATION_DISCHARGE = "8";
/**
*
*
*/
public static final String INP_SUMMARY = "InpSummary";
public static final String PARAMETER_PATIENT_UPDATE = "9";
/**
*
* lis
*/
public static final String HANDNUMBNESS_REPORT = "handNumbnessReport";
public static final String INSPECTION_REPORT_NAME = "10";
/**
* ICU
* 2019-12-23
*
*/
public static final String ICU_REPORT = "ICUReport";
public static final String PARAMETER_INSPECTIONAPPLY = "11";
/**
*
* 2020-2-28
*
*/
public static final String BLOODAPPLY_REPORT = "BloodTransfusionUrl";
public static final String PARAMETER_VERIFICATIONINSPECTIONAPPLY = "12";
/**
*
*/
public static final String DOCTOR_DATA = "DoctorData";
public static final String DOCTOR_DATA = "13";
/**
* 2
*/
public static final String NURSE_DATA = "NurseData";
public static final String NURSE_DATA = "14";
/**
* lis
*
*/
public static final String INSPECTION_REPORT_NAME = "LisSendReportBack";
public static final String INP_SUMMARY = "15";
/**
*
*/
public static final String HANDNUMBNESS_REPORT = "16";
/**
* 2019-12-23
*
* ICU
*/
public static final String PARAMETER_INSPECTIONAPPLY = "InspectionApplyRequest";
public static final String ICU_REPORT = "17";
/**
* 2020-2-28
*
*
*/
public static final String PARAMETER_VERIFICATIONINSPECTIONAPPLY = "VerificationInspectionApplyRequest";
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";
}

@ -51,6 +51,9 @@ public class MessageDto<T> {
// 2020-4-20 报告标题
private String detailType;
//2020-7-20 新增患者ID
private String patientId;
public MessageDto() {
}

@ -85,25 +85,22 @@ public class MessageLog {
*/
private Long xmlExecutionTime;
//// /*
//// * 患者id
//// * */
// private String masterId;
////
// /*
// * 2020-3-20 新增webserviceInfo
// * */
// private String webserviceInfo;
/*
* id
* */
private String masterId;
/*
* 2020-3-20 webserviceInfo
* */
private String webserviceInfo;
// ---------------------------时间怎么变成了毫秒数
// public MessageLog(String inputContent, String interfaceName, Date createTime,String webserviceInfo) {
// this.inputContent = inputContent;
// this.interfaceName = interfaceName;
// this.createTime = createTime;
// this.webserviceInfo = webserviceInfo;
// }
public MessageLog(String inputContent, String interfaceName, Date createTime,String webserviceInfo) {
this.inputContent = inputContent;
this.interfaceName = interfaceName;
this.createTime = createTime;
this.webserviceInfo = webserviceInfo;
}
public MessageLog(String inputContent, String interfaceName, Date createTime) {
this.inputContent = inputContent;
@ -115,7 +112,8 @@ public class 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;

@ -19,8 +19,8 @@ public interface MessageRepository extends JpaRepository<MessageLog, Integer> {
@Query("select o from MessageLog o where o.interfaceName = 'InpSummary' ")
public List<MessageLog> findAllHaha();
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (visit_id = ?2 ) and archiveState <> '作废' and is_valid = 0")
public String getArchiveMasterId(String inpNo,String visitId);
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (visit_id = ?2 ) and (patient_id = ?3) and archiveState <> '作废' and is_valid = 0")
public String getArchiveMasterId(String inpNo,String visitId,String patientId);
}

@ -68,8 +68,7 @@ public class AnalysisService {
long endTime = 0;
// 判断是否插入
// messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date(),webserviceId);
messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date());
messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date(),webserviceId);
// 只要没有传过 才会插入新的
messageService.save(messageLog);
MessageDto messageDto = XMLUtils.xpathToBean(message, tClass, parameter);
@ -83,13 +82,16 @@ public class AnalysisService {
Date date = simpleDateFormat.parse(authorReportTime, new ParsePosition(0));
String visitId = archiveMasterRepository.findVisitIdByTimeAndInpNo(date, messageDto.getInpNo());
messageDto.setVisitId(visitId);
}else if (Objects.equals(messageDto.getEntity(), ExamApply.class.getName())) { // 申请单
}
archiveMasterId = messageService.getArchiveMasterId(messageDto.getInpNo(), messageDto.getVisitId(),messageDto.getPatientId());
if(archiveMasterId != null){
if (Objects.equals(messageDto.getEntity(), ExamApply.class.getName())) { // 申请单
ExamApply examApply = JSON.parseObject(messageDto.getObject().toString(), ExamApply.class);
textContentTemp = changeApply(examApply,parameter);
}
archiveMasterId = messageService.getArchiveMasterId(messageDto.getInpNo(), messageDto.getVisitId());
if(archiveMasterId != null){
// 保存消息从属表
patientMainStr = JSON.toJSONString(new PatientMainDto(messageDto.getInpNo(), messageDto.getVisitId()), SerializerFeature.WriteMapNullValue);
if (textContentTemp != null) {
@ -101,24 +103,24 @@ public class AnalysisService {
result = 1;
}
}else{
textContent = "没有入院消息。。。";
textContent = "没有入院消息";
}
} else {
textContent = "传过来的消息无法解析。。";
textContent = "传过来的消息无法解析";
}
outContent = XMLUtils.generateV3XmlStr(typeCodeValue, textContent);
if (!outContent.equals("")) {
endTime = System.currentTimeMillis();
// messageLog.setMasterId(archiveMasterId);
messageLog.setValue(outContent, result, messageDto == null ? "" : JSON.toJSONString(messageDto), xmlCreateTime, (endTime - startTime), new Date(), type, textContent);
messageLog.setValue(archiveMasterId,outContent, result, messageDto == null ? "" : JSON.toJSONString(messageDto), xmlCreateTime, (endTime - startTime), new Date(), type, textContent);
messageService.save(messageLog);
if (Objects.equals(typeCodeValue, "AA")) {
if (Objects.equals(type, AliasName.EKG_REPORT)
|| Objects.equals(type, AliasName.PATHOLOGY_REPORT)
|| Objects.equals(type, AliasName.RADIATION_REPORT)
|| Objects.equals(type, AliasName.ULTRASONIC_REPORT)
|| Objects.equals(type, AliasName.PETCT_REPORT)) {
|| Objects.equals(type, AliasName.PETCT_REPORT )
|| Objects.equals(type, AliasName.OTHER_REPORT)) {
messageSubordinateService.save(new MessageSubordinate(messageLog.getId(), patientMainStr, JSON.toJSONString(messageLog)));
}
}
@ -136,7 +138,7 @@ public class AnalysisService {
if (Objects.equals(examApply.getResult(), "delete")) {
// 1.2 判断是否是删除
if (!examApplyService.updateExamApplyIsValid(examApplyTemp.getApplyId())) {
textContent = "申请单删除失败了。。。。";
textContent = "申请单删除失败了";
}
}else if(Objects.equals(interfaceName,InterfaceName.PARAMETER_EXAMAPPLYSTATECHANGE)){
// 1.3 如果是检查申请单状态变更设置IsOpenHIS
@ -154,11 +156,11 @@ public class AnalysisService {
}
}else {
// 1.5 如果存在,又不做任何操作,返回已存在
textContent = "该申请单已存在。。。。";
textContent = "该申请单已存在";
}
}else{
// 2 如果不存在,那就判断是否是新增,否则该申请单不存在
if (Objects.equals(examApply.getResult(), "new")) {
if (Objects.equals(examApply.getResult(), "new") && Objects.equals(interfaceName,InterfaceName.PARAMETER_EXAMAPPLY)) {
if (examApply.getReportType() != null) {
switch (examApply.getReportType()) {
case "病理":
@ -174,28 +176,32 @@ public class AnalysisService {
examApply.setReportType(AliasName.RADIATION_REPORT);
break;
case "核医学":
examApply.setReportType(AliasName.PET_CT_REPORT);
break;
case "肌电图":
examApply.setReportType(AliasName.ELECTROMYOGRAPHY);
break;
case "临床试验":
examApply.setReportType(AliasName.CLINICAL_TRIALS);
break;
case "内镜":
examApply.setReportType(AliasName.ENDOSCOPIC_REPORT);
break;
case "脑彩超":
examApply.setReportType(AliasName.BRAIN_COLOR_ULTRASOUND);
examApply.setReportType(AliasName.PETCT_REPORT);
break;
case "脑电图":
examApply.setReportType(AliasName.BRAIN_ELECTRIC_REPORT);
default:
//除了这5个 其他报告都归在一类
examApply.setReportType(AliasName.OTHER_REPORT);
break;
// case "肌电图":
// examApply.setReportType(AliasName.ELECTROMYOGRAPHY);
// break;
// case "临床试验":
// examApply.setReportType(AliasName.CLINICAL_TRIALS);
// break;
// case "内镜":
// examApply.setReportType(AliasName.ENDOSCOPIC_REPORT);
// break;
// case "脑彩超":
// examApply.setReportType(AliasName.BRAIN_COLOR_ULTRASOUND);
// break;
// case "脑电图":
// examApply.setReportType(AliasName.BRAIN_ELECTRIC_REPORT);
// break;
}
}
examApplyService.save(examApply);
} else {
textContent = "该申请单不存在。。。。";
textContent = "该申请单不存在";
}
}
return textContent;

@ -16,6 +16,6 @@ public interface MessageService {
public void save(MessageLog log);
//2020-3-20 获取患者信息id
String getArchiveMasterId(String inpNo,String visitId);
String getArchiveMasterId(String inpNo,String visitId,String patientId);
}

@ -34,8 +34,8 @@ public class MessageServiceImpl implements MessageService {
}
}
public String getArchiveMasterId(String inpNo,String visitId) {
return messageRepository.getArchiveMasterId(inpNo, visitId);
public String getArchiveMasterId(String inpNo,String visitId,String patientId) {
return messageRepository.getArchiveMasterId(inpNo, visitId,patientId);
}

@ -238,6 +238,9 @@ public class XMLUtils {
case InterfaceName.PARAMETER_VERIFICATIONEXAMAPPLY: // 检查申请单 是否核收 check
messageDto = new MessageDto(ExamApply.class.getName(), new ExamApply(), AliasName.PARAMETER_EXAMAPPLYSTATECHANGE, applyEstablishPath, source);
break;
default: //归为其他系统 其他报告
messageDto = new MessageDto(UltrasonicReport.class.getName(), new UltrasonicReport(), AliasName.OTHER_REPORT, reportPath, InterfaceName.OTHER_SYSTEM);
break;
}
return messageDto;
}

Loading…
Cancel
Save