react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
322 lines (301 loc) • 7.51 kB
text/typescript
import {
MedicalCertificateCheckboxField,
MedicalCertificateDateField,
MedicalCertificateFormType,
} from './model';
import type {
DetectionStatus,
Point,
Status,
Page,
MRZDocumentType,
BarcodeFormat,
} from '.';
export interface DocumentDetectionResult {
detectionResult: DetectionStatus;
polygon?: Point[];
documentImageFileUri?: string;
}
export interface DocumentScannerResult {
status: Status;
pages: Page[];
}
export interface CroppingResult {
status: Status;
page?: Page;
}
export interface MrzRecognitionResult {
recognitionSuccessful: boolean;
documentType: MRZDocumentType;
checkDigitsCount: number;
validCheckDigitsCount: number;
fields: {
name: string;
value: string;
confidence: number;
}[];
}
export interface HealthInsuranceCardScannerResult {
status: Status;
fields: {
type: string;
value: string;
confidence: number;
}[];
}
export interface TextDataScannerResult {
status: Status;
result?: {
text: string;
confidence: number;
};
}
export interface MedicalCertificateScannerResult {
/**
* `'OK'` if the Medical Certificate was scanned, `'CANCELED'` if the user canceled the scanner UI.
*/
status: Status;
data: MedicalCertificateScannerResultData;
}
export interface MedicalCertificateScannerResultData {
/**
* The Medical Certificate Form Type
*/
formType: MedicalCertificateFormType;
/**
* Image file uri of the captured Medical Certificate
*/
imageFileUri?: string;
/**
* The extracted patient data
*/
patientData: {
/**
* The health insurance provider.
*/
insuranceProvider?: string;
/**
* The patients first name.
*/
firstName?: string;
/**
* The patients last name.
*/
lastName?: string;
/**
* The patients address 1.
*/
address1?: string;
/**
* The patients address 2.
*/
address2?: string;
/**
* The patients diagnose.
*/
diagnose?: string;
/**
* The patients health insurance number.
*/
healthInsuranceNumber?: string;
/**
* The patients person number.
*/
insuredPersonNumber?: string;
/**
* The patients status.
*/
status?: string;
/**
* The place of operation number.
*/
placeOfOperationNumber?: string;
/**
* The doctors number.
*/
doctorNumber?: string;
/**
* An undefined field, that was recognized still.
*/
unknown?: string;
};
/**
* The extracted dates data
*/
dates: {
/**
* The date since when the employee is incapable of work.
*/
incapableOfWorkSince?: MedicalCertificateDateField;
/**
* The date until when the employee is incapable of work.
*/
incapableOfWorkUntil?: MedicalCertificateDateField;
/**
* The date of the day of diagnosis.
*/
diagnosedOn?: MedicalCertificateDateField;
/**
* The date since when the child needs care.
*/
childNeedsCareFrom?: MedicalCertificateDateField;
/**
* The date until the childs needs care.
*/
childNeedsCareUntil?: MedicalCertificateDateField;
/**
* Patient birth date.
*/
birthDate?: MedicalCertificateDateField;
/**
* Document date.
*/
documentDate?: MedicalCertificateDateField;
/**
* An unclassified date, which was recognized still
*/
unknown?: MedicalCertificateDateField;
};
/**
* The extracted checkboxes data.
* It contains information about the medical form checkboxes type
* and whether they are checked or not.
*/
checkboxes: {
/**
* The checkbox states if the certificate is an initial certificate.
*/
initialCertificate?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is a renewed certificate.
*/
renewedCertificate?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is about a work accident.
*/
workAccident?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is assigned to an accident insurance doctor.
*/
assignedToAccidentInsuranceDoctor?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is about an accident checked yes.
*/
accident?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is about an accident checked no.
*/
accidentNo?: MedicalCertificateCheckboxField;
/**
* The checkbox states if ill child requires care checked yes.
*/
requiresCare?: MedicalCertificateCheckboxField;
/**
* The checkbox states if ill child requires care checked no.
*/
requiresCareNo?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the insurance company has to pay for treatment.
*/
insuredPayCase?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is final.
*/
finalCertificate?: MedicalCertificateCheckboxField;
/**
* The checkbox states if the certificate is assigned to an other accident
*/
otherAccident?: MedicalCertificateCheckboxField;
/**
* The checkbox could not be classified, but it was recognized still
*/
unknown?: MedicalCertificateCheckboxField;
};
}
export interface LicensePlateScannerResult {
/**
* `'OK'` if the License Plate was scanned, `'CANCELED'` if the user canceled the scanner UI.
*/
status: Status;
/**
* The License Plate detected by the scanner
*/
licensePlate?: string;
/**
* Confidence in the accuracy of the detection (0 - 100)
*/
confidence?: number;
/**
* The Country Code on the License Plate as detected by the scanner
*/
countryCode?: string;
/**
* The entire raw text detected on the License Plate by the scanner
*/
rawText?: string;
/**
* 'true' if the validation of the scanned license plate was successful, 'false' otherwise - iOS only.
*/
isValidationSuccessful?: boolean;
}
export interface IdCardScannerResult {
status: Status;
id?: IdCardField;
surname?: IdCardField;
givenNames?: IdCardField;
nationality?: IdCardField;
birthDate?: IdCardField;
mrz?: IdCardField;
expiryDate?: IdCardField;
photoImageUri?: string;
signatureImageUri?: string;
birthplace?: IdCardField;
issueDate?: IdCardField;
issuingAuthority?: IdCardField;
address?: IdCardField;
eyeColor?: IdCardField;
height?: IdCardField;
pin?: IdCardField;
pseudonym?: IdCardField;
countryCode?: IdCardField;
gender?: IdCardField;
maidenName?: IdCardField;
passportType?: IdCardField;
}
export interface IdCardField {
text?: string;
confidence?: number;
}
export interface MrzResult extends MrzRecognitionResult {
status: Status;
}
export interface BarcodeResultField {
/**
* The barcode format.
*/
type: BarcodeFormat;
/**
* The raw text encoded in the barcode.
*/
text: string;
}
export interface BarcodeResult {
status: Status;
barcodes?: BarcodeResultField[];
}
export interface DetectBarcodesOnImagesResult {
status: Status;
results?: [
{
imageFileUri: string;
barcodeResults: BarcodeResult[];
error?: string;
},
];
}
export interface NFCPassportReaderResult {
status: Status;
datagroupDG1?: [{key: string; value: string}];
datagroupDG2?: [{key: string; value: string}];
photoImageURL?: string;
}