|
@@ -7,6 +7,8 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
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.DeathRecordDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
@@ -29,16 +31,46 @@ public class THR03147 extends QCCatalogue {
|
|
|
@Autowired
|
|
|
private SpecialStorageUtil specialStorageUtil;
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- /**
|
|
|
- * 出院时间前48小时,48小时内找上级医师同意出院的病程记录
|
|
|
- *
|
|
|
- * 以患者病案首页【出院时间】找前48小时内【查房记录】,查房记录标题或查房记录内容或医生签字包含【/主任/主治/主治及以上医师姓名】和查房记录内容包含【出院】同时存在
|
|
|
- * 医生签名加上审核医师和记录医师
|
|
|
- */
|
|
|
status.set("0");
|
|
|
if(inputInfo.getFirstPageRecordDoc()==null || inputInfo.getFirstPageRecordDoc().getStructureMap()==null){
|
|
|
return;
|
|
|
}
|
|
|
+ //死亡记录不为空
|
|
|
+ DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
|
|
|
+ if(deathRecordDoc!=null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //死亡患者不判断
|
|
|
+ List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
+ if(ListUtil.isNotEmpty(doctorAdviceDocs)){
|
|
|
+ for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
|
|
|
+ //取长期临时医嘱,不为作废医嘱
|
|
|
+ if(doctorAdviceDoc.getStructureMap()==null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, String> doctorAdviceDocStructureMap = doctorAdviceDoc.getStructureMap();
|
|
|
+ String adviceType = doctorAdviceDocStructureMap.get(Content.doctorAdviceType);
|
|
|
+ if (StringUtil.isEmpty(adviceType)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (adviceType.equals(Content.standingOrder) || adviceType.equals(Content.statOrder)) {
|
|
|
+ String adviceState = doctorAdviceDocStructureMap.get(Content.doctorAdviceState);
|
|
|
+ if (StringUtil.isEmpty(adviceState)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!Content.cancellationOrderList.contains(adviceState)) {
|
|
|
+ //死亡医嘱
|
|
|
+ String medicalOrderName = doctorAdviceDoc.getStructureMap().get(Content.medicalOrderName);
|
|
|
+ if(StringUtil.isBlank(medicalOrderName)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (medicalOrderName.contains("死亡")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取病案首页出院时间
|
|
|
String dischargeTime = inputInfo.getFirstPageRecordDoc().getStructureMap().get("出院时间");
|
|
|
if (CatalogueUtil.isEmpty(dischargeTime)) {
|
|
@@ -81,7 +113,8 @@ public class THR03147 extends QCCatalogue {
|
|
|
Long.valueOf(48 * 60))){
|
|
|
flag=false;
|
|
|
//出院前48小时的查房记录
|
|
|
- String illnessRecords = structureMap.get("病情记录");
|
|
|
+ String key = getKeyByHospitalId();
|
|
|
+ String illnessRecords = structureMap.get(key);
|
|
|
//包含出院
|
|
|
if(StringUtil.isNotEmpty(illnessRecords)){
|
|
|
if(illnessRecords.contains("出院")) {
|
|
@@ -92,24 +125,24 @@ public class THR03147 extends QCCatalogue {
|
|
|
for (String superior : superiorList) {
|
|
|
if (roundTitle.contains(superior)) {
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
if(judgeContainsDoctor(roundTitle)){
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
//查房记录判断
|
|
|
for (String superior : superiorList) {
|
|
|
if (illnessRecords.contains(superior)) {
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
if(judgeContainsDoctor(illnessRecords)){
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
//审核人判断
|
|
|
String reviewer = structureMap.get("审核人");
|
|
@@ -117,12 +150,12 @@ public class THR03147 extends QCCatalogue {
|
|
|
for (String superior : superiorList) {
|
|
|
if (reviewer.contains(superior)) {
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
if(judgeContainsDoctor(reviewer)){
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
//记录医师判断
|
|
@@ -131,12 +164,12 @@ public class THR03147 extends QCCatalogue {
|
|
|
for (String superior : superiorList) {
|
|
|
if (recordsPhysicians.contains(superior)) {
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
if(judgeContainsDoctor(recordsPhysicians)){
|
|
|
flag=true;
|
|
|
- break;
|
|
|
+ return flag;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -169,4 +202,14 @@ public class THR03147 extends QCCatalogue {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ private String getKeyByHospitalId() {
|
|
|
+ switch (Content.hospital_Id)
|
|
|
+ {
|
|
|
+ case "3": //台州
|
|
|
+ return "查房内容";
|
|
|
+ default:
|
|
|
+ return "病情记录";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|