版本更新
This commit is contained in:
@@ -3,18 +3,21 @@
|
||||
*/
|
||||
package com.openhis.web.ybmanage.controller;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.ybmanage.dto.VeriPrescriptionParam;
|
||||
import com.openhis.web.ybmanage.service.IYbEleBaseService;
|
||||
import com.openhis.web.ybmanage.service.IYbEleHttpService;
|
||||
import com.openhis.ybelep.domain.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 医保电子处方业务接口
|
||||
@@ -36,17 +39,17 @@ public class YbElepController {
|
||||
* 医保电子处方查询
|
||||
*
|
||||
* @param veriPrescriptionParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求数据
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求数据
|
||||
* @return 处方信息
|
||||
*/
|
||||
@GetMapping(value = "/get-PrescriptionInfo")
|
||||
public R<?> getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return ybEleBaseService.getVeriPrescriptionInfo(veriPrescriptionParam, searchKey, pageNo, pageSize, request);
|
||||
}
|
||||
|
||||
@@ -87,7 +90,7 @@ public class YbElepController {
|
||||
* 医保电子处方状态更新(撤销)
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param quashReason 撤销原因
|
||||
* @param quashReason 撤销原因
|
||||
* @return 处方信息
|
||||
*/
|
||||
@PutMapping(value = "/quashPrescriptionStatus")
|
||||
@@ -99,28 +102,30 @@ public class YbElepController {
|
||||
* 电子处方上传预核验
|
||||
*
|
||||
* @param prescriptionNo 处方信息
|
||||
* @param authNo 电子凭证线上身份核验流水号
|
||||
* @param ecToken 电子凭证令牌
|
||||
* @param tenantId 租户Id
|
||||
* @param authNo 电子凭证线上身份核验流水号
|
||||
* @param ecToken 电子凭证令牌
|
||||
* @param tenantId 租户Id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pre-verification")
|
||||
public R<?> preVerification(String prescriptionNo, String ecToken, String authNo, Integer tenantId) {
|
||||
PreCheckPrescription pcp = ybEleBaseService.makePreCheckPrescription(prescriptionNo, tenantId);
|
||||
//查类型和审核医生名称
|
||||
Map<String,String> map = ybEleBaseService.getMedTypeAndDoctorName(prescriptionNo, tenantId);
|
||||
public R<?> preVerification(String prescriptionNo, String ecToken, String authNo, Integer tenantId) throws ServerException {
|
||||
|
||||
R<?> result = ybEleHttpService.preCheck(pcp,map.get("medType"),map.get("doctorName"));
|
||||
PreCheckPrescription pcp = ybEleBaseService.makePreCheckPrescription(prescriptionNo, tenantId);
|
||||
|
||||
// 查类型和审核医生名称
|
||||
Map<String, String> map = ybEleBaseService.getMedTypeAndDoctorName(prescriptionNo, tenantId);
|
||||
|
||||
R<?> result = ybEleHttpService.preCheck(pcp, map.get("medType"), map.get("doctorName"));
|
||||
// 入参和出参 保存
|
||||
if (pcp != null) {
|
||||
pcp.getMdtrtinfo().setPrescriptionNo(prescriptionNo);
|
||||
ybEleBaseService.savePreCheckPrescription(pcp);
|
||||
}
|
||||
//成功时保存出参
|
||||
// 成功时保存出参
|
||||
if (result.getCode() == 200) {
|
||||
ElepVeriPrescriptionOutput pcpResult = null;
|
||||
if (ElepVeriPrescriptionOutput.class.isAssignableFrom(result.getData().getClass())) {
|
||||
pcpResult = (ElepVeriPrescriptionOutput) result.getData();
|
||||
pcpResult = (ElepVeriPrescriptionOutput)result.getData();
|
||||
pcpResult.setPrescriptionNo(prescriptionNo);
|
||||
ybEleBaseService.saveEleVeriPrescriptionOutput(pcpResult);
|
||||
return R.ok(pcpResult);
|
||||
@@ -132,30 +137,30 @@ public class YbElepController {
|
||||
/**
|
||||
* 电子处方医保电子签名
|
||||
*
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param practitionerId 审方药师Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pre-signature")
|
||||
public R<?> eleSignature(String hiRxno, Long practitionerId,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) {
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) {
|
||||
|
||||
ElepSignatureInput eleSignature =
|
||||
ybEleBaseService.makeEleSignature(hiRxno, practitionerId, checkDate, tenantId);
|
||||
R<?> result = ybEleHttpService.eleSign(eleSignature);
|
||||
ybEleBaseService.makeEleSignature(hiRxno, practitionerId, checkDate, tenantId);
|
||||
R<?> result = ybEleHttpService.eleSign(eleSignature);
|
||||
|
||||
// 入参和出参都保存
|
||||
if (eleSignature != null) {
|
||||
eleSignature.setHiRxno(hiRxno);
|
||||
ybEleBaseService.saveEleSignature(eleSignature);
|
||||
}
|
||||
//成功时保存出参
|
||||
// 成功时保存出参
|
||||
if (result.getCode() == 200) {
|
||||
ElepSignatureOutput esResult = null;
|
||||
if (ElepSignatureOutput.class.isAssignableFrom(result.getData().getClass())) {
|
||||
esResult = (ElepSignatureOutput) result.getData();
|
||||
esResult = (ElepSignatureOutput)result.getData();
|
||||
esResult.setHiRxno(hiRxno);
|
||||
ybEleBaseService.saveEleSignatureOutput(esResult);
|
||||
return R.ok(esResult);
|
||||
@@ -167,28 +172,28 @@ public class YbElepController {
|
||||
/**
|
||||
* 电子处方上传
|
||||
*
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param practitionerId 审方药师Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pre-upload")
|
||||
public R<?> uploadElePrescription(String hiRxno, Long practitionerId,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) {
|
||||
ElepUploadInput eleUploadInput =
|
||||
ybEleBaseService.makeEleUploadInput(hiRxno, practitionerId, checkDate, tenantId);
|
||||
R<?> result = ybEleHttpService.uploadElePre(eleUploadInput);
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date checkDate, Integer tenantId) {
|
||||
ElepUploadInput eleUploadInput =
|
||||
ybEleBaseService.makeEleUploadInput(hiRxno, practitionerId, checkDate, tenantId);
|
||||
R<?> result = ybEleHttpService.uploadElePre(eleUploadInput);
|
||||
|
||||
// 入参和出参都保存
|
||||
if (eleUploadInput != null) {
|
||||
ybEleBaseService.saveEleUploadInput(eleUploadInput);
|
||||
}
|
||||
//成功时保存出参
|
||||
// 成功时保存出参
|
||||
if (result.getCode() == 200) {
|
||||
ElepUploadOutput euResult = null;
|
||||
if (ElepUploadOutput.class.isAssignableFrom(result.getData().getClass())) {
|
||||
euResult = (ElepUploadOutput) result.getData();
|
||||
euResult = (ElepUploadOutput)result.getData();
|
||||
ybEleBaseService.saveEleUploadOutput(euResult);
|
||||
return R.ok(euResult);
|
||||
}
|
||||
@@ -199,28 +204,28 @@ public class YbElepController {
|
||||
/**
|
||||
* 电子处方撤销
|
||||
*
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param practitionerId 撤销医师Id
|
||||
* @param description 撤销原因
|
||||
* @param revokeDate 撤销时间
|
||||
* @param tenantId 租户Id
|
||||
* @param description 撤销原因
|
||||
* @param revokeDate 撤销时间
|
||||
* @param tenantId 租户Id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/pre-revoke")
|
||||
public R<?> revokePrescription(String hiRxno, Long practitionerId, String description,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date revokeDate, Integer tenantId) {
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date revokeDate, Integer tenantId) {
|
||||
|
||||
ElepRevokeInput eleRevokeInput =
|
||||
ybEleBaseService.makeEleRevokeInput(hiRxno, practitionerId, description, revokeDate, tenantId); // 入参和出参都保存
|
||||
R<?> result = ybEleHttpService.revokePre(eleRevokeInput);
|
||||
ybEleBaseService.makeEleRevokeInput(hiRxno, practitionerId, description, revokeDate, tenantId); // 入参和出参都保存
|
||||
R<?> result = ybEleHttpService.revokePre(eleRevokeInput);
|
||||
if (eleRevokeInput != null) {
|
||||
ybEleBaseService.saveEleRevokeInput(eleRevokeInput);
|
||||
}
|
||||
//成功时保存出参
|
||||
// 成功时保存出参
|
||||
if (result.getCode() == 200) {
|
||||
ElepRevokeOutput ereResult = null;
|
||||
if (ElepRevokeOutput.class.isAssignableFrom(result.getData().getClass())) {
|
||||
ereResult = (ElepRevokeOutput) result.getData();
|
||||
ereResult = (ElepRevokeOutput)result.getData();
|
||||
ybEleBaseService.saveEleRevokeOutput(ereResult);
|
||||
return R.ok(ereResult);
|
||||
}
|
||||
@@ -243,11 +248,11 @@ public class YbElepController {
|
||||
if (eleQueryPreResultInput != null) {
|
||||
ybEleBaseService.saveEleQueryPrescriptionInput(eleQueryPreResultInput);
|
||||
}
|
||||
//成功时保存出参
|
||||
// 成功时保存出参
|
||||
if (result.getCode() == 200) {
|
||||
QueryPrescription emrResult = null;
|
||||
if (QueryPrescription.class.isAssignableFrom(result.getData().getClass())) {
|
||||
emrResult = (QueryPrescription) result.getData();
|
||||
emrResult = (QueryPrescription)result.getData();
|
||||
ybEleBaseService.saveEleMedResultOut(emrResult);
|
||||
return R.ok(emrResult);
|
||||
}
|
||||
@@ -264,16 +269,16 @@ public class YbElepController {
|
||||
@GetMapping("/med-query")
|
||||
public R<?> queryMedPrescription(String hiRxno) {
|
||||
|
||||
ElepMedresultInput eleMedInput = ybEleBaseService.makeEleMedResultInput(hiRxno); // 入参和出参都保存
|
||||
ElepMedresultInput eleMedInput = ybEleBaseService.makeEleMedResultInput(hiRxno); // 入参和出参都保存
|
||||
R<?> result = ybEleHttpService.queryMedPre(eleMedInput);
|
||||
if (eleMedInput != null) {
|
||||
ybEleBaseService.saveEleMedResultInput(eleMedInput);
|
||||
}
|
||||
//成功时保存出参
|
||||
// 成功时保存出参
|
||||
if (result.getCode() == 200) {
|
||||
MedicationResultInquiry medResult = null;
|
||||
if (MedicationResultInquiry.class.isAssignableFrom(result.getData().getClass())) {
|
||||
medResult = (MedicationResultInquiry) result.getData();
|
||||
medResult = (MedicationResultInquiry)result.getData();
|
||||
ybEleBaseService.saveMedicationResultInquiry(medResult);
|
||||
return R.ok(medResult);
|
||||
}
|
||||
|
||||
@@ -3,17 +3,16 @@
|
||||
*/
|
||||
package com.openhis.web.ybmanage.service;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||
import com.openhis.web.ybmanage.dto.VeriPrescriptionParam;
|
||||
import com.openhis.ybelep.domain.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author yuxj
|
||||
@@ -31,8 +30,8 @@ public interface IYbEleBaseService {
|
||||
* @param request 请求数据
|
||||
* @return 处方信息
|
||||
*/
|
||||
R<?> getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
R<?> getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 医保电子处方查看
|
||||
@@ -65,7 +64,7 @@ public interface IYbEleBaseService {
|
||||
* @param quashReason 撤销原因
|
||||
* @return 处方信息
|
||||
*/
|
||||
R<?> quashPrescriptionStatus(String prescriptionNo,String quashReason);
|
||||
R<?> quashPrescriptionStatus(String prescriptionNo, String quashReason);
|
||||
|
||||
/**
|
||||
* 做成电子处方上传预核验入参信息
|
||||
@@ -74,8 +73,7 @@ public interface IYbEleBaseService {
|
||||
* @param tenantId 租户Id
|
||||
* @return 处方信息
|
||||
*/
|
||||
PreCheckPrescription makePreCheckPrescription(String prescriptionNo,
|
||||
Integer tenantId);
|
||||
PreCheckPrescription makePreCheckPrescription(String prescriptionNo, Integer tenantId) throws ServerException;
|
||||
|
||||
/**
|
||||
* 电子处方上传预核验信息保存
|
||||
@@ -157,7 +155,8 @@ public interface IYbEleBaseService {
|
||||
* @param tenantId 租户Id
|
||||
* @return 电子处方撤销入参
|
||||
*/
|
||||
ElepRevokeInput makeEleRevokeInput(String hiRxno, Long practitionerId,String description, Date checkDate, Integer tenantId);
|
||||
ElepRevokeInput makeEleRevokeInput(String hiRxno, Long practitionerId, String description, Date checkDate,
|
||||
Integer tenantId);
|
||||
|
||||
/**
|
||||
* 保存电子处方撤销入参
|
||||
@@ -223,5 +222,13 @@ public interface IYbEleBaseService {
|
||||
*/
|
||||
void saveMedicationResultInquiry(MedicationResultInquiry medResInquiry);
|
||||
|
||||
Map<String,String> getMedTypeAndDoctorName(String prescriptionNo, Integer tenantId);
|
||||
/**
|
||||
* 查类型和审核医生名称
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param tenantId 租户
|
||||
* @return 结果
|
||||
*/
|
||||
Map<String, String> getMedTypeAndDoctorName(String prescriptionNo, Integer tenantId);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,12 +3,8 @@
|
||||
*/
|
||||
package com.openhis.web.ybmanage.service.impl;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.yb.dto.BaseInfo;
|
||||
import com.openhis.yb.dto.BaseParam;
|
||||
import com.openhis.yb.util.YbParamBuilderUtil;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
@@ -21,14 +17,18 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.openhis.web.ybmanage.config.YbServiceConfig;
|
||||
import com.openhis.web.ybmanage.dto.Result;
|
||||
import com.openhis.web.ybmanage.service.IYbEleHttpService;
|
||||
import com.openhis.yb.dto.BaseInfo;
|
||||
import com.openhis.yb.dto.BaseParam;
|
||||
import com.openhis.yb.util.YbParamBuilderUtil;
|
||||
import com.openhis.ybelep.domain.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* http请求接口
|
||||
*
|
||||
@@ -43,6 +43,7 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
|
||||
@Autowired
|
||||
YbParamBuilderUtil ybParamBuilderUtil;
|
||||
|
||||
/**
|
||||
* 采用HTTP协议中的 POST 方法,发送医保电子处方注册预核验请求,并处理响应结果
|
||||
*
|
||||
@@ -50,11 +51,12 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
* @return 医保电子处方注册预核验响应出参实体
|
||||
*/
|
||||
@Override
|
||||
public R<?> preCheck(PreCheckPrescription pcp, String medType , String dutyDoctorName) {
|
||||
public R<?> preCheck(PreCheckPrescription pcp, String medType, String dutyDoctorName) {
|
||||
ElepVeriPrescriptionOutput pcpResult = new ElepVeriPrescriptionOutput();
|
||||
BaseInfo baseInfo = ybParamBuilderUtil.getBaseInfo(medType, dutyDoctorName);
|
||||
// 发送请求
|
||||
String s = httpPost( SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/preCheckPrescription", pcp,baseInfo);
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/preCheckPrescription",
|
||||
pcp, baseInfo);
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
@@ -66,9 +68,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
if (result != null && result.isSuccess()) {
|
||||
pcpResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepVeriPrescriptionOutput.class);;
|
||||
pcpResult.setPrescriptionNo(pcp.getHospRxno());
|
||||
return R.ok(pcpResult);
|
||||
}else{
|
||||
return R.fail(result.getMessage());
|
||||
return R.ok(pcpResult);
|
||||
} else {
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +84,8 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
|
||||
ElepSignatureOutput esResult = new ElepSignatureOutput();
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/signature", eleSign,ybParamBuilderUtil.getBaseInfo("",""));
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/signature", eleSign,
|
||||
ybParamBuilderUtil.getBaseInfo("", ""));
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
@@ -93,9 +96,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
}
|
||||
if (result != null && result.isSuccess()) {
|
||||
esResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepSignatureOutput.class);
|
||||
return R.ok(esResult);
|
||||
}else{
|
||||
return R.fail(result.getMessage());
|
||||
return R.ok(esResult);
|
||||
} else {
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +113,8 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
|
||||
ElepUploadOutput euResult = new ElepUploadOutput();
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/upload", eleUploadInput,ybParamBuilderUtil.getBaseInfo("",""));
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/upload",
|
||||
eleUploadInput, ybParamBuilderUtil.getBaseInfo("", ""));
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
@@ -121,9 +125,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
}
|
||||
if (result != null && result.isSuccess()) {
|
||||
euResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepUploadOutput.class);
|
||||
return R.ok(euResult);
|
||||
}else{
|
||||
return R.fail(result.getMessage());
|
||||
return R.ok(euResult);
|
||||
} else {
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +142,8 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
|
||||
ElepRevokeOutput ereResult = new ElepRevokeOutput();
|
||||
// 发送请求
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/revoke", eleRevokeInput,ybParamBuilderUtil.getBaseInfo("",""));
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/revoke",
|
||||
eleRevokeInput, ybParamBuilderUtil.getBaseInfo("", ""));
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
@@ -149,9 +154,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
}
|
||||
if (result != null && result.isSuccess()) {
|
||||
ereResult = JSON.parseObject(JSON.toJSONString(result.getResult()), ElepRevokeOutput.class);
|
||||
return R.ok(ereResult);
|
||||
}else{
|
||||
return R.fail(result.getMessage());
|
||||
return R.ok(ereResult);
|
||||
} else {
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,14 +168,14 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
*/
|
||||
@Override
|
||||
public R<?> queryPre(ElepQuerPrescriptionInput eleQueryPreInput) {
|
||||
//拼参数
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(eleQueryPreInput);
|
||||
// baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(o);
|
||||
// 拼参数
|
||||
// BaseParam baseParam = new BaseParam();
|
||||
// baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(eleQueryPreInput);
|
||||
// baseParam.setBaseInfo(ybParamBuilderUtil.getBaseInfo()).setData(o);
|
||||
QueryPrescription emrResult = new QueryPrescription();
|
||||
// 发送请求
|
||||
String s =
|
||||
httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/querPrescription", eleQueryPreInput,ybParamBuilderUtil.getBaseInfo("",""));
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/querPrescription",
|
||||
eleQueryPreInput, ybParamBuilderUtil.getBaseInfo("", ""));
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
@@ -181,9 +186,9 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
}
|
||||
if (result != null && result.isSuccess()) {
|
||||
emrResult = JSON.parseObject(JSON.toJSONString(result.getResult()), QueryPrescription.class);
|
||||
return R.ok(emrResult);
|
||||
}else{
|
||||
return R.fail(result.getMessage());
|
||||
return R.ok(emrResult);
|
||||
} else {
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,12 +198,12 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
* @param eleMedInput 电子处方取药结果查询入参实体
|
||||
* @return 电子处方取药结果查询出参实体
|
||||
*/
|
||||
public R<?> queryMedPre(ElepMedresultInput eleMedInput){
|
||||
public R<?> queryMedPre(ElepMedresultInput eleMedInput) {
|
||||
|
||||
MedicationResultInquiry medResult = new MedicationResultInquiry();
|
||||
// 发送请求
|
||||
String s =
|
||||
httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/medresult", eleMedInput,ybParamBuilderUtil.getBaseInfo("",""));
|
||||
String s = httpPost(SecurityUtils.getLoginUser().getOptionJson().getString("eleUrl") + "/medresult",
|
||||
eleMedInput, ybParamBuilderUtil.getBaseInfo("", ""));
|
||||
// 参数处理
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Result result = null;
|
||||
@@ -209,28 +214,30 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
}
|
||||
if (result != null && result.isSuccess()) {
|
||||
medResult = JSON.parseObject(JSON.toJSONString(result.getResult()), MedicationResultInquiry.class);
|
||||
return R.ok(medResult);
|
||||
}else{
|
||||
return R.fail(result.getMessage());
|
||||
return R.ok(medResult);
|
||||
} else {
|
||||
return R.fail(result.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送http请求(2025/05/02经测试,若以自带的工具类发送请求失败,故使用原peis系统中成功调用的写法重新封装)
|
||||
*
|
||||
* @param url 路径
|
||||
* @param o 参数
|
||||
* @return
|
||||
*/
|
||||
private String httpPost(String url, Object o, BaseInfo baseInfo){
|
||||
private String httpPost(String url, Object o, BaseInfo baseInfo) {
|
||||
String resultString = "";
|
||||
// //拼参数
|
||||
//拼参数
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setBaseInfo(baseInfo).setData(o);
|
||||
//创建Http请求
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setConnectionRequestTimeout(30000)
|
||||
.setSocketTimeout(30000).build();
|
||||
// 创建Http请求(2025/10/13 师大会超时故此由30000-》60000)
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(90000).setConnectionRequestTimeout(90000)
|
||||
.setSocketTimeout(90000).build();
|
||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig).build();
|
||||
CloseableHttpResponse response = null;
|
||||
//发送请求
|
||||
// 发送请求
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
StringEntity stringEntity = new StringEntity(JSON.toJSONString(baseParam), ContentType.APPLICATION_JSON);
|
||||
@@ -238,12 +245,10 @@ public class YbEleHttpServiceImpl implements IYbEleHttpService {
|
||||
// 执行http请求
|
||||
response = httpClient.execute(httpPost);
|
||||
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("Http请求异常,请稍后再试。");
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -3,8 +3,18 @@
|
||||
*/
|
||||
package com.openhis.web.ybmanage.service.impl;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.common.enums.ybenums.YbMedType;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -19,37 +29,36 @@ import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import com.openhis.common.enums.PrescriptionType;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.financial.service.IContractService;
|
||||
import com.openhis.web.ybmanage.dto.VeriPrescriptionDetailInfoDto;
|
||||
import com.openhis.web.ybmanage.dto.VeriPrescriptionInfoDto;
|
||||
import com.openhis.web.ybmanage.dto.VeriPrescriptionParam;
|
||||
import com.openhis.web.ybmanage.mapper.YbElepMapper;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
import com.openhis.workflow.service.IElepMedicationRequestService;
|
||||
import com.openhis.yb.service.IPerinfoService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.openhis.web.ybmanage.service.IYbEleBaseService;
|
||||
import com.openhis.web.ybmanage.util.YbEleParamBuilderUtil;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
import com.openhis.workflow.service.IElepMedicationRequestService;
|
||||
import com.openhis.yb.domain.ClinicReg;
|
||||
import com.openhis.yb.dto.Clinic2203DiseInfoParam;
|
||||
import com.openhis.yb.dto.Clinic2203MedicalParam;
|
||||
import com.openhis.yb.service.IPerinfoService;
|
||||
import com.openhis.yb.service.IRegService;
|
||||
import com.openhis.yb.service.YbHttpUtils;
|
||||
import com.openhis.ybcatalog.domain.CatalogSpecialInsuranceDisease;
|
||||
import com.openhis.ybcatalog.service.ICatalogSpecialDiseaseService;
|
||||
import com.openhis.ybelep.domain.*;
|
||||
import com.openhis.ybelep.service.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 医保表的增删改查接口
|
||||
*
|
||||
@@ -62,6 +71,12 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
@Autowired
|
||||
IRegService iRegService;
|
||||
@Autowired
|
||||
YbHttpUtils ybHttpUtils;
|
||||
@Autowired
|
||||
ICatalogSpecialDiseaseService catalogSpecialDiseaseService;
|
||||
@Autowired
|
||||
IConditionDefinitionService conditionDefinitionService;
|
||||
@Autowired
|
||||
IPerinfoService perinfoService;
|
||||
@Autowired
|
||||
IContractService contractService;
|
||||
@@ -124,29 +139,29 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
* 医保电子处方查询
|
||||
*
|
||||
* @param veriPrescriptionParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求数据
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求数据
|
||||
* @return 处方信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getVeriPrescriptionInfo(VeriPrescriptionParam veriPrescriptionParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<VeriPrescriptionParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(veriPrescriptionParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.IptOtpNo)),
|
||||
request);
|
||||
HisQueryUtils.buildQueryWrapper(veriPrescriptionParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.IptOtpNo)),
|
||||
request);
|
||||
|
||||
// 医保电子处方查询
|
||||
IPage<VeriPrescriptionInfoDto> veriPrescriptionInfo =
|
||||
ybElepMapper.getVeriPrescriptionInfo(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
ybElepMapper.getVeriPrescriptionInfo(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
// 状态转换
|
||||
veriPrescriptionInfo.getRecords().forEach(prescriptionInfoDto -> {
|
||||
prescriptionInfoDto.setStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(RequestStatus.class, prescriptionInfoDto.getStatusEnum()));
|
||||
EnumUtils.getInfoByValue(RequestStatus.class, prescriptionInfoDto.getStatusEnum()));
|
||||
});
|
||||
|
||||
return R.ok(veriPrescriptionInfo);
|
||||
@@ -162,7 +177,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
public R<?> getPrescriptionDetailInfo(String prescriptionNo) {
|
||||
// 处方详细查询
|
||||
List<VeriPrescriptionDetailInfoDto> prescriptionDetailInfo =
|
||||
ybElepMapper.getVeriPrescriptionDetailInfo(prescriptionNo);
|
||||
ybElepMapper.getVeriPrescriptionDetailInfo(prescriptionNo);
|
||||
// 状态转换
|
||||
for (VeriPrescriptionDetailInfoDto item : prescriptionDetailInfo) {
|
||||
item.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, item.getStatusEnum()));
|
||||
@@ -186,15 +201,15 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
Date now = DateUtils.getNowDate();
|
||||
// 获取医保处方号
|
||||
List<ElepVeriPrescriptionOutput> prescriptionOutput =
|
||||
elePresOutputService.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>()
|
||||
.eq(ElepVeriPrescriptionOutput::getPrescriptionNo, prescriptionNo)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
elePresOutputService.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>()
|
||||
.eq(ElepVeriPrescriptionOutput::getPrescriptionNo, prescriptionNo)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
if (prescriptionOutput == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
// 获取电子处方信息
|
||||
List<ElepMedicationRequest> elepMedicationRequest =
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo);
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo);
|
||||
if (elepMedicationRequest == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
@@ -235,7 +250,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
Date now = DateUtils.getNowDate();
|
||||
// 获取电子处方信息
|
||||
List<ElepMedicationRequest> elepMedicationRequest =
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo);
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo);
|
||||
if (elepMedicationRequest == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
@@ -257,7 +272,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
* 医保电子处方状态更新(撤销)
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param quashReason 撤销原因
|
||||
* @param quashReason 撤销原因
|
||||
* @return 处方信息
|
||||
*/
|
||||
@Override
|
||||
@@ -269,7 +284,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
Date now = DateUtils.getNowDate();
|
||||
// 获取电子处方信息
|
||||
List<ElepMedicationRequest> elepMedicationRequest =
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo);
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionNo);
|
||||
if (elepMedicationRequest == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
@@ -297,17 +312,16 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
* 做成电子处方上传预核验入参信息
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param tenantId 租户Id
|
||||
* @param tenantId 租户Id
|
||||
* @return 处方信息
|
||||
*/
|
||||
@Override
|
||||
public PreCheckPrescription makePreCheckPrescription(String prescriptionNo,
|
||||
Integer tenantId) {
|
||||
public PreCheckPrescription makePreCheckPrescription(String prescriptionNo, Integer tenantId) throws ServerException {
|
||||
|
||||
// 获取药品请求信息(处方表)
|
||||
List<ElepMedicationRequest> medicationRequestList = elepMedicationRequestService.list(
|
||||
new LambdaQueryWrapper<ElepMedicationRequest>().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo)
|
||||
.eq(ElepMedicationRequest::getTenantId, tenantId));
|
||||
new LambdaQueryWrapper<ElepMedicationRequest>().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo)
|
||||
.eq(ElepMedicationRequest::getTenantId, tenantId));
|
||||
if (medicationRequestList == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -315,9 +329,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
|
||||
// 就诊信息
|
||||
Encounter encounter = encounterService.getById(medicationRequest.getEncounterId());
|
||||
//患者信息
|
||||
// 患者信息
|
||||
Patient patient = patientService.getById(encounter.getPatientId());
|
||||
// 获取医保挂号信息 todo clinicReg可能改成一对多
|
||||
// 获取医保挂号信息 todo clinicReg可能改成一对多
|
||||
ClinicReg clinicReg = iRegService.getByBusNo(encounter.getBusNo());
|
||||
if (clinicReg == null) {
|
||||
return null;
|
||||
@@ -325,19 +339,26 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
|
||||
// 获取处方信息
|
||||
PreCheckPrescription prescriptionInfo =
|
||||
ybEleUtil.getEleVeriPrescriptionInfo(medicationRequest, patient, tenantId);
|
||||
ybEleUtil.getEleVeriPrescriptionInfo(medicationRequest, patient, tenantId);
|
||||
// 获取处方明细信息
|
||||
List<ElepVeriPrescriptionDetail> rxdrugdetail =
|
||||
ybEleUtil.getEleVeriPrescriptionDetail(prescriptionNo, tenantId);
|
||||
ybEleUtil.getEleVeriPrescriptionDetail(prescriptionNo, tenantId);
|
||||
|
||||
// 获取就诊信息和诊断信息
|
||||
PreCheckPrescription eleVisAndDisInfo =
|
||||
ybEleUtil.getEleVeriVisitAndDiagnosisInfo(medicationRequest, clinicReg, tenantId);
|
||||
ybEleUtil.getEleVeriVisitAndDiagnosisInfo(medicationRequest, clinicReg, tenantId);
|
||||
if(eleVisAndDisInfo==null){
|
||||
throw new ServerException("未查询到就诊或诊断信息");
|
||||
}
|
||||
|
||||
// 电子处方上传预核验实体赋值
|
||||
prescriptionInfo.setRxdrugdetail(rxdrugdetail).setMdtrtinfo(eleVisAndDisInfo.getMdtrtinfo())
|
||||
.setDiseinfo(eleVisAndDisInfo.getDiseinfo());
|
||||
|
||||
prescriptionInfo.setRxdrugdetail(rxdrugdetail)
|
||||
.setMdtrtinfo(eleVisAndDisInfo.getMdtrtinfo()).setDiseinfo(eleVisAndDisInfo.getDiseinfo());
|
||||
// 需要先进行2203接口上传就诊信息
|
||||
this.upload2203(prescriptionInfo, medicationRequest, clinicReg);
|
||||
|
||||
iRegService.updateById(clinicReg);
|
||||
|
||||
return prescriptionInfo;
|
||||
}
|
||||
@@ -351,7 +372,7 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
@Override
|
||||
public void savePreCheckPrescription(PreCheckPrescription pcpResult) {
|
||||
|
||||
//todo dto和表的字段类型不一致
|
||||
// todo dto和表的字段类型不一致
|
||||
ElepVeriPrescriptionInfo prescriptionInfo = new ElepVeriPrescriptionInfo();
|
||||
BeanUtils.copyProperties(pcpResult, prescriptionInfo);
|
||||
|
||||
@@ -365,7 +386,6 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
eleVeriDiagnosisInfoService.save(pcpResult.getDiseinfo());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 电子处方上传预核验响应出参信息保存
|
||||
*
|
||||
@@ -380,18 +400,18 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
/**
|
||||
* 做成电子处方医保电子签名入参
|
||||
*
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param practitionerId 审方药师Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @return 处方信息
|
||||
*/
|
||||
@Override
|
||||
public ElepSignatureInput makeEleSignature(String hiRxno, Long practitionerId, Date checkDate, Integer tenantId) {
|
||||
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService.list(
|
||||
new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService
|
||||
.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
if (pcpResult == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -423,22 +443,22 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
/**
|
||||
* 做成电子处方上传入参
|
||||
*
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param practitionerId 审方药师Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @param checkDate 审方时间
|
||||
* @param tenantId 租户Id
|
||||
* @return 电子处方上传入参
|
||||
*/
|
||||
@Override
|
||||
public ElepUploadInput makeEleUploadInput(String hiRxno, Long practitionerId, Date checkDate, Integer tenantId) {
|
||||
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService.list(
|
||||
new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService
|
||||
.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
|
||||
List<ElepSignatureOutput> esResult = eleSignOutService
|
||||
.list(new LambdaQueryWrapper<ElepSignatureOutput>().eq(ElepSignatureOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepSignatureOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
.list(new LambdaQueryWrapper<ElepSignatureOutput>().eq(ElepSignatureOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepSignatureOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
|
||||
if (pcpResult == null || esResult == null) {
|
||||
return null;
|
||||
@@ -471,32 +491,33 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
/**
|
||||
* 做成电子处方撤销入参
|
||||
*
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param hiRxno 医保处方编号
|
||||
* @param practitionerId 撤销药师Id
|
||||
* @param description 撤销原因
|
||||
* @param revokeDate 撤销时间
|
||||
* @param tenantId 租户Id
|
||||
* @param description 撤销原因
|
||||
* @param revokeDate 撤销时间
|
||||
* @param tenantId 租户Id
|
||||
* @return 电子处方撤销入参
|
||||
*/
|
||||
@Override
|
||||
public ElepRevokeInput makeEleRevokeInput(String hiRxno, Long practitionerId, String description, Date revokeDate,
|
||||
Integer tenantId) {
|
||||
Integer tenantId) {
|
||||
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService.list(
|
||||
new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService
|
||||
.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
if (pcpResult == null) {
|
||||
return null;
|
||||
}
|
||||
List<ElepUploadOutput> euResult = eleUploadOutputService
|
||||
.list(new LambdaQueryWrapper<ElepUploadOutput>().eq(ElepUploadOutput::getHiRxno, pcpResult.get(0).getHiRxno())
|
||||
.orderByDesc(ElepUploadOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
List<ElepUploadOutput> euResult = eleUploadOutputService.list(
|
||||
new LambdaQueryWrapper<ElepUploadOutput>().eq(ElepUploadOutput::getHiRxno, pcpResult.get(0).getHiRxno())
|
||||
.orderByDesc(ElepUploadOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
|
||||
if (euResult == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ybEleUtil.getElepRevokeInput(pcpResult.get(0), euResult.get(0), practitionerId, description, revokeDate, tenantId);
|
||||
return ybEleUtil.getElepRevokeInput(pcpResult.get(0), euResult.get(0), practitionerId, description, revokeDate,
|
||||
tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,9 +552,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
@Override
|
||||
public ElepQuerPrescriptionInput makeEleQueryPrescriptionInput(String hiRxno) {
|
||||
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService.list(
|
||||
new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService
|
||||
.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
|
||||
if (pcpResult == null) {
|
||||
return null;
|
||||
@@ -584,9 +605,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
@Override
|
||||
public ElepMedresultInput makeEleMedResultInput(String hiRxno) {
|
||||
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService.list(
|
||||
new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
List<ElepVeriPrescriptionOutput> pcpResult = elePresOutputService
|
||||
.list(new LambdaQueryWrapper<ElepVeriPrescriptionOutput>().eq(ElepVeriPrescriptionOutput::getHiRxno, hiRxno)
|
||||
.orderByDesc(ElepVeriPrescriptionOutput::getCreateTime).last(YbCommonConstants.sqlConst.LIMIT1));
|
||||
|
||||
if (pcpResult == null) {
|
||||
return null;
|
||||
@@ -628,8 +649,8 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// 获取药品请求信息(处方表)
|
||||
List<ElepMedicationRequest> medicationRequestList = elepMedicationRequestService.list(
|
||||
new LambdaQueryWrapper<ElepMedicationRequest>().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo)
|
||||
.eq(ElepMedicationRequest::getTenantId, tenantId));
|
||||
new LambdaQueryWrapper<ElepMedicationRequest>().eq(ElepMedicationRequest::getPrescriptionNo, prescriptionNo)
|
||||
.eq(ElepMedicationRequest::getTenantId, tenantId));
|
||||
if (medicationRequestList == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -637,9 +658,9 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
|
||||
// 就诊信息
|
||||
Encounter encounter = encounterService.getById(medicationRequest.getEncounterId());
|
||||
//患者信息
|
||||
// 患者信息
|
||||
Patient patient = patientService.getById(encounter.getPatientId());
|
||||
// 获取医保挂号信息 todo clinicReg可能改成一对多
|
||||
// 获取医保挂号信息 todo clinicReg可能改成一对多
|
||||
ClinicReg clinicReg = iRegService.getByBusNo(encounter.getBusNo());
|
||||
if (clinicReg == null) {
|
||||
return null;
|
||||
@@ -647,19 +668,19 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
|
||||
String medicalContractName = "";
|
||||
String insuplcAdmdvs = clinicReg.getInsuplcAdmdvs();
|
||||
if (insuplcAdmdvs.equals("229900") ) {
|
||||
if (insuplcAdmdvs.equals("229900")) {
|
||||
medicalContractName = "省";
|
||||
} else if (insuplcAdmdvs.startsWith("2201")) {
|
||||
medicalContractName = "市";
|
||||
} else {
|
||||
medicalContractName = "省异地";
|
||||
}
|
||||
// List<Contract> contractListByYb = contractService.getContractListByYb();
|
||||
// for (Contract contract : contractListByYb) {
|
||||
// if(insuplcAdmdvs.equals(contract.getAdmVs())){
|
||||
// medicalContractName = contract.getContractName();
|
||||
// }
|
||||
// }
|
||||
// List<Contract> contractListByYb = contractService.getContractListByYb();
|
||||
// for (Contract contract : contractListByYb) {
|
||||
// if(insuplcAdmdvs.equals(contract.getAdmVs())){
|
||||
// medicalContractName = contract.getContractName();
|
||||
// }
|
||||
// }
|
||||
|
||||
String insutype = clinicReg.getInsutype();
|
||||
|
||||
@@ -698,4 +719,51 @@ public class YbElepBaseServiceImpl implements IYbEleBaseService {
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传2203
|
||||
*
|
||||
* @param prescription 处方信息
|
||||
*/
|
||||
private void upload2203(PreCheckPrescription prescription, ElepMedicationRequest medicationRequest,
|
||||
ClinicReg clinicReg) throws ServerException {
|
||||
|
||||
// 查询慢病目录
|
||||
CatalogSpecialInsuranceDisease catalogSpecialInsuranceDisease =
|
||||
catalogSpecialDiseaseService.getOne(new LambdaQueryWrapper<CatalogSpecialInsuranceDisease>()
|
||||
.eq(CatalogSpecialInsuranceDisease::getDiseaseCode, medicationRequest.getOpspDiseCode()));
|
||||
if (catalogSpecialInsuranceDisease == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询诊断定义
|
||||
ConditionDefinition conditionDefinition =
|
||||
conditionDefinitionService.getConditionDefinitionListById(medicationRequest.getConditionDefId());
|
||||
if (conditionDefinition == null) {
|
||||
throw new ServerException("未查询到诊断定义");
|
||||
}
|
||||
List<Clinic2203DiseInfoParam> diseinfos = new ArrayList();
|
||||
ElepVeriDiagnosisInfo diseinfo = prescription.getDiseinfo();
|
||||
|
||||
Clinic2203DiseInfoParam diseinfo2203 = new Clinic2203DiseInfoParam();
|
||||
diseinfo2203.setDiagCode(conditionDefinition.getYbNo()).setDiagName(conditionDefinition.getName())
|
||||
.setDiagDept(diseinfo.getDiagDept()).setDiseDorName(diseinfo.getDiagDrName())
|
||||
.setDiseDorNo(diseinfo.getDiagDrNo()).setDiagTime(diseinfo.getDiagTime())
|
||||
.setValiFlag(Whether.YES.getValue().toString()).setDiagType(diseinfo.getDiagType())
|
||||
.setDiagSrtNo(diseinfo.getDiagSrtNo());
|
||||
|
||||
diseinfos.add(diseinfo2203);
|
||||
|
||||
Clinic2203MedicalParam medical2203Param = new Clinic2203MedicalParam();
|
||||
|
||||
medical2203Param.setMdtrtId(clinicReg.getMdtrtId()).setPsnNo(clinicReg.getPsnNo())
|
||||
.setBegntime(clinicReg.getBegntime()).setMedType(YbMedType.CHRONIC_DISEASE_OUTPATIENT.getValue())
|
||||
.setMainCondDscr(conditionDefinition.getName()).setInsuplcAdmdvs(clinicReg.getInsuplcAdmdvs())
|
||||
.setDiseCodg(medicationRequest.getOpspDiseCode()).setDiseName(conditionDefinition.getName())
|
||||
.setDiseinfoList(diseinfos);
|
||||
clinicReg.setMedType(YbMedType.CHRONIC_DISEASE_OUTPATIENT.getValue());
|
||||
prescription.getMdtrtinfo().setDiseCodg(medicationRequest.getOpspDiseCode());
|
||||
ybHttpUtils.upload2203Record(medical2203Param, null);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user