输血申请单保存业务,审核业务

This commit is contained in:
jiangs 2026-07-02 17:21:33 +08:00
parent bb65302b51
commit fa0fc0d361
22 changed files with 736 additions and 263 deletions

View File

@ -7,4 +7,5 @@ public class BloodSysLogConstants {
public static final String LOG_TYPE_TRANSFUSE_APPLY_BEFORE = "输血前评估";
public static final String LOG_TYPE_YLJG = "医疗机构";
public static final String LOG_TYPE_DMZD = "代码字典";
public static final String LOG_TYPE_TRANSFUSE_APPLY = "输血申请";
}

View File

@ -4,4 +4,7 @@ import com.czblood.bus.pojo.XkTransfuseApplyApproval;
public interface XkTransfuseApplyApprovalMapper {
XkTransfuseApplyApproval queryOneByBillNo(String billNo);
void insert(XkTransfuseApplyApproval xkTransfuseApplyApproval);
void update(XkTransfuseApplyApproval xkTransfuseApplyApproval);
void delete(String billNo);
}

View File

@ -7,4 +7,6 @@ import java.util.List;
public interface XkTransfuseApplyBloodbreedMapper {
List<XkTransfuseApplyBloodbreed> queryList(XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed);
List<XkTransfuseApplyBloodbreed> queryOne(String bill_no);
void insert(XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed);
void update(XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed);
}

View File

@ -9,4 +9,5 @@ public interface XkTransfuseApplyCausalisMapper {
List<XkTransfuseApplyCausalis> queryListByBillNo(String billNo);
void deleteByBillNo(String billNo);
void insert(XkTransfuseApplyCausalis xkTransfuseApplyCausalis);
void update(XkTransfuseApplyCausalis xkTransfuseApplyCausalis);
}

View File

@ -7,4 +7,6 @@ import java.util.List;
public interface XkTransfuseApplyMapper {
List<XkTransfuseApply> queryList(XkTransfuseApply xkTransfuseApply);
XkTransfuseApply queryOne(String billNo);
void insert(XkTransfuseApply xkTransfuseApply);
void update(XkTransfuseApply xkTransfuseApply);
}

View File

