管床医生修改

广东省中医_gdszy
宇宙皮皮娃 1 year ago
parent d644c4a187
commit 77cb3b3029

@ -0,0 +1,26 @@
package com.docus.server.collection.dto;
import lombok.Data;
@Data
public class BedDoctorDto {
private String serialId;
private String receive;
private String send;
/**
*
*/
private String inpatientNo;
/**
*
*/
private Integer admissTimes;
/**
*
*/
private String bedDoctor;
/**
*
*/
private String bedDoctorName;
}

@ -30,6 +30,10 @@ public interface TBasicMapper {
String getPatientId(@Param("jzh") String jzh);
List<String> getPatientIds(@Param("inpatientNo") String inpatientNo,@Param("admissTimes") Integer admissTimes);
Integer setBedDoctor(@Param("patientIds") List<String> patientIds,@Param("bedDoctor") String bedDoctor,@Param("bedDoctorName") String bedDoctorName);
Integer insert(@Param("tBasic") TBasic tBasic);
Integer insertExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend);

@ -1,5 +1,6 @@
package com.docus.server.collection.service;
import com.docus.server.collection.dto.BedDoctorDto;
import com.docus.server.collection.dto.TBasicDto;
import com.docus.server.collection.entity.TBasic;
@ -13,6 +14,8 @@ public interface ITBasicService {
public void updateAdmissTBasic(TBasicDto dto) throws Exception;
public void setBedDoctor(BedDoctorDto dto) throws Exception;
/**
*
* @param babyPatientId

@ -5,6 +5,7 @@ import com.docus.core.util.DateUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.collection.dto.BedDoctorDto;
import com.docus.server.collection.dto.TBasicDto;
import com.docus.server.collection.entity.TBasic;
import com.docus.server.collection.entity.TBasicExtend;
@ -339,6 +340,33 @@ public class TBasicServiceImpl implements ITBasicService {
confirmAndUpdIcuRecordState(tBasic.getInpatientNo(), tBasic.getAdmissTimes());
}
@Override
public void setBedDoctor(BedDoctorDto dto) throws Exception {
String inpatientNo = dto.getInpatientNo();
Integer admissTimes = dto.getAdmissTimes();
String bedDoctor = dto.getBedDoctor();
String bedDoctorName = dto.getBedDoctorName();
if(Func.isEmpty(inpatientNo)){
throw new BaseException("病案号为空,更新失败");
}
if(Func.isEmpty(admissTimes)){
throw new BaseException("住院次数为空,更新失败");
}
if(Func.isEmpty(bedDoctor)){
throw new BaseException("管床医生工号为空,更新失败");
}
if(Func.isEmpty(bedDoctorName)){
throw new BaseException("管床医生姓名为空,更新失败");
}
//判断病案是否存在
List<String> patientIds = tBasicMapper.getPatientIds(inpatientNo,admissTimes);
if (Func.isEmpty(patientIds)) {
throw new BaseException("数据不存在,更新失败");
}
tBasicMapper.setBedDoctor(patientIds,bedDoctor,bedDoctorName);
log.info("主键{}管床医生更新成功",patientIds.toString());
}
@Override
public TBasic getSdRyParentPatientInfo(String babyPatientId) {

@ -23,4 +23,10 @@ public interface BasicService {
* @description
*/
public String updateAdmissTBasic(String message);
/**
* @description
*/
public String setBedDoctor(String message);
}

@ -31,6 +31,12 @@ public interface ReceiveServer {
*/
public String updateAdmissTBasic(String message);
/**
* @description
*/
public String setBedDoctor(String message);
/**
*
*

@ -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;
}
}

@ -56,6 +56,11 @@ public class ReceiveServerImpl implements ReceiveServer {
return basicService.updateAdmissTBasic(message) ;
}
@Override
public String setBedDoctor(String message) {
return basicService.setBedDoctor(message);
}
@Override
public String userModify(String receiveUser) {
return userServer.userModify(receiveUser);

@ -124,6 +124,14 @@
UPDATE `docus_medicalrecord`.`t_basic` set nurs_collect = #{state}
where patient_id=#{patientId}
</update>
<update id="setBedDoctor">
UPDATE `docus_medicalrecord`.`t_basic` set bed_doctor = #{bedDoctor},
bed_doctor_name = #{bedDoctorName}
where patient_id in
<foreach collection="patientIds" open="(" close=")" separator="," item="val">
#{val}
</foreach>
</update>
<select id="selectOne" resultType="java.lang.Integer">
select count(patient_id) from t_basic where jzh=#{jzh}
@ -243,5 +251,9 @@
`docus_medicalrecord`.`t_basic`
where inpatient_no=#{inpNo}
</select>
<select id="getPatientIds" resultType="java.lang.String">
select patient_id from t_basic
where inpatient_no=#{inpatientNo}
and admiss_times=#{admissTimes}
</select>
</mapper>

Loading…
Cancel
Save