|
@@ -1,15 +1,20 @@
|
|
package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
|
|
|
|
|
|
+import com.lantone.qc.dbanaly.util.KernelConstants;
|
|
|
|
+import com.lantone.qc.dbanaly.util.RedisUtil;
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
import com.lantone.qc.pub.Content;
|
|
import com.lantone.qc.pub.Content;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
|
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
|
|
import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
|
|
|
|
+import com.lantone.qc.pub.util.SpringContextUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -40,12 +45,25 @@ public class THR0126 extends QCCatalogue {
|
|
status.set("0");
|
|
status.set("0");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ /* 首次病程录如果是主治或者主任写的,也算主治查房 */
|
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
|
+ if (firstCourseRecordDoc != null) {
|
|
|
|
+ String firstCourseProfessor = getFirstCourseProfessor(firstCourseRecordDoc);
|
|
|
|
+ if (firstCourseProfessor.contains("主治") || firstCourseProfessor.contains("主任")) {
|
|
|
|
+ String recordDateStr = firstCourseRecordDoc.getStructureMap().get("记录时间");
|
|
|
|
+ if (StringUtil.isNotBlank(recordDateStr)) {
|
|
|
|
+ if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(recordDateStr), 48 * 60L)) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
|
|
ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
|
|
List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDoc.getAttendingDoctorWardDocs();
|
|
List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDoc.getAttendingDoctorWardDocs();
|
|
if (attendingDoctorWardDocs.size() > 0) {
|
|
if (attendingDoctorWardDocs.size() > 0) {
|
|
AttendingDoctorWardDoc firstAttending = attendingDoctorWardDocs.get(0);
|
|
AttendingDoctorWardDoc firstAttending = attendingDoctorWardDocs.get(0);
|
|
String wardDateStr = firstAttending.getStructureMap().get("查房日期");
|
|
String wardDateStr = firstAttending.getStructureMap().get("查房日期");
|
|
- if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), (long) (48 * 60))) {
|
|
|
|
|
|
+ if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
|
|
status.set("0");
|
|
status.set("0");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -54,4 +72,22 @@ public class THR0126 extends QCCatalogue {
|
|
status.set("0");
|
|
status.set("0");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private String getFirstCourseProfessor(FirstCourseRecordDoc firstCourseRecordDoc) {
|
|
|
|
+ String professor = "";
|
|
|
|
+ String doctorSign = firstCourseRecordDoc.getStructureMap().get("记录医师");
|
|
|
|
+ if (StringUtil.isBlank(doctorSign)){
|
|
|
|
+ return professor;
|
|
|
|
+ }
|
|
|
|
+ RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
|
|
|
|
+ Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
|
|
|
|
+ if (surgeon != null) {
|
|
|
|
+ Map<String, String> doctor = (Map) surgeon.get(doctorSign);
|
|
|
|
+ if (doctor != null) {
|
|
|
|
+ professor = doctor.get("professor");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return professor;
|
|
|
|
+ }
|
|
}
|
|
}
|