|
@@ -4,6 +4,7 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
|
|
|
+import com.lantone.qc.pub.util.DateUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -26,34 +27,26 @@ import java.util.regex.Pattern;
|
|
|
public class CLI0305 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分"; //记录时间
|
|
|
+ DateUtil dateUtil = new DateUtil();
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
|
|
|
if(clinicalBloodDocs != null && clinicalBloodDocs.size()>0){
|
|
|
for (ClinicalBloodDoc cliB:clinicalBloodDocs) {
|
|
|
Map<String, String> cliBStructureMap = cliB.getStructureMap();
|
|
|
- String infusionDtae = cliBStructureMap.get("输注时间");
|
|
|
String infusion_begin= cliBStructureMap.get("输注开始");
|
|
|
String infusion_end = cliBStructureMap.get("输注结束");
|
|
|
- String record_date= cliBStructureMap.get("记录时间");
|
|
|
- if(StringUtils.isNotEmpty(infusionDtae) && StringUtils.isNotEmpty(record_date)){
|
|
|
+ if(StringUtils.isNotEmpty(infusion_begin) && StringUtils.isNotEmpty(infusion_end)){
|
|
|
try {
|
|
|
- Date date_in = new SimpleDateFormat(DATE_TIME_FORMAT).parse(infusionDtae);
|
|
|
- Date date_out = new SimpleDateFormat(FORMAT_LONG_CN_MI).parse(record_date);
|
|
|
- Calendar from = Calendar.getInstance();
|
|
|
- from.setTime(date_in);
|
|
|
- Calendar to = Calendar.getInstance();
|
|
|
- to.setTime(date_out);
|
|
|
- int fromYear = from.get(Calendar.DAY_OF_MONTH);
|
|
|
- int toYear = to.get(Calendar.DAY_OF_MONTH);
|
|
|
- int year = toYear - fromYear;
|
|
|
- if(year >= 1){
|
|
|
+ Date date_in = new SimpleDateFormat(DATE_TIME_FORMAT).parse(infusion_begin);
|
|
|
+ Date date_out = new SimpleDateFormat(DATE_TIME_FORMAT).parse(infusion_end);
|
|
|
+ double distanceHour = dateUtil.getDistanceTime2(date_in, date_out);
|
|
|
+ if(distanceHour > 24.0){
|
|
|
status.set("-1");
|
|
|
}
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }else if(StringUtils.isNotEmpty(infusion_begin) && StringUtils.isNotEmpty(infusion_end)){
|
|
|
|
|
|
}
|
|
|
}
|