|
@@ -6,13 +6,15 @@ import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
|
|
|
import com.lantone.qc.pub.model.doc.consultation.ConsultationDoc;
|
|
|
-import com.lantone.qc.pub.model.doc.consultation.ConsultationResultsDoc;
|
|
|
-import com.lantone.qc.pub.util.DateUtil;
|
|
|
+import com.lantone.qc.pub.model.doc.consultation.ConsultationRecordDoc;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
-import org.apache.http.client.utils.DateUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Comparator;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : CON0281
|
|
@@ -24,7 +26,6 @@ import java.util.*;
|
|
|
public class CON0281 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
- DateUtil dateUtil = new DateUtil();
|
|
|
if (inputInfo.getConsultationDocs() == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -32,37 +33,40 @@ public class CON0281 extends QCCatalogue {
|
|
|
List<ConsultationDoc> consultationDocs = inputInfo.getConsultationDocs();
|
|
|
//医嘱按照医嘱开始时间排序
|
|
|
List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
|
|
|
- Collections.sort(doctorAdviceDocs, new Comparator<DoctorAdviceDoc>(){
|
|
|
- public int compare (DoctorAdviceDoc o1, DoctorAdviceDoc o2){
|
|
|
+ Collections.sort(doctorAdviceDocs, new Comparator<DoctorAdviceDoc>() {
|
|
|
+ public int compare(DoctorAdviceDoc o1, DoctorAdviceDoc o2) {
|
|
|
return o1.getStructureMap().get("医嘱开始时间")
|
|
|
.compareTo(o2.getStructureMap().get("医嘱开始时间"));
|
|
|
}
|
|
|
});
|
|
|
- StringBuffer stringBuffer = new StringBuffer();
|
|
|
- for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {//循环取最近一条医嘱和会诊申请单中的急会诊比较
|
|
|
- for (ConsultationDoc consultationDoc : consultationDocs) {
|
|
|
- if(consultationDoc.getConsultationRecordDoc() == null || doctorAdviceDocs == null){
|
|
|
- continue;
|
|
|
- }
|
|
|
- if(doctorAdviceDoc.getStructureMap().get("医嘱项目名称") != null && doctorAdviceDoc.getStructureMap().get("医嘱项目名称").contains("会诊")){
|
|
|
- if(consultationDoc.getConsultationResultsDoc().getStructureMap().get("会诊分类") == null && consultationDoc.getConsultationResultsDoc().getStructureMap().get("会诊分类").contains("急会诊")){
|
|
|
- if(dateUtil.getDistanceTime3(dateUtil.parseDate(doctorAdviceDoc.getStructureMap().get("医嘱开始时间"),DateUtil.DATE_TIME_FORMAT)
|
|
|
- ,dateUtil.parseDate(consultationDoc.getConsultationResultsDoc().getStructureMap().get("会诊时间"),DateUtil.DATE_TIME_FORMAT)) > 10){//如果医嘱中的日期和会诊结果中的日期大于十分钟
|
|
|
- status.set("-1");
|
|
|
- }else {
|
|
|
- stringBuffer.append(doctorAdviceDoc.getStructureMap().get("医嘱项目名称")
|
|
|
- +":"
|
|
|
- +doctorAdviceDoc.getStructureMap().get("医嘱开始时间")
|
|
|
- +"会诊时间:"
|
|
|
- +consultationDoc.getConsultationResultsDoc().getStructureMap().get("会诊时间"));
|
|
|
- continue;
|
|
|
- }
|
|
|
+ for (ConsultationDoc consultationDoc : consultationDocs) {
|
|
|
+ ConsultationRecordDoc consultationRecordDoc = consultationDoc.getConsultationRecordDoc();
|
|
|
+ if (consultationRecordDoc == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, String> conStructureMap = consultationRecordDoc.getStructureMap();
|
|
|
+ if (conStructureMap.get("会诊分类") == null || !conStructureMap.get("会诊分类").contains("急会诊")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {//循环取最近一条医嘱和会诊申请单中的急会诊比较
|
|
|
+ Map<String, String> docStructureMap = doctorAdviceDoc.getStructureMap();
|
|
|
+ if (docStructureMap.get("医嘱项目名称") != null && docStructureMap.get("医嘱项目名称").contains("会诊")) {
|
|
|
+ String applicationDateStr = docStructureMap.get("医嘱开始时间");
|
|
|
+ String arrivalDateStr = conStructureMap.get("会诊时间");
|
|
|
+ if (StringUtil.isBlank(applicationDateStr) || StringUtil.isBlank(arrivalDateStr)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Date applicationDate = StringUtil.parseDateTime(applicationDateStr);//医嘱开始时间
|
|
|
+ Date arrivalDate = StringUtil.parseDateTime(arrivalDateStr);//会诊时间
|
|
|
+ if (applicationDate == null || arrivalDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (CatalogueUtil.compareTime(applicationDate, arrivalDate, 10L)) {
|
|
|
+ status.set("-1");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
- info.set(stringBuffer.toString());
|
|
|
-
|
|
|
}
|
|
|
}
|