|
@@ -1,7 +1,6 @@
|
|
|
package thyyxxk.webserver.service.medicalinsurance;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -10,9 +9,7 @@ import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.constants.sidicts.Insutype;
|
|
|
-import thyyxxk.webserver.constants.sidicts.MdtrtCertType;
|
|
|
import thyyxxk.webserver.constants.sidicts.MedType;
|
|
|
-import thyyxxk.webserver.constants.sidicts.SiFunction;
|
|
|
import thyyxxk.webserver.dao.his.medicalinsurance.SiMzDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.markmtfees.*;
|
|
@@ -365,69 +362,6 @@ public class SiMzService {
|
|
|
return ResultVoUtil.success("门诊诊断保存成功。");
|
|
|
}
|
|
|
|
|
|
- public ResultVo<List<SpcChrDiseAcct>> fetchSpcSlwinfo(String socialNo) {
|
|
|
- if (StringUtil.isBlank(socialNo)) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者身份证号不能为空,请补充!");
|
|
|
- }
|
|
|
- JSONObject input = exec.makeTradeHeader(SiFunction.OBTAIN_BASIC_PERSON_INFO);
|
|
|
- JSONObject data = new JSONObject();
|
|
|
- data.put("mdtrt_cert_type", MdtrtCertType.RESIDENT_IDENTITY_CARD.getCode());
|
|
|
- data.put("psn_cert_type", "01");
|
|
|
- data.put("mdtrt_cert_no", socialNo);
|
|
|
- data.put("certno", socialNo);
|
|
|
- input.getJSONObject("input").put("data", data);
|
|
|
- JSONObject result = exec.executeTrade(input, SiFunction.OBTAIN_BASIC_PERSON_INFO);
|
|
|
- if (null == result) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
- }
|
|
|
- if (null == result.getInteger(RESULT_CODE)) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的慢特病备案,或慢特病备案已过期!");
|
|
|
- }
|
|
|
- if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
- JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
- JSONObject baseinfo = output.getJSONObject("baseinfo");
|
|
|
- String psnNo = baseinfo.getString("psn_no");
|
|
|
- JSONArray insuinfo = output.getJSONArray("insuinfo");
|
|
|
- Date now = new Date();
|
|
|
- List<SpcChrDiseAcct> list = new ArrayList<>();
|
|
|
- for (int i = 0; i < insuinfo.size(); i++) {
|
|
|
- JSONObject item = insuinfo.getJSONObject(i);
|
|
|
- String admdvs = item.getString("insuplc_admdvs");
|
|
|
- input = exec.makeTradeHeaderWithInsureArea(SiFunction.QUERY_SPECIAL_CHRONIC_DISEASES_ACCREDITATION, admdvs);
|
|
|
- data = new JSONObject();
|
|
|
- data.put("psn_no", psnNo);
|
|
|
- input.getJSONObject("input").put("data", data);
|
|
|
- result = exec.executeTrade(input, SiFunction.QUERY_SPECIAL_CHRONIC_DISEASES_ACCREDITATION);
|
|
|
- if (null == result) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (null == result.getInteger(RESULT_CODE)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
- output = result.getJSONObject(OUTPUT);
|
|
|
- JSONArray details = output.getJSONArray("feedetail");
|
|
|
- if (null == details || details.isEmpty()) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- for (int j = 0; j < details.size(); j++) {
|
|
|
- JSONObject detail = details.getJSONObject(j);
|
|
|
- SpcChrDiseAcct spcChrDiseAcct = JSONObject.parseObject(detail.toJSONString(), SpcChrDiseAcct.class);
|
|
|
- if (now.before(spcChrDiseAcct.getEnddate())) {
|
|
|
- list.add(spcChrDiseAcct);
|
|
|
- }
|
|
|
- }
|
|
|
- if (!list.isEmpty()) {
|
|
|
- return ResultVoUtil.success(list);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的慢特病备案,或慢特病备案已过期!");
|
|
|
- }
|
|
|
-
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的慢特病备案,或慢特病备案已过期!");
|
|
|
- }
|
|
|
-
|
|
|
public Map<String, Object> queryInsuinfo(SiMzBusinessParams param) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
QryPsnBsInfo mzptnt = new QryPsnBsInfo();
|