parent
2ff6c0433f
commit
e161890a3e
12 changed files with 611 additions and 91 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,176 @@ |
||||
package com.ynxbd.common.bean.xbd; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @author 李进才 |
||||
* @ClassName MRHistory |
||||
* @Description TODO |
||||
* @date 2023/05/05 13:56:00 |
||||
*/ |
||||
|
||||
@Getter |
||||
@Setter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class MRHistory { |
||||
/** |
||||
* 预约申请号 |
||||
*/ |
||||
private int id; |
||||
|
||||
/** |
||||
* 住院号 |
||||
*/ |
||||
private String ipsId; |
||||
|
||||
/** |
||||
* 诊断名称 |
||||
*/ |
||||
private String dx; |
||||
|
||||
/** |
||||
* 病人id |
||||
*/ |
||||
private String ptId; |
||||
|
||||
/** |
||||
* 病人姓名 |
||||
*/ |
||||
private String ptName; |
||||
|
||||
/** |
||||
* 出院科室id |
||||
*/ |
||||
private String deptId; |
||||
|
||||
/** |
||||
* 出院科室代码 |
||||
*/ |
||||
private String deptName; |
||||
|
||||
/** |
||||
* 病人身份证号 |
||||
*/ |
||||
private String ptIdcId; |
||||
|
||||
/** |
||||
* 电话号码 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 申请人姓名 |
||||
*/ |
||||
private String applyerName; |
||||
|
||||
/** |
||||
* 申请人与病人关系 |
||||
*/ |
||||
private String applyerRel; |
||||
|
||||
/** |
||||
* 申请人与病人关系代码 |
||||
*/ |
||||
private String applyerRelId; |
||||
|
||||
/** |
||||
* 病人身份证正面照片 |
||||
*/ |
||||
private byte[] ptIdcImg1; |
||||
|
||||
/** |
||||
* 病人身份证背面照片 |
||||
*/ |
||||
private byte[] ptIdcImg2; |
||||
|
||||
/** |
||||
* 申请人身份证正面照片 |
||||
*/ |
||||
private byte[] applyerIdcImg1; |
||||
|
||||
/** |
||||
* 申请人身份证背面照片 |
||||
*/ |
||||
private byte[] applyerIdcImg2; |
||||
|
||||
/** |
||||
* 申请书照片 |
||||
*/ |
||||
private byte[] agreementLetterImg; |
||||
|
||||
/** |
||||
* 申请时间 |
||||
*/ |
||||
private Date applyTime; |
||||
|
||||
/** |
||||
* 用途 |
||||
*/ |
||||
private String useWay; |
||||
|
||||
/** |
||||
* 用途代码 |
||||
*/ |
||||
private String useWayId; |
||||
|
||||
/** |
||||
* 获取方式 |
||||
*/ |
||||
private String getWay; |
||||
|
||||
/** |
||||
* 地址 |
||||
*/ |
||||
private String address; |
||||
|
||||
/** |
||||
* 快递信息 |
||||
*/ |
||||
private String expressInfo; |
||||
|
||||
/** |
||||
* 状态代码(null.未审核1.已审核 2.审核不通过) |
||||
*/ |
||||
private int stateId; |
||||
|
||||
/** |
||||
* 审核不通过的原因 |
||||
*/ |
||||
private String noReviewNote; |
||||
|
||||
/** |
||||
* 打印页数 |
||||
*/ |
||||
private int pages; |
||||
|
||||
/** |
||||
* 付费状态 |
||||
*/ |
||||
private boolean isPay; |
||||
|
||||
/** |
||||
* 打印状态 |
||||
*/ |
||||
private boolean isPrint; |
||||
|
||||
/** |
||||
* 最终状态代码(null:正在流程中.1完成流程 2审核未通过 3其他情况) |
||||
*/ |
||||
private int statusId; |
||||
|
||||
/** |
||||
* 删除时间 |
||||
*/ |
||||
private Date statusDate; |
||||
|
||||
/** |
||||
* 删除说明 |
||||
*/ |
||||
private String statusNote; |
||||
} |
@ -0,0 +1,65 @@ |
||||
package com.ynxbd.common.bean.xbd; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
|
||||
/** |
||||
* @author 李进才 |
||||
* @ClassName MedicalRecordList |
||||
* @Description TODO |
||||
* @date 2023/05/05 11:17:00 |
||||
*/ |
||||
|
||||
|
||||
@Getter |
||||
@Setter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class MedicalRecord { |
||||
/** |
||||
* 入院时间 |
||||
*/ |
||||
public String inHospTime; |
||||
/** |
||||
* 住院号 |
||||
*/ |
||||
public String ipsId; |
||||
/** |
||||
* 主要诊断 |
||||
*/ |
||||
public String dx; |
||||
/** |
||||
* 入院科室代码 |
||||
*/ |
||||
public String inHospDeptCode; |
||||
/** |
||||
* 患者Id |
||||
*/ |
||||
public String ptId; |
||||
/** |
||||
* 患者身份证号 |
||||
*/ |
||||
public String ptIdcId; |
||||
/** |
||||
* 科室名称 |
||||
*/ |
||||
public String deptName; |
||||
/** |
||||
* 出院时间 |
||||
*/ |
||||
public String outHospTime; |
||||
/** |
||||
* 患者姓名 |
||||
*/ |
||||
public String ptName; |
||||
/** |
||||
* 出院科室code |
||||
*/ |
||||
public String deptId; |
||||
/** |
||||
* 入院科室名称 |
||||
*/ |
||||
public String inHospDeptName; |
||||
} |
@ -1,89 +0,0 @@ |
||||
package com.ynxbd.common.helper.xbd; |
||||
|
||||
import cn.hutool.core.compress.Gzip; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.ynxbd.common.helper.http.OkHttpHelper; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import okhttp3.*; |
||||
import org.apache.commons.compress.compressors.gzip.GzipUtils; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.nio.charset.StandardCharsets; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
|
||||
/** |
||||
* @author 李进才 |
||||
* @ClassName HttpHelper |
||||
* @Description 在线病历打印请求的http请求方法 |
||||
* @date 2023/4/20 09:40 |
||||
*/ |
||||
@Slf4j |
||||
public class HttpHelper { |
||||
/** |
||||
* Get执行后台指定方法 |
||||
* @param methodName 方法名 |
||||
* @param paramDic 参数 |
||||
* @return 返回的数据(Json) |
||||
*/ |
||||
public static String ExecMethodGet (String methodName, Object paramDic){ |
||||
return UseGet(methodName,paramDic); |
||||
} |
||||
|
||||
/** |
||||
* Get执行后台指定方法 |
||||
* @param methodName 方法名 |
||||
* @return 返回的数据(Json) |
||||
*/ |
||||
public static String ExecMethodGet (String methodName){ |
||||
return UseGet(methodName,null); |
||||
} |
||||
private static String UseGet(String methodName, Object paramDic) { |
||||
try { |
||||
String url = "http://192.168.12.66:8080"; |
||||
OkHttpClient httpClient = OkHttpHelper.creatClient(); |
||||
HttpUrl.Builder urlBuilder = HttpUrl.parse(url+"/api/SqlContext/ExecMethodByNameEncryption").newBuilder(); |
||||
// 加密序列化
|
||||
String methodNameEnv = URLEncoder.encode(EncHelper.AES_Encrypt(methodName), StandardCharsets.UTF_8.toString()); |
||||
urlBuilder.addQueryParameter("methodNameEnc", methodNameEnv); |
||||
String paramJson = JSONObject.toJSONString(paramDic==null? "" :paramDic); |
||||
// json 加密序列化传入链接
|
||||
String paramsStrEnv = URLEncoder.encode(EncHelper.AES_Encrypt(paramJson), StandardCharsets.UTF_8.toString()); |
||||
|
||||
urlBuilder.addQueryParameter("paramsStrEnc", paramsStrEnv); |
||||
String md5Check = URLEncoder.encode(EncHelper.MD5Encrypt64(methodName + paramJson),StandardCharsets.UTF_8.toString()); |
||||
urlBuilder.addQueryParameter("modCode", md5Check); |
||||
|
||||
|
||||
Request request = new Request.Builder() |
||||
.url(urlBuilder.toString()) |
||||
.get() |
||||
.build(); |
||||
Response response = httpClient.newCall(request).execute(); |
||||
// 清除并关闭线程池
|
||||
// httpClient.dispatcher().executorService().shutdown();
|
||||
// 清除并关闭连接池
|
||||
// httpClient.connectionPool().evictAll();
|
||||
JSONObject JSON = JSONObject.parseObject(response.body().string()); |
||||
if(response.isSuccessful()){ |
||||
return JSON.getString("Data").replaceAll(" ",""); |
||||
} |
||||
else { |
||||
log.error("[在线病例打印]返回错误:方法名-{},错误-{}",methodName,JSON.getString("Msg")); |
||||
throw new Exception("方法:" + methodName + "错误:" + JSON.getString("Msg") ); |
||||
} |
||||
} |
||||
catch (Exception e){ |
||||
log.error("[在线病例打印]请求错误-{}",e.getMessage()); |
||||
return e.getMessage(); |
||||
} |
||||
|
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
Map<String,String> test = new HashMap<>(); |
||||
test.put("patientID","10947918"); |
||||
System.out.println(ExecMethodGet("BLSM_Appointment_GetBA", test)); |
||||
} |
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.ynxbd.common.helper.xbd; |
||||
|
||||
/** |
||||
* @author 李进才 |
||||
* @ClassName XBDEnum |
||||
* @Description TODO |
||||
* @date 2023/05/05 10:24:00 |
||||
*/ |
||||
public enum XBDEnum { |
||||
/** |
||||
* [病案翻拍] 获取可以翻拍的列表 |
||||
*/ |
||||
BLSM_Appointment_GetBA("BLSM_Appointment_GetBA","获取此病人已被翻拍的病案(可以翻拍的病历)"), |
||||
/** |
||||
* [病案翻拍] 获取病人翻拍病案所用用途 |
||||
*/ |
||||
BLSM_Appointment_GetTemplate("BLSM_Appointment_GetTemplate","获取模板列表(获取用途列表)"), |
||||
/** |
||||
* [病案翻拍] 新增预约记录 |
||||
*/ |
||||
BLSM_Appointment_SetAppointment("BLSM_Appointment_SetAppointment","新增预约记录"), |
||||
/** |
||||
* [病案翻拍] 获取历史预约记录 |
||||
*/ |
||||
BLSM_Appointment_GetHistoryAppointment("BLSM_Appointment_GetHistoryAppointment","获取此病人预约的历史数据"), |
||||
/** |
||||
* [病案翻拍] 付费成功回调 |
||||
*/ |
||||
BLSM_Appointment_SetISPay("BLSM_Appointment_SetISPay","付费成功回调"), |
||||
/** |
||||
* [病案翻拍] 修改收获地址 |
||||
*/ |
||||
BLSM_Appointment_ChangeAddress("BLSM_Appointment_ChangeAddress","修改收货信息"), |
||||
/** |
||||
* [病案翻拍] 停止预约 |
||||
*/ |
||||
BLSM_Appointment_StopAppointment("BLSM_Appointment_StopAppointment","停止预约"); |
||||
|
||||
public final String Name; |
||||
public final String Description; |
||||
|
||||
XBDEnum(String Name, String Description) { |
||||
this.Name = Name; |
||||
this.Description = Description; |
||||
} |
||||
} |
@ -0,0 +1,183 @@ |
||||
package com.ynxbd.common.helper.xbd; |
||||
|
||||
import cn.hutool.core.compress.Gzip; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.ynxbd.common.helper.common.JsonHelper; |
||||
import com.ynxbd.common.helper.http.OkHttpHelper; |
||||
import com.ynxbd.common.result.JsonResult; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import okhttp3.*; |
||||
import org.apache.commons.compress.compressors.gzip.GzipUtils; |
||||
import org.apache.commons.io.IOUtils; |
||||
import org.apache.poi.ss.formula.functions.T; |
||||
|
||||
import java.io.ByteArrayInputStream; |
||||
import java.io.ByteArrayOutputStream; |
||||
import java.io.IOException; |
||||
import java.io.InputStream; |
||||
import java.net.URLEncoder; |
||||
import java.nio.charset.StandardCharsets; |
||||
import java.util.Base64; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
import java.util.zip.GZIPInputStream; |
||||
import java.util.zip.GZIPOutputStream; |
||||
|
||||
|
||||
/** |
||||
* @author 李进才 |
||||
* @ClassName HttpHelper |
||||
* @Description 在线病历打印请求的http请求方法 |
||||
* @date 2023/4/20 09:40 |
||||
*/ |
||||
@Slf4j |
||||
public class XBDHttpHelper { |
||||
/** |
||||
* Get执行后台指定方法 |
||||
* @param methodName 方法名 |
||||
* @param paramDic 参数 |
||||
* @return 返回的数据(Json) |
||||
*/ |
||||
public static String ExecMethodGet (String methodName, Object paramDic){ |
||||
return UseGet(methodName,paramDic); |
||||
} |
||||
|
||||
/** |
||||
* 直接用lambda传参数的方法 |
||||
* @param methodName 方法名 |
||||
* @param params lambda表达式 |
||||
* @return String |
||||
*/ |
||||
public static String ExecMethodGet(String methodName, JsonResult.MapParams params){ |
||||
Map<String, Object> requestParams = new HashMap<>(); |
||||
if (params != null) { |
||||
params.setParams(requestParams); |
||||
} |
||||
return ExecMethodGet(methodName,requestParams); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Get执行后台指定方法 |
||||
* @param methodName 方法名 |
||||
* @return 返回的数据(Json) |
||||
*/ |
||||
public static String ExecMethodGet (String methodName){ |
||||
return UseGet(methodName,null); |
||||
} |
||||
private static String UseGet(String methodName, Object paramDic) { |
||||
try { |
||||
OkHttpClient httpClient = OkHttpHelper.creatClient(); |
||||
HttpUrl.Builder urlBuilder = HttpUrl.parse(XBDHelper.MEDICAL_RECORD_REMAKE_URL+"/api/SqlContext/ExecMethodByNameEncryption").newBuilder(); |
||||
// 加密序列化
|
||||
String methodNameEnv = URLEncoder.encode(EncHelper.AES_Encrypt(methodName), StandardCharsets.UTF_8.toString()); |
||||
urlBuilder.addQueryParameter("methodNameEnc", methodNameEnv); |
||||
String paramJson = JSONObject.toJSONString(paramDic==null? "" :paramDic); |
||||
// json 加密序列化传入链接
|
||||
String paramsStrEnv = URLEncoder.encode(EncHelper.AES_Encrypt(paramJson), StandardCharsets.UTF_8.toString()); |
||||
urlBuilder.addQueryParameter("paramsStrEnc", compress(paramsStrEnv)); |
||||
String md5Check = URLEncoder.encode(EncHelper.MD5Encrypt64(methodName + paramJson),StandardCharsets.UTF_8.toString()); |
||||
urlBuilder.addQueryParameter("modCode", md5Check); |
||||
|
||||
|
||||
Request request = new Request.Builder() |
||||
.url(urlBuilder.toString()) |
||||
.get() |
||||
.build(); |
||||
Response response = httpClient.newCall(request).execute(); |
||||
// 清除并关闭线程池
|
||||
// httpClient.dispatcher().executorService().shutdown();
|
||||
// 清除并关闭连接池
|
||||
// httpClient.connectionPool().evictAll();
|
||||
JSONObject JSON = JSONObject.parseObject(response.body().string()); |
||||
if(response.isSuccessful()){ |
||||
return JSON.getString("Data").replaceAll(" ",""); |
||||
} |
||||
else { |
||||
log.error("[在线病例打印]返回错误:方法名-{},错误-{}",methodName,JSON.getString("Msg")); |
||||
throw new Exception("方法:" + methodName + "错误:" + JSON.getString("Msg") ); |
||||
} |
||||
} |
||||
catch (Exception e){ |
||||
log.error("[在线病例打印]请求错误-{}",e.getMessage()); |
||||
return e.getMessage(); |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* gzip压缩方法 |
||||
* @param primStr 压缩字符串 |
||||
* @return 压缩后的字符 |
||||
*/ |
||||
private static String compress(String primStr) { |
||||
if (primStr == null || primStr.length() == 0) { |
||||
return primStr; |
||||
} |
||||
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
||||
GZIPOutputStream gzip = null; |
||||
try { |
||||
gzip = new GZIPOutputStream(out); |
||||
gzip.write(primStr.getBytes()); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} finally { |
||||
if (gzip != null) { |
||||
try { |
||||
gzip.close(); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
||||
return new sun.misc.BASE64Encoder().encode(out.toByteArray()); |
||||
} |
||||
private static String uncompress(String compressedStr) { |
||||
if (compressedStr == null) { |
||||
return null; |
||||
} |
||||
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
||||
ByteArrayInputStream in = null; |
||||
GZIPInputStream ginzip = null; |
||||
byte[] compressed = null; |
||||
String decompressed = null; |
||||
try { |
||||
compressed = new sun.misc.BASE64Decoder().decodeBuffer(compressedStr); |
||||
in = new ByteArrayInputStream(compressed); |
||||
ginzip = new GZIPInputStream(in); |
||||
|
||||
byte[] buffer = new byte[1024]; |
||||
int offset = -1; |
||||
while ((offset = ginzip.read(buffer)) != -1) { |
||||
out.write(buffer, 0, offset); |
||||
} |
||||
decompressed = out.toString(); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} finally { |
||||
if (ginzip != null) { |
||||
try { |
||||
ginzip.close(); |
||||
} catch (IOException ignored) { |
||||
} |
||||
} |
||||
if (in != null) { |
||||
try { |
||||
in.close(); |
||||
} catch (IOException ignored) { |
||||
} |
||||
} |
||||
try { |
||||
out.close(); |
||||
} catch (IOException ignored) { |
||||
} |
||||
} |
||||
return decompressed; |
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
Map<String,String> test = new HashMap<>(); |
||||
test.put("patientID","10947918"); |
||||
System.out.println(ExecMethodGet("BLSM_Appointment_GetBA", test)); |
||||
} |
||||
} |
@ -1 +1,2 @@ |
||||
xbd.out_team_cloud_film_link= |
||||
xbd.medical_record_remake_url = http://192.168.12.66:8080 |
||||
|
Loading…
Reference in new issue