|
@@ -2,12 +2,16 @@ package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
|
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
+import com.lantone.qc.kernel.util.KernelConstants;
|
|
|
+import com.lantone.qc.kernel.util.RedisUtil;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
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.util.DateUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -23,6 +27,9 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Component
|
|
|
public class THR0128 extends QCCatalogue {
|
|
|
+ @Autowired
|
|
|
+ private RedisUtil redisUtil;
|
|
|
+
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
if (inputInfo.getLeaveHospitalDoc() != null
|
|
@@ -71,6 +78,19 @@ public class THR0128 extends QCCatalogue {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
+ boolean firstRecordAttendExist = findfirstRecordAttend(inputInfo);
|
|
|
+ for (int j = 0; j < roundRecordEveryWeek.size(); j++) {
|
|
|
+ int indicationsNum = CatalogueUtil.appearNumber(roundRecordEveryWeek.get(j).split(","), Content.attend);
|
|
|
+ if (j == 0 && firstRecordAttendExist) { //如果首程中医师签名为主治医师,第一周查房记录也要加上
|
|
|
+ indicationsNum += 1;
|
|
|
+ }
|
|
|
+ if (indicationsNum < 3) {
|
|
|
+ //每周无3次主治医师查房记录
|
|
|
+ status.set("-1");
|
|
|
+ info.set(lastWardDateRange);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
for (String roundRecord : roundRecordEveryWeek) {
|
|
|
int indicationsNum = CatalogueUtil.appearNumber(roundRecord.split(","), Content.attend);
|
|
|
if (indicationsNum < 3) {
|
|
@@ -129,4 +149,23 @@ public class THR0128 extends QCCatalogue {
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
|
+
|
|
|
+ private boolean findfirstRecordAttend(InputInfo inputInfo) {
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
+ if (firstCourseRecordDoc == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ Map<String, Map<String, Object>> hospitalDoctorMap = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
|
|
|
+ String doctorSign = firstCourseRecordDoc.getStructureMap().get("医师签名");
|
|
|
+ if (hospitalDoctorMap == null || StringUtil.isBlank(doctorSign)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (hospitalDoctorMap.containsKey(doctorSign)) {
|
|
|
+ Object professor = hospitalDoctorMap.get(doctorSign).get("professor");
|
|
|
+ if (professor != null) {
|
|
|
+ return professor.toString().contains("主治");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|