|
|
|
@ -4,10 +4,7 @@ import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.log.annotation.TrackRetryListener;
|
|
|
|
|
import com.docus.server.api.ocr.OcrApi;
|
|
|
|
|
import com.docus.server.common.service.IFileUploadService;
|
|
|
|
|
import com.docus.server.entity.segmentation.OcrBasicTest;
|
|
|
|
|
import com.docus.server.entity.segmentation.OcrFileInfoTest;
|
|
|
|
|
import com.docus.server.entity.segmentation.OcrRuleResult;
|
|
|
|
|
import com.docus.server.entity.segmentation.OcrSpecialResult;
|
|
|
|
|
import com.docus.server.entity.segmentation.*;
|
|
|
|
|
import com.docus.server.enums.OcrStatusEnum;
|
|
|
|
|
import com.docus.server.infrastructure.dao.IOcrBasicTestDao;
|
|
|
|
|
import com.docus.server.infrastructure.dao.IOcrFileInfoTestDao;
|
|
|
|
@ -19,6 +16,7 @@ import com.docus.server.vo.segmentation.ocrcutconfigtest.OcrCutConfigTestVO;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -54,21 +52,23 @@ public class StartSegmentTestHandler {
|
|
|
|
|
|
|
|
|
|
//根据病案号查询文件列表
|
|
|
|
|
List<OcrBasicTest> ocrBasicTestList = iOcrBasicTestDao.findBy("patientId",patientId);
|
|
|
|
|
List<OcrFileInfoTest> fileInfoTestList = iOcrFileInfoTestDao.findBy("patientId", patientId);
|
|
|
|
|
List<OcrFileInfoTest> fileInfoTestList = iOcrFileInfoTestDao.findBy("patientId", patientId)
|
|
|
|
|
.stream().sorted(Comparator.comparing(OcrFileInfoTest::getPicName))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
String url = iOcrUrlConfigTestDao.findAll().get(0).getUrl();
|
|
|
|
|
OcrCutConfigTestVO ocrCutConfigTestVO = iOcrCutConfigTestService.findAll().get(0);
|
|
|
|
|
Double height = ocrCutConfigTestVO.getHeight();
|
|
|
|
|
Double widthStart = ocrCutConfigTestVO.getWidthStart();
|
|
|
|
|
Double widthEnd = ocrCutConfigTestVO.getWidthEnd();
|
|
|
|
|
|
|
|
|
|
String assortId = null;
|
|
|
|
|
String assortName = null;
|
|
|
|
|
for (OcrFileInfoTest fileInfoTest : fileInfoTestList) {
|
|
|
|
|
iFileUploadService.compressFile(fileInfoTest.getPicCompressUrl(),fileInfoTest.getPicUrl(),height);
|
|
|
|
|
iFileUploadService.cutPic(fileInfoTest.getPicCutUrl(),fileInfoTest.getPicCompressUrl(),widthStart,widthEnd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean assortFlag = false;
|
|
|
|
|
String assortId = null;
|
|
|
|
|
String assortName = null;
|
|
|
|
|
Long ruleId = null;
|
|
|
|
|
String hitKey = null;
|
|
|
|
|
Double rate = null;
|
|
|
|
@ -125,8 +125,10 @@ public class StartSegmentTestHandler {
|
|
|
|
|
hitKey = ocrRuleResult.getHitKey();
|
|
|
|
|
rate = ocrRuleResult.getRate();
|
|
|
|
|
}else {
|
|
|
|
|
assortId = "-1";
|
|
|
|
|
assortName="其他";
|
|
|
|
|
if (assortName==null){
|
|
|
|
|
assortId = "-1";
|
|
|
|
|
assortName="其他(无关键字)";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|