| | |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import jdk.nashorn.internal.runtime.logging.Logger; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | * */ |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class HisApiMethod { |
| | | @Autowired |
| | | private HisApiMethodService controller; |
| | |
| | | |
| | | //对接his总接口 注册挂号接诊申请单操作 |
| | | @Logger |
| | | public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) { |
| | | public AjaxResult HisApiMethods(TjCustomer customer,TjOrder tjOrder) { |
| | | String jzh=null; |
| | | try { |
| | | TjOrder tjOrder = orderService.getById(orderId); |
| | | // TjOrder tjOrder = orderService.getById(orderId); |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | | OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto(); |
| | |
| | | hisApiGetMethodService.save(object4, "Outpinregapply", hisApiConfig, JSONUtil.toJsonStr(BeanUtil.beanToMap(outpinregapplyDto))); |
| | | |
| | | //门诊医生接诊 |
| | | controller.Outpinconapply(hisRegistrationId, date, "00029"); |
| | | AjaxResult result = controller.Outpinconapply(hisRegistrationId, date, "00029"); |
| | | String result3 = getAjaxResult(result); |
| | | JSONObject object2 = getJSONObject(result3); |
| | | String code2 = object2.getStr("ResultCode"); |
| | | if (!code2.equals("0")) { |
| | | return AjaxResult.error(object2.getStr("ResultContent")); |
| | | } |
| | | log.info("his接口-----医生接诊成功!"); |
| | | if(null != tjOrder.getTjCategory() && !tjOrder.getTjCategory().equals("13")){ |
| | | customer.setCardId(hisRegistrationId); |
| | | }else { |
| | |
| | | dto.setSfqj("0"); |
| | | dto.setJzqk(9); |
| | | controller.Outpinimpapply(dto); |
| | | return tijianshenqing(customer, date,tjOrder.getCardId()); |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | |
| | | //体检对his申请单调用方法 |
| | | private AjaxResult tijianshenqing(TjCustomer customer, String date,String cardId) { |
| | | public AjaxResult tijianshenqing(TjCustomer customer, String date,String cardId) { |
| | | //检验申请 |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(cardId); |
| | |
| | | if (code.equals("0")) { |
| | | orderService.delHuoQuJcsqdh(jzh); |
| | | } |
| | | // else { |
| | | // return false; |
| | | // } |
| | | } |
| | | |
| | | } |
| | |
| | | if (code1.equals("0")) { |
| | | orderService.delHuoQuJysqdh(jzh); |
| | | } |
| | | // else { |
| | | // return false; |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | // if (!code1.equals("0")) { |
| | | // return false; |
| | | // } |
| | | return true; |
| | | } |
| | | |