|
@@ -4,8 +4,10 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
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.label.MenstrualLabel;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Map;
|
|
@@ -17,44 +19,82 @@ import java.util.Map;
|
|
|
* @Date: 2020-03-10 10:10
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class BEH0059 extends QCCatalogue {
|
|
|
+ /**
|
|
|
+ * 1.判断住院信息表"科室"若为包含(儿科/新生儿)则通过
|
|
|
+ * 2..判断入院记录是否存在,若不存在则通过
|
|
|
+ * 3.获取性别(住院信息表/入院记录),若是性别不存在或性别为男则通过。然后获取年龄(住院信息表/入院记录),若是年龄小于10岁则通过。
|
|
|
+ * 4.获取入院记录结构化数据若是其中存在"月经"、"经期"、"绝经"且不为空则通过,
|
|
|
+ * 然后获取入院记录月经史,若不存在则报错返回,
|
|
|
+ * 若存在则去除符合规则‘[月经史|:|:|null]’的情况若是去除之后月经史为空则触发规则返回,若是不为空则判断其中是否包含中文字,若是包含则通过
|
|
|
+ */
|
|
|
@Override
|
|
|
protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- if (inputInfo.getBeHospitalizedDoc() != null) {
|
|
|
- if (inputInfo.getBeHospitalizedDoc().getStructureMap() == null
|
|
|
- || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
|
|
|
- || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
|
|
|
- status.set("0"); //如果性别是男,就不报错
|
|
|
- } else {
|
|
|
- String concatMenstrualText = concatMenstrualText(inputInfo);
|
|
|
- if (StringUtil.isNotBlank(concatMenstrualText)) {
|
|
|
+ MedicalRecordInfoDoc medicalRecordInfoDoc = inputInfo.getMedicalRecordInfoDoc();
|
|
|
+ if (medicalRecordInfoDoc != null && medicalRecordInfoDoc.getStructureMap() != null) {
|
|
|
+ //科室
|
|
|
+ String behDeptName = medicalRecordInfoDoc.getStructureMap().get("behDeptName");
|
|
|
+ if (StringUtil.isNotBlank(behDeptName) && (behDeptName.contains("儿科") || behDeptName.contains("新生儿"))) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //性别
|
|
|
+ String sex = medicalRecordInfoDoc.getStructureMap().get("sex");
|
|
|
+ if (StringUtil.isNotBlank(sex) && (sex.contains("男"))) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getStructureMap() == null) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") != null &&
|
|
|
+ inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
|
|
|
+ status.set("0"); //如果性别是男,就不报错
|
|
|
+ }
|
|
|
+ //年龄
|
|
|
+ String age = inputInfo.getBeHospitalizedDoc().getStructureMap().get("年龄");
|
|
|
+ if (StringUtil.isNotBlank(age)) {
|
|
|
+ try {
|
|
|
+ age = age.replace("岁", "");
|
|
|
+ int ageNum = Integer.parseInt(age);
|
|
|
+ if (ageNum < 10) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
- MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
|
|
|
- if (menstrualLabel == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- String menstrualText = StringUtil.removeBlank(menstrualLabel.getText()).replaceAll("[月经史|:|:|null]", "");
|
|
|
- if (StringUtil.isBlank(menstrualText)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- boolean containChinese = CatalogueUtil.isContainChinese(menstrualText);
|
|
|
- if (containChinese) {
|
|
|
- status.set("0"); //如果性别是女,不为空就不报错
|
|
|
- }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e + "BEH0059 : 日期转换异常");
|
|
|
}
|
|
|
- }else {
|
|
|
+ }
|
|
|
+ String concatMenstrualText = concatMenstrualText(inputInfo);
|
|
|
+ if (StringUtil.isNotBlank(concatMenstrualText)) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
+ MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
|
|
|
+ if (menstrualLabel == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String menstrualText = StringUtil.removeBlank(menstrualLabel.getText()).replaceAll("[月经史|:|:|null]", "");
|
|
|
+ if (StringUtil.isBlank(menstrualText)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ boolean containChinese = CatalogueUtil.isContainChinese(menstrualText);
|
|
|
+ if (containChinese) {
|
|
|
+ status.set("0"); //如果性别是女,不为空就不报错
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private String concatMenstrualText(InputInfo inputInfo) {
|
|
|
Map<String, String> beHospitalizedStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
for (Map.Entry<String, String> bhMap : beHospitalizedStructureMap.entrySet()) {
|
|
|
- if (bhMap.getKey().contains("月经") || bhMap.getKey().contains("经期") || bhMap.getKey().contains("绝经")) {
|
|
|
+ if (bhMap.getKey().contains("月经") || bhMap.getKey().contains("经期") || bhMap.getKey().contains("绝经") || bhMap.getKey().contains("月经史")) {
|
|
|
if (StringUtil.isNotBlank(bhMap.getValue())) {
|
|
|
sb.append(bhMap.getValue());
|
|
|
}
|