|
@@ -8,11 +8,13 @@ import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
import com.lantone.qc.pub.model.label.DiagLabel;
|
|
import com.lantone.qc.pub.model.label.DiagLabel;
|
|
import com.lantone.qc.pub.model.label.PastLabel;
|
|
import com.lantone.qc.pub.model.label.PastLabel;
|
|
|
|
+import com.lantone.qc.pub.util.DateUtil;
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@@ -42,22 +44,31 @@ public class BEH03330 extends QCCatalogue {
|
|
String eDOC = beHospitalizedDoc.getStructureMap().get("预产期");
|
|
String eDOC = beHospitalizedDoc.getStructureMap().get("预产期");
|
|
//末次月经
|
|
//末次月经
|
|
String lastMP = beHospitalizedDoc.getStructureMap().get("末次月经");
|
|
String lastMP = beHospitalizedDoc.getStructureMap().get("末次月经");
|
|
- //末次月经月份
|
|
|
|
- String lastMPMonth = beHospitalizedDoc.getStructureMap().get("末次月经月份");
|
|
|
|
- //末次月经日
|
|
|
|
- String lastMPDay = beHospitalizedDoc.getStructureMap().get("末次月经日");
|
|
|
|
- if (StringUtil.isBlank(eDOC) || StringUtil.isBlank(lastMP) || StringUtil.isBlank(lastMPMonth) || StringUtil.isBlank(lastMPDay)) {
|
|
|
|
|
|
+ if (StringUtil.isBlank(eDOC) || StringUtil.isBlank(lastMP)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ Date eDOCDate = StringUtil.parseDateTime(eDOC);
|
|
|
|
+ Date lastMPDate = StringUtil.parseDateTime(lastMP);
|
|
|
|
+ if (eDOCDate == null || lastMPDate == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
try {
|
|
try {
|
|
- int lastMPMonthNum = strConvertInt(lastMPMonth) + 9 > 12 ? strConvertInt(lastMPMonth) - 3 : strConvertInt(lastMPMonth) + 9;
|
|
|
|
- int lastMPDayNum = strConvertInt(lastMPDay) + 7;
|
|
|
|
|
|
+ //预产期月份
|
|
|
|
+ int eDOCMonth = DateUtil.getMonth(eDOCDate);
|
|
|
|
+ //预产期日
|
|
|
|
+ int eDOCDay = DateUtil.getDay(eDOCDate);
|
|
|
|
+ //末次月经月份
|
|
|
|
+ int lastMPMonth = DateUtil.getMonth(lastMPDate);
|
|
|
|
+ //末次月经日
|
|
|
|
+ int lastMPDay = DateUtil.getDay(lastMPDate);
|
|
|
|
+
|
|
|
|
+ int lastMPMonthNum = lastMPMonth + 9 > 12 ? lastMPMonth - 3 : lastMPMonth + 9;
|
|
|
|
+ int lastMPDayNum = lastMPDay + 7;
|
|
if (lastMPDayNum > 30) {
|
|
if (lastMPDayNum > 30) {
|
|
lastMPMonthNum = lastMPMonthNum + 1;
|
|
lastMPMonthNum = lastMPMonthNum + 1;
|
|
lastMPDayNum = lastMPDayNum - 30;
|
|
lastMPDayNum = lastMPDayNum - 30;
|
|
}
|
|
}
|
|
- if (lastMPMonthNum != lastMPDayNum) {
|
|
|
|
|
|
+ if (eDOCMonth != lastMPMonthNum || eDOCDay != lastMPDayNum) {
|
|
status.set("-1");
|
|
status.set("-1");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -67,9 +78,4 @@ public class BEH03330 extends QCCatalogue {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- //String转int
|
|
|
|
- private int strConvertInt(String str) {
|
|
|
|
- return Integer.parseInt(str);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|