脑科接口
parent
fe3143a152
commit
6a6badfa44
@ -1,10 +1,9 @@
|
||||
[{
|
||||
"method": "WS_RECORD_SUBMIT",
|
||||
"collectorIds": ["2", "3", "4", "5", "6", "8"]
|
||||
|
||||
},
|
||||
{
|
||||
"method": "WS_NURS_SUBMIT",
|
||||
"collectorIds": ["1"]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -1,13 +1,8 @@
|
||||
[
|
||||
{
|
||||
"method": "WS_RECORD_SUBMIT",
|
||||
"urls": ["http://127.0.0.1:9314/hospital/zqFirstRy/wsRecordSubmit/do"],
|
||||
"urls": ["http://127.0.0.1:9314/hospital/gznk/wsRecordSubmit/do"],
|
||||
"errorResult": "<Response><RetInfo><RetCode>0</RetCode><RetCon>成功</RetCon></RetInfo></Response>",
|
||||
"messageDataType": 1
|
||||
} , {
|
||||
"method": "WS_NURS_SUBMIT",
|
||||
"urls": ["http://127.0.0.1:9314/hospital/zqFirstRy/wsNurseSubmit/do"],
|
||||
"errorResult": "<Response><RetInfo><RetCode>1</RetCode><RetCon>系统内部错误!</RetCon></RetInfo></Response>",
|
||||
"messageDataType": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.docus.server.message.busservice;
|
||||
|
||||
import com.docus.server.message.dto.Message;
|
||||
import com.docus.server.message.dto.MessageResponse;
|
||||
|
||||
|
||||
public interface NkBusinessService {
|
||||
/**
|
||||
* 广州脑科电子病历提交信息
|
||||
*
|
||||
* @param message 信息
|
||||
* @return 消息处理结果
|
||||
*/
|
||||
MessageResponse recordSubmitHandle(Message message);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.docus.server.message.controller;
|
||||
|
||||
import com.docus.server.message.busservice.NkBusinessService;
|
||||
import com.docus.server.message.busservice.SdBusinessService;
|
||||
import com.docus.server.message.dto.Message;
|
||||
import com.docus.server.message.dto.MessageResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author WYBDEV
|
||||
*/
|
||||
@Api("广州脑科医院")
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/hospital/gznk")
|
||||
public class GznkHospitalController {
|
||||
|
||||
@Autowired
|
||||
private NkBusinessService nkBusinessService;
|
||||
|
||||
@PostMapping("/wsRecordSubmit/do")
|
||||
@ApiOperation("广州脑科电子病例提交消息接收")
|
||||
public MessageResponse wsRecordSubmit(@RequestBody Message message) {
|
||||
log.info("广州脑科电子病例提交消息接收:{}", message);
|
||||
return nkBusinessService.recordSubmitHandle(message);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
package com.docus.server.message.converters;
|
||||
|
||||
import com.docus.core.util.DateUtil;
|
||||
import com.docus.core.util.Func;
|
||||
import com.docus.infrastructure.core.exception.BaseException;
|
||||
import com.docus.server.message.dto.NkRecordSubmitDTO;
|
||||
import com.docus.server.message.dto.TbasicQrPreciseCondition;
|
||||
import com.docus.server.message.feign.vo.ArchiveAndRecallPushVo;
|
||||
import com.docus.server.message.util.XmlUtil;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NkWsRecordSubmitMessageConvert {
|
||||
public static NkRecordSubmitDTO convert(String str) {
|
||||
String jzh = null;
|
||||
String inpatientNo = null;
|
||||
String name = null;
|
||||
Integer admissTimes = null;
|
||||
String submitNo=null;
|
||||
String submitName=null;
|
||||
String submitDate = null;
|
||||
|
||||
XmlUtil xmlUtil = XmlUtil.of(str);
|
||||
try {
|
||||
// 住院流水号
|
||||
Node inHospNoNode = xmlUtil.getNode("/Request/Msg/INHOSP_NO");
|
||||
jzh = inHospNoNode.getTextContent();
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 住院流水号 出错!");
|
||||
}
|
||||
|
||||
try {
|
||||
// 住院号
|
||||
Node inHospIndexNoNode = xmlUtil.getNode("/Request/Msg/INHOSP_INDEX_NO");
|
||||
inpatientNo = inHospIndexNoNode.getTextContent();
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 住院号 出错!");
|
||||
}
|
||||
try {
|
||||
// 住院次数
|
||||
Node visitNoNode = xmlUtil.getNode("/Request/Msg/VISIT_NO");
|
||||
String admissTimesStr = visitNoNode.getTextContent();
|
||||
if (Func.isNotBlank(admissTimesStr)) {
|
||||
admissTimes = Integer.parseInt(admissTimesStr.trim());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 住院次数 出错!");
|
||||
}
|
||||
try {
|
||||
// 患者姓名
|
||||
Node nameNode = xmlUtil.getNode("/Request/Msg/NAME");
|
||||
name = nameNode.getTextContent();
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 姓名 出错!");
|
||||
}
|
||||
try {
|
||||
// 提交人工号
|
||||
Node submitNoNode = xmlUtil.getNode("/Request/Msg/SUBMIT_NO");
|
||||
submitNo = submitNoNode.getTextContent();
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 提交人工号 出错!");
|
||||
}
|
||||
try {
|
||||
// 提交人姓名
|
||||
Node submitNameNode = xmlUtil.getNode("/Request/Msg/SUBMIT_NAME");
|
||||
submitName = submitNameNode.getTextContent();
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 提交人姓名 出错!");
|
||||
}
|
||||
|
||||
try {
|
||||
// 提交时间
|
||||
Node submitTimeNode = xmlUtil.getNode("/Request/Msg/SUBMIT_TIME");
|
||||
String submitTime = submitTimeNode.getTextContent();
|
||||
Date submitDateTime = Func.parseDate(submitTime.trim(), DateUtil.PATTERN_DATETIME);
|
||||
submitDate = Func.formatDateTime(submitDateTime);
|
||||
} catch (Exception ex) {
|
||||
throw new BaseException("解析 提交时间 出错!");
|
||||
}
|
||||
|
||||
NkRecordSubmitDTO recordSubmitDTO = new NkRecordSubmitDTO();
|
||||
recordSubmitDTO.setJzh(jzh);
|
||||
recordSubmitDTO.setInpatientNo(inpatientNo);
|
||||
recordSubmitDTO.setAdmissTimes(admissTimes);
|
||||
recordSubmitDTO.setName(name);
|
||||
recordSubmitDTO.setSubmitNo(submitNo);
|
||||
recordSubmitDTO.setSubmitName(submitName);
|
||||
recordSubmitDTO.setSubmitDate(submitDate);
|
||||
return recordSubmitDTO;
|
||||
}
|
||||
|
||||
public static TbasicQrPreciseCondition convert(NkRecordSubmitDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
TbasicQrPreciseCondition condition = new TbasicQrPreciseCondition();
|
||||
|
||||
condition.setInpatientNo(dto.getInpatientNo());
|
||||
condition.setAdmissTimes(dto.getAdmissTimes());
|
||||
condition.setName(dto.getName());
|
||||
return condition;
|
||||
}
|
||||
public static String getPushXml(ArchiveAndRecallPushVo vo) {
|
||||
String result = "<Msg>\n" +
|
||||
"\t<!--归档/解档ID-->\n" +
|
||||
"\t<Id>"+ UUID.randomUUID()+"</Id>\n" +
|
||||
"\t<!--住院号-->\n" +
|
||||
"\t<inHospIndexNo>"+vo.getInpatientNo()+"</inHospIndexNo>\n" +
|
||||
"\t<!--住院次数-->\n" +
|
||||
"\t<visitNo>"+vo.getAdmissTimes()+"</visitNo>\n" +
|
||||
"\t<!--患者姓名-->\n" +
|
||||
"\t<patientName>"+vo.getName()+"</patientName>\n" +
|
||||
"\t<!--住院就诊流水号-->\n" +
|
||||
"\t<inHospNo>"+vo.getExternalId()+"</inHospNo>\n" +
|
||||
"\t<!--入院时间yyyy-MM-dd HH:mm:ss-->\n" +
|
||||
"\t<admitTime>"+ DateUtil.format(vo.getAdmissDate(),DateUtil.PATTERN_DATETIME)+"</admitTime>\n" +
|
||||
"\t<!--出院时间yyyy-MM-dd HH:mm:ss-->\n" +
|
||||
"\t<disTime>"+DateUtil.format(vo.getDisDate(),DateUtil.PATTERN_DATETIME)+"</disTime>\n" +
|
||||
"\t<!--归档时间yyyy-MM-dd HH:mm:ss-->\n" +
|
||||
"\t<archiveTime>"+vo.getArchiveTime()+"</archiveTime>\n" +
|
||||
"\t<!--解档时间yyyy-MM-dd HH:mm:ss-->\n" +
|
||||
"\t<unarchiveTime></unarchiveTime>\n" +
|
||||
"\t<!--出院科室代码-->\n" +
|
||||
"\t<dischargeDeptCode>"+vo.getDisDept()+"</dischargeDeptCode>\n" +
|
||||
"\t<!--出院科室-->\n" +
|
||||
"\t<dischargeDeptName>"+vo.getDisDeptName()+"</dischargeDeptName>\n" +
|
||||
"\t<!--操作人工号-->\n" +
|
||||
"\t<controlUserName>"+vo.getControlUserName()+"</controlUserName>\n" +
|
||||
"\t<!--操作人姓名-->\n" +
|
||||
"\t<controlName>"+vo.getControlName()+"</controlName>\n" +
|
||||
"\t<!--解档/归档状态 0:解档 1:归档-->\n" +
|
||||
"\t<archiveState>"+vo.getIsArchive()+"</archiveState>\n" +
|
||||
"</Msg>";
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.docus.server.message.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 广州脑科电子病历提交信息
|
||||
*
|
||||
* @author ceh
|
||||
*/
|
||||
@Data
|
||||
public class NkRecordSubmitDTO {
|
||||
/**
|
||||
* 住院流水号/记账号
|
||||
*/
|
||||
private String jzh;
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String inpatientNo;
|
||||
/**
|
||||
* 住院次数
|
||||
*/
|
||||
private Integer admissTimes;
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 提交人工号
|
||||
*/
|
||||
private String submitNo;
|
||||
/**
|
||||
* 提交人姓名
|
||||
*/
|
||||
private String submitName;
|
||||
/**
|
||||
* 提交时间 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String submitDate;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.docus.server.message.feign.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @BelongsProject: docus_medicalrecord_starter
|
||||
* @BelongsPackage: com.docus.services.clinicqualitycontrol.dto
|
||||
* @Author: chierhao
|
||||
* @CreateTime: 2023-02-14 14:56
|
||||
* @Description: TODO
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("退回推送Vo")
|
||||
public class ArchiveAndRecallPushVo {
|
||||
|
||||
@ApiModelProperty(value = "病案主键")
|
||||
private String patientId;
|
||||
|
||||
@ApiModelProperty(value = "住院号(病案号)")
|
||||
private String inpatientNo;
|
||||
|
||||
@ApiModelProperty(value = "住院次数")
|
||||
private Integer admissTimes;
|
||||
|
||||
@ApiModelProperty(value = "住院就诊流水号(外部id)")
|
||||
private String externalId;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
private Date admissDate;
|
||||
|
||||
@ApiModelProperty(value = "出院时间")
|
||||
private Date disDate;
|
||||
|
||||
@ApiModelProperty(value = "归档时间")
|
||||
private String archiveTime;
|
||||
|
||||
@ApiModelProperty(value = "出院科室代码")
|
||||
private String disDept;
|
||||
|
||||
@ApiModelProperty(value = "出院科室")
|
||||
private String disDeptName;
|
||||
|
||||
@ApiModelProperty(value = "操作人工号")
|
||||
private String controlUserName;
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String controlName;
|
||||
|
||||
@ApiModelProperty(value = "解档\\归档状态( 未归档状态\\归档状态) ")
|
||||
private Integer isArchive;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.docus.server.message.mapper;
|
||||
import com.docus.server.message.entity.CqcPushConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface CqcPushConfigMapper {
|
||||
|
||||
/**
|
||||
* @description 根据业务类型查询推送配置
|
||||
* @author chierhao
|
||||
* @date 2023-02-14 13:59
|
||||
* @param businessType
|
||||
* @return: com.docus.services.clinicqualitycontrol.entity.CqcPushConfig
|
||||
*/
|
||||
CqcPushConfig getCqcPushConfigByBusinessType(@Param("businessType") String businessType);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.docus.server.message.validate;
|
||||
|
||||
import com.docus.core.util.Func;
|
||||
import com.docus.infrastructure.core.exception.BaseException;
|
||||
import com.docus.server.message.dto.NkRecordSubmitDTO;
|
||||
import com.docus.server.message.dto.ZqRecordSubmitDTO;
|
||||
|
||||
public class NkRecordSubmitValidate {
|
||||
public static void verifyRecordSubmitDTO(NkRecordSubmitDTO recordSubmitDto) throws BaseException{
|
||||
String jzh = recordSubmitDto.getJzh();
|
||||
String inpatientNo = recordSubmitDto.getInpatientNo();
|
||||
String name = recordSubmitDto.getName();
|
||||
String submitDate = recordSubmitDto.getSubmitDate();
|
||||
String submitNo = recordSubmitDto.getSubmitNo();
|
||||
String submitName = recordSubmitDto.getSubmitName();
|
||||
if (Func.isBlank(jzh)
|
||||
&& Func.isBlank(inpatientNo)
|
||||
&& Func.isBlank(name)) {
|
||||
throw new BaseException("住院流水号、住院号、患者姓名 不可全部为空!");
|
||||
}
|
||||
if (Func.isBlank(submitDate)) {
|
||||
throw new BaseException("提交时间不能为空!");
|
||||
}
|
||||
if(Func.isBlank(submitNo)||Func.isBlank(submitName)){
|
||||
throw new BaseException("提交人工号和姓名不能为空!");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.docus.server.message.mapper.CqcPushConfigMapper">
|
||||
|
||||
<select id="getCqcPushConfigByBusinessType"
|
||||
resultType="com.docus.server.message.entity.CqcPushConfig">
|
||||
SELECT
|
||||
id,
|
||||
business_type,
|
||||
protocol_type,
|
||||
namespace,
|
||||
url,
|
||||
method,
|
||||
effective,
|
||||
title,
|
||||
create_user,
|
||||
create_time,
|
||||
update_user,
|
||||
update_time,
|
||||
parameter_list
|
||||
FROM
|
||||
cqc_push_config
|
||||
WHERE business_type=#{businessType}
|
||||
AND effective=1
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue