|
@@ -63,82 +63,88 @@ public class THR0128 extends QCCatalogue {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getStructureMap() != null
|
|
|
- && inputInfo.getThreeLevelWardDocs().size() > 0) {
|
|
|
- Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
- String admisTime = beHospitalStructureMap.get("入院日期");
|
|
|
- if (CatalogueUtil.isEmpty(admisTime)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- //开始时间(入院时间)
|
|
|
- Date beginDate = StringUtil.parseDateTime(admisTime);
|
|
|
- if (beginDate == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
- ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
|
|
|
- List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
|
|
|
- if (allDoctorWradDocs.size() == 0) {
|
|
|
- status.set("0");
|
|
|
- return;
|
|
|
- }
|
|
|
- Date lastRecordDate = getLastRecordDate(allDoctorWradDocs);
|
|
|
- if (lastRecordDate == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- int hoursPerWeek = 7 * 24 * 60;
|
|
|
- String roundRecordThisWeek = "";
|
|
|
- List<String> roundRecordEveryWeek = new ArrayList<>();
|
|
|
- beginDate = DateUtil.dateZeroClear(beginDate);//从入院记录当天天0点开始算
|
|
|
- int i = 1;
|
|
|
- //长兴首次病程算一次主治查房,所以第一周只需要两次主治查房就可以
|
|
|
- int rounds = 0;//主治查房次数
|
|
|
- Date firstWeek = DateUtil.addDate(beginDate, 7);
|
|
|
- for (AttendingDoctorWardDoc attendingDoctorWardDoc : threeLevelWardDoc.getAttendingDoctorWardDocs()) {//循环筛选主治,找出地日在第一周的个数
|
|
|
- String recordTime = attendingDoctorWardDoc.getStructureMap().get("查房日期");
|
|
|
- Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
|
- if(recordDate.before(firstWeek)){
|
|
|
- rounds = rounds + 1;
|
|
|
+ if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getThreeLevelWardDocs().size() > 0) {
|
|
|
+ if (CatalogueUtil.isEmpty(admisTime)) {
|
|
|
+ return;
|
|
|
}
|
|
|
- }
|
|
|
- if(rounds >= 2){
|
|
|
- return;
|
|
|
- }
|
|
|
- String lastWardDateRange = "";
|
|
|
- List<String> lastWardDateRangeList = new ArrayList<>();
|
|
|
- //每周的病历记录
|
|
|
- while (i >= 1) {
|
|
|
- roundRecordThisWeek = extractWardRecord(inputInfo, allDoctorWradDocs, beginDate, hoursPerWeek, lastRecordDate);
|
|
|
- if (CatalogueUtil.isEmpty(roundRecordThisWeek)) {
|
|
|
- break;
|
|
|
+ //开始时间(入院时间)
|
|
|
+ Date beginDate = StringUtil.parseDateTime(admisTime);
|
|
|
+ if (beginDate == null) {
|
|
|
+ return;
|
|
|
}
|
|
|
- lastWardDateRange = DateUtil.formatDate(beginDate) + " -> " + DateUtil.formatDate(DateUtil.addDate(beginDate, 6));
|
|
|
- lastWardDateRangeList.add(lastWardDateRange);
|
|
|
- roundRecordEveryWeek.add(roundRecordThisWeek);
|
|
|
- beginDate = DateUtil.addDate(beginDate, 7);
|
|
|
- i++;
|
|
|
- }
|
|
|
- if (roundRecordEveryWeek.size() == 0) {
|
|
|
- status.set("0");
|
|
|
- return;
|
|
|
- }
|
|
|
- boolean firstRecordAttendExist = findfirstRecordAttend(inputInfo);
|
|
|
- List<String> resultInfos = new ArrayList<>();
|
|
|
- for (int j = 0; j < roundRecordEveryWeek.size(); j++) {
|
|
|
- int indicationsNum = CatalogueUtil.appearNumber(roundRecordEveryWeek.get(j).split(","), Content.attend);
|
|
|
- if (j == 0 && firstRecordAttendExist) { //如果首程中医师签名为主治医师,第一周查房记录也要加上
|
|
|
- indicationsNum += 1;
|
|
|
+
|
|
|
+ ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
|
|
|
+ List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
|
|
|
+ if (allDoctorWradDocs.size() == 0) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
}
|
|
|
- if (indicationsNum < 3) {
|
|
|
- //每周无3次主治医师查房记录
|
|
|
- status.set("-1");
|
|
|
- resultInfos.add(lastWardDateRangeList.get(j));
|
|
|
+ Date lastRecordDate = getLastRecordDate(allDoctorWradDocs);
|
|
|
+ if (lastRecordDate == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ int hoursPerWeek = 7 * 24 * 60;
|
|
|
+ String roundRecordThisWeek = "";
|
|
|
+ List<String> roundRecordEveryWeek = new ArrayList<>();
|
|
|
+ beginDate = DateUtil.dateZeroClear(beginDate);//从入院记录当天天0点开始算
|
|
|
+ int i = 1;
|
|
|
+ //长兴首次病程算一次主治查房,所以第一周只需要两次主治查房就可以
|
|
|
+ int rounds = 0;//主治查房次数
|
|
|
+ Date firstWeek = DateUtil.addDate(beginDate, 7);
|
|
|
+ for (AttendingDoctorWardDoc attendingDoctorWardDoc : threeLevelWardDoc.getAttendingDoctorWardDocs()) {//循环筛选主治,找出地日在第一周的个数
|
|
|
+ String recordTime = attendingDoctorWardDoc.getStructureMap().get("查房日期");
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
|
+ if (recordDate.before(firstWeek)) {
|
|
|
+ rounds = rounds + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (rounds >= 2) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String lastWardDateRange = "";
|
|
|
+ List<String> lastWardDateRangeList = new ArrayList<>();
|
|
|
+ //每周的病历记录
|
|
|
+ while (i >= 1) {
|
|
|
+ roundRecordThisWeek = extractWardRecord(inputInfo, allDoctorWradDocs, beginDate, hoursPerWeek, lastRecordDate);
|
|
|
+ if (CatalogueUtil.isEmpty(roundRecordThisWeek)) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //如果6天后日期大于出院日期,跳过
|
|
|
+ if (StringUtil.isBlank(dischargeTime)) {
|
|
|
+ dischargeTime = presentTime;
|
|
|
+ }
|
|
|
+ Date sixDate = DateUtil.addDate(beginDate, 6);
|
|
|
+ if (StringUtil.parseDateTime(dischargeTime).before(sixDate)) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ lastWardDateRange = DateUtil.formatDate(beginDate) + " -> " + DateUtil.formatDate(sixDate);
|
|
|
+ lastWardDateRangeList.add(lastWardDateRange);
|
|
|
+ roundRecordEveryWeek.add(roundRecordThisWeek);
|
|
|
+ beginDate = DateUtil.addDate(beginDate, 7);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ if (roundRecordEveryWeek.size() == 0) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ boolean firstRecordAttendExist = findfirstRecordAttend(inputInfo);
|
|
|
+ List<String> resultInfos = new ArrayList<>();
|
|
|
+ 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");
|
|
|
+ resultInfos.add(lastWardDateRangeList.get(j));
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (resultInfos.size() > 0) {
|
|
|
- info.set(StringUtils.join(resultInfos.toArray(), ";"));
|
|
|
+ if (resultInfos.size() > 0) {
|
|
|
+ info.set(StringUtils.join(resultInfos.toArray(), ";"));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -180,10 +186,10 @@ public class THR0128 extends QCCatalogue {
|
|
|
/* 替换查房标题中主刀/一助的职称 */
|
|
|
List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
|
|
|
if (title.contains("主刀")) {
|
|
|
- String doctorTitle = CatalogueUtil.getDoctorTitle(operationDocs, recordDate,"主刀医师");
|
|
|
+ String doctorTitle = CatalogueUtil.getDoctorTitle(operationDocs, recordDate, "主刀医师");
|
|
|
title = title.replace("主刀", doctorTitle);
|
|
|
- } else if (title.contains("一助")){
|
|
|
- String doctorTitle = CatalogueUtil.getDoctorTitle(operationDocs, recordDate,"一助");
|
|
|
+ } else if (title.contains("一助")) {
|
|
|
+ String doctorTitle = CatalogueUtil.getDoctorTitle(operationDocs, recordDate, "一助");
|
|
|
title = title.replace("一助", doctorTitle);
|
|
|
}
|
|
|
if (admisDate.before(recordDate) && !CatalogueUtil.compareTime(admisDate, recordDate, (long) duration)) {
|