|
@@ -7,8 +7,10 @@ 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.MedicalRecordInfoDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+import com.lantone.qc.pub.util.DateUtil;
|
|
|
import com.lantone.qc.pub.util.SpringContextUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -26,15 +28,42 @@ import java.util.Map;
|
|
|
public class THR0601 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
- if (inputInfo.getLeaveHospitalDoc() == null || inputInfo.getThreeLevelWardDocs().size() == 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
|
|
|
- String lengthOfStay = leaveHospitalStructureMap.get("住院天数");
|
|
|
- if (StringUtil.isNotBlank(lengthOfStay) && CatalogueUtil.numbersOnly(lengthOfStay)) {
|
|
|
+
|
|
|
+ MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
|
|
|
+ if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null &&
|
|
|
+ medicalRecordInfoDoc != null) {
|
|
|
+ Map<String, String> getFirstPageRecordStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
+ String admisTime = medicalRecordInfoDoc.getStructureMap().get("behospitalDate");
|
|
|
+ String dischargeTime = getFirstPageRecordStructureMap.get("出院时间");
|
|
|
+ if (CatalogueUtil.isEmpty(admisTime) || CatalogueUtil.isEmpty(dischargeTime)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!CatalogueUtil.compareTime(
|
|
|
+ StringUtil.parseDateTime(admisTime),
|
|
|
+ StringUtil.parseDateTime(DateUtil.nowString()),
|
|
|
+ Long.valueOf(48 * 60))) {//如果入院未超过48小时,规则不判断
|
|
|
+ return;
|
|
|
+ }
|
|
|
//如果住院天数小于2天则不判断该条规则
|
|
|
- if (Integer.parseInt(lengthOfStay) <= 2) {
|
|
|
+ if (DateUtil.parseDate(dischargeTime) != null &&
|
|
|
+ !CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(dischargeTime), (long) (48 * 60))) {
|
|
|
return;
|
|
|
+ } else {
|
|
|
+ if (inputInfo.getThreeLevelWardDocs().size() == 0) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (inputInfo.getLeaveHospitalDoc() != null) {
|
|
|
+ Map<String, String> leaveHospitalStructureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
|
|
|
+ String lengthOfStay = leaveHospitalStructureMap.get("住院天数");
|
|
|
+ if (StringUtil.isNotBlank(lengthOfStay) && CatalogueUtil.numbersOnly(lengthOfStay)) {
|
|
|
+ //如果住院天数小于2天则不判断该条规则
|
|
|
+ if (Integer.parseInt(lengthOfStay) <= 2) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -58,13 +87,6 @@ public class THR0601 extends QCCatalogue {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //取病案首页主治医生名称
|
|
|
-// String visitingStaff = "";
|
|
|
-// if (inputInfo.getFirstPageRecordDoc() != null) {
|
|
|
-// Map<String, String> firstPageStructureExtMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
|
|
|
-// visitingStaff = firstPageStructureExtMap.get("主治医师");
|
|
|
-// }
|
|
|
-
|
|
|
List<ThreeLevelWardDoc> allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();//查房记录
|
|
|
String title, record;
|
|
|
boolean findIndications = false;
|