| | |
| | | import com.ltkj.web.controller.lis.LisApiMethod; |
| | | import com.ltkj.web.controller.pacs.PacsApiMethodService; |
| | | import com.ltkj.web.controller.service.TjSysAsyncServiceImpl; |
| | | import com.ltkj.web.controller.system.TjSamplingController; |
| | | import jdk.nashorn.internal.runtime.logging.Logger; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private TjSysAsyncServiceImpl tjSysAsyncService; |
| | | @Autowired |
| | | private LisApiMethod lisApiMethod; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private ITjSamplingService tjSamplingService; |
| | | @Autowired |
| | | private TjSamplingController samplingController; |
| | | |
| | | |
| | | //将方法返回值解析成json格式 |
| | |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | TjOrder tjOrder = orderService.getOrderByCardId(cardId); |
| | | if(null !=tjOrder){ |
| | | List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null); |
| | | } |
| | | // TODO 个人以及团体 暂不向采样管理写数据 |
| | | // HIS发送无法合并操作 无法获取LIS的检验序号 条码无法打印 |
| | | // TjOrder tjOrder = orderService.getOrderByCardId(cardId); |
| | | // if(null !=tjOrder){ |
| | | // List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | // tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null); |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | // log.info("TjOrderDetail ->{}",JSONUtil.toJsonStr(detailList1)); |
| | | tjSysAsyncService.addCaiYangDengJi(detailList1, !detailList1.isEmpty(), tjOrder, sysUser,null); |
| | | |
| | | String mergeRequest = configService.selectConfigByKey("use_lis_pacs_is_auto_merge_request"); |
| | | if (mergeRequest.equals("Y")){ |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | // log.info("采样数据 ->{}",list); |
| | | Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | // log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | // log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // Lis标本代码 |
| | | String specimenTypeCode = entry.getKey(); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if (samplings.size() > 1){ |
| | | // 进行合并 |
| | | List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | // log.info("提取id ->{}",stringList); |
| | | for (int i = 0; i < stringList.size(); i++) { |
| | | String s = stringList.get(i); |
| | | if (tjSamplingService.isMergeItem(s) != 0) { |
| | | stringList.remove(s); |
| | | ids.add(s); |
| | | } |
| | | } |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList); |
| | | ids.add(id); |
| | | }else { |
| | | ids.add(samplings.get(0).getId()); |
| | | } |
| | | } |
| | | Boolean confirmed = samplingController.confirmSamplingApi(ids, "Y", "Y"); |
| | | if (!confirmed){ |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("处理失败"); |
| | | } |
| | | } |
| | | |
| | | //检验申请 |
| | | // OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | // dto.setHisRegistrationId(tjOrder.getCardId()); |