|
@@ -32,113 +32,97 @@ public class THR0126 extends QCCatalogue {
|
|
status.set("0");
|
|
status.set("0");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (inputInfo.getLeaveHospitalDoc() != null && inputInfo.getLeaveHospitalDoc().getStructureMap() != null
|
|
|
|
- && inputInfo.getThreeLevelWardDocs().size() > 0) {
|
|
|
|
- Map<String, String> getLeaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
|
|
|
|
- String admisTime = getLeaveHospitalStructureMap.get("入院日期");
|
|
|
|
- String dischargeTime = getLeaveHospitalStructureMap.get("出院日期");
|
|
|
|
- if (CatalogueUtil.isEmpty(admisTime)) {
|
|
|
|
- status.set("0");
|
|
|
|
- return;
|
|
|
|
|
|
+ String admisTime = null, dischargeTime = null;
|
|
|
|
+ if (inputInfo.getLeaveHospitalDoc() != null && inputInfo.getThreeLevelWardDocs().size() > 0) {
|
|
|
|
+ if (inputInfo.getMedicalRecordInfoDoc() != null) {
|
|
|
|
+ Map<String, String> structureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
|
|
|
|
+ admisTime = structureMap.get("behospitalDate");
|
|
|
|
+ dischargeTime = structureMap.get("leaveHospitalDate");
|
|
}
|
|
}
|
|
- if (!CatalogueUtil.compareTime(
|
|
|
|
- StringUtil.parseDateTime(admisTime),
|
|
|
|
- StringUtil.parseDateTime(DateUtil.nowString()),
|
|
|
|
- Long.valueOf(48 * 60))) {//如果入院未超过48小时,规则不判断
|
|
|
|
|
|
+ if (CatalogueUtil.isEmpty(admisTime)) {
|
|
status.set("0");
|
|
status.set("0");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//如果住院天数小于2天则不判断该条规则
|
|
//如果住院天数小于2天则不判断该条规则
|
|
- if (DateUtil.parseDate(dischargeTime) != null && StringUtil.isNotEmpty(dischargeTime) &&
|
|
|
|
- !CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(dischargeTime), (long) (48 * 60))) {
|
|
|
|
- status.set("0");
|
|
|
|
- return;
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(admisTime) && StringUtil.isNotBlank(dischargeTime)) {
|
|
|
|
+ if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(DateUtil.nowString()),
|
|
|
|
+ 48 * 60L)) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (inputInfo.getBeHospitalizedDoc() != null) {
|
|
|
|
- Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
|
- String admisTime = beHospitalStructureMap.get("入院日期");
|
|
|
|
- if (CatalogueUtil.isEmpty(admisTime)) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!CatalogueUtil.compareTime(
|
|
|
|
- StringUtil.parseDateTime(admisTime),
|
|
|
|
- StringUtil.parseDateTime(DateUtil.nowString()),
|
|
|
|
- Long.valueOf(48 * 60))) {//如果入院未超过48小时,规则不判断
|
|
|
|
- status.set("0");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- //开始时间(入院时间)
|
|
|
|
- Date beginDate = StringUtil.parseDateTime(admisTime);
|
|
|
|
- if (beginDate == null) {
|
|
|
|
- status.set("0");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- /* 首次病程录如果是主治或者主任写的,也算主治查房 */
|
|
|
|
- FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
|
- if (firstCourseRecordDoc != null) {
|
|
|
|
- String doctorSign = firstCourseRecordDoc.getStructureMap().get("医生签名");
|
|
|
|
- String firstCourseProfessor = getFirstCourseProfessor(doctorSign);
|
|
|
|
- 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");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ //开始时间(入院时间)
|
|
|
|
+ Date beginDate = StringUtil.parseDateTime(admisTime);
|
|
|
|
+ if (beginDate == null) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ /* 首次病程录如果是主治或者主任写的,也算主治查房 */
|
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
|
+ if (firstCourseRecordDoc != null) {
|
|
|
|
+ String doctorSign = firstCourseRecordDoc.getStructureMap().get("医生签名");
|
|
|
|
+ String firstCourseProfessor = getFirstCourseProfessor(doctorSign);
|
|
|
|
+ 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");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
|
|
|
|
- List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDoc.getAttendingDoctorWardDocs();
|
|
|
|
- if (attendingDoctorWardDocs.size() > 0) {
|
|
|
|
- AttendingDoctorWardDoc firstAttending = attendingDoctorWardDocs.get(0);
|
|
|
|
- String wardDateStr = firstAttending.getStructureMap().get("查房日期");
|
|
|
|
- if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
|
|
|
|
- status.set("0");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- } else if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), new Date(), 48 * 60L)) {
|
|
|
|
- status.set("0");//没有主治医师查房,若入院时间和系统当前时间对比,相差48小时则报错
|
|
|
|
|
|
+ }
|
|
|
|
+ ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
|
|
|
|
+ List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDoc.getAttendingDoctorWardDocs();
|
|
|
|
+ if (attendingDoctorWardDocs.size() > 0) {
|
|
|
|
+ AttendingDoctorWardDoc firstAttending = attendingDoctorWardDocs.get(0);
|
|
|
|
+ String wardDateStr = firstAttending.getStructureMap().get("查房日期");
|
|
|
|
+ if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
|
|
|
|
+ status.set("0");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ } else if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), new Date(), 48 * 60L)) {
|
|
|
|
+ status.set("0");//没有主治医师查房,若入院时间和系统当前时间对比,相差48小时则报错
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- /* 如果存在手术记录,判断主刀医生是否为主治医生 */
|
|
|
|
- String operatorName = "";
|
|
|
|
- List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
|
- if (operationDocs != null) {
|
|
|
|
- for (OperationDoc operationDoc : operationDocs) {
|
|
|
|
- if (operationDoc.getOperationRecordDoc() != null) {
|
|
|
|
- Map<String, String> operationDocStructureMap = operationDoc.getOperationRecordDoc().getStructureMap();
|
|
|
|
- if (StringUtil.isBlank(operatorName)) {
|
|
|
|
- operatorName = operationDocStructureMap.get("主刀医师");
|
|
|
|
- if (StringUtil.isBlank(operatorName) && StringUtil.isNotBlank(operationDocStructureMap.get("手术者及助手名称"))) {
|
|
|
|
- operatorName = operationDocStructureMap.get("手术者及助手名称").split("、")[0];
|
|
|
|
- if (operatorName.contains("主刀:") && operatorName.split(":").length > 1) {
|
|
|
|
- operatorName = operatorName.split(":")[1];
|
|
|
|
- }
|
|
|
|
|
|
+ /* 如果存在手术记录,判断主刀医生是否为主治医生 */
|
|
|
|
+ String operatorName = "";
|
|
|
|
+ List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
|
+ if (operationDocs != null) {
|
|
|
|
+ for (OperationDoc operationDoc : operationDocs) {
|
|
|
|
+ if (operationDoc.getOperationRecordDoc() != null) {
|
|
|
|
+ Map<String, String> operationDocStructureMap = operationDoc.getOperationRecordDoc().getStructureMap();
|
|
|
|
+ if (StringUtil.isBlank(operatorName)) {
|
|
|
|
+ operatorName = operationDocStructureMap.get("主刀医师");
|
|
|
|
+ if (StringUtil.isBlank(operatorName) && StringUtil.isNotBlank(operationDocStructureMap.get("手术者及助手名称"))) {
|
|
|
|
+ operatorName = operationDocStructureMap.get("手术者及助手名称").split("、")[0];
|
|
|
|
+ if (operatorName.contains("主刀:") && operatorName.split(":").length > 1) {
|
|
|
|
+ operatorName = operatorName.split(":")[1];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
|
|
|
|
- for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
|
|
|
|
- Map<String, String> structureMap = threeLevelWard.getStructureMap();
|
|
|
|
- String wardDateStr = structureMap.get("查房日期");
|
|
|
|
- if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
|
|
|
|
- String makeTitle = structureMap.get("查房标题");
|
|
|
|
- String pathography = structureMap.get("病情记录");
|
|
|
|
- //判断标题
|
|
|
|
- visitingPhysicianHouse(operatorName, makeTitle);
|
|
|
|
- //判断病情记录
|
|
|
|
- visitingPhysicianHouse(operatorName, pathography);
|
|
|
|
- }
|
|
|
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
|
|
|
|
+ for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
|
|
|
|
+ Map<String, String> structureMap = threeLevelWard.getStructureMap();
|
|
|
|
+ String wardDateStr = structureMap.get("查房日期");
|
|
|
|
+ if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
|
|
|
|
+ String makeTitle = structureMap.get("查房标题");
|
|
|
|
+ String pathography = structureMap.get("病情记录");
|
|
|
|
+ //判断标题
|
|
|
|
+ visitingPhysicianHouse(operatorName, makeTitle);
|
|
|
|
+ //判断病情记录
|
|
|
|
+ visitingPhysicianHouse(operatorName, pathography);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 判断查房记录是否含有主治医师查房
|
|
* 判断查房记录是否含有主治医师查房
|
|
*
|
|
*
|
|
@@ -149,12 +133,10 @@ public class THR0126 extends QCCatalogue {
|
|
if (StringUtil.isNotBlank(titlePathography)) {
|
|
if (StringUtil.isNotBlank(titlePathography)) {
|
|
if (titlePathography.contains("主治")) {
|
|
if (titlePathography.contains("主治")) {
|
|
status.set("0");
|
|
status.set("0");
|
|
- return;
|
|
|
|
} else if (StringUtil.isNotBlank(operatorName) && (titlePathography.contains(operatorName) || titlePathography.contains("主刀"))) {
|
|
} else if (StringUtil.isNotBlank(operatorName) && (titlePathography.contains(operatorName) || titlePathography.contains("主刀"))) {
|
|
String operationProfessor = getFirstCourseProfessor(operatorName);
|
|
String operationProfessor = getFirstCourseProfessor(operatorName);
|
|
if (operationProfessor.contains("主治")) {
|
|
if (operationProfessor.contains("主治")) {
|
|
status.set("0");
|
|
status.set("0");
|
|
- return;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|