|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
package com.docus.server.collection.webservice.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.core.util.ObjectUtil;
|
|
|
|
|
import com.docus.server.collection.dto.BedDoctorDto;
|
|
|
|
|
import com.docus.server.collection.dto.TBasicDto;
|
|
|
|
|
import com.docus.server.collection.service.ITBasicService;
|
|
|
|
|
import com.docus.server.collection.util.Result;
|
|
|
|
@ -111,7 +113,26 @@ public class BasicServiceImpl implements BasicService {
|
|
|
|
|
return Result.failed(tBasicDto.getSerialId(),e.getMessage(),tBasicDto.getReceive(),tBasicDto.getSend());
|
|
|
|
|
}
|
|
|
|
|
return Result.success(tBasicDto.getSerialId(),tBasicDto.getReceive(),tBasicDto.getSend());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String setBedDoctor(String message) {
|
|
|
|
|
log.info("设置管床医生数据:{}", message);
|
|
|
|
|
if (Func.isEmpty(message)) {
|
|
|
|
|
return Result.failed(null,"参数为空",null,null);
|
|
|
|
|
}
|
|
|
|
|
//解析xml
|
|
|
|
|
BedDoctorDto bedDoctorDto = null;
|
|
|
|
|
try {
|
|
|
|
|
bedDoctorDto=getBedDoctorDto(message);
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicService.setBedDoctor(bedDoctorDto);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return Result.failed(bedDoctorDto.getSerialId(),e.getMessage(),bedDoctorDto.getReceive(),bedDoctorDto.getSend());
|
|
|
|
|
}
|
|
|
|
|
return Result.success(bedDoctorDto.getSerialId(),bedDoctorDto.getReceive(),bedDoctorDto.getSend());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TBasicDto getNewTBasicDto(String str) {
|
|
|
|
@ -773,6 +794,64 @@ public class BasicServiceImpl implements BasicService {
|
|
|
|
|
}
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
public BedDoctorDto getBedDoctorDto(String str) {
|
|
|
|
|
XmlUtil xml=XmlUtil.of(str);
|
|
|
|
|
//id-消息流水号
|
|
|
|
|
String serialId=null;
|
|
|
|
|
Node serialIdNode = xml.getNode("/PRPA_HIP1233/id/@extension");
|
|
|
|
|
if(Func.isNotEmpty(serialIdNode)){
|
|
|
|
|
serialId=serialIdNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//接受方
|
|
|
|
|
String receive=null;
|
|
|
|
|
Node receiveNode = xml.getNode("/PRPA_HIP1233/receiver/device/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(receiveNode)){
|
|
|
|
|
receive=receiveNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//发送方
|
|
|
|
|
String send=null;
|
|
|
|
|
Node sendNode = xml.getNode("/PRPA_HIP1233/sender/device/id/item/@extension");
|
|
|
|
|
if(Func.isNotEmpty(sendNode)){
|
|
|
|
|
send=sendNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//病案号
|
|
|
|
|
String inpatientNo=null;
|
|
|
|
|
Node inpatientNoNode = xml.getNode("/PRPA_HIP1233/controlActProcess/ihNum/@value");
|
|
|
|
|
if(Func.isNotEmpty(serialIdNode)){
|
|
|
|
|
inpatientNo=inpatientNoNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//住院次数
|
|
|
|
|
Integer admissTimes=null;
|
|
|
|
|
Node admissTimesNode = xml.getNode("/PRPA_HIP1233/controlActProcess/ihTimes/@value");
|
|
|
|
|
if(Func.isNotEmpty(receiveNode)){
|
|
|
|
|
String nodeValue = admissTimesNode.getNodeValue();
|
|
|
|
|
if(ObjectUtil.isNotEmpty(nodeValue)&&NumberUtil.isInteger(nodeValue)){
|
|
|
|
|
admissTimes=Integer.parseInt(nodeValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//管床医生工号
|
|
|
|
|
String bedDoctor=null;
|
|
|
|
|
Node bedDoctorNode = xml.getNode("/PRPA_HIP1233/controlActProcess/referPhysician/@code");
|
|
|
|
|
if(Func.isNotEmpty(sendNode)){
|
|
|
|
|
bedDoctor=bedDoctorNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//管床医生姓名
|
|
|
|
|
String bedDoctorName=null;
|
|
|
|
|
Node bedDoctorNameNode = xml.getNode("/PRPA_HIP1233/controlActProcess/referPhysician/@value");
|
|
|
|
|
if(Func.isNotEmpty(sendNode)){
|
|
|
|
|
bedDoctorName=bedDoctorNameNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
//设置dto
|
|
|
|
|
BedDoctorDto dto=new BedDoctorDto();
|
|
|
|
|
dto.setSerialId(serialId);
|
|
|
|
|
dto.setSend(send);
|
|
|
|
|
dto.setReceive(receive);
|
|
|
|
|
dto.setInpatientNo(inpatientNo);
|
|
|
|
|
dto.setAdmissTimes(admissTimes);
|
|
|
|
|
dto.setBedDoctor(bedDoctor);
|
|
|
|
|
dto.setBedDoctorName(bedDoctorName);
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|