|
@@ -35,15 +35,15 @@ import java.util.*;
|
|
|
public class ViewController extends Controller {
|
|
|
private static final OkHttpClient OKHTTP_CLIENT = new OkHttpClient();
|
|
|
|
|
|
-// static{
|
|
|
-// PropKit.use("config.properties");
|
|
|
-// DruidPlugin plugin = new DruidPlugin(PropKit.get("jdbcUrl_zskk"), PropKit.get("user_zskk"), PropKit.get("password_zskk").trim());
|
|
|
-// ActiveRecordPlugin arp = new ActiveRecordPlugin(plugin);
|
|
|
-// _MappingKit.mapping(arp);
|
|
|
-// plugin.start();
|
|
|
-// arp.start();
|
|
|
-//
|
|
|
-// }
|
|
|
+ static{
|
|
|
+ PropKit.use("config.properties");
|
|
|
+ DruidPlugin plugin = new DruidPlugin(PropKit.get("jdbcUrl_zskk"), PropKit.get("user_zskk"), PropKit.get("password_zskk").trim());
|
|
|
+ ActiveRecordPlugin arp = new ActiveRecordPlugin(plugin);
|
|
|
+ _MappingKit.mapping(arp);
|
|
|
+ plugin.start();
|
|
|
+ arp.start();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 在被连接数据库执行sql语句
|
|
@@ -96,8 +96,8 @@ public class ViewController extends Controller {
|
|
|
|
|
|
try {
|
|
|
String string = "here";
|
|
|
- String jString = "{\"birthdate\":\"1962-03-28 00:00:00\",\"modality\":\"CT\",\"patientid\":\"030228612\",\"patientsex\":\"男\",\"reportPaperNum\":737322,\"reportdate\":\"2019-12-30 13:16:34\",\"diagnosis\":\"肺癌\",\"accessionNumber\":\"161191\",\"patientname\":\"黄世光\",\"symptom\":\"肺癌病史二年\",\"clinicaldoctor\":\"康博\",\"phone\":\"13644539072\",\"DESCRIPTION\":\"双侧基底节及侧脑室旁多发低密度影,边界尚清。脑室未见扩张。脑沟增宽、加深。中线结构居中。颅骨骨质结构完整。筛窦内多发高密度。\\r\\n\",\"printreport\":true,\"idcard\":\"231003196203281317\",\"patientage\":\"57岁\",\"impression\":\"1、双脑多发低密度,考虑脑梗死伴软化灶形成。\\r\\n2、脑萎缩。\\r\\n3、筛窦炎症。\\r\\n\",\"regPaperNum\":\"890663\",\"reviewdoctor\":\"李由山\",\"department\":\"肿瘤内一科\",\"studyuid\":\"161191\",\"printfilm\":false,\"reportdoctor\":\"姚文达\"}";
|
|
|
- List<Exams> exams = Exams.dao.find("SELECT * FROM pacsonline.exams where id='116f51b2313f5fda'");
|
|
|
+ String jString = "{\"birthdate\":\"19730821\",\"modality\":\"MR\",\"patientid\":\"18244734\",\"patientsex\":\"男\",\"reportPaperNum\":\"2020040124640047\",\"reportdate\":\"2020-04-01 18:11:09\",\"diagnosis\":\"后循环缺血\",\"description\":\" 脑MR扫描显示:脑实质内未见明显异常信号,脑灰、白质界限清晰;诸脑室、脑池、脑沟及脑裂形态、大小、信号未见明显异常,中线结构无移位。\",\"accessionNumber\":\"2020040124640047\",\"patientname\":\"赵松苍\",\"symptom\":\"\",\"clinicaldoctor\":\"邱海军\",\"phone\":\"13969575096\",\"printreport\":\"\",\"idcard\":\"372526197308214514\",\"patientage\":\"\",\"impression\":\" 脑实质MRI平扫未见明显异常。\",\"regPaperNum\":\"708025^MR009|\",\"reviewdoctor\":\"谢洪翠\",\"department\":\"神经内科门诊\",\"studyuid\":\"1.2.840.113820.104.2464.120200401144808\",\"printfilm\":\"\",\"reportdoctor\":\"谢洪翠\"}";
|
|
|
+ List<Exams> exams = Exams.dao.find("SELECT * FROM pacsonline.exams where id='117135248cc3905a'");
|
|
|
for (Exams exams2 : exams) {
|
|
|
//Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
// Record record = Db.use("connected").findFirst("select * from zskk where accessionNumber=?",exams2.getAccessionNum());
|
|
@@ -109,11 +109,11 @@ public class ViewController extends Controller {
|
|
|
Report report = new Report().use("zskk");
|
|
|
report.setId(creatId());
|
|
|
report.setReportDatetime(parseStringToDate(record.getString("reportdate")));
|
|
|
- if (record.getString("impression") == null || record.getString("DESCRIPTION") == null || record.getString("impression").isBlank() || record.getString("DESCRIPTION").isBlank()) {
|
|
|
+ if (record.getString("impression") == null || record.getString("description") == null || record.getString("impression").isBlank() || record.getString("description").isBlank()) {
|
|
|
continue;
|
|
|
}
|
|
|
report.setImpression(record.getString("impression"));
|
|
|
- report.setDescription(record.getString("DESCRIPTION"));
|
|
|
+ report.setDescription(record.getString("description"));
|
|
|
report.setExamId(exams2.getId());
|
|
|
report.setCreatedAt(new Date());
|
|
|
report.setReportDoctorId(getDoctorIdByName(record.getString("reportdoctor")));
|
|
@@ -135,51 +135,52 @@ public class ViewController extends Controller {
|
|
|
// exams2.update();
|
|
|
//传云医康 数据
|
|
|
Map<String, String> data = new HashMap<String, String>();
|
|
|
- //获取data数据
|
|
|
- //医院id
|
|
|
- data.put("hospital_id","15700002");
|
|
|
- //影像所见
|
|
|
- data.put("description",record.getString("DESCRIPTION"));
|
|
|
- //意见建议
|
|
|
- data.put("impression",record.getString("impression"));
|
|
|
- //检查id
|
|
|
- data.put("exam_id",exams2.getId());
|
|
|
- //患者id
|
|
|
- data.put("patient_id",exams2.getPatientId());
|
|
|
- data.put("study_id",exams2.getStudyId());
|
|
|
-
|
|
|
- //患者姓名
|
|
|
- data.put("patient_name",record.getString("patientname"));
|
|
|
- //患者性别
|
|
|
- data.put("patient_sex",record.getString("patientsex").equals("女")?"F":"M");
|
|
|
- //身份证号
|
|
|
- data.put("card_num","");
|
|
|
- //手机号
|
|
|
- data.put("phone","");
|
|
|
- //患者生日
|
|
|
- data.put("birthday",returnSecondTimestamp(record.getString("birthdate")));
|
|
|
- //患者检查时年龄
|
|
|
- data.put("patient_age",patientInfos.getAge());
|
|
|
- //阴阳性 1阴性 2阳性
|
|
|
- data.put("report_result","");
|
|
|
- //报告时间 10位时间戳
|
|
|
- data.put("report_datetime",returnSecondTimestamp(record.getString("reportdate")));
|
|
|
- //报告医生id
|
|
|
- data.put("report_doctor_id",record.getString("reportdoctor"));
|
|
|
- //报告医生姓名
|
|
|
- data.put("report_doctor_name",record.getString("reportdoctor"));
|
|
|
- //审核时间
|
|
|
- data.put("review_datetime",returnSecondTimestamp(record.getString("reportdate")));
|
|
|
- //审核医生id
|
|
|
- data.put("review_doctor_id",record.getString("reviewdoctor"));
|
|
|
- //审核姓名
|
|
|
- data.put("review_doctor_name",record.getString("reviewdoctor"));
|
|
|
- //确认时间
|
|
|
- data.put("confirm_datetime", returnSecondTimestamp(record.getString("reportdate")));
|
|
|
- //确认医生id
|
|
|
- data.put("confirm_doctor_id", record.getString("reviewdoctor"));
|
|
|
- //确认医生姓名
|
|
|
- data.put("confirm_doctor_name",record.getString("reviewdoctor"));
|
|
|
+ // 获取data数据
|
|
|
+ // 医院id
|
|
|
+ data.put("hospital_id", "25200005");
|
|
|
+ // 影像所见
|
|
|
+ data.put("description", record.getString("description"));
|
|
|
+ // 意见建议
|
|
|
+ data.put("impression", record.getString("impression"));
|
|
|
+ // 检查id
|
|
|
+ data.put("exam_id", exams2.getId());
|
|
|
+ data.put("study_id", exams2.getStudyId());
|
|
|
+ // 患者id
|
|
|
+ data.put("patient_id", exams2.getPatientId());
|
|
|
+ // 患者姓名
|
|
|
+ data.put("patient_name", record.getString("patientname"));
|
|
|
+ // 患者性别
|
|
|
+ data.put("patient_sex", patientInfos.getSex());
|
|
|
+ // 身份证号
|
|
|
+ data.put("card_num", patientInfos.getCardNum());
|
|
|
+ // 手机号
|
|
|
+ data.put("phone", patientInfos.getPhone());
|
|
|
+ // 患者生日
|
|
|
+ data.put("birthday", patientInfos.getBirthday());
|
|
|
+ // 患者检查时年龄
|
|
|
+ data.put("patient_age", patientInfos.getAge());
|
|
|
+ // 阴阳性 1阴性 2阳性
|
|
|
+ data.put("report_result", "");
|
|
|
+ // 报告时间 10位时间戳
|
|
|
+ data.put("report_datetime", returnSecondTimestamp(record.getString("reportdate")));
|
|
|
+ // 报告医生id
|
|
|
+ data.put("report_doctor_id", record.getString("reportdoctor"));
|
|
|
+ // 报告医生姓名
|
|
|
+ data.put("report_doctor_name", record.getString("reportdoctor"));
|
|
|
+ // 审核时间
|
|
|
+ data.put("review_datetime", returnSecondTimestamp(record.getString("reportdate")));
|
|
|
+ // 审核医生id
|
|
|
+ data.put("review_doctor_id", record.getString("reviewdoctor"));
|
|
|
+ // 审核姓名
|
|
|
+ data.put("review_doctor_name", record.getString("reviewdoctor"));
|
|
|
+ // 确认时间
|
|
|
+ data.put("confirm_datetime", returnSecondTimestamp(record.getString("reportdate")));
|
|
|
+ // 确认医生id
|
|
|
+ data.put("confirm_doctor_id", record.getString("reviewdoctor"));
|
|
|
+ // 确认医生姓名
|
|
|
+ data.put("confirm_doctor_name", record.getString("reviewdoctor"));
|
|
|
+ //就诊号
|
|
|
+ data.put("patient_no", record.getString("patientid"));
|
|
|
// System.out.println(data);
|
|
|
//调用接口
|
|
|
// String s = post(null, data);
|
|
@@ -350,13 +351,13 @@ public class ViewController extends Controller {
|
|
|
.post(formBody)
|
|
|
.build();
|
|
|
|
|
|
-// try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
|
-// if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
-//
|
|
|
-// System.out.println(response.body().string());
|
|
|
-//// return response.body().string();
|
|
|
-//
|
|
|
-// }
|
|
|
+ try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
|
+ if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
|
+
|
|
|
+ System.out.println(response.body().string());
|
|
|
+// return response.body().string();
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
public static String Ksort(Map<String, String> map){
|
|
|
String sb = "";
|