输血申请单保存业务,审核业务
This commit is contained in:
parent
67c19dd9a2
commit
4f00d8fa84
@ -28,4 +28,8 @@ public class BloodInterfaceTypeConstants {
|
||||
* 获取lis血型结果
|
||||
*/
|
||||
public static final String GET_TEST_RESULT_BLOOD_TYPE = "GET_TEST_RESULT_BLOOD_TYPE";
|
||||
/**
|
||||
* 申请单审核
|
||||
*/
|
||||
public static final String APPLY_CHECK = "APPLY_CHECK";
|
||||
}
|
||||
|
||||
@ -6,4 +6,5 @@ import java.util.List;
|
||||
|
||||
public interface XkCheckBloodtypeMapper {
|
||||
List<XkCheckBloodtype> queryList(XkCheckBloodtype xkCheckBloodtype);
|
||||
void insert(XkCheckBloodtype xkCheckBloodtype);
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
package com.czblood.bus.mapper;
|
||||
|
||||
import com.czblood.bus.pojo.XkSampleInfo;
|
||||
|
||||
public interface XkSampleInfoMapper {
|
||||
XkSampleInfo queryOne(String sampleNo);
|
||||
void insert(XkSampleInfo xkSampleInfo);
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.czblood.bus.pojo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -10,29 +11,53 @@ import java.util.Date;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class XkCheckBloodtype {
|
||||
@ApiModelProperty("单据编号")
|
||||
private String bill_no;
|
||||
@ApiModelProperty("申请单号")
|
||||
private String apply_no;
|
||||
@ApiModelProperty("住院号")
|
||||
private String beinhos_id;
|
||||
@ApiModelProperty("病人姓名")
|
||||
private String patient_name;
|
||||
@ApiModelProperty("科室编号")
|
||||
private String dept_id;
|
||||
@ApiModelProperty("ABO正定")
|
||||
private String check_abo;
|
||||
@ApiModelProperty("ABO反定")
|
||||
private String check_fabo;
|
||||
@ApiModelProperty("ABO最终结论")
|
||||
private String affirm_abo;
|
||||
@ApiModelProperty("RH复检")
|
||||
private String check_rh;
|
||||
@ApiModelProperty("抗体筛查I")
|
||||
private String antibody1;
|
||||
@ApiModelProperty("抗体筛查II")
|
||||
private String antibody2;
|
||||
@ApiModelProperty("抗体筛查III")
|
||||
private String antibody3;
|
||||
@ApiModelProperty("抗体筛查最终结论")
|
||||
private String affirm_antibody;
|
||||
@ApiModelProperty("抗人球蛋白实验")
|
||||
private String proteid_test;
|
||||
@ApiModelProperty("检测人")
|
||||
private String test_person;
|
||||
@ApiModelProperty("检测时间")
|
||||
private Date test_date;
|
||||
@ApiModelProperty("审核人")
|
||||
private String check_person;
|
||||
@ApiModelProperty("录入人")
|
||||
private String input_person;
|
||||
@ApiModelProperty("录入时间")
|
||||
private Date input_date;
|
||||
@ApiModelProperty("样本编号")
|
||||
private String sample_id;
|
||||
@ApiModelProperty("是否配血")
|
||||
private String need_match;
|
||||
@ApiModelProperty("单据类别")
|
||||
private String bill_sort;
|
||||
@ApiModelProperty("单据状态")
|
||||
private String bill_status;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
private String Sub_Blood;
|
||||
private String bz1;
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
package com.czblood.bus.pojo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Api(tags = "样本信息")
|
||||
public class XkSampleInfo {
|
||||
@ApiModelProperty("样本号")
|
||||
private String Sample_No;
|
||||
@ApiModelProperty("标本用途")
|
||||
private String Purpose;
|
||||
@ApiModelProperty("申请科室")
|
||||
private String Dept;
|
||||
@ApiModelProperty("关联申请单号")
|
||||
private String Relate_ApplyNo;
|
||||
@ApiModelProperty("血型")
|
||||
private String Blood_Type;
|
||||
@ApiModelProperty("RH血型")
|
||||
private String Rh_Blood_Type;
|
||||
@ApiModelProperty("姓名")
|
||||
private String Sample_Name;
|
||||
private String Sex;
|
||||
private String Age;
|
||||
private Date Birthday;
|
||||
@ApiModelProperty("采集护士")
|
||||
private String Pick_Nurse;
|
||||
@ApiModelProperty("采集时间")
|
||||
private Date Pick_Date;
|
||||
@ApiModelProperty("送标本护士")
|
||||
private String Send_Nurse;
|
||||
@ApiModelProperty("送标本时间")
|
||||
private Date Send_Date;
|
||||
@ApiModelProperty("接收人")
|
||||
private String TakeOver_Man;
|
||||
@ApiModelProperty("接收时间")
|
||||
private Date TakeOver_Date;
|
||||
@ApiModelProperty("过期标志")
|
||||
private String Overdue_Flag;
|
||||
private String Exp1;
|
||||
private String Exp2;
|
||||
@ApiModelProperty("样本状态")
|
||||
private String sample_status;
|
||||
@ApiModelProperty("作废人")
|
||||
private String discard_person;
|
||||
@ApiModelProperty("作废时间")
|
||||
private Date discard_date;
|
||||
@ApiModelProperty("作废原因")
|
||||
private String discard_reason;
|
||||
@ApiModelProperty("发送时间")
|
||||
private Date senddate;
|
||||
@ApiModelProperty("发送人")
|
||||
private String sendperson;
|
||||
private Date createtime;
|
||||
}
|
||||
@ -121,7 +121,7 @@ public class XkTransfuseApply {
|
||||
private Date last_modified;
|
||||
@ApiModelProperty("通知标志")
|
||||
private String notify_sign;
|
||||
@ApiModelProperty("联系手机")
|
||||
@ApiModelProperty("就诊号")
|
||||
private String adm_no;
|
||||
private BigDecimal Use1_Num;
|
||||
private BigDecimal Use2_Num;
|
||||
@ -150,4 +150,6 @@ public class XkTransfuseApply {
|
||||
private String card_no;
|
||||
@ApiModelProperty("是否需要做血型复核(A,B需要,C申请单无交叉配血需求时不做血型复查)")
|
||||
private String need_check;
|
||||
@ApiModelProperty("是否需要血型复核,生成条码标志(1=是,0=否)")
|
||||
private String isxxfh;
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.czblood.bus.pojo.inter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czblood.bus.constants.BloodInterfaceTypeConstants;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ApplyCheckRequest implements BloodInterfaceType {
|
||||
private final String method = BloodInterfaceTypeConstants.APPLY_CHECK;
|
||||
private String billNo;
|
||||
|
||||
@Override
|
||||
public String serializationJson() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
@ -72,16 +72,16 @@ public class BloodBankUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public XkDmzd getDictCacheOneByName(String dictType,String dictName){
|
||||
List<XkDmzd> dictCache = getDictCache(dictType);
|
||||
if(dictCache == null || dictCache.isEmpty()) return null;
|
||||
List<XkDmzd> collect = dictCache.stream().filter(xkDmzd -> xkDmzd.getWordbook_name().equals(dictName)).collect(Collectors.toList());
|
||||
if(collect.size() > 0) {
|
||||
return collect.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// public XkDmzd getDictCacheOneByName(String dictType,String dictName){
|
||||
// List<XkDmzd> dictCache = getDictCache(dictType);
|
||||
// if(dictCache == null || dictCache.isEmpty()) return null;
|
||||
// List<XkDmzd> collect = dictCache.stream().filter(xkDmzd -> xkDmzd.getWordbook_name().equals(dictName)).collect(Collectors.toList());
|
||||
// if(collect.size() > 0) {
|
||||
// return collect.get(0);
|
||||
// }else{
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -2,6 +2,48 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.czblood.bus.mapper.XkCheckBloodtypeMapper">
|
||||
<insert id="insert">
|
||||
insert into xk_check_bloodtype (
|
||||
<if test="check_rh != null">check_rh,</if>
|
||||
<if test="antibody1 != null">antibody1,</if>
|
||||
<if test="antibody2 != null">antibody2,</if>
|
||||
<if test="antibody3 != null">antibody3,</if>
|
||||
<if test="affirm_antibody != null">affirm_antibody,</if>
|
||||
<if test="proteid_test != null">proteid_test,</if>
|
||||
<if test="test_person != null">test_person,</if>
|
||||
<if test="test_date != null">test_date,</if>
|
||||
<if test="check_person != null">check_person,</if>
|
||||
<if test="input_person != null">input_person,</if>
|
||||
<if test="input_date != null">input_date,</if>
|
||||
<if test="sample_id != null">sample_id,</if>
|
||||
<if test="need_match != null">need_match,</if>
|
||||
<if test="bill_sort != null">bill_sort,</if>
|
||||
<if test="bill_status != null">bill_status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="Sub_Blood != null">Sub_Blood,</if>
|
||||
<if test="bz1 != null">bz1,</if>
|
||||
hos_id,bill_no,apply_no,beinhos_id,patient_name,dept_id,check_abo,check_fabo,affirm_abo
|
||||
)values (
|
||||
<if test="check_rh != null">#{check_rh},</if>
|
||||
<if test="antibody1 != null">#{antibody1},</if>
|
||||
<if test="antibody2 != null">#{antibody2},</if>
|
||||
<if test="antibody3 != null">#{antibody3},</if>
|
||||
<if test="affirm_antibody != null">#{affirm_antibody},</if>
|
||||
<if test="proteid_test != null">#{proteid_test},</if>
|
||||
<if test="test_person != null">#{test_person},</if>
|
||||
<if test="test_date != null">#{test_date},</if>
|
||||
<if test="check_person != null">#{check_person},</if>
|
||||
<if test="input_person != null">#{input_person},</if>
|
||||
<if test="input_date != null">#{input_date},</if>
|
||||
<if test="sample_id != null">#{sample_id},</if>
|
||||
<if test="need_match != null">#{need_match},</if>
|
||||
<if test="bill_sort != null">#{bill_sort},</if>
|
||||
<if test="bill_status != null">#{bill_status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="Sub_Blood != null">#{Sub_Blood},</if>
|
||||
<if test="bz1 != null">#{bz1},</if>
|
||||
#{hos_id},#{bill_no},#{apply_no},#{beinhos_id},#{patient_name},#{dept_id},#{check_abo},#{check_fabo},#{affirm_abo})
|
||||
</insert>
|
||||
|
||||
<select id="queryList" resultType="com.czblood.bus.pojo.XkCheckBloodtype">
|
||||
select * from xk_check_bloodtype where hos_id = #{hos_id}
|
||||
|
||||
64
blood_bus/src/main/resources/mapper/XkSampleInfoMapper.xml
Normal file
64
blood_bus/src/main/resources/mapper/XkSampleInfoMapper.xml
Normal file
@ -0,0 +1,64 @@
|
||||
<?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.czblood.bus.mapper.XkSampleInfoMapper">
|
||||
<insert id="insert">
|
||||
insert into xk_sample_info(
|
||||
<if test="Purpose != null ">Purpose,</if>
|
||||
<if test="Dept != null ">Dept,</if>
|
||||
<if test="Relate_ApplyNo != null ">Relate_ApplyNo,</if>
|
||||
<if test="Blood_Type != null ">Blood_Type,</if>
|
||||
<if test="Rh_Blood_Type != null ">Rh_Blood_Type,</if>
|
||||
<if test="Sample_Name != null ">Sample_Name,</if>
|
||||
<if test="Sex != null ">Sex,</if>
|
||||
<if test="Age != null ">Age,</if>
|
||||
<if test="Birthday != null ">Birthday,</if>
|
||||
<if test="Pick_Nurse != null ">Pick_Nurse,</if>
|
||||
<if test="Pick_Date != null ">Pick_Date,</if>
|
||||
<if test="Send_Nurse != null ">Send_Nurse,</if>
|
||||
<if test="Send_Date != null ">Send_Date,</if>
|
||||
<if test="TakeOver_Man != null ">TakeOver_Man,</if>
|
||||
<if test="TakeOver_Date != null ">TakeOver_Date,</if>
|
||||
<if test="Overdue_Flag != null ">Overdue_Flag,</if>
|
||||
<if test="Exp1 != null ">Exp1,</if>
|
||||
<if test="Exp2 != null ">Exp2,</if>
|
||||
<if test="sample_status != null ">sample_status,</if>
|
||||
<if test="discard_person != null ">discard_person,</if>
|
||||
<if test="discard_date != null ">discard_date,</if>
|
||||
<if test="discard_reason != null ">discard_reason,</if>
|
||||
<if test="senddate != null ">senddate,</if>
|
||||
<if test="sendperson != null ">sendperson,</if>
|
||||
<if test="createtime != null ">createtime,</if>
|
||||
Sample_No
|
||||
)values(
|
||||
<if test="Purpose != null ">#{Purpose},</if>
|
||||
<if test="Dept != null ">#{Dept},</if>
|
||||
<if test="Relate_ApplyNo != null ">#{Relate_ApplyNo},</if>
|
||||
<if test="Blood_Type != null ">#{Blood_Type},</if>
|
||||
<if test="Rh_Blood_Type != null ">#{Rh_Blood_Type},</if>
|
||||
<if test="Sample_Name != null ">#{Sample_Name},</if>
|
||||
<if test="Sex != null ">#{Sex},</if>
|
||||
<if test="Age != null ">#{Age},</if>
|
||||
<if test="Birthday != null ">#{Birthday},</if>
|
||||
<if test="Pick_Nurse != null ">#{Pick_Nurse},</if>
|
||||
<if test="Pick_Date != null ">#{Pick_Date},</if>
|
||||
<if test="Send_Nurse != null ">#{Send_Nurse},</if>
|
||||
<if test="Send_Date != null ">#{Send_Date},</if>
|
||||
<if test="TakeOver_Man != null ">#{TakeOver_Man},</if>
|
||||
<if test="TakeOver_Date != null ">#{TakeOver_Date},</if>
|
||||
<if test="Overdue_Flag != null ">#{Overdue_Flag},</if>
|
||||
<if test="Exp1 != null ">#{Exp1},</if>
|
||||
<if test="Exp2 != null ">#{Exp2},</if>
|
||||
<if test="sample_status != null ">#{sample_status},</if>
|
||||
<if test="discard_person != null ">#{discard_person},</if>
|
||||
<if test="discard_date != null ">#{discard_date},</if>
|
||||
<if test="discard_reason != null ">#{discard_reason},</if>
|
||||
<if test="senddate != null ">#{senddate},</if>
|
||||
<if test="sendperson != null ">#{sendperson},</if>
|
||||
<if test="createtime != null ">#{createtime},</if>
|
||||
#{Sample_No})
|
||||
</insert>
|
||||
<select id="queryOne" resultType="com.czblood.bus.pojo.XkSampleInfo">
|
||||
select * from xk_sample_info where Sample_No = #{Sample_No}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -126,10 +126,11 @@ public class TransfuseApplyController extends BaseController {
|
||||
return transfuseApplyService.applyPreCheck(applyCheckVO);
|
||||
}
|
||||
|
||||
@ApiOperation("申请单审核结果填写")
|
||||
@PostMapping("/checkExplain")
|
||||
public Result checkExplain(ExplainVO explainVO){
|
||||
return transfuseApplyService.checkExplain(explainVO);
|
||||
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.UNCHECK_MEDIC)
|
||||
@ApiOperation("取消上级医生审核")
|
||||
@PostMapping("/cancelApplyMedicCheck")
|
||||
public Result cancelApplyMedicCheck(CheckMedicVO checkMedicVO){
|
||||
return transfuseApplyService.cancelApplyMedicCheck(checkMedicVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package com.czblood.busDoctor.controller;
|
||||
|
||||
import com.czblood.bus.constants.BloodSysLogConstants;
|
||||
import com.czblood.busDoctor.pojo.VO.ExplainVO;
|
||||
import com.czblood.busDoctor.service.TransfuseCheckExplainService;
|
||||
import com.czblood.common.annotation.Log;
|
||||
import com.czblood.common.core.controller.BaseController;
|
||||
import com.czblood.common.core.domain.Result;
|
||||
import com.czblood.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -18,7 +22,7 @@ import javax.annotation.Resource;
|
||||
@RestController
|
||||
@RequestMapping("/bus/doctor/checkExplain")
|
||||
@Slf4j
|
||||
public class TransfuseCheckExplainController {
|
||||
public class TransfuseCheckExplainController extends BaseController {
|
||||
|
||||
@Resource
|
||||
TransfuseCheckExplainService transfuseCheckExplainService;
|
||||
@ -29,9 +33,11 @@ public class TransfuseCheckExplainController {
|
||||
return transfuseCheckExplainService.queryCausailsList(billNo);
|
||||
}
|
||||
|
||||
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.CHECK)
|
||||
@ApiOperation("审核意见")
|
||||
@PostMapping("/checkExplain")
|
||||
public Result checkExplain(ExplainVO explainVO){
|
||||
explainVO.setUserId(getUsername());
|
||||
return transfuseCheckExplainService.checkExplain(explainVO);
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
package com.czblood.busDoctor.mapper;
|
||||
|
||||
import com.czblood.bus.pojo.XkCheckBloodtype;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface TransfuseCheckExplainMapper {
|
||||
XkCheckBloodtype queryCheckDate(String beinhos_id);
|
||||
XkCheckBloodtype queryTopOne(String beinhos_id);
|
||||
List<Map<String,Object>> querySampleData(@Param("billNo") String billNo, @Param("stime") String stime, @Param("etime") String etime);
|
||||
}
|
||||
|
||||
@ -23,4 +23,5 @@ public class ExplainVO {
|
||||
private String checkDateText;
|
||||
@ApiModelProperty("申请单类别")
|
||||
private String billSort;
|
||||
private String userId;
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ public interface TransfuseApplyService {
|
||||
|
||||
Result applyPreCheck(ApplyCheckVO applyCheckVO);
|
||||
|
||||
Result checkExplain(ExplainVO explainVO);
|
||||
Result cancelApplyMedicCheck(CheckMedicVO checkMedicVO);
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
|
||||
}
|
||||
XkDmzd dictCacheOne = bloodBankUtil.getDictCacheOne("sqlx", applyType);
|
||||
//没有开启绿色通道的单据类型
|
||||
if(!dictCacheOne.getExp2().equals("Y")){
|
||||
if(!BloodBankUtil.isBank(dictCacheOne.getExp2()).equals("Y")){
|
||||
String sfsyzckz = BloodBankUtil.isBank(bloodBankUtil.getParameterValue("SFSYZCKZ"));
|
||||
//开启职称校验
|
||||
if(sfsyzckz.equals("Y")){
|
||||
@ -246,7 +246,7 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return new Result("0","校验成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -285,7 +285,8 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
|
||||
XkTransfuseApplyApproval xkTransfuseApplyApproval = (XkTransfuseApplyApproval) result.getData();
|
||||
|
||||
//设置相关值,准备数据
|
||||
String billType = xkTransfuseApply.getBill_type();
|
||||
String billType = BloodBankUtil.isBank(xkTransfuseApply.getBill_type());
|
||||
|
||||
if(billType.equals("补单")) xkTransfuseApply.setBill_stasus("BD");
|
||||
/**
|
||||
* 大量用血标志,以前是有参数控制来判断值,但是以前是一个申请单只有一个血液品种,现在是有多个,
|
||||
@ -314,14 +315,14 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
|
||||
}
|
||||
//输血指征信息
|
||||
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
|
||||
if(!xkTransfuseApplyCausalisList.isEmpty()){
|
||||
if(xkTransfuseApplyCausalisList != null && !xkTransfuseApplyCausalisList.isEmpty()){
|
||||
for (XkTransfuseApplyCausalis xkTransfuseApplyCausalis : xkTransfuseApplyCausalisList) {
|
||||
xkTransfuseApplyCausalis.setBill_No(newBillNo);
|
||||
}
|
||||
}
|
||||
//检验项目明细
|
||||
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
|
||||
if(!xkTransfuseApplyTestitemList.isEmpty()){
|
||||
if(xkTransfuseApplyTestitemList != null &&!xkTransfuseApplyTestitemList.isEmpty()){
|
||||
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
|
||||
xkTransfuseApplyTestitem.setBill_no(newBillNo);
|
||||
}
|
||||
@ -430,12 +431,15 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
|
||||
/**
|
||||
* 下面是输血科审核的逻辑
|
||||
*/
|
||||
//判断上级医生是否审核
|
||||
String checkMedic = xkTransfuseApply.getCheck_medic();
|
||||
if(checkMedic == null || checkMedic.equals("")) return new Result("-1","请先进行上级医生审核!");
|
||||
String applyType = xkTransfuseApply.getApply_type();
|
||||
XkDmzd sqlxDictOne = bloodBankUtil.getDictCacheOne("sqlx", applyType);
|
||||
String exp2 = BloodBankUtil.isBank(sqlxDictOne.getExp2());
|
||||
//是否使用用血审批控制
|
||||
String sfsyyxsp = bloodBankUtil.getParameterValue("SFSYYXSP");
|
||||
//不是抢救用血的类型,就需要判断是否是大量用血的标准,\
|
||||
//不是抢救用血的类型,就需要判断是否是大量用血的标准,
|
||||
if(!exp2.equals("Y") && !sfsyyxsp.equals("Y")){
|
||||
if(xkTransfuseApplyApproval != null){
|
||||
String applyLevel = xkTransfuseApplyApproval.getApplyLevel();
|
||||
@ -511,10 +515,18 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result checkExplain(ExplainVO explainVO) {
|
||||
return null;
|
||||
public Result cancelApplyMedicCheck(CheckMedicVO checkMedicVO) {
|
||||
String billNo = checkMedicVO.getBillNo();
|
||||
if(StringUtils.isEmpty(billNo)) return new Result("-1","申请单号不能为空!");
|
||||
XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
|
||||
xkTransfuseApply.setCheck_medic("");
|
||||
xkTransfuseApply.setMedic_check_date(DateUtil.parse("1900-01-01 00:00:00","yyyy-MM-dd HH:mm:ss"));
|
||||
xkTransfuseApply.setBill_no(billNo);
|
||||
xkTransfuseApplyMapper.update(xkTransfuseApply);
|
||||
return new Result("0","取消上级医生审核成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验医生职称是否符合要求
|
||||
* @return
|
||||
|
||||
@ -1,10 +1,17 @@
|
||||
package com.czblood.busDoctor.service.impl;
|
||||
|
||||
import com.czblood.bus.mapper.XkTransfuseApplyCausalisMapper;
|
||||
import com.czblood.bus.mapper.XkTransfuseApplyMapper;
|
||||
import com.czblood.bus.pojo.XkCheckBloodtype;
|
||||
import com.czblood.bus.pojo.XkTransfuseApply;
|
||||
import com.czblood.bus.pojo.XkTransfuseApplyCausalis;
|
||||
import com.czblood.bus.pojo.inter.ApplyCheckRequest;
|
||||
import com.czblood.bus.pojo.xtwh.XkDmzd;
|
||||
import com.czblood.bus.utils.BloodBankUtil;
|
||||
import com.czblood.bus.utils.BloodInterfaceUtil;
|
||||
import com.czblood.busDoctor.pojo.VO.ExplainVO;
|
||||
import com.czblood.busDoctor.service.TransfuseCheckExplainService;
|
||||
import com.czblood.busDoctor.utils.TransfuseCheckExplainUtil;
|
||||
import com.czblood.common.core.domain.Result;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -20,7 +27,10 @@ public class TransfuseCheckExplainServiceImpl implements TransfuseCheckExplainSe
|
||||
XkTransfuseApplyCausalisMapper xkTransfuseApplyCausalisMapper;
|
||||
@Resource
|
||||
BloodBankUtil bloodBankUtil;
|
||||
|
||||
@Resource
|
||||
XkTransfuseApplyMapper xkTransfuseApplyMapper;
|
||||
@Resource
|
||||
TransfuseCheckExplainUtil transfuseCheckExplainUtil;
|
||||
|
||||
@Override
|
||||
public Result queryCausailsList(String billNo) {
|
||||
@ -46,16 +56,74 @@ public class TransfuseCheckExplainServiceImpl implements TransfuseCheckExplainSe
|
||||
billSortTemp = "D";
|
||||
}
|
||||
}
|
||||
//条码是否在输血审核的时候生成
|
||||
String tmsfzsxshsc = bloodBankUtil.getParameterValue("TMSFZSXSHSC");
|
||||
String ixxfh = "";
|
||||
String isxxfh = "";
|
||||
if (tmsfzsxshsc.equals("Y")) {
|
||||
if(needCheck.equals("Y")){
|
||||
ixxfh = "1";
|
||||
isxxfh = "1";
|
||||
}else{
|
||||
ixxfh = "0";
|
||||
isxxfh = "0";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
String applyNo = explainVO.getApplyNo();
|
||||
XkTransfuseApply xkTransfuseApply = xkTransfuseApplyMapper.queryOne(applyNo);
|
||||
if(xkTransfuseApply == null) return new Result("-1","没有查询到申请单信息!");
|
||||
XkDmzd sqdshyjDmzd = bloodBankUtil.getDictCacheOne("sqdshyj", explainVO.getCheckResult());
|
||||
String pass = BloodBankUtil.isBank(sqdshyjDmzd.getExp1());
|
||||
String billType = BloodBankUtil.isBank(xkTransfuseApply.getBill_type());
|
||||
//List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = xkTransfuseApplyBloodbreedMapper.queryOne(applyNo);
|
||||
//String billSort1 = transfuseApplyUtil.checkBillSort(xkTransfuseApplyBloodbreedList, xkTransfuseApply1.getBeinhos_id());
|
||||
String billStatus = "";
|
||||
XkCheckBloodtype xkCheckBloodtype = null;
|
||||
String sqxjcpxtm = bloodBankUtil.getParameterValue("SQXJCPXTM"); //申请单始终生成配血条码
|
||||
if(billType.equals("正常") || billType.isEmpty()){
|
||||
if(pass.equals("Y")){
|
||||
if(billSortTemp.equals("D")){
|
||||
//生成不进行血型复核的数据
|
||||
Result result = transfuseCheckExplainUtil.dealMatchNotCheck(xkTransfuseApply);
|
||||
if(!result.getCode().equals("0")) return result;
|
||||
billStatus = "F";
|
||||
if(sqxjcpxtm.equals("Y")) billStatus = "B";
|
||||
xkCheckBloodtype = (XkCheckBloodtype) result.getData();
|
||||
}else{
|
||||
billStatus = "B";
|
||||
}
|
||||
}else{
|
||||
billStatus = "N";
|
||||
}
|
||||
}else if(billType.equals("补单")){
|
||||
billStatus = "BD";
|
||||
}
|
||||
if(billSortTemp.equals("D")) billSortTemp = "B";
|
||||
|
||||
|
||||
//写修改申请单,血型复核数据,生成条码逻辑
|
||||
XkTransfuseApply xkTransfuseApplyTemp = new XkTransfuseApply();
|
||||
xkTransfuseApplyTemp.setBill_no(explainVO.getApplyNo());
|
||||
xkTransfuseApplyTemp.setCheck_explain(explainVO.getCheckResult());
|
||||
xkTransfuseApplyTemp.setRemark(explainVO.getCheckExplain());
|
||||
xkTransfuseApplyTemp.setValid_Flag(explainVO.getValidFlag());
|
||||
xkTransfuseApplyTemp.setReceive_date(xkTransfuseApply.getReceive_date());
|
||||
xkTransfuseApplyTemp.setGather_date(xkTransfuseApply.getGather_date());
|
||||
xkTransfuseApplyTemp.setBill_stasus(billStatus);
|
||||
xkTransfuseApplyTemp.setCheck_sign("Y");
|
||||
xkTransfuseApplyTemp.setBank_director(xkTransfuseApply.getBank_director());
|
||||
xkTransfuseApplyTemp.setMedical_affairs(xkTransfuseApply.getMedical_affairs());
|
||||
xkTransfuseApplyTemp.setBill_sort(billSortTemp);
|
||||
xkTransfuseApplyTemp.setNotify_sign("Y");
|
||||
xkTransfuseApplyTemp.setExp3(explainVO.getUserId());
|
||||
xkTransfuseApplyTemp.setIsxxfh(isxxfh);
|
||||
transfuseCheckExplainUtil.updateApplyStatus(xkTransfuseApplyTemp,xkCheckBloodtype);
|
||||
//保存条码数据
|
||||
Result result = transfuseCheckExplainUtil.createSampleData(applyNo);
|
||||
if(!result.getCode().equals("0")) return result;
|
||||
|
||||
//调用外部接口
|
||||
ApplyCheckRequest applyCheckRequest = new ApplyCheckRequest();
|
||||
applyCheckRequest.setBillNo(applyNo);
|
||||
BloodInterfaceUtil.invokeBloodInterface(applyCheckRequest);
|
||||
return new Result("0","审核成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -9,9 +9,11 @@ import com.czblood.bus.pojo.xtwh.XkBloodBreed;
|
||||
import com.czblood.bus.pojo.xtwh.XkDmzd;
|
||||
import com.czblood.bus.utils.BloodBankUtil;
|
||||
import com.czblood.busDoctor.mapper.TransfuseApplyMapper;
|
||||
import com.czblood.busDoctor.mapper.TransfuseCheckExplainMapper;
|
||||
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
|
||||
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
|
||||
import com.czblood.busDoctor.pojo.DTO.XkTransfuseApplyCausalisDTO;
|
||||
import com.czblood.busDoctor.pojo.VO.ExplainVO;
|
||||
import com.czblood.common.core.domain.Result;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -54,8 +56,8 @@ public class TransfuseApplyUtil {
|
||||
String beinhosId = xkTransfuseApply.getBeinhos_id();
|
||||
String billNo = xkTransfuseApply.getBill_no();
|
||||
String applyType = xkTransfuseApply.getApply_type();
|
||||
XkDmzd sqlxDmzd = bloodBankUtil.getDictCacheOneByName("sqlx", applyType);
|
||||
String exp2 = sqlxDmzd.getExp2(); //是否是抢救用血
|
||||
XkDmzd sqlxDmzd = bloodBankUtil.getDictCacheOne("sqlx", applyType);
|
||||
String exp2 = BloodBankUtil.isBank(sqlxDmzd.getExp2()); //是否是抢救用血
|
||||
String applyLev = ""; //大量用血等级
|
||||
String flag = ""; //通过标志
|
||||
String msg = "";
|
||||
@ -69,8 +71,8 @@ public class TransfuseApplyUtil {
|
||||
String bloodBreed = xkTransfuseApplyBloodbreed.getBlood_breed();
|
||||
BigDecimal bloodNum = xkTransfuseApplyBloodbreed.getBlood_num();
|
||||
XkBloodBreed xkBloodBreed = xkBloodBreedMapper.queryOne(bloodBreed);
|
||||
XkDmzd xylxDmzd = bloodBankUtil.getDictCacheOneByName("xylx", xkBloodBreed.getBlood_kind());
|
||||
String exp1 = xylxDmzd.getExp1(); //是否参与大量用血计算
|
||||
XkDmzd xylxDmzd = bloodBankUtil.getDictCacheOne("xylx", xkBloodBreed.getBlood_kind());
|
||||
String exp1 = BloodBankUtil.isBank(xylxDmzd.getExp1()); //是否参与大量用血计算
|
||||
if(!BloodBankUtil.isBank(exp1).equals("Y")) continue;
|
||||
BigDecimal applyTransNum = bloodBankUtil.getApplyTransNum(bloodBreed,bloodNum);
|
||||
totalApplyNum = totalApplyNum.add(applyTransNum);
|
||||
@ -81,6 +83,7 @@ public class TransfuseApplyUtil {
|
||||
DateTime yesterday = DateUtil.offsetDay(currentTimeDate, -1);
|
||||
//其中不包含了当前申请单的输血量
|
||||
BigDecimal beforeNum = transfuseApplyMapper.queryApplyTransTotalNum(beinhosId, yesterday, currentTimeDate, bloodKindList,billNo);
|
||||
if(beforeNum == null) beforeNum = BigDecimal.ZERO;
|
||||
//大量用血判断
|
||||
BigDecimal largeBloodNum = totalApplyNum.add(beforeNum).abs();
|
||||
if(largeBloodNum.compareTo(new BigDecimal(800)) < 0){
|
||||
|
||||
@ -0,0 +1,133 @@
|
||||
package com.czblood.busDoctor.utils;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czblood.bus.mapper.XkCheckBloodtypeMapper;
|
||||
import com.czblood.bus.mapper.XkPatientInfoMapper;
|
||||
import com.czblood.bus.mapper.XkSampleInfoMapper;
|
||||
import com.czblood.bus.mapper.XkTransfuseApplyMapper;
|
||||
import com.czblood.bus.pojo.XkCheckBloodtype;
|
||||
import com.czblood.bus.pojo.XkPatientInfo;
|
||||
import com.czblood.bus.pojo.XkSampleInfo;
|
||||
import com.czblood.bus.pojo.XkTransfuseApply;
|
||||
import com.czblood.bus.utils.BloodBankUtil;
|
||||
import com.czblood.busDoctor.mapper.TransfuseCheckExplainMapper;
|
||||
import com.czblood.common.core.domain.Result;
|
||||
import com.czblood.common.utils.StringUtils;
|
||||
import com.czblood.common.utils.spring.SpringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class TransfuseCheckExplainUtil {
|
||||
|
||||
|
||||
@Resource
|
||||
BloodBankUtil bloodBankUtil;
|
||||
@Resource
|
||||
TransfuseCheckExplainMapper transfuseCheckExplainMapper;
|
||||
@Resource
|
||||
XkTransfuseApplyMapper xkTransfuseApplyMapper;
|
||||
@Resource
|
||||
XkCheckBloodtypeMapper xkCheckBloodtypeMapper;
|
||||
@Resource
|
||||
XkPatientInfoMapper xkPatientInfoMapper;
|
||||
@Resource
|
||||
XkSampleInfoMapper xkSampleInfoMapper;
|
||||
|
||||
@Transactional
|
||||
public void updateApplyStatus(XkTransfuseApply xkTransfuseApply,XkCheckBloodtype xkCheckBloodtype){
|
||||
xkTransfuseApplyMapper.update(xkTransfuseApply);
|
||||
if(xkCheckBloodtype != null){
|
||||
xkCheckBloodtypeMapper.insert(xkCheckBloodtype);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 产生不进行血型复核的数据
|
||||
* @param xkTransfuseApply
|
||||
* @return
|
||||
*/
|
||||
public Result dealMatchNotCheck(XkTransfuseApply xkTransfuseApply) {
|
||||
String beinhosId = xkTransfuseApply.getBeinhos_id();
|
||||
XkCheckBloodtype xkCheckBloodtype = transfuseCheckExplainMapper.queryTopOne(beinhosId);
|
||||
if(xkCheckBloodtype == null) return new Result("-1","未能找到该患者的上次血型复核记录,不能继续!");
|
||||
//生成血型复核的单据号
|
||||
String newBillNo = bloodBankUtil.produceBillNo("XXFH");
|
||||
xkCheckBloodtype.setBill_no(newBillNo);
|
||||
xkCheckBloodtype.setApply_no(xkTransfuseApply.getBill_no());
|
||||
xkCheckBloodtype.setBill_status("A");
|
||||
xkCheckBloodtype.setRemark("系统生成");
|
||||
return new Result("0","操作成功",xkCheckBloodtype);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改ABO血型结果
|
||||
* @param xkTransfuseApply
|
||||
* @return
|
||||
*/
|
||||
public Result updateABOBloodType(XkTransfuseApply xkTransfuseApply){
|
||||
//审核时是否更新历史申请单的空血型,患者初次用血可能无血型,下次用血有检验结果后是否更新之前的申请单,默认不更新
|
||||
String sfgxsqdxx = bloodBankUtil.getParameterValue("SFGXSQDXX");
|
||||
//这个后面的逻辑是把血型结果更新为未知了 ,这个以后考虑是否需要
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成条码数据
|
||||
* @param billNo
|
||||
* @return
|
||||
*/
|
||||
public Result createSampleData(String billNo){
|
||||
String tmsfzsxshsc = bloodBankUtil.getParameterValue("TMSFZSXSHSC");
|
||||
if(!tmsfzsxshsc.equals("Y")) return new Result("0","未开启条码在审核的时候生成的参数!");
|
||||
Date currentTimeDate = bloodBankUtil.getCurrentTimeDate();
|
||||
DateTime stime = DateUtil.offsetDay(currentTimeDate, -30);
|
||||
List<Map<String, Object>> mapList = transfuseCheckExplainMapper.querySampleData(billNo, DateUtil.format(stime, "yyyy-MM-dd HH:mm:ss"), DateUtil.format(currentTimeDate, "yyyy-MM-dd HH:mm:ss"));
|
||||
if(mapList == null || mapList.isEmpty()) return new Result("0","没有要生成的条码数据!");
|
||||
String beinhos_id = BloodBankUtil.isBank(mapList.get(0).get("beinhos_id"));
|
||||
String dept_id = BloodBankUtil.isBank(mapList.get(0).get("dept_id"));
|
||||
XkPatientInfo xkPatientInfo = xkPatientInfoMapper.queryOne(beinhos_id);
|
||||
if(xkPatientInfo == null) return new Result("-1","未能找到该患者的个人信息,生成条码失败!");
|
||||
//原来的逻辑是按照表的最大值产生条码号,完全没并发,改为取种子号码模式产生数据
|
||||
String newSampleNo = bloodBankUtil.produceBillNo("");
|
||||
XkSampleInfo xkSampleInfo = new XkSampleInfo();
|
||||
xkSampleInfo.setSample_No(newSampleNo);
|
||||
xkSampleInfo.setPurpose("A");
|
||||
xkSampleInfo.setDept(dept_id);
|
||||
xkSampleInfo.setRelate_ApplyNo(billNo);
|
||||
xkSampleInfo.setBlood_Type(xkPatientInfo.getAbo());
|
||||
xkSampleInfo.setRh_Blood_Type(xkPatientInfo.getRh());
|
||||
xkSampleInfo.setSample_Name(xkPatientInfo.getPatient_name());
|
||||
xkSampleInfo.setSex(xkPatientInfo.getPatient_sex());
|
||||
xkSampleInfo.setAge(xkPatientInfo.getAge());
|
||||
xkSampleInfo.setBirthday(xkPatientInfo.getPatient_birthday());
|
||||
xkSampleInfo.setExp1("Y");
|
||||
xkSampleInfo.setSample_status("1");
|
||||
xkSampleInfo.setCreatetime(currentTimeDate);
|
||||
|
||||
//修改申请单数据
|
||||
XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
|
||||
xkTransfuseApply.setBill_no(billNo);
|
||||
xkTransfuseApply.setSample_id(newSampleNo);
|
||||
xkTransfuseApply.setGather_date(currentTimeDate);
|
||||
SpringUtils.getBean(TransfuseCheckExplainUtil.class).saveSampleData(xkSampleInfo,xkTransfuseApply);
|
||||
return new Result("0","操作成功");
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void saveSampleData(XkSampleInfo xkSampleInfo, XkTransfuseApply xkTransfuseApply){
|
||||
xkSampleInfoMapper.insert(xkSampleInfo);
|
||||
xkTransfuseApplyMapper.update(xkTransfuseApply);
|
||||
}
|
||||
|
||||
}
|
||||
@ -118,7 +118,6 @@
|
||||
</select>
|
||||
<select id="checkSameBloodType" resultType="java.lang.String">
|
||||
select distinct t1.bill_no
|
||||
into :ls_pre_billno
|
||||
from xk_transfuse_apply t1 , xk_transfuse_apply_bloodbreed t2
|
||||
where t1.apply_date in (
|
||||
select max ( apply_date )
|
||||
|
||||
@ -7,4 +7,22 @@
|
||||
SELECT * FROM xk_check_bloodtype
|
||||
<![CDATA[ Where Beinhos_id = #{beinhos_id} and isnull(remark,'')<>'系统生成' Order By test_date Desc;]]>
|
||||
</select>
|
||||
<select id="queryTopOne" resultType="com.czblood.bus.pojo.XkCheckBloodtype">
|
||||
SELECT Top 1 * FROM xk_check_bloodtype Where beinhos_id = #{beinhos_id} AND bill_sort ='C' Order By test_date Desc
|
||||
</select>
|
||||
<select id="querySampleData" resultType="java.util.Map">
|
||||
SELECT xk_transfuse_apply.bill_no, xk_patient_info.patient_name, xk_transfuse_apply.dept_id ,apply_date,xk_transfuse_apply_bloodbreed.blood_breed,xk_transfuse_apply.beinhos_id
|
||||
FROM xk_transfuse_apply with (nolock) LEFT OUTER JOIN xk_patient_info with (nolock) ON xk_transfuse_apply.beinhos_id = xk_patient_info.beinhos_id ,
|
||||
xk_dmzd,xk_transfuse_apply_bloodbreed with (nolock)
|
||||
WHERE (xk_transfuse_apply.bill_no = xk_transfuse_apply_bloodbreed.bill_no) and
|
||||
(xk_transfuse_apply.check_sign = 'Y' or xk_transfuse_apply.check_sign = 'y' ) and
|
||||
(xk_transfuse_apply.bill_stasus = 'b'or xk_transfuse_apply.bill_stasus = 'B') AND
|
||||
(xk_transfuse_apply.bill_sort = 'A' OR xk_transfuse_apply.bill_sort = 'B' ) AND
|
||||
( xk_transfuse_apply.bill_no NOT IN ( SELECT apply_no FROM xk_match_apply)) AND
|
||||
(xk_transfuse_apply.operation_type ='C' or isnull(xk_transfuse_apply.operation_type,'') = '') AND
|
||||
(((xk_transfuse_apply.check_explain = xk_dmzd.wordbook_code) AND (xk_dmzd.wordbook_sign ='sqdshyj') and (xk_dmzd.exp1 = 'Y')) OR (isnull(xk_transfuse_apply.check_explain,'') = ''))
|
||||
and xk_transfuse_apply.apply_date between #{stime} and #{etime}
|
||||
and (xk_transfuse_apply.sample_id is null or xk_transfuse_apply.sample_id = '')
|
||||
and xk_transfuse_apply.bill_no = #{billNo}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -102,9 +102,9 @@ public enum BusinessType {
|
||||
*/
|
||||
UNCHECK,
|
||||
/**
|
||||
* 取消初审21
|
||||
* 取消上级医生审核
|
||||
*/
|
||||
UNCHECK1,
|
||||
UNCHECK_MEDIC,
|
||||
/**
|
||||
* 登记22
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user