You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
7.2 KiB
186 lines
7.2 KiB
package com.ynxbd.common.dao.his;
|
|
|
|
import com.ynxbd.common.bean.his.HisReRegister;
|
|
import com.ynxbd.common.bean.his.HisTreat;
|
|
import com.ynxbd.common.bean.report.CheckReport;
|
|
import com.ynxbd.common.bean.xk.InquiryFee;
|
|
import com.ynxbd.common.helper.common.Base64Helper;
|
|
import com.ynxbd.common.helper.common.JsonHelper;
|
|
import com.ynxbd.common.helper.his.HisEnum;
|
|
import com.ynxbd.common.helper.his.HisHelper;
|
|
import com.ynxbd.common.result.JsonResult;
|
|
import com.ynxbd.common.result.ServiceException;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class HisTreatDao {
|
|
|
|
/**
|
|
* 根据患者id和科室编码查询就诊记录
|
|
*
|
|
* @param patientId 患者id
|
|
*/
|
|
public List<HisTreat> getTreatList(String patientId, String deptCode) {
|
|
List<HisTreat> dataList = new ArrayList<>();
|
|
|
|
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_GET_TREAT_LIST, params -> {
|
|
params.put("PatientID", patientId);
|
|
params.put("DeptCode", deptCode);
|
|
});
|
|
|
|
if (jsonResult.success()) {
|
|
dataList = jsonResult.getDataMapList(HisTreat.class, "Items", "Item");
|
|
}
|
|
return dataList;
|
|
}
|
|
|
|
|
|
/**
|
|
* 根据患者id查询检查报告
|
|
*
|
|
* @param treatNum 门诊号
|
|
*/
|
|
public HisTreat createTreat(String treatNum, String deptCode, String doctCode, String registCode, String regFee, String clinicFee, String transNo, String payMoney, String payDate, String payTime, String payWay, String payDeviceID, String bankTransNo, String openId) throws ServiceException {
|
|
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_CREATE_TREAT, params -> {
|
|
params.put("MZNum", treatNum);
|
|
params.put("DeptCode", deptCode);
|
|
params.put("DoctCode", doctCode);
|
|
params.put("RegistCode", registCode);
|
|
params.put("RegFee", regFee);
|
|
params.put("ClinicFee", clinicFee);
|
|
params.put("TransNo", transNo);
|
|
params.put("PayMoney", payMoney);
|
|
params.put("PayDate", payDate);
|
|
params.put("PayTime", payTime);
|
|
params.put("PayWay", payWay);
|
|
params.put("PayDeviceID", payDeviceID);
|
|
params.put("BankTransNo", bankTransNo);
|
|
params.put("OpenId", openId);
|
|
});
|
|
|
|
if (jsonResult.success()) {
|
|
return JsonHelper.parseObject(JsonHelper.toJsonString(jsonResult.getDataMap()), HisTreat.class);
|
|
}
|
|
throw new ServiceException(jsonResult.getMessage());
|
|
}
|
|
|
|
|
|
/**
|
|
* [问诊]查询咨询费用信息
|
|
*
|
|
* @param inquiryCode 收费项目代码
|
|
*/
|
|
public List<InquiryFee> getInquiryFee(String inquiryCode) throws ServiceException {
|
|
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_INQUIRY_FEE, params -> {
|
|
params.put("Code", inquiryCode);
|
|
});
|
|
|
|
if (jsonResult.success()) {
|
|
return jsonResult.getDataMapList(InquiryFee.class, "Items", "Item");
|
|
}
|
|
throw new ServiceException(jsonResult.getMessage());
|
|
}
|
|
|
|
/**
|
|
* [问诊]查询复诊挂号费
|
|
*
|
|
* @param clinicCode 号别
|
|
*/
|
|
public List<HisReRegister> getReRegister(String clinicCode) throws ServiceException {
|
|
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_QUERY_RE_REGISTER, params -> {
|
|
params.put("ClinicCode", clinicCode);
|
|
});
|
|
|
|
if (jsonResult.success()) {
|
|
return jsonResult.getDataMapList(HisReRegister.class, "RegisterFeeInfos", "RegisterFeeInfo");
|
|
}
|
|
throw new ServiceException(jsonResult.getMessage());
|
|
}
|
|
|
|
|
|
public List<HisTreat> getInfoByTreatNum(String treatNum) throws ServiceException {
|
|
List<HisTreat> dataList = new ArrayList<>();
|
|
|
|
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_QUERY_TREAT, params -> {
|
|
params.put("MZNum", treatNum);
|
|
});
|
|
|
|
if (jsonResult.success()) {
|
|
dataList = jsonResult.getDataMapList(HisTreat.class, "Items", "Item");
|
|
}
|
|
return dataList;
|
|
}
|
|
|
|
public String getDoctCaSign(String doctCode) throws ServiceException {
|
|
String data = null;
|
|
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.XK_DOC_CA, params -> {
|
|
params.put("DoctCode", doctCode);
|
|
});
|
|
|
|
if (jsonResult.success()) {
|
|
data = jsonResult.getDataMapString("Sign");
|
|
if (data == null) {
|
|
return null;
|
|
}
|
|
data = Base64Helper.decode(data);
|
|
}
|
|
return data;
|
|
}
|
|
|
|
|
|
/**
|
|
* 创建问诊订单
|
|
*
|
|
* @param patientId 患者id
|
|
* @param patientName 患者姓名
|
|
* @param payMoney 支付金额
|
|
* @param payDate 支付日期
|
|
* @param payTime 支付时间
|
|
* @param transNo 交易流水号
|
|
* @param payDeviceId 支付终端编号
|
|
* @param bankTransNo 银行流水号或微信支付订单号或微信医保支付订单号
|
|
* @param deptCode 科室代码
|
|
* @param doctCode 医师代码
|
|
* @param feeCode 13005中的收费项目代码
|
|
* @param payWay 支付方式
|
|
* @param ID 问诊订单ID
|
|
* @param begTime 接诊日期
|
|
* @param endTime 结束日期
|
|
* @param IDCardNo 身份证号
|
|
* @param remark 备注
|
|
* @param doctTitleCode 医生职称编码
|
|
* @param hospitalArea 院区
|
|
* @param treatNum 复诊门诊号
|
|
* @param firstTreatNum 初诊门诊号
|
|
* @param openId 微信OpenId
|
|
* @return 是否成功
|
|
*/
|
|
public JsonResult createInquiry(String patientId, String patientName, String payMoney, String payDate, String payTime, String transNo, String payDeviceId, String bankTransNo, String deptCode, String doctCode, String feeCode, String payWay, String ID, String begTime, String endTime, String IDCardNo, String remark, String doctTitleCode, String hospitalArea, String treatNum, String firstTreatNum, String openId) {
|
|
return HisHelper.getJsonResult(HisEnum.XK_CREATE_INQUIRY, params -> {
|
|
params.put("PatientId", patientId);
|
|
params.put("PatientName", patientName);
|
|
params.put("PayMoney", payMoney);
|
|
params.put("PayDate", payDate);
|
|
params.put("PayTime", payTime);
|
|
params.put("TransNo", transNo);
|
|
params.put("PayDeviceID", payDeviceId);
|
|
params.put("BankTransNo", bankTransNo);
|
|
params.put("DeptCode", deptCode);
|
|
params.put("DoctCode", doctCode);
|
|
params.put("FeeCode", feeCode);
|
|
params.put("PayWay", payWay);
|
|
params.put("ID", ID);
|
|
params.put("BegTime", begTime);
|
|
params.put("EndTime", endTime);
|
|
params.put("IDCardNo", IDCardNo);
|
|
params.put("Remark", remark);
|
|
params.put("DoctTitleCode", doctTitleCode);
|
|
params.put("HospitalArea", hospitalArea);
|
|
params.put("TreatNum", treatNum);
|
|
params.put("FirstTreatNum", firstTreatNum);
|
|
params.put("OpenId", openId);
|
|
});
|
|
}
|
|
}
|
|
|