zjh
2025-04-24 672ce84d5ce6545a0e81709ea736c69cbbef8c1a
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiController.java
@@ -9,10 +9,7 @@
import com.ltkj.common.core.controller.BaseController;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.framework.config.UserHoder;
import com.ltkj.hosp.domain.LtkjJianchajianyanTree;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.domain.TjProject;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.hisDto.*;
import com.ltkj.hosp.mapper.TestMapper;
import com.ltkj.hosp.service.*;
@@ -23,6 +20,7 @@
import com.ltkj.hosp.vodomain.CsProVo;
import com.ltkj.web.controller.system.TjCheckController;
import io.swagger.annotations.Api;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.NoTransactionException;
@@ -63,6 +61,8 @@
    private LtkjHybgdService hybgdService;
    @Autowired
    private ITjCustomerService tjCustomerService;
    @Autowired
    private TjJcycxmService jcycxmService;
    /**
     * 获取pacs检查数据
@@ -278,7 +278,31 @@
                ltkjExamJcsqd.setBw(checkParts);
                ltkjExamJcsqd.setJgzt(pacs.getStr("diagnosis"));
                ltkjExamJcsqd.setJgbx(pacs.getStr("examination"));
                ltkjExamJcsqd.setSgorzd("1");
                ltkjExamJcsqd.setCreateTime(new Date());
                ltkjExamJcsqdService.deletedLtkjJcsqdByTjhAndXmId(ltkjExamJcsqd.getTjh(),ltkjExamJcsqd.getJcxmid());
                boolean save1 = ltkjExamJcsqdService.save(ltkjExamJcsqd);
                if(StringUtil.isNotBlank(ltkjExamJcsqd.getJgzt())){
                    jcycxmService.deletedByTjh(order.getTjNumber());
                    String[] split = ltkjExamJcsqd.getJgzt().replaceAll("\n", "").split("。|;|;|,|,");
                    for (String jg : split) {
                        if(StringUtil.isNotBlank(jg) && !jg.contains("未见异常")
                                && !jg.contains("未见明显异常") && !jg.contains("未见占位") && !jg.contains("未见")
                                && !jg.contains("未见明显")&& !jg.contains("正常")&& !jg.contains("双侧椎间孔无狭窄")){
                            TjJcycxm jcycxm=new TjJcycxm();
                            jcycxm.setTjh(order.getTjNumber());
                            jcycxm.setYqid("jczyy");
                            String[] split1 = ltkjExamJcsqd.getJcxmid().split(";");
                            jcycxm.setProId(split1[0]);
                            jcycxm.setProName(ltkjExamJcsqd.getJcxmmc());
                            jcycxm.setCreateTime(new Date());
                            jcycxm.setJcjg(jg);
                            jcycxmService.save(jcycxm);
                        }
                    }
                }
                LtkjExamJcbgd ltkjExamJcbgd = new LtkjExamJcbgd();
                ltkjExamJcbgd.setTjh(ltkjExamJcsqd.getTjh());
@@ -300,6 +324,9 @@
                ltkjExamJcbgd.setBgNr(ltkjExamJcsqd.getJgbx());
                ltkjExamJcbgd.setYxbx(ltkjExamJcsqd.getJgzt());
                ltkjExamJcbgd.setYxzd(ltkjExamJcsqd.getJgzt());
                ltkjExamJcbgd.setSgorzd("1");
                ltkjExamJcsqd.setCreateTime(new Date());
                ltkjExamJcbgdService.deletedLtkjJcbgdByTjhAndTmhA(ltkjExamJcsqd.getTjh(),ltkjExamJcsqd.getTmh());
                boolean save2 = ltkjExamJcbgdService.save(ltkjExamJcbgd);
                if (save1 && save2) {
                    try {
@@ -329,6 +356,7 @@
                queryWrapper.eq(LtkjJianchajianyanTree::getType,"检验");
                queryWrapper.eq(LtkjJianchajianyanTree::getHisXmdm,xmdm);
                LtkjJianchajianyanTree tree = ltkjJianchajianyanTreeService.getOne(queryWrapper);
                String tmh;
                if (tree == null) {
                    tree = new LtkjJianchajianyanTree();
                    tree.setHisXmdm(xmdm);
@@ -349,8 +377,10 @@
                            }
                        }
                    }
                    tmh = tree.getSqdh()+"_"+tree.getHisXmdm();
                }else{
                    tmh = tree.getSqdh();
                }
                String tmh = tree.getSqdh()+"_"+tree.getHisXmdm();
                String shys = "";
                for (Object o : lis) {
                    cn.hutool.json.JSONObject jsonObject = (cn.hutool.json.JSONObject) o;
@@ -374,14 +404,15 @@
                hysqd.setSqsj(format.format(tree.getCreateTime()));
                hysqd.setJgsj(format.format(new Date()));
                hysqd.setShrxm(shys);
                hysqd.setCreateTime(new Date());
    //            hysqd.setBbmc();
                hysqdService.deletedByTjhAndXmId(hysqd.getTjh(),hysqd.getXmid());
                hybgdService.deletedLtkjHybgdByTjhAndTmh(tree.getSqdh()+"_"+tree.getHisXmdm());
                hybgdService.deletedLtkjHybgdByTjhAndTmh(tmh);
                hysqdService.save(hysqd);
                for (Object object : lis) {
                    cn.hutool.json.JSONObject jsonObject = (cn.hutool.json.JSONObject) object;
                    LtkjHybgd hybgd = new LtkjHybgd();
                    hybgd.setTmh(tree.getSqdh()+"_"+tree.getHisXmdm());
                    hybgd.setTmh(tmh);
                    hybgd.setJcxmid(jsonObject.getStr("jcxmid"));
                    hybgd.setJcxm(jsonObject.getStr("proName"));
                    hybgd.setJyjg(jsonObject.getStr("proResult"));
@@ -402,6 +433,7 @@
                    hybgd.setJyys(jsonObject.getStr("checkDoctorName"));
                    hybgd.setShysmc(shys);
                    hybgd.setYcbz(jsonObject.getStr("ycbz"));
                    hybgd.setCreateTime(new Date());
                    hybgdService.save(hybgd);
                }
                try {