|
@@ -0,0 +1,56 @@
|
|
|
+package com.lantone.qc.kernel.catalogue.firstcourserecord;
|
|
|
+
|
|
|
+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.BeHospitalizedDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : FIRC0093
|
|
|
+ * @Description : 首次病程未在患者入院8小时内完成
|
|
|
+ * @Author : 楼辉荣
|
|
|
+ * @Date: 2020-03-06 17:28
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class FIRC0093 extends QCCatalogue {
|
|
|
+ public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm";
|
|
|
+ public static String FORMAT_LONG_CN_MI = "yyyy年MM月dd日HH时mm分";
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
|
|
|
+ status = "0";
|
|
|
+ BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
|
+ FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
+ if(firstCourseRecordDoc != null && beHospitalizedDoc != null){
|
|
|
+ Map<String, String> courseRecordDocStructureMap = firstCourseRecordDoc.getStructureMap();
|
|
|
+ Map<String, String> beHospitalizedDocStructureMap = beHospitalizedDoc.getStructureMap();
|
|
|
+ if(courseRecordDocStructureMap != null && beHospitalizedDocStructureMap != null){
|
|
|
+ String couDate = courseRecordDocStructureMap.get("记录时间");
|
|
|
+ String beDate = beHospitalizedDocStructureMap.get("入院日期");
|
|
|
+ if(StringUtils.isNotEmpty(couDate) && StringUtils.isNotEmpty(beDate)){
|
|
|
+ Date date_in = new SimpleDateFormat(DATE_TIME_FORMAT).parse(beDate);
|
|
|
+ Date date_out = new SimpleDateFormat(FORMAT_LONG_CN_MI).parse(couDate);
|
|
|
+ Calendar from = Calendar.getInstance();
|
|
|
+ from.setTime(date_in);
|
|
|
+ Calendar to = Calendar.getInstance();
|
|
|
+ to.setTime(date_out);
|
|
|
+ int fromHour = from.get(Calendar.HOUR_OF_DAY);
|
|
|
+ int toHour = to.get(Calendar.HOUR_OF_DAY);
|
|
|
+ int hour = toHour - fromHour;
|
|
|
+ if(hour > 8){
|
|
|
+ status = "-1";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|