没有异常调用质控接口
parent
24bba702db
commit
5448ec84d4
@ -0,0 +1,18 @@
|
|||||||
|
package com.docus.server.report.api;
|
||||||
|
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 病案基础服务
|
||||||
|
*
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
public interface MedicalRecordService {
|
||||||
|
/**
|
||||||
|
* 根据病案主键和配置自动质控
|
||||||
|
*
|
||||||
|
* @param patientId 案主键
|
||||||
|
* @return 质控接口返回参数
|
||||||
|
*/
|
||||||
|
CommonResult<String> cqcAudit(String patientId);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.docus.server.report.api.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.docus.core.util.Func;
|
||||||
|
import com.docus.infrastructure.core.exception.BaseException;
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.server.report.api.MedicalRecordService;
|
||||||
|
import com.docus.server.report.config.ApplicationBusinessConfig;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MedicalRecordServiceImpl implements MedicalRecordService {
|
||||||
|
@Autowired
|
||||||
|
private ApplicationBusinessConfig businessConfig;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<String> cqcAudit(String patientId) {
|
||||||
|
String nisApproveUrl = businessConfig.getNisApproveUrl();
|
||||||
|
if(Func.isBlank(nisApproveUrl)){
|
||||||
|
throw new BaseException("未配置质控地址!");
|
||||||
|
}
|
||||||
|
// 地址是否已经自带参数了
|
||||||
|
if (nisApproveUrl.contains("?")) {
|
||||||
|
nisApproveUrl=nisApproveUrl+"&";
|
||||||
|
}else {
|
||||||
|
nisApproveUrl=nisApproveUrl+"?";
|
||||||
|
}
|
||||||
|
nisApproveUrl=nisApproveUrl+"patientId="+patientId;
|
||||||
|
String reusltStr = HttpUtil.get(nisApproveUrl);
|
||||||
|
return JSON.parseObject(reusltStr,new TypeReference<CommonResult<String>>(){});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue