| | |
| | | |
| | | //对接his总接口 注册挂号接诊申请单操作 |
| | | @Transactional |
| | | public void HisApiMethods(TjCustomer customer, Long orderId) { |
| | | public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) { |
| | | |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | |
| | | if (null != pationid) { |
| | | customer.setPationId(pationid); |
| | | customerService.updateById(customer); |
| | | /* String key = configService.selectConfigByKey("getInfoFromSqlData"); |
| | | if (null != key && key.equals("Y")) { |
| | | OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); |
| | | outpinregapplyDto.setPationid(pationid); |
| | | outpinregapplyDto.setSqysbm(SecurityUtils.getUsername()); |
| | | outpinregapplyDto.setMzksbm("0101"); |
| | | outpinregapplyDto.setCzybm("00029"); |
| | | outpinregapplyDto.setSfjz("0"); |
| | | outpinregapplyDto.setGhzlbm("01"); |
| | | outpinregapplyDto.setYwckbm("0001"); |
| | | outpinregapplyDto.setSflstd("0"); |
| | | outpinregapplyDto.setGhrq(date); |
| | | //门诊挂号 |
| | | AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto); |
| | | String result2 = getAjaxResult(ajaxResult); |
| | | JSONObject object1 = getJSONObject(result2); |
| | | String code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | JSONArray resultDatas = object1.getJSONArray("ResultData"); |
| | | if (null != resultDatas && resultDatas.size() > 0) { |
| | | //门诊医生接诊 |
| | | controller.Outpinconapply(customer.getCardId(), date, SecurityUtils.getUsername()); |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | |
| | | //检验申请 |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | |
| | | } |
| | | } |
| | | } |
| | | if (detailsDtos.size()==0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(""); |
| | | detailsDto.setSfzhfy(""); |
| | | detailsDto.setSl(0); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | dto.setDetails(detailsDtos); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | Map<String, Object> datas = object3.getJSONObject("ResultData"); |
| | | datas.put("cardId", customer.getCardId()); |
| | | JSONObject object4 = JSONUtil.parseObj(datas); |
| | | LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply"); |
| | | HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); |
| | | hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig); |
| | | if (detailsDtos.size()>0) { |
| | | dto.setDetails(detailsDtos); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | Map<String, Object> datas = object3.getJSONObject("ResultData"); |
| | | datas.put("cardId", customer.getCardId()); |
| | | JSONObject object4 = JSONUtil.parseObj(datas); |
| | | LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintestapply"); |
| | | HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); |
| | | hisApiGetMethodService.save(object4, "Outpintestapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dto))); |
| | | |
| | | }else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(customer.getCardId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | if (detailsDtoss.size()==0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(""); |
| | | detailsDto.setSfzhfy(""); |
| | | detailsDto.setSl(0); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | outpinexamapplyDto.setDetails(detailsDtoss); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | Map<String, Object> map = object5.getJSONObject("ResultData"); |
| | | map.put("cardId", customer.getCardId()); |
| | | JSONObject jsonObject = JSONUtil.parseObj(map); |
| | | LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply"); |
| | | HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); |
| | | hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig); |
| | | if (detailsDtoss.size()>0) { |
| | | outpinexamapplyDto.setDetails(detailsDtoss); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | Map<String, Object> map = object5.getJSONObject("ResultData"); |
| | | map.put("cardId", customer.getCardId()); |
| | | JSONObject jsonObject = JSONUtil.parseObj(map); |
| | | LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinexamapply"); |
| | | HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); |
| | | hisApiGetMethodService.save(jsonObject, "Outpinexamapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinexamapplyDto))); |
| | | |
| | | }else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | |
| | | |
| | | //门诊治疗处置申请 |
| | | OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | |
| | | } |
| | | } |
| | | } |
| | | if (detailDtos.size()==0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(""); |
| | | detailsDto.setSfzhfy(""); |
| | | detailsDto.setSl(0); |
| | | detailDtos.add(detailsDto); |
| | | if (detailDtos.size()>0) { |
| | | dao.setDetails(detailDtos); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData"); |
| | | map.put("cardId", customer.getCardId()); |
| | | JSONObject jsonObject = JSONUtil.parseObj(map); |
| | | LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpintreatapply"); |
| | | HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); |
| | | hisApiGetMethodService.save(jsonObject, "Outpintreatapply", hisApiConfig,JSONUtil.toJsonStr(BeanUtil.beanToMap(dao))); |
| | | }else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | dao.setDetails(detailDtos); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | Map<String, Object> map = mzylyzsq3.getJSONObject("ResultData"); |
| | | map.put("cardId", customer.getCardId()); |
| | | JSONObject jsonObject = JSONUtil.parseObj(map); |
| | | LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpinmedapply"); |
| | | HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); |
| | | hisApiGetMethodService.save(jsonObject, "Outpinmedapply", hisApiConfig); |
| | | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | |
| | | //退费后取消接诊作废申请单等操作 |
| | | @Transactional |
| | | public void ZfHisApiMethods(TjCustomer customer, TjOrder order) { |
| | | public boolean ZfHisApiMethods(TjCustomer customer, TjOrder order) { |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | | |
| | |
| | | |
| | | String zlsqdh = orderService.getHuoQuZlsqdh(order.getCardId()); |
| | | |
| | | //作废门诊检查申请 |
| | | AjaxResult result = controller.Outpindelexamapply(order.getCardId(), "00029", jcsqdh); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if (code.equals("0")) { |
| | | orderService.delHuoQuJcsqdh(order.getCardId()); |
| | | //2.1.6.5 作废门诊检查申请 |
| | | if (null !=jcsqdh){ |
| | | AjaxResult result = controller.Outpindelexamapply(order.getCardId(), "00029", jcsqdh); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if (code.equals("0")) { |
| | | orderService.delHuoQuJcsqdh(order.getCardId()); |
| | | }else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //作废门诊申请 |
| | | AjaxResult ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", jysqdh); |
| | | String result2 = getAjaxResult(ajaxResult); |
| | | JSONObject object1 = getJSONObject(result2); |
| | | String code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | orderService.delHuoQuJysqdh(order.getCardId()); |
| | | |
| | | //2.1.6.3 作废门诊检验申请 |
| | | |
| | | AjaxResult ajaxResult =null; |
| | | String result2 =null; |
| | | JSONObject object1 =null; |
| | | String code1 =null; |
| | | |
| | | if(null !=jysqdh){ |
| | | ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", jysqdh); |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | orderService.delHuoQuJysqdh(order.getCardId()); |
| | | }else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | controller.Outpinunconapply(order.getCardId(), date, "00029"); |
| | | |
| | | controller.Outpindelmedapply(order.getCardId(), "00029", zlsqdh); |
| | | |
| | | //2.1.6.9 作废门诊治疗处置申请 |
| | | if(null !=zlsqdh){ |
| | | ajaxResult = controller.Outpintdelreatapply(order.getCardId(), "00029", zlsqdh); |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | if (!code1.equals("0")){ |
| | | return false; |
| | | } |
| | | } |
| | | //2.1.3 门诊医生取消接诊 |
| | | ajaxResult = controller.Outpinunconapply(order.getCardId(), date, "00029"); |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | if (!code1.equals("0")){ |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |