|
@@ -3,6 +3,7 @@ package thyyxxk.webserver.service.inpatient;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -21,6 +22,7 @@ import thyyxxk.webserver.entity.inpatient.dismiss.*;
|
|
|
import thyyxxk.webserver.entity.inpatient.patient.Overview;
|
|
|
import thyyxxk.webserver.entity.inpatient.patient.Patient;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.injury.InjuryCareQualification;
|
|
|
+import thyyxxk.webserver.http.drg.DrgWebApi;
|
|
|
import thyyxxk.webserver.service.externalhttp.SiInjuryFeeUpld;
|
|
|
import thyyxxk.webserver.service.externalhttp.SiZySrvc;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
@@ -33,11 +35,14 @@ import java.util.*;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
public class DismissService {
|
|
|
private final DismissDao dao;
|
|
|
private final SiZySrvc zySrvc;
|
|
|
private final SiInjuryFeeUpld injuryFeeUpld;
|
|
|
private final RestTemplate template;
|
|
|
+ private final DrgWebApi drgWebApi;
|
|
|
+
|
|
|
@Value("${si-zy-fee-url}")
|
|
|
private String siZyFeeUrl;
|
|
|
@Value("${si-injury-fee-url}")
|
|
@@ -45,42 +50,9 @@ public class DismissService {
|
|
|
@Value("${rmHkUserApi}")
|
|
|
private String rmHkUserApi;
|
|
|
|
|
|
- @Autowired
|
|
|
- public DismissService(DismissDao dao, SiZySrvc zySrvc, SiInjuryFeeUpld injuryFeeUpld, RestTemplate template) {
|
|
|
- this.dao = dao;
|
|
|
- this.zySrvc = zySrvc;
|
|
|
- this.injuryFeeUpld = injuryFeeUpld;
|
|
|
- this.template = template;
|
|
|
- }
|
|
|
|
|
|
public ResultVo<JSONArray> powersiPreDischarge(String visitId) {
|
|
|
- String url = "http://172.16.32.126:8080/drg_web/api/json/call.action";
|
|
|
- JSONObject params = new JSONObject();
|
|
|
- params.put("function_id", "apiHnsService1001");
|
|
|
- params.put("hospital_id", SiUtil.INSTITUTION_ID);
|
|
|
- params.put("scene_type", "6");
|
|
|
- params.put("visit_id", visitId);
|
|
|
-
|
|
|
-
|
|
|
- JSONObject response;
|
|
|
- try {
|
|
|
- response = template.postForObject(url, params, JSONObject.class);
|
|
|
- } catch (Exception e) {
|
|
|
- return ResultVoUtil.success();
|
|
|
- }
|
|
|
- log.info("创智出院预审:【{}】,【{}】", visitId, response);
|
|
|
- if (null == response) {
|
|
|
- return ResultVoUtil.success();
|
|
|
- }
|
|
|
- Integer retcode = response.getInteger("return_code");
|
|
|
- if (null != retcode && retcode == 1) {
|
|
|
- JSONArray retdata = response.getJSONArray("return_data");
|
|
|
- if (null == retdata || retdata.isEmpty()) {
|
|
|
- return ResultVoUtil.success();
|
|
|
- }
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.PRE_DISCHARGE_ERROR, retdata);
|
|
|
- }
|
|
|
- return ResultVoUtil.success();
|
|
|
+ return drgWebApi.powersiPreDischarge(visitId);
|
|
|
}
|
|
|
|
|
|
public ResultVo<Object> dismiss(Patient param) {
|
|
@@ -212,7 +184,7 @@ public class DismissService {
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
if (param.getPsnCertType().equals(PsnCertType.RESIDENT_IDENTITY_CARD.getCode()) &&
|
|
|
- !IdCardUtil.isValidatedIdCard(param.getSocialNo())) {
|
|
|
+ !IdCardUtil.isValidatedIdCard(param.getSocialNo())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "身份证不合法!");
|
|
|
}
|
|
|
Integer age = param.getAge();
|
|
@@ -221,7 +193,7 @@ public class DismissService {
|
|
|
}
|
|
|
if (null != age && (age < 16 || age > 60)) {
|
|
|
if (param.getName().equals(param.getContactName()) ||
|
|
|
- param.getContactRelation().equals("0")) {
|
|
|
+ param.getContactRelation().equals("0")) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "16岁以下或60岁以上的患者,联系人不能填写本人。");
|
|
|
}
|
|
|
}
|
|
@@ -429,7 +401,7 @@ public class DismissService {
|
|
|
exception.setMessage("更新住院状态失败。" + code);
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
- new DestructionUser(settleFee.getInpatientNo(),settleFee.getAdmissTimes()).start();
|
|
|
+ new DestructionUser(settleFee.getInpatientNo(), settleFee.getAdmissTimes()).start();
|
|
|
return "OK";
|
|
|
}
|
|
|
|