@ -139,7 +139,17 @@ public class BloodBankUtil {
*/
public String produceBillNo(String type){
String formatDate = DateUtil.format(commonUtil.getCurrentTimeDate(), "yyyyMMdd");
return type + formatDate + getMaxValue();
formatDate = formatDate.substring(2);
String maxNo = getMaxValue();
int length = maxNo.length();
String subMaxNo = "";
if(length > 4){
subMaxNo = maxNo.substring(length - 4);
}else{
// int len = position - length ;
subMaxNo = String.format("%04d", Integer.valueOf(maxNo));
}
return type + formatDate + subMaxNo;
}
public List<XkBloodBreed> getBloodBreed(){

View File

@ -2,8 +2,43 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyApprovalMapper">
<insert id="insert">
insert into xk_transfuse_apply_approval (
<if test="Archiater != null and Archiater != ''">Archiater,</if>
<if test="Archiater_CheckTime != null ">Archiater_CheckTime,</if>
<if test="Medical_Dept != null and Medical_Dept != ''">Medical_Dept,</if>
<if test="Medical_CheckTime != null ">Medical_CheckTime,</if>
<if test="ApplyLevel != null and ApplyLevel != ''">ApplyLevel,</if>
<if test="Flag != null and Flag != ''">Flag,</if>
bill_no
)values (
<if test="Archiater != null and Archiater != ''">#{Archiater},</if>
<if test="Archiater_CheckTime != null and Archiater_CheckTime != ''">#{Archiater_CheckTime},</if>
<if test="Medical_Dept != null and Medical_Dept != ''">#{Medical_Dept},</if>
<if test="Medical_CheckTime != null ">#{Medical_CheckTime},</if>
<if test="ApplyLevel != null and ApplyLevel != ''">#{ApplyLevel},</if>
<if test="Flag != null and Flag != ''">#{Flag},</if>
#{billNo}
)
</insert>
<update id="update">
update xk_transfuse_apply_approval set
<if test="Archiater != null and Archiater != ''">Archiater = #{Archiater},</if>
<if test="Archiater_CheckTime != null">Archiater_CheckTime = #{Archiater_CheckTime},</if>
<if test="Medical_Dept != null and Medical_Dept != ''">Medical_Dept = #{Medical_Dept},</if>
<if test="Medical_CheckTime != null">Medical_CheckTime = #{Medical_CheckTime},</if>
<if test="ApplyLevel != null and ApplyLevel != ''">ApplyLevel = #{ApplyLevel},</if>
<if test="Flag != null and Flag != ''">Flag = #{Flag},</if>
bill_no = #{billNo}
</update>
<delete id="delete">
delete from xk_transfuse_apply_approval where bill_no = #{billNo}
</delete>
<select id="queryOneByBillNo" resultType="com.czblood.bus.pojo.XkTransfuseApplyApproval">
select * from xk_transfuse_apply_approval where bill_no = #{billNo}
</select>
</mapper>

View File

@ -2,6 +2,52 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyBloodbreedMapper">
<insert id="insert">
insert into xk_transfuse_apply_bloodbreed(
<if test="blood_num != null">blood_num,</if>
<if test="unit != null">unit,</if>
<if test="special_deal != null">special_deal,</if>
<if test="onetime_num != null">onetime_num,</if>
<if test="remark != null">remark,</if>
<if test="replace_bloodbreed != null">replace_bloodbreed,</if>
<if test="apply_bloodtype != null">apply_bloodtype,</if>
<if test="ops_bleeding != null">ops_bleeding,</if>
<if test="ops_fact_use != null">ops_fact_use,</if>
<if test="intent != null">intent,</if>
<if test="causalis != null">causalis,</if>
bill_no, blood_breed
) values(
<if test="blood_num != null">#{blood_num},</if>
<if test="unit != null">#{unit},</if>
<if test="special_deal != null">#{special_deal},</if>
<if test="onetime_num != null">#{onetime_num},</if>
<if test="remark != null">#{remark},</if>
<if test="replace_bloodbreed != null">#{replace_bloodbreed},</if>
<if test="apply_bloodtype != null">#{apply_bloodtype},</if>
<if test="ops_bleeding != null">#{ops_bleeding},</if>
<if test="ops_fact_use != null">#{ops_fact_use},</if>
<if test="intent != null">#{intent},</if>
<if test="causalis != null">#{causalis},</if>
#{bill_no}, #{blood_breed})
</insert>
<update id="update">
update xk_transfuse_apply_bloodbreed set
<if test="blood_num != null">blood_num = #{blood_num},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="special_deal != null">special_deal = #{special_deal},</if>
<if test="onetime_num != null">onetime_num = #{onetime_num},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="replace_bloodbreed != null">replace_bloodbreed = #{replace_bloodbreed},</if>
<if test="apply_bloodtype != null">apply_bloodtype = #{apply_bloodtype},</if>
<if test="ops_bleeding != null">ops_bleeding = #{ops_bleeding},</if>
<if test="ops_fact_use != null">ops_fact_use = #{ops_fact_use},</if>
<if test="intent != null">intent = #{intent},</if>
<if test="causalis != null">causalis = #{causalis},</if>
blood_breed = #{blood_breed}
where bill_no = #{bill_no}
<if test="blood_breed != null and blood_breed != ''">and blood_breed = #{blood_breed}</if>
</update>
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApplyBloodbreed">
select * from xk_transfuse_apply_bloodbreed where bill_no = #{bill_no}
<if test="blood_breed != null and blood_breed != ''">and blood_breed = #{blood_breed}</if>

View File

@ -6,14 +6,29 @@
insert into xk_transfuse_apply_causalis (Bill_No, Hos_ID, SID,Causalis_Code,Causalis_Type,Causalis_Name,Causalis_Result,Use_Flag,Upload_Flag,Explain)
values (#{bill_no}, #{hos_id}, #{sid}, #{causalis_code}, #{causalis_type}, #{causalis_name}, #{causalis_result}, #{use_flag}, #{upload_flag}, #{explain})
</insert>
<update id="update">
update xk_transfuse_apply_causalis
<set>
<if test="SID != null">SID = #{SID},</if>
<if test="Causalis_Code != null">Causalis_Code = #{Causalis_Code},</if>
<if test="Causalis_Type != null">Causalis_Type = #{Causalis_Type},</if>
<if test="Causalis_Name != null">Causalis_Name = #{Causalis_Name}</if>
<if test="Causalis_Result != null">Causalis_Result = #{Causalis_Result}</if>
<if test="Use_Flag != null">Use_Flag = #{Use_Flag}</if>
<if test="Upload_Flag != null">Upload_Flag = #{Upload_Flag}</if>
<if test="Explain != null">Explain = #{Explain}</if>
hos_id = #{hos_id}
</set>
where Bill_No = #{bill_no} and Causalis_Code = #{Causalis_Code}
</update>
<delete id="deleteByBillNo">
delete from xk_transfuse_apply_causalis where Bill_No = #{bill_no}
delete from xk_transfuse_apply_causalis where Bill_No = #{bill_no} and Hos_ID = #{hos_id}
</delete>
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApplyCausalis">
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no}
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no} and Hos_ID = #{hos_id}
<if test="SID != null">and sid = #{SID}</if>
</select>
<select id="queryListByBillNo" resultType="com.czblood.bus.pojo.XkTransfuseApplyCausalis">
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no}
select * from xk_transfuse_apply_causalis where Bill_No = #{bill_no} and Hos_ID = #{hos_id}
</select>
</mapper>

View File

@ -2,14 +2,239 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyMapper">
<insert id="insert">
insert into xk_transfuse_apply (
<if test="beinhos_number != null">beinhos_number,</if>
<if test="zone_id != null">zone_id,</if>
<if test="patient_bed != null">patient_bed,</if>
<if test="casehistory_id != null">casehistory_id,</if>
<if test="transfuse_history != null">transfuse_history,</if>
<if test="reaction_history != null">reaction_history,</if>
<if test="gestation_history != null">gestation_history,</if>
<if test="parturition_history != null">parturition_history,</if>
<if test="match_history != null">match_history,</if>
<if test="transplant_history != null">transplant_history,</if>
<if test="dept_id != null">dept_id,</if>
<if test="apply_date != null">apply_date,</if>
<if test="send_person != null">apply_date,</if>
<if test="charge_sign != null">charge_sign,</if>
<if test="input_person != null">input_person,</if>
<if test="receive_date != null">receive_date,</if>
<if test="attending_medic != null">attending_medic,</if>
<if test="treat_medic != null">treat_medic,</if>
<if test="causalis != null">causalis,</if>
<if test="bank_director != null">bank_director,</if>
<if test="medical_affairs != null">medical_affairs,</if>
<if test="sample_id != null">sample_id,</if>
<if test="gather_date != null">gather_date,</if>
<if test="abo_type != null">abo_type,</if>
<if test="rh_type != null">rh_type,</if>
<if test="check_sign != null">check_sign,</if>
<if test="check_explain != null">check_explain,</if>
<if test="bill_stasus != null">bill_stasus,</if>
<if test="bill_type != null">bill_type,</if>
<if test="apply_medic != null">apply_medic,</if>
<if test="diagnoses != null">diagnoses,</if>
<if test="intent != null">intent,</if>
<if test="apply_type != null">apply_type,</if>
<if test="use1_date != null">use1_date,</if>
<if test="use2_date != null">use2_date,</if>
<if test="use3_date != null">use3_date,</if>
<if test="remark != null">remark,</if>
<if test="is_plan != null">is_plan,</if>
<if test="bill_sort != null">bill_sort,</if>
<if test="sample_sign != null">sample_sign,</if>
<if test="input_dept != null">input_dept,</if>
<if test="send_able != null">send_able,</if>
<if test="medic_check_date != null">medic_check_date,</if>
<if test="check_medic != null">check_medic,</if>
<if test="is_large_use != null">is_large_use,</if>
<if test="operation_type != null">operation_type,</if>
<if test="bloodcheck_abnor != null">bloodcheck_abnor,</if>
<if test="abnor_next != null">abnor_next,</if>
<if test="agreement_ink != null">agreement_ink,</if>
<if test="exp1 != null">exp1,</if>
<if test="exp2 != null">exp2,</if>
<if test="exp3 != null">exp3,</if>
<if test="exp4 != null">exp4,</if>
<if test="last_modified != null">last_modified,</if>
<if test="notify_sign != null">notify_sign,</if>
<if test="adm_no != null">adm_no,</if>
<if test="Use1_Num != null">Use1_Num,</if>
<if test="Use2_Num != null">Use2_Num,</if>
<if test="Use3_Num != null">Use3_Num,</if>
<if test="Dept_Type != null">Dept_Type,</if>
<if test="use_type != null">use_type,</if>
<if test="Ill_Code != null">Ill_Code,</if>
<if test="Ops_Name != null">Ops_Name,</if>
<if test="isemergency != null">isemergency,</if>
<if test="Valid_Flag != null">Valid_Flag,</if>
<if test="notice_yn != null">notice_yn,</if>
<if test="his_SerialNo != null">his_SerialNo,</if>
<if test="assess_bill_no != null">assess_bill_no,</if>
<if test="operation_name != null">operation_name,</if>
<if test="operation_level != null">operation_level,</if>
<if test="card_no != null">card_no,</if>
bill_no, beinhos_id, assess_bill_no, hos_id
)values (
<if test="beinhos_number != null">#{beinhos_number},</if>
<if test="zone_id != null">#{zone_id},</if>
<if test="patient_bed != null">#{patient_bed},</if>
<if test="casehistory_id != null">#{casehistory_id},</if>
<if test="transfuse_history != null">#{transfuse_history},</if>
<if test="reaction_history != null">#{reaction_history},</if>
<if test="gestation_history != null">#{gestation_history},</if>
<if test="parturition_history != null">#{parturition_history},</if>
<if test="match_history != null">#{match_history},</if>
<if test="transplant_history != null">#{transplant_history},</if>
<if test="dept_id != null">#{dept_id},</if>
<if test="apply_date != null">#{apply_date},</if>
<if test="send_person != null">#{send_person},</if>
<if test="charge_sign != null">#{charge_sign},</if>
<if test="input_person != null">#{input_person},</if>
<if test="receive_date != null">#{receive_date},</if>
<if test="attending_medic != null">#{attending_medic},</if>
<if test="treat_medic != null">#{treat_medic},</if>
<if test="causalis != null">#{causalis},</if>
<if test="bank_director != null">#{bank_director},</if>
<if test="medical_affairs != null">#{medical_affairs},</if>
<if test="sample_id != null">#{sample_id},</if>
<if test="gather_date != null">#{gather_date},</if>
<if test="abo_type != null">#{abo_type},</if>
<if test="rh_type != null">#{rh_type},</if>
<if test="check_sign != null">#{check_sign},</if>
<if test="check_explain != null">#{check_explain},</if>
<if test="bill_stasus != null">#{bill_stasus},</if>
<if test="bill_type != null">#{bill_type},</if>
<if test="apply_medic != null">#{apply_medic},</if>
<if test="diagnoses != null">#{diagnoses},</if>
<if test="intent != null">#{intent},</if>
<if test="apply_type != null">#{apply_type},</if>
<if test="use1_date != null">#{use1_date},</if>
<if test="use2_date != null">#{use2_date},</if>
<if test="use3_date != null">#{use3_date},</if>
<if test="remark != null">#{remark},</if>
<if test="is_plan != null">#{is_plan},</if>
<if test="bill_sort != null">#{bill_sort},</if>
<if test="sample_sign != null">#{sample_sign},</if>
<if test="input_dept != null">#{input_dept},</if>
<if test="send_able != null">#{send_able},</if>
<if test="medic_check_date != null">#{medic_check_date},</if>
<if test="check_medic != null">#{check_medic},</if>
<if test="is_large_use != null">#{is_large_use},</if>
<if test="operation_type != null">#{operation_type},</if>
<if test="bloodcheck_abnor != null">#{bloodcheck_abnor},</if>
<if test="abnor_next != null">#{abnor_next},</if>
<if test="agreement_ink != null">#{agreement_ink},</if>
<if test="exp1 != null">#{exp1},</if>
<if test="exp2 != null">#{exp2},</if>
<if test="exp3 != null">#{exp3},</if>
<if test="exp4 != null">#{exp4},</if>
<if test="last_modified != null">#{last_modified},</if>
<if test="notify_sign != null">#{notify_sign},</if>
<if test="adm_no != null">#{adm_no},</if>
<if test="Use1_Num != null">#{Use1_Num},</if>
<if test="Use2_Num != null">#{Use2_Num},</if>
<if test="Use3_Num != null">#{Use3_Num},</if>
<if test="Dept_Type != null">#{Dept_Type},</if>
<if test="use_type != null">#{use_type},</if>
<if test="Ill_Code != null">#{Ill_Code},</if>
<if test="Ops_Name != null">#{Ops_Name},</if>
<if test="isemergency != null">#{isemergency},</if>
<if test="Valid_Flag != null">#{Valid_Flag},</if>
<if test="notice_yn != null">#{notice_yn},</if>
<if test="his_SerialNo != null">#{his_SerialNo},</if>
<if test="assess_bill_no != null">#{assess_bill_no},</if>
<if test="operation_name != null">#{operation_name},</if>
<if test="operation_level != null">#{operation_level},</if>
<if test="card_no != null">#{card_no},</if>
#{bill_no}, #{beinhos_id}, #{assess_bill_no}, #{hos_id})
</insert>
<update id="update">
update xk_transfuse_apply
<set>
<if test="beinhos_number != null">beinhos_number = #{beinhos_number},</if>
<if test="zone_id != null">zone_id = #{zone_id},</if>
<if test="patient_bed != null">patient_bed = #{patient_bed},</if>
<if test="casehistory_id != null">casehistory_id = #{casehistory_id},</if>
<if test="transfuse_history != null">transfuse_history = #{transfuse_history},</if>
<if test="reaction_history != null">reaction_history = #{reaction_history},</if>
<if test="gestation_history != null">gestation_history = #{gestation_history},</if>
<if test="parturition_history != null">parturition_history = #{parturition_history},</if>
<if test="match_history != null">match_history = #{match_history},</if>
<if test="transplant_history != null">transplant_history = #{transplant_history},</if>
<if test="dept_id != null">dept_id = #{dept_id},</if>
<if test="apply_date != null">apply_date = #{apply_date},</if>
<if test="send_person != null">send_person = #{send_person},</if>
<if test="charge_sign != null">charge_sign = #{charge_sign},</if>
<if test="input_person != null">input_person = #{input_person},</if>
<if test="receive_date != null">receive_date = #{receive_date},</if>
<if test="attending_medic != null">attending_medic = #{attending_medic},</if>
<if test="treat_medic != null">treat_medic = #{treat_medic},</if>
<if test="causalis != null">causalis = #{causalis},</if>
<if test="bank_director != null">bank_director = #{bank_director},</if>
<if test="medical_affairs != null">medical_affairs = #{medical_affairs},</if>
<if test="sample_id != null">sample_id = #{sample_id},</if>
<if test="gather_date != null">gather_date = #{gather_date},</if>
<if test="abo_type != null">abo_type = #{abo_type},</if>
<if test="rh_type != null">rh_type = #{rh_type},</if>
<if test="check_sign != null">check_sign = #{check_sign},</if>
<if test="check_explain != null">check_explain = #{check_explain},</if>
<if test="bill_stasus != null">bill_stasus = #{bill_stasus},</if>
<if test="bill_type != null">bill_type = #{bill_type},</if>
<if test="apply_medic != null">apply_medic = #{apply_medic},</if>
<if test="diagnoses != null">diagnoses = #{diagnoses},</if>
<if test="intent != null">intent = #{intent},</if>
<if test="apply_type != null">apply_type = #{apply_type},</if>
<if test="use1_date != null">use1_date = #{use1_date},</if>
<if test="use2_date != null">use2_date = #{use2_date},</if>
<if test="use3_date != null">use3_date = #{use3_date},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="is_plan != null">is_plan = #{is_plan},</if>
<if test="bill_sort != null">bill_sort = #{bill_sort},</if>
<if test="sample_sign != null">sample_sign = #{sample_sign},</if>
<if test="input_dept != null">input_dept = #{input_dept},</if>
<if test="send_able != null">send_able = #{send_able},</if>
<if test="medic_check_date != null">medic_check_date = #{medic_check_date},</if>
<if test="check_medic != null">check_medic = #{check_medic},</if>
<if test="is_large_use != null">is_large_use = #{is_large_use},</if>
<if test="operation_type != null">operation_type = #{operation_type},</if>
<if test="bloodcheck_abnor != null">bloodcheck_abnor = #{bloodcheck_abnor},</if>
<if test="abnor_next != null">abnor_next = #{abnor_next},</if>
<if test="agreement_ink != null">agreement_ink = #{agreement_ink},</if>
<if test="exp1 != null">exp1 = #{exp1},</if>
<if test="exp2 != null">exp2 = #{exp2},</if>
<if test="exp3 != null">exp3 = #{exp3},</if>
<if test="exp4 != null">exp4 = #{exp4},</if>
<if test="last_modified != null">last_modified = #{last_modified},</if>
<if test="notify_sign != null">notify_sign = #{notify_sign},</if>
<if test="adm_no != null">adm_no = #{adm_no},</if>
<if test="Use1_Num != null">Use1_Num = #{Use1_Num},</if>
<if test="Use2_Num != null">Use2_Num = #{Use2_Num},</if>
<if test="Use3_Num != null">Use3_Num = #{Use3_Num},</if>
<if test="Dept_Type != null">Dept_Type = #{Dept_Type},</if>
<if test="use_type != null">use_type = #{use_type},</if>
<if test="Ill_Code != null">Ill_Code = #{Ill_Code},</if>
<if test="Ops_Name != null">Ops_Name = #{Ops_Name},</if>
<if test="isemergency != null">isemergency = #{isemergency},</if>
<if test="Valid_Flag != null">Valid_Flag = #{Valid_Flag},</if>
<if test="notice_yn != null">notice_yn = #{notice_yn},</if>
<if test="his_SerialNo != null">his_SerialNo = #{his_SerialNo},</if>
<if test="assess_bill_no != null">assess_bill_no = #{assess_bill_no},</if>
<if test="operation_name != null">operation_name = #{operation_name},</if>
<if test="operation_level != null">operation_level = #{operation_level},</if>
<if test="card_no != null">card_no = #{card_no},</if>
hos_id = #{hos_id}
</set>
where bill_no = #{bill_no}
</update>
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApply">
select * from xk_transfuse_apply
<where>
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
<if test="assess_bill_no != null and assess_bill_no != ''">and assess_bill_no = #{assess_bill_no}</if>
<if test="hos_id != null and hos_id != ''">and hos_id = #{hos_id}</if>
</where>
select * from xk_transfuse_apply where hos_id = #{hos_id}
<if test="bill_no != null and bill_no != ''">and bill_no = #{bill_no}</if>
<if test="beinhos_id != null and beinhos_id != ''">and beinhos_id = #{beinhos_id}</if>
<if test="assess_bill_no != null and assess_bill_no != ''">and assess_bill_no = #{assess_bill_no}</if>
</select>
<select id="queryOne" resultType="com.czblood.bus.pojo.XkTransfuseApply">

View File

@ -32,11 +32,11 @@
<if test="upload_flag != null and upload_flag != ''">upload_flag=#{upload_flag},</if>
item_name=#{item_name}
where bill_no=#{bill_no}
<if test="sid != null">and sid=#{sid}</if>
<if test="sid != 0">and sid=#{sid}</if>
</update>
<delete id="deleteXkTransfuseApplyTestitem">
delete from xk_transfuse_apply_testitem where bill_no=#{bill_no}
<if test="sid != null">and sid=#{sid}</if>
<if test="sid != 0">and sid=#{sid}</if>
</delete>
</mapper>

View File

@ -1,17 +1,27 @@
package com.czblood.busDoctor.controller;
import com.czblood.bus.constants.BloodSysLogConstants;
import com.czblood.bus.mapper.XkXtwhIllDiagnoseMapper;
import com.czblood.bus.pojo.xtwh.XkXtwhIllDiagnose;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.VO.ApplyCheckVO;
import com.czblood.busDoctor.pojo.VO.CheckMedicVO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import com.czblood.busDoctor.service.TransfuseApplyService;
import com.czblood.common.annotation.Log;
import com.czblood.common.core.controller.BaseController;
import com.czblood.common.core.domain.Result;
import com.czblood.common.core.page.TableDataInfo;
import com.czblood.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* 输血申请
@ -24,6 +34,8 @@ public class TransfuseApplyController extends BaseController {
@Resource
private TransfuseApplyService transfuseApplyService;
@Resource
XkXtwhIllDiagnoseMapper xkXtwhIllDiagnoseMapper;
@ -72,6 +84,16 @@ public class TransfuseApplyController extends BaseController {
return transfuseApplyService.checkCausalis(transfuseApplyDTO);
}
/**
* 保存申请单的步骤
* 1. 自体血校验
* 2. 校验是否符合输血指征的规则
* 3. 保存前校验 如果点是,调用queryApplyOne,查询单个申请单,传返回值
* 4. 保存申请单
* @param transfuseApplyDTO
* @return
*/
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.INSERT)
@ApiOperation("保存申请单")
@PostMapping("/saveApplyInfo")
public Result saveApplyInfo(@RequestBody TransfuseApplyDTO transfuseApplyDTO){
@ -79,5 +101,28 @@ public class TransfuseApplyController extends BaseController {
return transfuseApplyService.saveApplyInfo(transfuseApplyDTO);
}
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.CHECK_MEDIC)
@ApiOperation("上级医生审核")
@PostMapping("/applyMedicCheck")
public Result applyMedicCheck(CheckMedicVO checkMedicVO){
return transfuseApplyService.applyMedicCheck(checkMedicVO);
}
@ApiOperation("查询单病种信息列表")
@GetMapping("/queryIllDiagnoseList")
public TableDataInfo queryIllDiagnoseList(){
startPage();
XkXtwhIllDiagnose xkXtwhIllDiagnose = new XkXtwhIllDiagnose();
List<XkXtwhIllDiagnose> xkXtwhIllDiagnoseList = xkXtwhIllDiagnoseMapper.queryList(xkXtwhIllDiagnose);
return getDataTable(xkXtwhIllDiagnoseList);
}
@Log(title = BloodSysLogConstants.LOG_TYPE_TRANSFUSE_APPLY, businessType = BusinessType.CHECK)
@ApiOperation("申请单审核")
@PostMapping("/applyCheck")
public Result applyCheck(ApplyCheckVO applyCheckVO){
return transfuseApplyService.applyCheck(applyCheckVO);
}
}

View File

@ -1,5 +1,6 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkTransfuseApplyApproval;
import com.czblood.bus.pojo.XkTransfuseApplyBloodbreed;
import com.czblood.bus.pojo.XkTransfuseApplyCausalis;
import com.czblood.bus.pojo.XkTransfuseApplyTestitem;
@ -22,5 +23,7 @@ public class TransfuseApplyDTO {
private List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList;
@ApiModelProperty("输血指征列表")
private List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList;
@ApiModelProperty("大量用血申请表")
private XkTransfuseApplyApproval xkTransfuseApplyApproval;
private String userId;
}

View File

@ -1,5 +1,6 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkPatientInfo;
import com.czblood.bus.pojo.XkTransfuseApply;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -14,155 +15,8 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
public class TransfuseApplyInfoOne {
@ApiModelProperty("医疗机构ID")
private String hos_id;
@ApiModelProperty("住院号")
@NotBlank(message = "住院号不能为空")
private String beinhos_id;
@ApiModelProperty("病人姓名")
@NotBlank(message = "病人姓名不能为空")
private String patient_name;
@NotBlank(message = "病人性别不能为空")
@ApiModelProperty("病人性别")
private String patient_sex;
@ApiModelProperty("病人年龄")
private String age;
@ApiModelProperty("病人生日")
private Date patient_birthday;
@ApiModelProperty("病人属地")
private String apanage;
@ApiModelProperty("单据号")
private String bill_no;
@ApiModelProperty("病人唯一号")
private String beinhos_number;
@ApiModelProperty("病区代码")
private String zone_id;
@ApiModelProperty("床号")
private String patient_bed;
private String casehistory_id;
@ApiModelProperty("输血史")
private String transfuse_history;
@ApiModelProperty("输血反应史")
private String reaction_history;
@ApiModelProperty("妊娠史")
private String gestation_history;
@ApiModelProperty("分娩史")
private String parturition_history;
@ApiModelProperty("移植配型史")
private String match_history;
@ApiModelProperty("器官移植史")
private String transplant_history;
private String dept_id;
@ApiModelProperty("申请时间")
private Date apply_date;
private String send_person;
@ApiModelProperty("收费标志")
private String charge_sign;
@ApiModelProperty("输入人")
private String input_person;
@ApiModelProperty("接收时间")
private Date receive_date;
@ApiModelProperty("主治医师")
private String attending_medic;
@ApiModelProperty("上级医师")
private String treat_medic;
@ApiModelProperty("输血指征")
private String causalis;
@ApiModelProperty("输血科主任")
private String bank_director;
@ApiModelProperty("医务部负责人")
private String medical_affairs;
@ApiModelProperty("对应的条码ID")
private String sample_id;
@ApiModelProperty("采集时间")
private Date gather_date;
@ApiModelProperty("ABO血型")
private String abo_type;
@ApiModelProperty("RH血型")
private String rh_type;
@ApiModelProperty("审核标志")
private String check_sign;
@ApiModelProperty("审核意见")
private String check_explain;
@ApiModelProperty("状态(A=未审核、B=已审核、C=已配血、D=已发血、Z=作废、BD=未补录、W=已补录、F=已复核血型、S=已追加配血、N=审核未通过)")
private String bill_stasus;
private String bill_type;
@ApiModelProperty("申请医生")
private String apply_medic;
@ApiModelProperty("诊断")
private String diagnoses;
@ApiModelProperty("输血目的")
private String intent;
@NotBlank(message = "申请单类型不能为空")
@ApiModelProperty("申请单类型")
private String apply_type;
@ApiModelProperty("第一次输血时间")
private Date use1_date;
@ApiModelProperty("第二次输血时间")
private Date use2_date;
@ApiModelProperty("第三次输血时间")
private Date use3_date;
private String remark;
@ApiModelProperty("预约入库标志(N=否、Y=是)")
private String is_plan;
@ApiModelProperty("单据类别(A,B,C,D,J)")
private String bill_sort;
@ApiModelProperty("是否有标本申请")
private String sample_sign;
@ApiModelProperty("输入科室")
private String input_dept;
@ApiModelProperty("上级医师审核标志")
private String send_able;
@ApiModelProperty("上级医师审核时间")
private Date medic_check_date;
@ApiModelProperty("审核医生")
private String check_medic;
@ApiModelProperty("是否大量用血(N=否、Y=是)")
private String is_large_use;
@ApiModelProperty("操作类型(C输血申请,Z自体血申请单,S为输血治疗单)")
private String operation_type;
@ApiModelProperty("血型复核结果与申请单的血型不一致继续配血标志(N=否、Y=是)")
private String bloodcheck_abnor;
@ApiModelProperty("当血型复核结果与申请单的血型不一致时,输血申请单是否可以继续进行下一步的流程操作,Y表示可以,N表示不可以")
private String abnor_next;
@ApiModelProperty("是否同意配血(N=否、Y=是)")
private String agreement_ink;
private String exp1;
private String exp2;
private String exp3;
private String exp4;
@ApiModelProperty("最后修改时间")
private Date last_modified;
@ApiModelProperty("通知标志")
private String notify_sign;
@ApiModelProperty("联系手机")
private String adm_no;
private BigDecimal Use1_Num;
private BigDecimal Use2_Num;
private BigDecimal Use3_Num;
@ApiModelProperty("科室类型(A手术科室,B非手术科室)")
private String Dept_Type;
@NotBlank(message = "手术科室必须填写后面的类型")
private String use_type;
@ApiModelProperty("单病种")
private String Ill_Code;
@ApiModelProperty("手术名称")
private String Ops_Name;
private String isemergency;
@ApiModelProperty("是否合理(不合理N,待定W,合理Y)")
private String Valid_Flag;
@ApiModelProperty("通知消息确认标志(N=否、Y=是)")
private String notice_yn;
@ApiModelProperty("his系统申请单号")
private String his_SerialNo;
@ApiModelProperty("输血评估单")
private String assess_bill_no;
@ApiModelProperty("手术名称")
private String operation_name;
@ApiModelProperty("手术级别")
private String operation_level;
@ApiModelProperty("身份证号")
private String card_no;
@ApiModelProperty("病人信息")
private XkPatientInfo xkPatientInfo;
@ApiModelProperty("输血申请信息")
private XkTransfuseApply xkTransfuseApply;
}

View File

@ -0,0 +1,15 @@
package com.czblood.busDoctor.pojo.DTO;
import com.czblood.bus.pojo.XkTransfuseApplyCausalis;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XkTransfuseApplyCausalisDTO {
private XkTransfuseApplyCausalis xkTransfuseApplyCausalis;
private String itemName;
private String itemResult;
}

View File

@ -0,0 +1,12 @@
package com.czblood.busDoctor.pojo.VO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApplyCheckVO {
private String billNo;
}

View File

@ -0,0 +1,20 @@
package com.czblood.busDoctor.pojo.VO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CheckMedicVO {
@NotBlank(message = "上级医生不能为空!")
private String checkMedic;
@NotBlank(message = "审核时间不能为空!")
private Date checkDate;
@NotBlank(message = "单据号不能为空!")
private String billNo;
}

View File

@ -2,6 +2,8 @@ package com.czblood.busDoctor.service;
import com.czblood.bus.pojo.XkTransfuseApply;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.VO.ApplyCheckVO;
import com.czblood.busDoctor.pojo.VO.CheckMedicVO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import com.czblood.common.core.domain.Result;
@ -21,4 +23,8 @@ public interface TransfuseApplyService {
Result saveApplyInfo(TransfuseApplyDTO transfuseApplyDTO);
Result checkCausalis(TransfuseApplyDTO transfuseApplyDTO);
Result applyMedicCheck(CheckMedicVO checkMedicVO);
Result applyCheck(ApplyCheckVO applyCheckVO);
}

View File

@ -7,6 +7,8 @@ import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.busDoctor.mapper.TransfuseApplyMapper;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
import com.czblood.busDoctor.pojo.VO.ApplyCheckVO;
import com.czblood.busDoctor.pojo.VO.CheckMedicVO;
import com.czblood.busDoctor.pojo.VO.TransfuseApplyVO;
import com.czblood.busDoctor.service.TransfuseApplyService;
import com.czblood.busDoctor.utils.TransfuseApplyUtil;
@ -45,6 +47,8 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
TransfuseApplyUtil transfuseApplyUtil;
@Resource
XkTransfuseApplyApprovalMapper xkTransfuseApplyApprovalMapper;
@Resource
XkTransfuseApplyMapper xkTransfuseApplyMapper;
/**
* 获取病人信息
@ -82,42 +86,44 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
private Result getTransfuseApplyInfo(XkTransfuseApplyBefore xkTransfuseApplyBefore,XkPatientInfo xkPatientInfo,String userId) {
String beinhosId = xkTransfuseApplyBefore.getBeinhos_id();
TransfuseApplyInfoOne transfuseApplyInfoOne = new TransfuseApplyInfoOne();
//XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
transfuseApplyInfoOne.setBeinhos_id(beinhosId);
transfuseApplyInfoOne.setHos_id(xkTransfuseApplyBefore.getHos_id());
transfuseApplyInfoOne.setBeinhos_number(xkPatientInfo.getBeinhos_number());
transfuseApplyInfoOne.setZone_id(xkTransfuseApplyBefore.getZone_id());
transfuseApplyInfoOne.setPatient_bed(xkTransfuseApplyBefore.getPatient_bed());
transfuseApplyInfoOne.setTransfuse_history(xkPatientInfo.getTransfuse_history());
transfuseApplyInfoOne.setReaction_history(xkPatientInfo.getReaction_history());
transfuseApplyInfoOne.setGestation_history(xkPatientInfo.getGestation_history());
transfuseApplyInfoOne.setParturition_history(xkPatientInfo.getParturition_history());
transfuseApplyInfoOne.setMatch_history(xkPatientInfo.getMatch_history());
transfuseApplyInfoOne.setTransplant_history(xkPatientInfo.getTransplant_history());
transfuseApplyInfoOne.setDept_id(xkTransfuseApplyBefore.getDept_id());
transfuseApplyInfoOne.setApply_date(bloodBankUtil.getCurrentTimeDate());
transfuseApplyInfoOne.setInput_person(userId);
transfuseApplyInfoOne.setAttending_medic(userId);
transfuseApplyInfoOne.setTreat_medic(userId);
transfuseApplyInfoOne.setAbo_type(xkPatientInfo.getAbo());
transfuseApplyInfoOne.setRh_type(xkPatientInfo.getRh());
transfuseApplyInfoOne.setBill_stasus("A");
transfuseApplyInfoOne.setApply_medic(userId);
transfuseApplyInfoOne.setDiagnoses(xkTransfuseApplyBefore.getDiagnoses());
transfuseApplyInfoOne.setApply_type("001"); //常规用血
transfuseApplyInfoOne.setUse1_date(bloodBankUtil.getCurrentTimeDate());
transfuseApplyInfoOne.setSample_sign("N");
transfuseApplyInfoOne.setInput_dept(BloodBankUtil.isBank(xkTransfuseApplyBefore.getDept_id()));
transfuseApplyInfoOne.setOperation_type("C");
transfuseApplyInfoOne.setAgreement_ink("Y");
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
XkPatientInfo xkPatientInfoSet = transfuseApplyInfoOne.getXkPatientInfo();
xkTransfuseApply.setBeinhos_id(beinhosId);
xkTransfuseApply.setHos_id(xkTransfuseApplyBefore.getHos_id());
xkTransfuseApply.setBeinhos_number(xkPatientInfo.getBeinhos_number());
xkTransfuseApply.setZone_id(xkTransfuseApplyBefore.getZone_id());
xkTransfuseApply.setPatient_bed(xkTransfuseApplyBefore.getPatient_bed());
xkTransfuseApply.setTransfuse_history(xkPatientInfo.getTransfuse_history());
xkTransfuseApply.setReaction_history(xkPatientInfo.getReaction_history());
xkTransfuseApply.setGestation_history(xkPatientInfo.getGestation_history());
xkTransfuseApply.setParturition_history(xkPatientInfo.getParturition_history());
xkTransfuseApply.setMatch_history(xkPatientInfo.getMatch_history());
xkTransfuseApply.setTransplant_history(xkPatientInfo.getTransplant_history());
xkTransfuseApply.setDept_id(xkTransfuseApplyBefore.getDept_id());
xkTransfuseApply.setApply_date(bloodBankUtil.getCurrentTimeDate());
xkTransfuseApply.setInput_person(userId);
xkTransfuseApply.setAttending_medic(userId);
xkTransfuseApply.setTreat_medic(userId);
xkTransfuseApply.setAbo_type(xkPatientInfo.getAbo());
xkTransfuseApply.setRh_type(xkPatientInfo.getRh());
xkTransfuseApply.setBill_stasus("A");
xkTransfuseApply.setApply_medic(userId);
xkTransfuseApply.setDiagnoses(xkTransfuseApplyBefore.getDiagnoses());
xkTransfuseApply.setApply_type("001"); //常规用血
xkTransfuseApply.setUse1_date(bloodBankUtil.getCurrentTimeDate());
xkTransfuseApply.setSample_sign("N");
xkTransfuseApply.setInput_dept(BloodBankUtil.isBank(xkTransfuseApplyBefore.getDept_id()));
xkTransfuseApply.setOperation_type("C");
xkTransfuseApply.setAgreement_ink("Y");
xkTransfuseApply.setSend_able("N"); //这个像是上级医生审核标志,这里先默认为否
//xkTransfuseApply.setDept_Type(""); //这个前端传吧,而且是必填的
transfuseApplyInfoOne.setValid_Flag("Y"); //默认是合理的
transfuseApplyInfoOne.setNotice_yn("N");
transfuseApplyInfoOne.setAssess_bill_no(xkTransfuseApplyBefore.getBill_no()); //输血评估单号
transfuseApplyInfoOne.setPatient_name(xkPatientInfo.getPatient_name());
transfuseApplyInfoOne.setPatient_sex(xkPatientInfo.getPatient_sex());
transfuseApplyInfoOne.setAge(xkPatientInfo.getAge());
transfuseApplyInfoOne.setApanage(xkPatientInfo.getApanage());
xkTransfuseApply.setValid_Flag("Y"); //默认是合理的
xkTransfuseApply.setNotice_yn("N");
xkTransfuseApply.setAssess_bill_no(xkTransfuseApplyBefore.getBill_no()); //输血评估单号
xkPatientInfoSet.setPatient_name(xkPatientInfo.getPatient_name());
xkPatientInfoSet.setPatient_sex(xkPatientInfo.getPatient_sex());
xkPatientInfoSet.setAge(xkPatientInfo.getAge());
xkPatientInfoSet.setApanage(xkPatientInfo.getApanage());
return new Result("0","操作成功",transfuseApplyInfoOne);
}
@ -142,6 +148,10 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
transfuseApplyDTO.setXkTransfuseApplyBloodbreedList(xkTransfuseApplyBloodbreedList);
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = xkTransfuseApplyCausalisMapper.queryListByBillNo(billNo);
transfuseApplyDTO.setXkTransfuseApplyCausalisList(xkTransfuseApplyCausalisList);
XkTransfuseApplyApproval xkTransfuseApplyApproval = xkTransfuseApplyApprovalMapper.queryOneByBillNo(billNo);
if (xkTransfuseApplyApproval != null) {
transfuseApplyDTO.setXkTransfuseApplyApproval(xkTransfuseApplyApproval);
}
return new Result("0", "查询成功", transfuseApplyDTO);
}
@ -159,10 +169,11 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
@Override
public Result savePreApplyInfo(TransfuseApplyDTO transfuseApplyDTO) {
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
String beinhosId = transfuseApplyInfoOne.getBeinhos_id();
String billStasus = transfuseApplyInfoOne.getBill_stasus();
String beinhosId = xkTransfuseApply.getBeinhos_id();
String billStasus = xkTransfuseApply.getBill_stasus();
switch (billStasus) {
case "B":
return new Result("-1","该申请单已经审核!");
@ -175,9 +186,9 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
case "S":
return new Result("-1","该申请单正在增加血液!");
}
String applyType = transfuseApplyInfoOne.getApply_type();
String applyType = xkTransfuseApply.getApply_type();
if(applyType.contains("手术")){
String operationName = transfuseApplyInfoOne.getOperation_name();
String operationName = xkTransfuseApply.getOperation_name();
if(StringUtils.isEmpty(operationName)){
return new Result("-1","手术备血必须填写手术名称!");
}
@ -189,11 +200,11 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
//开启职称校验
if(sfsyzckz.equals("Y")){
//申请单的申请医生
Result result = checkZC(transfuseApplyInfoOne.getApply_medic());
Result result = checkZC(xkTransfuseApply.getApply_medic());
if(!result.getCode().equals("0")) return result;
if(Integer.parseInt(result.getData().toString()) < 2) return new Result("-1","申请医师必须具备中级或以上职称,录入的申请医师不具备该职称。");
//申请单的上级医师
Result result1 = checkZC(transfuseApplyInfoOne.getTreat_medic());
Result result1 = checkZC(xkTransfuseApply.getTreat_medic());
if(!result1.getCode().equals("0")) return result1;
if(Integer.parseInt(result1.getData().toString()) < 3) return new Result("-1","上级医师必须具备高级职称,录入的上级医师不具备该职称。");
XkProTransfuseProject xkProTransfuseProject = new XkProTransfuseProject();
@ -209,9 +220,9 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
}
}
String agreementInk = BloodBankUtil.isBank(transfuseApplyInfoOne.getAgreement_ink());
String agreementInk = BloodBankUtil.isBank(xkTransfuseApply.getAgreement_ink());
if(!agreementInk.equals("Y")) return new Result("-1","请先签署输血知情同意书!");
String intent = BloodBankUtil.isBank(transfuseApplyInfoOne.getIntent());
String intent = BloodBankUtil.isBank(xkTransfuseApply.getIntent());
if(intent.equals("")) return new Result("-1","请填写输血目的!");
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
@ -257,26 +268,70 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
@Override
public Result saveApplyInfo(TransfuseApplyDTO transfuseApplyDTO) {
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
String billNo = transfuseApplyInfoOne.getBill_no();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
String billNo = xkTransfuseApply.getBill_no();
//校验是否是大量用血
if(billNo != null){
//有申请单编号,说明是修改数据,如果之前有记录,直接返回数据给前端
XkTransfuseApplyApproval xkTransfuseApplyApproval = xkTransfuseApplyApprovalMapper.queryOneByBillNo(billNo);
if(xkTransfuseApplyApproval != null){
String applyLevel = xkTransfuseApplyApproval.getApplyLevel();
if(applyLevel.equals("2")) return new Result("-1","申请用血量≥800ml,需科主任进入临床用血(大量用血审批)页面核准!");
if(applyLevel.equals("3")) return new Result("-1","申请用血量≥1600ml,需科主任进入临床用血(大量用血审批)页面核准后,再报医务部门在临床用血(大量用血审批)批准!");
}
//修改数据,保存申请单数据
}
//新增数据,判断大量用血申请
Result result = transfuseApplyUtil.computeLargeBlood(transfuseApplyDTO);
if(!result.getCode().equals("0")) return result;
//产生申请单编号
//if(!result.getCode().equals("0")) return result;
String code = result.getCode();
String msg = result.getMsg();
XkTransfuseApplyApproval xkTransfuseApplyApproval = (XkTransfuseApplyApproval) result.getData();
//设置相关值,准备数据
String billType = xkTransfuseApply.getBill_type();
if(billType.equals("补单")) xkTransfuseApply.setBill_stasus("BD");
/**
* 大量用血标志,以前是有参数控制来判断值,但是以前是一个申请单只有一个血液品种,现在是有多个,
* 暂时就以大量用血审批表来做判断吧,有大量用血的审批,标志为Y,否则为N
* String spyxlParam = bloodBankUtil.getParameterValue("spyxl");
*/
if(code.equals("0")){
xkTransfuseApply.setIs_large_use("Y");
}else{
xkTransfuseApply.setIs_large_use("N");
}
//PB的逻辑:if gs_deptid = "001" then dw_main.object.xk_transfuse_apply_send_able[1] = "Y"
//xkTransfuseApply.setSend_able("Y");
//代表新增单据
if(billNo == null){
//产生申请单编号
String newBillNo = bloodBankUtil.produceBillNo("SQD");
//申请单信息
xkTransfuseApply.setBill_no(newBillNo);
//申请单明细,血液品种
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreed.setBill_no(newBillNo);
}
//输血指征信息
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
if(!xkTransfuseApplyCausalisList.isEmpty()){
for (XkTransfuseApplyCausalis xkTransfuseApplyCausalis : xkTransfuseApplyCausalisList) {
xkTransfuseApplyCausalis.setBill_No(newBillNo);
}
}
//检验项目明细
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
if(!xkTransfuseApplyTestitemList.isEmpty()){
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
xkTransfuseApplyTestitem.setBill_no(newBillNo);
}
}
//大量用血申请单表
xkTransfuseApplyApproval.setBill_No(newBillNo);
}
//保存数据
return null;
transfuseApplyUtil.saveTransfuseApply(transfuseApplyDTO, billNo == null);
if(code.equals("0")){
return new Result("0","保存成功!");
}else{
return new Result("1",msg);
}
}
/**
@ -287,26 +342,72 @@ public class TransfuseApplyServiceImpl implements TransfuseApplyService {
@Override
public Result checkCausalis(TransfuseApplyDTO transfuseApplyDTO) {
//输血指征处理
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
if(!StringUtils.isEmpty(transfuseApplyInfoOne.getBill_no())){
//如果申请单编号不是空的,说明是修改数据,如果之前有数据,则返回之前的数据,没有标识校验通过
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
if(xkTransfuseApplyCausalisList.isEmpty()){
return new Result("0","校验通过!");
}else{
return new Result("1","校验失败!",xkTransfuseApplyCausalisList);
}
}
// TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
// XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
// if(!StringUtils.isEmpty(xkTransfuseApply.getBill_no())){
// //如果申请单编号不是空的,说明是修改数据,如果之前有数据,则返回之前的数据,没有标识校验通过
// List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
// if(xkTransfuseApplyCausalisList.isEmpty()){
// return new Result("0","校验通过!");
// }else{
// return new Result("1","校验失败!",xkTransfuseApplyCausalisList);
// }
// }
//输血指征是否输血合理,校验是否符合输血指征的规则
//他原来的逻辑,分单据类型了,没搞懂为啥分,先统一校验吧
Result result = transfuseApplyUtil.checkCausalis(transfuseApplyDTO);
if(result.getCode().equals("0")) return result;
if(result.getCode().equals("1")){
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisRetList = (List<XkTransfuseApplyCausalis>)result.getData();
return new Result("1","校验失败!",xkTransfuseApplyCausalisRetList);
}
return transfuseApplyUtil.checkCausalis(transfuseApplyDTO);
// if(result.getCode().equals("0")) return result;
// if(result.getCode().equals("1")){
// List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisRetList = (List<XkTransfuseApplyCausalis>)result.getData();
// return new Result("1","校验失败!",xkTransfuseApplyCausalisRetList);
// }
//
// return new Result("0","校验通过!");
}
return new Result("0","校验通过!");
/**
* 上级医生审核
* @param checkMedicVO
* @return
*/
@Override
public Result applyMedicCheck(CheckMedicVO checkMedicVO) {
SysUser userInfo = bloodBankUtil.getUserInfo(checkMedicVO.getCheckMedic());
String postName = userInfo.getPostname();
if(!postName.equals("003") && !postName.equals("004")) return new Result("-1","审核医生不是副主任医师或主任医师!");
XkTransfuseApply xkTransfuseApply = new XkTransfuseApply();
xkTransfuseApply.setSend_able("Y");
xkTransfuseApply.setCheck_medic(checkMedicVO.getCheckMedic());
xkTransfuseApply.setMedic_check_date(checkMedicVO.getCheckDate());
xkTransfuseApply.setBill_no(checkMedicVO.getBillNo());
xkTransfuseApplyMapper.update(xkTransfuseApply);
return new Result("0","审核通过!");
}
/**
* 输血申请单审核
* @param applyCheckVO
* @return
*/
@Override
public Result applyCheck(ApplyCheckVO applyCheckVO) {
String billNo = applyCheckVO.getBillNo();
XkTransfuseApply xkTransfuseApply = xkTransfuseApplyMapper.queryOne(billNo);
String billStasus = xkTransfuseApply.getBill_stasus();
switch (billStasus){
case "B":
return new Result("-1","该单据已经审核!");
case "C":
return new Result("-1","该单据已经配血,不允许重复审核!");
case "Z":
return new Result("-1","该单据已经作废,不允许审核!");
case "F":
return new Result("-1","该单据已复核血型,不允许重复审核!");
case "D":
return new Result("-1","该单据已发血,不允许重复审核!");
}
return null;
}
/**

View File

@ -3,8 +3,7 @@ package com.czblood.busDoctor.utils;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.czblood.bus.mapper.XkBloodBreedMapper;
import com.czblood.bus.mapper.XkCausalisSetMapper;
import com.czblood.bus.mapper.*;
import com.czblood.bus.pojo.*;
import com.czblood.bus.pojo.xtwh.XkBloodBreed;
import com.czblood.bus.pojo.xtwh.XkDmzd;
@ -12,8 +11,10 @@ import com.czblood.bus.utils.BloodBankUtil;
import com.czblood.busDoctor.mapper.TransfuseApplyMapper;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyDTO;
import com.czblood.busDoctor.pojo.DTO.TransfuseApplyInfoOne;
import com.czblood.busDoctor.pojo.DTO.XkTransfuseApplyCausalisDTO;
import com.czblood.common.core.domain.Result;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
@ -31,21 +32,33 @@ public class TransfuseApplyUtil {
XkBloodBreedMapper xkBloodBreedMapper;
@Resource
TransfuseApplyMapper transfuseApplyMapper;
@Resource
XkTransfuseApplyApprovalMapper xkTransfuseApplyApprovalMapper;
@Resource
XkPatientInfoMapper xkPatientInfoMapper;
@Resource
XkTransfuseApplyBloodbreedMapper xkTransfuseApplyBloodbreedMapper;
@Resource
XkTransfuseApplyCausalisMapper xkTransfuseApplyCausalisMapper;
@Resource
XkTransfuseApplyTestitemMapper xkTransfuseApplyTestitemMapper;
@Resource
XkTransfuseApplyMapper xkTransfuseApplyMapper;
/**
* 计算大量用血
*/
public Result computeLargeBlood(TransfuseApplyDTO transfuseApplyDTO){
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
String beinhosId = transfuseApplyInfoOne.getBeinhos_id();
String billNo = transfuseApplyInfoOne.getBill_no();
String applyType = transfuseApplyInfoOne.getApply_type();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
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(); //是否是抢救用血
String applyLev = ""; //大量用血等级
String flag = ""; //通过标志
String msg = "";
Map<String,Object> map = new HashMap<>();
//抢救用血不参与大量用血计算
if(BloodBankUtil.isBank(exp2).equals("Y")) return new Result("0","抢救用血不参与大量用血计算");
//血液品种是否参与大量用血判断
@ -82,13 +95,21 @@ public class TransfuseApplyUtil {
flag = "N";
msg = "申请用血量≥1600ml,需科主任进入临床用血(大量用血审批)页面核准后,再报医务部门在临床用血(大量用血审批)批准!";
}
map.put("applyLev",applyLev);
map.put("flag",flag);
XkTransfuseApplyApproval xkTransfuseApplyApproval = null;
if(billNo == null){
xkTransfuseApplyApproval = new XkTransfuseApplyApproval();
}else{
xkTransfuseApplyApproval = xkTransfuseApplyApprovalMapper.queryOneByBillNo(billNo);
}
xkTransfuseApplyApproval.setApplyLevel(applyLev);
xkTransfuseApplyApproval.setFlag(flag);
if(flag.equals("N")){
return new Result("1",msg,map);
return new Result("1",msg,xkTransfuseApplyApproval);
}else{
//校验通过
return new Result("0",msg,map);
return new Result("0",msg,xkTransfuseApplyApproval);
}
}
@ -101,16 +122,17 @@ public class TransfuseApplyUtil {
*/
public Result checkCausalis(TransfuseApplyDTO transfuseApplyDTO){
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
String beinhosId = BloodBankUtil.isBank(transfuseApplyInfoOne.getBeinhos_id());
String deptType = BloodBankUtil.isBank(transfuseApplyInfoOne.getDept_Type());
String useType = BloodBankUtil.isBank(transfuseApplyInfoOne.getUse_type());
String beinhosId = BloodBankUtil.isBank(xkTransfuseApply.getBeinhos_id());
String deptType = BloodBankUtil.isBank(xkTransfuseApply.getDept_Type());
String useType = BloodBankUtil.isBank(xkTransfuseApply.getUse_type());
XkCausalisSet xkCausalisSet = new XkCausalisSet();
xkCausalisSet.setUse_Sign("Y");
xkCausalisSet.setDept_Type(deptType);
xkCausalisSet.setUse_Type(useType);
List<XkCausalisSet> xkCausalisSetList = xkCausalisSetMapper.queryList(xkCausalisSet);
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = new ArrayList<>();
List<XkTransfuseApplyCausalisDTO> xkTransfuseApplyCausalisList = new ArrayList<>();
int i = 0;
//这个返回也是原来的逻辑
if(beinhosId.equals("") || deptType.equals("") || useType.equals("") ) return new Result("0","字段没有填完整,无法校验!");
@ -127,6 +149,7 @@ public class TransfuseApplyUtil {
XkCausalisSet xkCausalisSet2 = calcCausalis(collect, itemName, itemResult);
if(xkCausalisSet2 != null){
//没有校验通过的,增加数据,让前台界面显示
XkTransfuseApplyCausalisDTO xkTransfuseApplyCausalisDTO = new XkTransfuseApplyCausalisDTO();
XkTransfuseApplyCausalis xkTransfuseApplyCausalis = new XkTransfuseApplyCausalis();
xkTransfuseApplyCausalis.setSID(i++);
xkTransfuseApplyCausalis.setCausalis_Code(xkCausalisSet.getCausalis_Code());
@ -135,7 +158,10 @@ public class TransfuseApplyUtil {
xkTransfuseApplyCausalis.setUse_Flag("Y");
xkTransfuseApplyCausalis.setUpload_Flag("N");
xkTransfuseApplyCausalis.setExplain("");
xkTransfuseApplyCausalisList.add(xkTransfuseApplyCausalis);
xkTransfuseApplyCausalisDTO.setItemName(itemName);
xkTransfuseApplyCausalisDTO.setItemResult(xkTransfuseApplyTestitem.getItem_result());
xkTransfuseApplyCausalisDTO.setXkTransfuseApplyCausalis(xkTransfuseApplyCausalis);
xkTransfuseApplyCausalisList.add(xkTransfuseApplyCausalisDTO);
}
}
}
@ -226,12 +252,56 @@ public class TransfuseApplyUtil {
return null;
}
/**
* 产生单据编号
* @param billType
* @return
*/
public String produceBillNo(String billType){
return null;
@Transactional
public void saveTransfuseApply(TransfuseApplyDTO transfuseApplyDTO,boolean isNew){
TransfuseApplyInfoOne transfuseApplyInfoOne = transfuseApplyDTO.getTransfuseApplyInfoOne();
XkTransfuseApply xkTransfuseApply = transfuseApplyInfoOne.getXkTransfuseApply();
XkPatientInfo xkPatientInfo = transfuseApplyInfoOne.getXkPatientInfo();
List<XkTransfuseApplyBloodbreed> xkTransfuseApplyBloodbreedList = transfuseApplyDTO.getXkTransfuseApplyBloodbreedList();
List<XkTransfuseApplyCausalis> xkTransfuseApplyCausalisList = transfuseApplyDTO.getXkTransfuseApplyCausalisList();
List<XkTransfuseApplyTestitem> xkTransfuseApplyTestitemList = transfuseApplyDTO.getXkTransfuseApplyTestitemList();
XkTransfuseApplyApproval xkTransfuseApplyApproval = transfuseApplyDTO.getXkTransfuseApplyApproval();
//保存病人信息表
xkPatientInfoMapper.deleteXkPatientInfo(xkPatientInfo.getBeinhos_id());
xkPatientInfoMapper.insertXkPatientInfo(xkPatientInfo);
if(!isNew){
//保存申请单信息表
xkTransfuseApplyMapper.update(xkTransfuseApply);
//保存申请单品种表
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreedMapper.update(xkTransfuseApplyBloodbreed);
}
}else{
//保存申请单信息表
xkTransfuseApplyMapper.insert(xkTransfuseApply);
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreedMapper.insert(xkTransfuseApplyBloodbreed);
}
//保存申请单品种表
for (XkTransfuseApplyBloodbreed xkTransfuseApplyBloodbreed : xkTransfuseApplyBloodbreedList) {
xkTransfuseApplyBloodbreedMapper.insert(xkTransfuseApplyBloodbreed);
}
}
//保存输血指征表
if(xkTransfuseApplyCausalisList.size() > 0){
xkTransfuseApplyCausalisMapper.deleteByBillNo(xkTransfuseApplyCausalisList.get(0).getBill_No());
for (XkTransfuseApplyCausalis xkTransfuseApplyCausalis : xkTransfuseApplyCausalisList) {
xkTransfuseApplyCausalisMapper.insert(xkTransfuseApplyCausalis);
}
}
//保存检验项目明细
xkTransfuseApplyTestitemMapper.deleteXkTransfuseApplyTestitem(xkTransfuseApply.getBill_no(),0);
for (XkTransfuseApplyTestitem xkTransfuseApplyTestitem : xkTransfuseApplyTestitemList) {
xkTransfuseApplyTestitemMapper.insertXkTransfuseApplyTestitem(xkTransfuseApplyTestitem);
}
//大量用血申请单表
xkTransfuseApplyApprovalMapper.delete(xkTransfuseApplyApproval.getBill_No());
xkTransfuseApplyApprovalMapper.insert(xkTransfuseApplyApproval);
}
}

View File

@ -94,9 +94,9 @@ public enum BusinessType {
*/
CHECK,
/**
* 初审19
* 上级医生审核
*/
CHECK1,
CHECK_MEDIC,
/**
* 取消审核20
*/

View File

@ -481,3 +481,10 @@ IF NOT EXISTS (SELECT 1 FROM sys.key_constraints WHERE name = 'PK_xk_blood_apply
ALTER TABLE xk_blood_apply_trans ADD CONSTRAINT PK_xk_blood_apply_trans PRIMARY KEY CLUSTERED (blood_breed,sid);
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.key_constraints WHERE name = 'PK_xk_transfuse_apply_causalis' AND type = 'PK' )
BEGIN
ALTER TABLE xk_transfuse_apply_causalis ADD CONSTRAINT PK_xk_transfuse_apply_causalis PRIMARY KEY CLUSTERED (bill_no,Causalis_Code);
END
GO