更新取消住院操做,删除基础数据

3.2.4.44
宇宙皮皮娃 2 years ago
parent 5448ec84d4
commit a6c0ed7fb5

@ -37,4 +37,6 @@ public class TBasicDto {
private String wardCode;
private String wardName;
private String sdryIndex;
//入院状态 1更新 2删除
private String statu;
}

@ -94,4 +94,5 @@ public interface TBasicMapper{
*/
TBasic getByPatientId(@Param("patientId") String patientId);
int deleteByPatientId(@Param("patientId") String patientId);
}

@ -10,6 +10,7 @@ import com.docus.server.collection.entity.TBasic;
import com.docus.server.collection.entity.TBasicExtend;
import com.docus.server.collection.mapper.TBasicMapper;
import com.docus.server.collection.service.ITBasicService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -25,6 +26,7 @@ import java.util.Date;
* @Version: 1.0
*/
@Service
@Slf4j
public class TBasicServiceImpl implements ITBasicService {
@Resource
@ -205,6 +207,11 @@ public class TBasicServiceImpl implements ITBasicService {
if (Func.isEmpty(patientId)) {
throw new BaseException("数据不存在,更新失败");
}
if("2".equals(tBasicDto.getStatu())){
tBasicMapper.deleteByPatientId(patientId);
log.info("入院信息删除jzh:{},patientId:{},statusCode:{}",tBasicDto.getJzh(),patientId,tBasicDto.getStatu());
return;
}
//数据类型转化,格式处理
Date admissDate=null;
if(Func.isNotEmpty(tBasicDto.getAdmissDate())){

@ -710,6 +710,13 @@ public class BasicServiceImpl implements BasicService {
sdryIndex=sdryIndexNode.getNodeValue();
}
//入院日期时间
String statu=null;
Node statuNode = xml.getNode("/PRPA_HIP0027/controlActProcess/subject/encounterEvent/statusCode/@code");
if(Func.isNotEmpty(statuNode)){
statu=statuNode.getNodeValue();
}
//设置dto
TBasicDto dto=new TBasicDto();
dto.setSerialId(serialId);
@ -731,6 +738,7 @@ public class BasicServiceImpl implements BasicService {
dto.setWardCode(wardCode);
dto.setWardName(wardName);
dto.setSdryIndex(sdryIndex);
dto.setStatu(statu);
return dto;
}

@ -3,6 +3,10 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.collection.mapper.TBasicMapper">
<delete id="deleteByPatientId">
delete from `docus_medicalrecord`.`t_basic`
where `patient_id`=#{patientId};
</delete>
<select id="getPatientIdByInpatientNoAndAdminssTimes" resultType="java.lang.String">
select `patient_id`

Loading…
Cancel
Save