|
@@ -12,6 +12,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.Base64;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.bouncycastle.crypto.CryptoException;
|
|
@@ -23,6 +24,7 @@ import com.aliyun.oss.OSS;
|
|
|
import com.aliyun.oss.OSSClientBuilder;
|
|
|
import com.aliyun.oss.model.PutObjectResult;
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
+import com.jfinal.plugin.activerecord.Record;
|
|
|
import com.zskk.tools.SM4Utils;
|
|
|
|
|
|
import okhttp3.FormBody;
|
|
@@ -49,6 +51,11 @@ public class DataService {
|
|
|
private static String SAVE_PRINT_URL = "https://risserver3.pacsonline.cn/butt/savePrint";
|
|
|
|
|
|
private static String SAVE_EXAMINFO_URL = "http://10.200.199.136:9605/api/postExamInfo";
|
|
|
+
|
|
|
+ private static String SAVE_EXAMREPORT_URL = "http://10.200.199.136:9605/api/postExamReport";
|
|
|
+
|
|
|
+ private static String SAVE_LABREPORT_URL = "http://10.200.199.136:9605/api/postLabReport";
|
|
|
+
|
|
|
// private static String SAVE_EXAMINFO_URL = "http://111.53.165.106:9605/api/postExamInfo";
|
|
|
|
|
|
|
|
@@ -148,7 +155,7 @@ public class DataService {
|
|
|
* @param instutionId
|
|
|
* @param number
|
|
|
*/
|
|
|
- public String postExamInfo(com.jfinal.plugin.activerecord.Record record) {
|
|
|
+ public String postExamInfo(Record record) {
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
params.put("request_time", "1");
|
|
|
params.put("request_no", "2");
|
|
@@ -214,8 +221,151 @@ public class DataService {
|
|
|
return content;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 互认-检查报告信息
|
|
|
+ *
|
|
|
+ * @param instutionId
|
|
|
+ * @param number
|
|
|
+ */
|
|
|
+ public String postExamReport(Record record) {
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ params.put("request_time", "1");
|
|
|
+ params.put("request_no", "3");
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
+ JSONObject jsonObjectB = new JSONObject();
|
|
|
+
|
|
|
+ jsonObjectB.put("BD", checkStr(record.getStr("检查号")));
|
|
|
+ jsonObjectB.put("BJ", "121403004061412685");
|
|
|
+ jsonObjectB.put("BK", "阳泉市第一人民医院");
|
|
|
+
|
|
|
+ JSONObject jsonObjectC = new JSONObject();
|
|
|
+ jsonObjectC.put("CA", checkStr(record.getStr("报告单编号")));
|
|
|
+ jsonObjectC.put("CB", checkStr(record.getStr("检查类型")));
|
|
|
+ jsonObjectC.put("CC", checkStr(record.getStr("检查部位")));
|
|
|
+ jsonObjectC.put("CD", checkStr(record.getStr("检查所见")));
|
|
|
+ jsonObjectC.put("CE", checkStr(record.getStr("影像诊断")));
|
|
|
+ jsonObjectC.put("CF", checkStr(record.getStr("检查结果类别")));
|
|
|
+ jsonObjectC.put("CG", checkStr(record.getStr("报告科室名称")));
|
|
|
+ jsonObjectC.put("CH", checkStr(record.getStr("报告医生姓名")));
|
|
|
+ jsonObjectC.put("CI", checkStr(record.getStr("审核医生姓名")));
|
|
|
+ jsonObjectC.put("CJ", checkStr(record.getStr("报告时间")));
|
|
|
+ jsonObjectC.put("CK", checkStr(record.getStr("审核时间")));
|
|
|
+ jsonObjectC.put("CL", checkStr(record.getStr("检查时间")));
|
|
|
+ jsonObjectC.put("CM", checkStr(record.getStr("危急值")));
|
|
|
+ jsonObjectC.put("CN", checkStr(record.getStr("报告医生编码")));
|
|
|
+ jsonObjectC.put("CO", checkStr(record.getStr("审核医生编码")));
|
|
|
+ jsonObjectC.put("CP", checkStr(record.getStr("患者编号")));
|
|
|
+ jsonObjectC.put("CQ", checkStr(record.getStr("报告单")));
|
|
|
+ jsonObjectC.put("CR", checkStr(record.getStr("检查状态")));
|
|
|
+
|
|
|
+ jsonObject.put("B", jsonObjectB);
|
|
|
+ jsonObject.put("C", jsonObjectC);
|
|
|
+ try {
|
|
|
+ String encodedString = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes());
|
|
|
+
|
|
|
+ params.put("data", SM4Utils.sm4Encrypt("zLxapoeqWYpoeqWY",encodedString));
|
|
|
+ } catch (CryptoException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ String content = postWithParameters(SAVE_EXAMREPORT_URL, params);
|
|
|
+ return content;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 互认-检验报告信息
|
|
|
+ *
|
|
|
+ * @param instutionId
|
|
|
+ * @param number
|
|
|
+ */
|
|
|
+ public String postLabReport(Record record, List<Record> items) {
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ params.put("request_time", "1");
|
|
|
+ params.put("request_no", "4");
|
|
|
+
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+
|
|
|
+ JSONObject jsonObjectA = new JSONObject();
|
|
|
+ jsonObjectA.put("AA", checkStr(record.getStr("姓名")));
|
|
|
+ jsonObjectA.put("AB", checkStr(record.getStr("证件类型编码")));
|
|
|
+ jsonObjectA.put("AC", checkStr(record.getStr("证件号码")));
|
|
|
+ jsonObjectA.put("AD", checkStr(record.getStr("性别编码")));
|
|
|
+ jsonObjectA.put("AE", checkStr(record.getStr("出生日期")));
|
|
|
+ jsonObjectA.put("AF", checkStr(record.getStr("联系电话")));
|
|
|
+ jsonObjectA.put("AG", checkStr(record.getStr("电子健康卡号")));
|
|
|
+
|
|
|
+ JSONObject jsonObjectB = new JSONObject();
|
|
|
+ jsonObjectB.put("BA", checkStr(record.getStr("就诊类型编码")));
|
|
|
+ jsonObjectB.put("BB", checkStr(record.getStr("就诊卡号")));
|
|
|
+ jsonObjectB.put("BC", checkStr(record.getStr("患者编号")));
|
|
|
+ jsonObjectB.put("BD", checkStr(record.getStr("就诊时间")));
|
|
|
+ jsonObjectB.put("BE", checkStr(record.getStr("就诊科室名称")));
|
|
|
+ jsonObjectB.put("BF", checkStr(record.getStr("申请医师名称")));
|
|
|
+ jsonObjectB.put("BG", checkStr(record.getStr("申请医生编码")));
|
|
|
+ jsonObjectB.put("BH", checkStr(record.getStr("主诉")));
|
|
|
+ jsonObjectB.put("BI", checkStr(record.getStr("年龄")));
|
|
|
+ jsonObjectB.put("BJ", "121403004061412685");
|
|
|
+ jsonObjectB.put("BK", "阳泉市第一人民医院");
|
|
|
+ jsonObjectB.put("BL", checkStr(record.getStr("临床诊断名称")));
|
|
|
+ jsonObjectB.put("BM", checkStr(record.getStr("临床诊断代码")));
|
|
|
+
|
|
|
+ JSONObject jsonObjectC = new JSONObject();
|
|
|
+ jsonObjectC.put("CA", checkStr(record.getStr("报告单编号")));
|
|
|
+ jsonObjectC.put("CB", checkStr(record.getStr("标本类型")));
|
|
|
+ jsonObjectC.put("CC", checkStr(record.getStr("检验项目名称")));
|
|
|
+ jsonObjectC.put("CD", checkStr(record.getStr("检测项目类型")));
|
|
|
+ jsonObjectC.put("CE", checkStr(record.getStr("报告医生姓名")));
|
|
|
+ jsonObjectC.put("CF", checkStr(record.getStr("报告医生编码")));
|
|
|
+ jsonObjectC.put("CG", checkStr(record.getStr("审核医师姓名")));
|
|
|
+ jsonObjectC.put("CH", checkStr(record.getStr("审核医师编码")));
|
|
|
+ jsonObjectC.put("CI", checkStr(record.getStr("报告科室名称")));
|
|
|
+ jsonObjectC.put("CJ", checkStr(record.getStr("报告评语")));
|
|
|
+ jsonObjectC.put("CK", checkStr(record.getStr("报告时间")));
|
|
|
+ jsonObjectC.put("CL", checkStr(record.getStr("互认项目编码")));
|
|
|
+ jsonObjectC.put("CM", checkStr(record.getStr("互认项目名称")));
|
|
|
+ jsonObjectC.put("CN", checkStr(record.getStr("报告单")));
|
|
|
+
|
|
|
+ JSONArray jsonArrayD = new JSONArray();
|
|
|
+ for (Record itemrecord : items) {
|
|
|
+ JSONObject jsonObjectE = new JSONObject();
|
|
|
+ jsonObjectE.put("EA", checkStr(itemrecord.getStr("检验细项名称中文")));
|
|
|
+ jsonObjectE.put("EB", checkStr(itemrecord.getStr("检验细项缩写")));
|
|
|
+ jsonObjectE.put("EC", checkStr(itemrecord.getStr("检验细项序号")));
|
|
|
+ jsonObjectE.put("ED", checkStr(itemrecord.getStr("检验细项测量值")));
|
|
|
+ jsonObjectE.put("EE", checkStr(itemrecord.getStr("检验细项结果计量单位")));
|
|
|
+ jsonObjectE.put("EF", checkStr(itemrecord.getStr("检验细项结果")));
|
|
|
+ jsonObjectE.put("EG", checkStr(itemrecord.getStr("药敏结果")));
|
|
|
+ jsonObjectE.put("EH", checkStr(itemrecord.getStr("参考范围")));
|
|
|
+ jsonObjectE.put("EI", checkStr(itemrecord.getStr("检测方法")));
|
|
|
+ jsonObjectE.put("EJ", checkStr(itemrecord.getStr("KB")));
|
|
|
+ jsonObjectE.put("EK", checkStr(itemrecord.getStr("MIC")));
|
|
|
+ jsonObjectE.put("EL", checkStr(itemrecord.getStr("敏感度")));
|
|
|
+ jsonObjectE.put("EM", checkStr(itemrecord.getStr("互认项目编码")));
|
|
|
+ jsonObjectE.put("EN", checkStr(itemrecord.getStr("互认项目名称")));
|
|
|
+ jsonArrayD.add(jsonObjectE);
|
|
|
+ }
|
|
|
+ jsonObject.put("A", jsonObjectA);
|
|
|
+ jsonObject.put("B", jsonObjectB);
|
|
|
+ jsonObject.put("C", jsonObjectC);
|
|
|
+ jsonObject.put("D", jsonArrayD);
|
|
|
+ try {
|
|
|
+ String encodedString = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes());
|
|
|
+
|
|
|
+ params.put("data", SM4Utils.sm4Encrypt("zLxapoeqWYpoeqWY",encodedString));
|
|
|
+ } catch (CryptoException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ String content = postWithParameters(SAVE_LABREPORT_URL, params);
|
|
|
+ return content;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 校验字符串
|
|
@@ -412,7 +562,7 @@ public class DataService {
|
|
|
// map.put("institution_id", "06300006");
|
|
|
// map.put("start", "2022-02-01");
|
|
|
// map.put("finish", "2022-03-01");
|
|
|
-// String content = postExamInfo(null);
|
|
|
+// String content = postExamReport(null);
|
|
|
// System.out.println(content);
|
|
|
|
|
|
|