|
@@ -9,6 +9,7 @@ import com.zskk.model.Doctors;
|
|
|
import com.zskk.model.Exams;
|
|
|
import com.zskk.model.PatientInfos;
|
|
|
import com.zskk.model.Report;
|
|
|
+import com.zskk.model.Studies;
|
|
|
import com.zskk.service.ServiceFactory;
|
|
|
import com.zskk.service.ThreadPoolService;
|
|
|
import com.zskk.service.WeixinService;
|
|
@@ -35,24 +36,24 @@ public class DataTask implements ITask {
|
|
|
// TODO Auto-generated method stub
|
|
|
try {
|
|
|
List<Exams> exams = Exams.dao.use("zskk").find(
|
|
|
- "SELECT * FROM pacsonline.exams where exam_status=3 and institution_id='15700002' order by createdAt desc limit 50");
|
|
|
+ "SELECT * FROM pacsonline.exams where exam_status=3 and institution_id='15400009' order by createdAt desc limit 30");
|
|
|
for (Exams exams2 : exams) {
|
|
|
try {
|
|
|
- // Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
- Record record = Db.use("connected").findFirst("select * from zskk where accessionNumber=?",
|
|
|
- exams2.getPatientNum());
|
|
|
+ Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
+ Record record = Db.use("connected").findFirst("select * from reportinfo where impression is not null and studyuid=?",
|
|
|
+ studies.getStudyuid());
|
|
|
if (record == null) {
|
|
|
continue;
|
|
|
}
|
|
|
Report report = new Report().use("zskk");
|
|
|
report.setId(creatId());
|
|
|
report.setReportDatetime(parseStringToDate(record.getStr("reportdate")));
|
|
|
- if (record.getStr("impression") == null || record.getStr("DESCRIPTION") == null
|
|
|
- || record.getStr("impression").isBlank() || record.getStr("DESCRIPTION").isBlank()) {
|
|
|
+ if (record.getStr("impression") == null || record.getStr("description") == null
|
|
|
+ || record.getStr("impression").isBlank() || record.getStr("description").isBlank()) {
|
|
|
continue;
|
|
|
}
|
|
|
report.setImpression(record.getStr("impression"));
|
|
|
- report.setDescription(record.getStr("DESCRIPTION"));
|
|
|
+ report.setDescription(record.getStr("description"));
|
|
|
report.setExamId(exams2.getId());
|
|
|
report.setCreatedAt(new Date());
|
|
|
report.setReportDoctorId(getDoctorIdByName(record.getStr("reportdoctor")));
|
|
@@ -67,22 +68,22 @@ public class DataTask implements ITask {
|
|
|
patientInfos.setCardNum(record.getStr("idcard"));
|
|
|
patientInfos.update();
|
|
|
exams2.setExamStatus(9);
|
|
|
- String patString = record.getStr("patientid");
|
|
|
- Integer length = patString.length();
|
|
|
- patString = String.format("%0"+length+"d",Long.valueOf(patString));
|
|
|
- exams2.setHopitalizedNo(patString);
|
|
|
- exams2.setClinDoctors(record.getStr("clinicaldoctor"));
|
|
|
+// String patString = record.getStr("patientid");
|
|
|
+// Integer length = patString.length();
|
|
|
+// patString = String.format("%0"+length+"d",Long.valueOf(patString));
|
|
|
+// exams2.setHopitalizedNo(patString);
|
|
|
+// exams2.setClinDoctors(record.getStr("clinicaldoctor"));
|
|
|
exams2.setApplicationDepartment(record.getStr("department"));
|
|
|
exams2.setApplicationDoctor(record.getStr("clinicaldoctor"));
|
|
|
- exams2.setClinDiag(record.getStr("diagnosis"));
|
|
|
+// exams2.setClinDiag(record.getStr("diagnosis"));
|
|
|
exams2.update();
|
|
|
// 传云医康 数据
|
|
|
Map<String, String> data = new HashMap<String, String>();
|
|
|
// 获取data数据
|
|
|
// 医院id
|
|
|
- data.put("hospital_id", "15700002");
|
|
|
+ data.put("hospital_id", "15400009");
|
|
|
// 影像所见
|
|
|
- data.put("description", record.getStr("DESCRIPTION"));
|
|
|
+ data.put("description", record.getStr("description"));
|
|
|
// 意见建议
|
|
|
data.put("impression", record.getStr("impression"));
|
|
|
// 检查id
|
|
@@ -93,7 +94,7 @@ public class DataTask implements ITask {
|
|
|
// 患者姓名
|
|
|
data.put("patient_name", record.getStr("patientname"));
|
|
|
// 患者性别
|
|
|
- data.put("patient_sex", record.getStr("patientsex").equals("女") ? "F" : "M");
|
|
|
+ data.put("patient_sex", patientInfos.getSex());
|
|
|
// 身份证号
|
|
|
data.put("card_num", patientInfos.getCardNum());
|
|
|
// 手机号
|
|
@@ -103,7 +104,7 @@ public class DataTask implements ITask {
|
|
|
// 患者检查时年龄
|
|
|
data.put("patient_age", patientInfos.getAge());
|
|
|
// 阴阳性 1阴性 2阳性
|
|
|
- data.put("report_result", "");
|
|
|
+ data.put("report_result", record.getStr("reportdoctor").contains("阴")?"1":"2");
|
|
|
// 报告时间 10位时间戳
|
|
|
data.put("report_datetime", returnSecondTimestamp(record.getStr("reportdate")));
|
|
|
// 报告医生id
|
|
@@ -122,7 +123,7 @@ public class DataTask implements ITask {
|
|
|
data.put("confirm_doctor_id", record.getStr("reviewdoctor"));
|
|
|
// 确认医生姓名
|
|
|
data.put("confirm_doctor_name", record.getStr("reviewdoctor"));
|
|
|
- data.put("patient_no", patString);
|
|
|
+ data.put("patient_no", "");
|
|
|
|
|
|
|
|
|
ThreadPoolService tService = new com.zskk.service.ThreadPoolService();
|
|
@@ -269,14 +270,14 @@ public class DataTask implements ITask {
|
|
|
}
|
|
|
name = name.replace(" ", "");
|
|
|
Doctors doctors = Doctors.dao.use("zskk").findFirst(
|
|
|
- "SELECT * FROM doctors where instr(?,realname) and institution_id='15700002' and realname <>''", name);
|
|
|
+ "SELECT * FROM doctors where instr(?,realname) and institution_id='15400009' and realname <>''", name);
|
|
|
if (doctors == null) {
|
|
|
Doctors newDoctors = new Doctors().use("zskk");
|
|
|
newDoctors.setId(creatId());
|
|
|
newDoctors.setUsername("none");
|
|
|
newDoctors.setRealname(name);
|
|
|
newDoctors.setPassword("123456");
|
|
|
- newDoctors.setInstitutionId("15700002");
|
|
|
+ newDoctors.setInstitutionId("15400009");
|
|
|
newDoctors.setCreatedAt(new Date());
|
|
|
newDoctors.setUpdatedAt(new Date());
|
|
|
newDoctors.save();
|