|
@@ -1,29 +1,62 @@
|
|
|
package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
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.ThreeLevelWardDoc;
|
|
|
+import com.lantone.qc.pub.util.DateUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author wangfeng
|
|
|
- * @Description:
|
|
|
+ * @Description:入院后没有连续记录3天
|
|
|
* @date 2020-06-29 17:16
|
|
|
*/
|
|
|
@Component
|
|
|
public class THR03010 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
- if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getThreeLevelWardDocs().size() == 0) {
|
|
|
+ if (inputInfo.getMedicalRecordInfoDoc() == null || inputInfo.getMedicalRecordInfoDoc().getStructureMap().size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
+ Map<String, String> structureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
|
|
|
+ String behospitalDate = structureMap.get("behospitalDate")==null?null:structureMap.get("behospitalDate");
|
|
|
+ String leaveHospitalDate = structureMap.get("leaveHospitalDate")==null?null:structureMap.get("leaveHospitalDate");
|
|
|
+ if(behospitalDate!=null && leaveHospitalDate!=null){
|
|
|
+ Date beDate = StringUtil.parseDateTime(behospitalDate);
|
|
|
+ Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
|
|
|
+ long l = (leaveDate.getTime() - beDate.getTime())/(24*60*60*1000);
|
|
|
+ if(l>3){
|
|
|
+ List<String> stringDate = new ArrayList<>();
|
|
|
+
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ for (int i=1;i<4;i++) {
|
|
|
+ Date firstTimeOfDay = DateUtil.getFirstTimeOfDay(DateUtil.addDay(beDate, i));
|
|
|
+ stringDate.add(formatter.format(firstTimeOfDay));
|
|
|
+ }
|
|
|
+ List<String> stringList = new ArrayList<>();
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
|
|
|
+ for(ThreeLevelWardDoc t :threeLevelWardDocs){
|
|
|
+ Date threeLevelDate = StringUtil.parseDateTime(t.getStructureMap().get("查房日期"));
|
|
|
+ stringList.add(formatter.format(threeLevelDate));
|
|
|
+ }
|
|
|
+ if(stringList.size() > 2){//查房日期取出没有3天时间, 直接报错
|
|
|
+ if(!stringDate.containsAll(stringList)){
|
|
|
+ status.set("-1");
|
|
|
+ };
|
|
|
+ }else {
|
|
|
+ status.set("-1");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|