| | |
| | | String code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | JSONArray resultDatas = object1.getJSONArray("ResultData"); |
| | | if (null != resultDatas && resultDatas.size() > 0) { |
| | | if (null != resultDatas && !resultDatas.isEmpty()) { |
| | | Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0); |
| | | String hisRegistrationId = resultDatasss.get("his_registration_id").toString(); |
| | | jzh=hisRegistrationId; |
| | |
| | | String lis_tmh_prefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | String isRequestLisAllzx = configService.selectConfigByKey("jcx_is_requestLisAllzx"); |
| | | if (mergeRequest.equals("Y")){ |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | if (isRequestLisAllzx != null && isRequestLisAllzx.equals("Y")){ |
| | | log.info("进入团体根据小项标本合并发送方法"); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | if(null !=list && !list.isEmpty()){ |
| | | List<String> strings = list.stream().map(TjSampling::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjProject> wrapper1 = new LambdaQueryWrapper<>(); |
| | |
| | | |
| | | }else{ |
| | | try { |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | // LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); |
| | | // List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | if (!list.isEmpty()) { |
| | | Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | |
| | | |
| | | List<String> jysqdh = orderService.getHuoQuJysqdh(order.getCardId()); |
| | | //2.1.6.5 作废门诊检查申请 |
| | | if (null != jcsqdh && jcsqdh.size()>0) { |
| | | if (null != jcsqdh && !jcsqdh.isEmpty()) { |
| | | for (String s : jcsqdh) { |
| | | AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s); |
| | | String result1 = getAjaxResult(result); |
| | |
| | | List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh); |
| | | // }else { |
| | | // 2.1.6.5 作废门诊检查申请 |
| | | if (null != jcsqdh && jcsqdh.size()>0) { |
| | | if (null != jcsqdh && !jcsqdh.isEmpty()) { |
| | | for (String s : jcsqdh) { |
| | | AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s); |
| | | String result1 = getAjaxResult(result); |
| | |
| | | } |
| | | |
| | | //2.1.6.3 作废门诊检验申请 |
| | | if (null != jysqdh && jysqdh.size()>0) { |
| | | if (null != jysqdh && !jysqdh.isEmpty()) { |
| | | for (String s : jysqdh) { |
| | | ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s); |
| | | result2 = getAjaxResult(ajaxResult); |
| | |
| | | } |
| | | |
| | | //2.1.6.9 作废门诊治疗处置申请 |
| | | if (null != zlsqdh && zlsqdh.size()>0) { |
| | | if (null != zlsqdh && !zlsqdh.isEmpty()) { |
| | | for (String s : zlsqdh) { |
| | | ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s); |
| | | result2 = getAjaxResult(ajaxResult); |
| | |
| | | } |
| | | |
| | | //作废药品申请 |
| | | if(null !=cfhs && cfhs.size()>0){ |
| | | if(null !=cfhs && !cfhs.isEmpty()){ |
| | | for (String cfh : cfhs) { |
| | | AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh); |
| | | String result1 = getAjaxResult(result); |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | public void ZfBlHisApiMethod(String tjh,String bldh) { |
| | | |
| | | TjOrder order = orderService.getOrderByTjNum(tjh); |
| | | if(null !=order){ |
| | | String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | |
| | | List<String> zlsqdh = orderService.getHuoQuBlZlsqdh(order.getCardId(),bldh); |
| | | List<String> jcsqdh = orderService.getHuoQuBlJcsqdh(order.getCardId(),bldh); |
| | | List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh); |
| | | List<String> cfhs = cfService.getCfBlhs(order.getCardId(),bldh); |
| | | |
| | | AjaxResult ajaxResult = null; |
| | | String result2 = null; |
| | | JSONObject object1 = null; |
| | | String code1 = null; |
| | | log.info("查询前"); |
| | | TjCustomer customer1 = customerService.getById(order.getUserId()); |
| | | log.info("customer1 ->{}",customer1); |
| | | List<String> bljcsqdhByPacs = orderService.getBljcsqdhByPacs(order.getCardId(), bldh); |
| | | log.info("bljcsqdhByPacs ->{}",bljcsqdhByPacs); |
| | | // 作废检查申请 |
| | | if (bljcsqdhByPacs != null && !bljcsqdhByPacs.isEmpty()){ |
| | | for (String sqdh : bljcsqdhByPacs) { |
| | | AjaxResult cancelPacsAjaxResult = pacsApiMethodService.updatePacsApply(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("作废检查 pacs返回 ->{}",JSONUtil.toJsonStr(cancelPacsAjaxResult)); |
| | | String result = cancelPacsAjaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | | String code = object.getStr("ResultCode"); |
| | | if(code.equals("1")){ |
| | | orderService.delHuoQuBlJcsqdh(order.getCardId(),bldh); |
| | | } |
| | | } |
| | | } |
| | | List<String> bljysqdhByLis = orderService.getBljysqdhByLis(order.getCardId(), bldh); |
| | | log.info("bljysqdhByLis ->{}",bljysqdhByLis); |
| | | // 作废检验申请 |
| | | if (bljysqdhByLis != null && !bljysqdhByLis.isEmpty()){ |
| | | for (String sqdh : bljysqdhByLis) { |
| | | AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("作废检验 lis返回 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult)); |
| | | String result = cancelLisAjaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | | String code= object.getStr("ResultCode"); |
| | | if(code.equals("1")){ |
| | | orderService.delHuoQuBlJysqdh(order.getCardId(),bldh); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | if (null != jcsqdh && !jcsqdh.isEmpty()) { |
| | | for (String s : jcsqdh) { |
| | | AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if (code.equals("0")) { |
| | | orderService.delHuoQuBlJcsqdh(order.getCardId(),bldh); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //2.1.6.3 作废门诊检验申请 |
| | | if (null != jysqdh && !jysqdh.isEmpty()) { |
| | | for (String s : jysqdh) { |
| | | ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s); |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | orderService.delHuoQuBlJysqdh(order.getCardId(),bldh); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //2.1.6.9 作废门诊治疗处置申请 |
| | | if (null != zlsqdh && !zlsqdh.isEmpty()) { |
| | | for (String s : zlsqdh) { |
| | | ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s); |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | orderService.delHuoQuZlsqdh(order.getCardId(),bldh); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //作废药品申请 |
| | | if(null !=cfhs && !cfhs.isEmpty()){ |
| | | for (String cfh : cfhs) { |
| | | AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null !=code && code.equals("0")){ |
| | | cfService.delCfByCardId(cfh); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //获取门诊结算记录 |
| | | @Transactional |
| | | public void getHisMzJsJl(TjOrder order) { |