<commit_before>package ch.elexis.core.importer.div.importers.multifile.strategy;

import java.io.IOException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.elexis.core.exceptions.ElexisException;
import ch.elexis.core.importer.div.importers.HL7Parser;
import ch.elexis.core.importer.div.importers.ILabContactResolver;
import ch.elexis.core.importer.div.importers.IPersistenceHandler;
import ch.elexis.core.importer.div.importers.ImportHandler;
import ch.elexis.core.importer.div.importers.OverwriteAllImportHandler;
import ch.elexis.core.importer.div.importers.TransientLabResult;
import ch.elexis.core.importer.div.importers.multifile.IMultiFileParser;
import ch.elexis.core.importer.div.service.holder.LabImportUtilHolder;
import ch.elexis.core.importer.div.service.holder.OmnivoreDocumentStoreServiceHolder;
import ch.elexis.core.l10n.Messages;
import ch.elexis.core.model.ICategory;
import ch.elexis.core.model.IDocument;
import ch.elexis.core.model.ILabItem;
import ch.elexis.core.model.ILaboratory;
import ch.elexis.core.model.IPatient;
import ch.elexis.core.services.IVirtualFilesystemService.IVirtualFilesystemHandle;
import ch.elexis.core.types.LabItemTyp;
import ch.rgw.io.FileTool;
import ch.rgw.tools.Result;
import ch.rgw.tools.Result.SEVERITY;
import ch.rgw.tools.TimeTool;

/**
 * Imports PDFFiles into Omnivore and adds them as a {@link LabResult} to the
 * Labor View
 * 
 * @author lucia
 * 
 */
@Component
public class DefaultPDFImportStrategy implements IFileImportStrategy {
	private static final Logger log = LoggerFactory.getLogger(DefaultPDFImportStrategy.class);

	private static final String PDF = "pdf";
	private ILaboratory myLab;
	private String labName;
	private IPatient patient;
	private TimeTool dateTime;
	private String group;
	private String prio;

	private boolean testMode = false;

	private boolean moveAfterImport;

	private ImportHandler defaultImportHandler;

	public DefaultPDFImportStrategy(ImportHandler defaultImportHandler) {
		this.defaultImportHandler = defaultImportHandler;<commit_msg>[14946] DefaultPDFImportStrategy is not a Component<commit_after>package ch.elexis.core.importer.div.importers.multifile.strategy;

import java.io.IOException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.elexis.core.exceptions.ElexisException;
import ch.elexis.core.importer.div.importers.HL7Parser;
import ch.elexis.core.importer.div.importers.ILabContactResolver;
import ch.elexis.core.importer.div.importers.IPersistenceHandler;
import ch.elexis.core.importer.div.importers.ImportHandler;
import ch.elexis.core.importer.div.importers.OverwriteAllImportHandler;
import ch.elexis.core.importer.div.importers.TransientLabResult;
import ch.elexis.core.importer.div.importers.multifile.IMultiFileParser;
import ch.elexis.core.importer.div.service.holder.LabImportUtilHolder;
import ch.elexis.core.importer.div.service.holder.OmnivoreDocumentStoreServiceHolder;
import ch.elexis.core.l10n.Messages;
import ch.elexis.core.model.ICategory;
import ch.elexis.core.model.IDocument;
import ch.elexis.core.model.ILabItem;
import ch.elexis.core.model.ILaboratory;
import ch.elexis.core.model.IPatient;
import ch.elexis.core.services.IVirtualFilesystemService.IVirtualFilesystemHandle;
import ch.elexis.core.types.LabItemTyp;
import ch.rgw.io.FileTool;
import ch.rgw.tools.Result;
import ch.rgw.tools.Result.SEVERITY;
import ch.rgw.tools.TimeTool;

/**
 * Imports PDFFiles into Omnivore and adds them as a {@link LabResult} to the
 * Labor View
 * 
 * @author lucia
 * 
 */
public class DefaultPDFImportStrategy implements IFileImportStrategy {
	private static final Logger log = LoggerFactory.getLogger(DefaultPDFImportStrategy.class);

	private static final String PDF = "pdf";
	private ILaboratory myLab;
	private String labName;
	private IPatient patient;
	private TimeTool dateTime;
	private String group;
	private String prio;

	private boolean testMode = false;

	private boolean moveAfterImport;

	private ImportHandler defaultImportHandler;

	public DefaultPDFImportStrategy(ImportHandler defaultImportHandler) {
		this.defaultImportHandler = defaultImportHandler;
{'fraction_non_alphanumeric': 0.09368143922773146, 'fraction_numerical': 0.003290917068889864, 'mean_word_length': 6.14576802507837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5457956', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1475, 'n_words': 269}