|
|
|
@ -70,6 +70,49 @@ public class BasicServiceImpl implements BasicService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String setAdmissTBasic(String message) {
|
|
|
|
|
log.info("新增入院基础数据:{}", message);
|
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(message)) {
|
|
|
|
|
return Result.failedMessage(null,"参数为空",null,null);
|
|
|
|
|
}
|
|
|
|
|
//解析xml
|
|
|
|
|
TBasicDto tBasicDto = null;
|
|
|
|
|
try {
|
|
|
|
|
tBasicDto=getAdmissTBasicDto(message);
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicService.setTBasic(tBasicDto);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("住院号:"+tBasicDto.getJzh()+" 异常信息:\n"+e.getMessage(), e);
|
|
|
|
|
return Result.failedMessage(tBasicDto.getSerialId(),e.getMessage(),tBasicDto.getReceive(),tBasicDto.getSend());
|
|
|
|
|
}
|
|
|
|
|
return Result.successMessage(tBasicDto.getSerialId(),tBasicDto.getReceive(),tBasicDto.getSend());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String updateAdmissTBasic(String message) {
|
|
|
|
|
log.info("修改基础数据:{}", message);
|
|
|
|
|
if (Func.isEmpty(message)) {
|
|
|
|
|
return Result.failedMessage(null,"参数为空",null,null);
|
|
|
|
|
}
|
|
|
|
|
//解析xml
|
|
|
|
|
TBasicDto tBasicDto = null;
|
|
|
|
|
try {
|
|
|
|
|
tBasicDto=getUpdateAdmissTBasicDto(message);
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicService.updateTBasic(tBasicDto);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return Result.failedMessage(tBasicDto.getSerialId(),e.getMessage(),tBasicDto.getReceive(),tBasicDto.getSend());
|
|
|
|
|
}
|
|
|
|
|
return Result.successMessage(tBasicDto.getSerialId(),tBasicDto.getReceive(),tBasicDto.getSend());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TBasicDto getNewTBasicDto(String str) {
|
|
|
|
|
XmlUtil xml=XmlUtil.of(str);
|
|
|
|
@ -423,5 +466,272 @@ public class BasicServiceImpl implements BasicService {
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TBasicDto getAdmissTBasicDto(String message) {
|
|
|
|
|
XmlUtil xml=XmlUtil.of(message);
|
|
|
|
|
//id-消息流水号
|
|
|
|
|
String serialId=null;
|
|
|
|
|
Node serialIdNode = xml.getNode("/PRPA_HIP1069/id/@extension");
|
|
|
|
|
if(Func.isNotEmpty(serialIdNode)){
|
|
|
|
|
serialId=serialIdNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//接受方
|
|
|
|
|
String receive=null;
|
|
|
|
|
Node receiveNode = xml.getNode("/PRPA_HIP1069/receiver/device/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(receiveNode)){
|
|
|
|
|
receive=receiveNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//发送方
|
|
|
|
|
String send=null;
|
|
|
|
|
Node sendNode = xml.getNode("/PRPA_HIP1069/sender/device/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(sendNode)){
|
|
|
|
|
send=sendNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院流水号*
|
|
|
|
|
String jzh=null;
|
|
|
|
|
Node jzhNode = xml.getNode("/PRPA_HIP1070/controlActProcess/encounterEvent/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(jzhNode)){
|
|
|
|
|
jzh=jzhNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院号标识
|
|
|
|
|
String inpatientNo=null;
|
|
|
|
|
Node inpatientNoNode = xml.getNode("/PRPA_HIP1070/controlActProcess/encounterEvent/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(inpatientNoNode)){
|
|
|
|
|
inpatientNo=inpatientNoNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院次数[]
|
|
|
|
|
String admissTimes=null;
|
|
|
|
|
Node admissTimesNode = xml.getNode("/PRPA_HIP1070/controlActProcess/encounterEvent/lengthOfStayQuantity/@value");
|
|
|
|
|
if(Func.isNotEmpty(admissTimesNode)){
|
|
|
|
|
admissTimes=admissTimesNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//姓名
|
|
|
|
|
String name=null;
|
|
|
|
|
Node nameNode = xml.getNode("/PRPA_HIP1070/controlActProcess/encounterEvent/subject/patient/patientPerson/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(nameNode)){
|
|
|
|
|
name=nameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//入院日期时间
|
|
|
|
|
String admissDate=null;
|
|
|
|
|
Node admissDateNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value");
|
|
|
|
|
if(Func.isNotEmpty(admissDateNode)){
|
|
|
|
|
admissDate=admissDateNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//入院诊断科室名称[]
|
|
|
|
|
String admissDeptName=null;
|
|
|
|
|
Node admissDeptNameNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/location1/serviceDeliveryLocation/location/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(admissDeptNameNode)){
|
|
|
|
|
admissDeptName=admissDeptNameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//主治医师[]
|
|
|
|
|
String attending=null;
|
|
|
|
|
Node attendingNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/execute/assignedEntity/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(attendingNode)){
|
|
|
|
|
attending=attendingNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
//主治医师名称[]
|
|
|
|
|
String attendingName=null;
|
|
|
|
|
Node attendingNameNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/execute/assignedEntity/assignedPerson/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(attendingNameNode)){
|
|
|
|
|
attendingName=attendingNameNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//身份证号
|
|
|
|
|
String idCard=null;
|
|
|
|
|
Node idCardNode = xml.getNode("/PRPA_HIP1070/controlActProcess/encounterEvent/subject/patient/patientPerson/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(idCardNode)){
|
|
|
|
|
idCard=idCardNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//入院科室
|
|
|
|
|
String admissDept=null;
|
|
|
|
|
Node admissDeptCardNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/location1/serviceDeliveryLocation/location/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(admissDeptCardNode)){
|
|
|
|
|
admissDept=admissDeptCardNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//床位号
|
|
|
|
|
String bedNum=null;
|
|
|
|
|
Node bedNumNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/location1/serviceDeliveryLocation/location/locatedEntityHasParts/locatedPlace/locatedEntityHasParts/locatedPlace/locatedEntityHasParts/locatedPlace/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(bedNumNode)){
|
|
|
|
|
bedNum=bedNumNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//病区编号
|
|
|
|
|
String wardCode=null;
|
|
|
|
|
Node wardCodeNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/location1/serviceDeliveryLocation/location/locatedEntityHasParts/locatedPlace/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(wardCodeNode)){
|
|
|
|
|
wardCode=wardCodeNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//病区名称
|
|
|
|
|
String wardName=null;
|
|
|
|
|
Node wardNameNode = xml.getNode("/PRPA_HIP1070/controlActProcess/subject/component/location1/serviceDeliveryLocation/location/locatedEntityHasParts/locatedPlace/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(wardNameNode)){
|
|
|
|
|
wardName=wardNameNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
//顺德人医第三方索引
|
|
|
|
|
// String sdryIndex=null;
|
|
|
|
|
// Node sdryIndexNode = xml.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/id/item/@extension");
|
|
|
|
|
// if(Func.isNotEmpty(sdryIndexNode)){
|
|
|
|
|
// sdryIndex=sdryIndexNode.getNodeValue();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//设置dto
|
|
|
|
|
TBasicDto dto=new TBasicDto();
|
|
|
|
|
dto.setSerialId(serialId);
|
|
|
|
|
dto.setSend(send);
|
|
|
|
|
dto.setReceive(receive);
|
|
|
|
|
dto.setInpatientNo(inpatientNo);
|
|
|
|
|
dto.setName(name);
|
|
|
|
|
dto.setJzh(jzh);
|
|
|
|
|
dto.setAdmissDept(admissDept);
|
|
|
|
|
dto.setAdmissDeptName(admissDeptName);
|
|
|
|
|
dto.setAdmissDate(admissDate);
|
|
|
|
|
dto.setAdmissTimes(admissTimes);
|
|
|
|
|
dto.setAttending(attending);
|
|
|
|
|
dto.setAttendingName(attendingName);
|
|
|
|
|
dto.setIdCard(idCard);
|
|
|
|
|
dto.setBedNum(bedNum);
|
|
|
|
|
dto.setWardCode(wardCode);
|
|
|
|
|
dto.setWardName(wardName);
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TBasicDto getUpdateAdmissTBasicDto(String str) {
|
|
|
|
|
XmlUtil xml=XmlUtil.of(str);
|
|
|
|
|
//id-消息流水号
|
|
|
|
|
String serialId=null;
|
|
|
|
|
Node serialIdNode = xml.getNode("/PRPA_HIP0027/id/@extension");
|
|
|
|
|
if(Func.isNotEmpty(serialIdNode)){
|
|
|
|
|
serialId=serialIdNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//接受方
|
|
|
|
|
String receive=null;
|
|
|
|
|
Node receiveNode = xml.getNode("/PRPA_HIP0027/receiver/device/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(receiveNode)){
|
|
|
|
|
receive=receiveNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//发送方
|
|
|
|
|
String send=null;
|
|
|
|
|
Node sendNode = xml.getNode("/PRPA_HIP0027/sender/device/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(sendNode)){
|
|
|
|
|
send=sendNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院流水号
|
|
|
|
|
String jzh=null;
|
|
|
|
|
Node jzhNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/id/item[1]/@extension");
|
|
|
|
|
if(Func.isNotEmpty(jzhNode)){
|
|
|
|
|
jzh=jzhNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院号标识
|
|
|
|
|
String inpatientNo=null;
|
|
|
|
|
Node inpatientNoNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/id/item[0]/@extension");
|
|
|
|
|
if(Func.isNotEmpty(inpatientNoNode)){
|
|
|
|
|
inpatientNo=inpatientNoNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院次数[]
|
|
|
|
|
String admissTimes=null;
|
|
|
|
|
Node admissTimesNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value");
|
|
|
|
|
if(Func.isNotEmpty(admissTimesNode)){
|
|
|
|
|
admissTimes=admissTimesNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//姓名
|
|
|
|
|
String name=null;
|
|
|
|
|
Node nameNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(nameNode)){
|
|
|
|
|
name=nameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//入院日期时间
|
|
|
|
|
String admissDate=null;
|
|
|
|
|
Node admissDateNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/effectiveTime/low/@value");
|
|
|
|
|
if(Func.isNotEmpty(admissDateNode)){
|
|
|
|
|
admissDate=admissDateNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//入院诊断科室名称[]
|
|
|
|
|
String admissDeptName=null;
|
|
|
|
|
Node admissDeptNameNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/location/serviceDeliveryLocation/location/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(admissDeptNameNode)){
|
|
|
|
|
admissDeptName=admissDeptNameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//入院诊断科室
|
|
|
|
|
String admissDept=null;
|
|
|
|
|
Node admissDeptNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/location/serviceDeliveryLocation/location/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(admissDeptNameNode)){
|
|
|
|
|
admissDept=admissDeptNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//主治医师[]
|
|
|
|
|
String attending=null;
|
|
|
|
|
Node attendingNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/authenticator/assignedEntity/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(attendingNode)){
|
|
|
|
|
attending=attendingNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//主治医师[]
|
|
|
|
|
String attendingName=null;
|
|
|
|
|
Node attendingNameNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/authenticator/assignedEntity/assignedPerson/name");
|
|
|
|
|
if(Func.isNotEmpty(attendingNameNode)){
|
|
|
|
|
attendingName=attendingNameNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
//年龄
|
|
|
|
|
String age=null;
|
|
|
|
|
Node ageNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/age/@value");
|
|
|
|
|
if(Func.isNotEmpty(ageNode)){
|
|
|
|
|
age=ageNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//性别
|
|
|
|
|
String sex=null;
|
|
|
|
|
Node sexNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/genderCode/@value");
|
|
|
|
|
if(Func.isNotEmpty(sexNode)){
|
|
|
|
|
sex=sexNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//身份证号
|
|
|
|
|
String idCard=null;
|
|
|
|
|
Node idCardNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(idCardNode)){
|
|
|
|
|
idCard=idCardNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//性别名称
|
|
|
|
|
String sexName=null;
|
|
|
|
|
Node sexNameNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/genderName/@value");
|
|
|
|
|
if(Func.isNotEmpty(sexNameNode)){
|
|
|
|
|
sexName=sexNameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//病区编号
|
|
|
|
|
String wardCode=null;
|
|
|
|
|
Node wardCodeNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/location/serviceDeliveryLocation/location/locatedEntityHasParts/locatedPlace/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(wardCodeNode)){
|
|
|
|
|
wardCode=wardCodeNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//病区名称
|
|
|
|
|
String wardName=null;
|
|
|
|
|
Node wardNameNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/location/serviceDeliveryLocation/location/locatedEntityHasParts/locatedPlace/name/item/part/@value");
|
|
|
|
|
if(Func.isNotEmpty(wardNameNode)){
|
|
|
|
|
wardName=wardNameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//顺德人医第三方索引
|
|
|
|
|
// String sdryIndex=null;
|
|
|
|
|
// Node sdryIndexNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/subject/patient/id/item/@extension");
|
|
|
|
|
// if(Func.isNotEmpty(sdryIndexNode)){
|
|
|
|
|
// sdryIndex=sdryIndexNode.getNodeValue();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//设置dto
|
|
|
|
|
TBasicDto dto=new TBasicDto();
|
|
|
|
|
dto.setSerialId(serialId);
|
|
|
|
|
dto.setSend(send);
|
|
|
|
|
dto.setReceive(receive);
|
|
|
|
|
dto.setInpatientNo(inpatientNo);
|
|
|
|
|
dto.setName(name);
|
|
|
|
|
dto.setJzh(jzh);
|
|
|
|
|
dto.setAdmissDept(admissDept);
|
|
|
|
|
dto.setAdmissDeptName(admissDeptName);
|
|
|
|
|
dto.setAdmissDate(admissDate);
|
|
|
|
|
dto.setAdmissTimes(admissTimes);
|
|
|
|
|
dto.setAttending(attending);
|
|
|
|
|
dto.setAttendingName(attendingName);
|
|
|
|
|
dto.setAge(age);
|
|
|
|
|
dto.setSex(sex);
|
|
|
|
|
dto.setIdCard(idCard);
|
|
|
|
|
dto.setSexName(sexName);
|
|
|
|
|
dto.setWardCode(wardCode);
|
|
|
|
|
dto.setWardName(wardName);
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|