react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
1,665 lines (1,446 loc) • 118 kB
JavaScript
/// All possible root document types.
export const BoardingPassDocumentType = 'BoardingPass';
export const BoardingPassLegDocumentType = 'Leg';
export const SwissQRDocumentType = 'SwissQR';
export const DEMedicalPlanDocumentType = 'DEMedicalPlan';
export const DEMedicalPlanPatientDocumentType = 'Patient';
export const DEMedicalPlanDoctorDocumentType = 'Doctor';
export const DEMedicalPlanSubheadingDocumentType = 'Subheading';
export const DEMedicalPlanSubheadingMedicineDocumentType = 'Medicine';
export const DEMedicalPlanSubheadingMedicineSubstanceDocumentType = 'Substance';
export const DEMedicalPlanSubheadingPrescriptionDocumentType = 'Prescription';
export const IDCardPDF417DocumentType = 'IDCardPDF417';
export const GS1DocumentType = 'GS1';
export const GS1ElementDocumentType = 'Element';
export const GS1ElementValidationErrorDocumentType = 'ValidationError';
export const SEPADocumentType = 'SEPA';
export const MedicalCertificateDocumentType = 'MedicalCertificate';
export const VCardDocumentType = 'VCard';
export const VCardEntryDocumentType = 'Entry';
export const VCardVersionDocumentType = 'Version';
export const VCardSourceDocumentType = 'Source';
export const VCardKindDocumentType = 'Kind';
export const VCardXMLDocumentType = 'XML';
export const VCardNameDocumentType = 'Name';
export const VCardFirstNameDocumentType = 'FirstName';
export const VCardNicknameDocumentType = 'Nickname';
export const VCardBirthdayDocumentType = 'Birthday';
export const VCardAnniversaryDocumentType = 'Anniversary';
export const VCardGenderDocumentType = 'Gender';
export const VCardDeliveryAddressDocumentType = 'DeliveryAddress';
export const VCardPhotoDocumentType = 'Photo';
export const VCardTelephoneNumberDocumentType = 'TelephoneNumber';
export const VCardEmailDocumentType = 'Email';
export const VCardIMPPDocumentType = 'IMPP';
export const VCardLanguagesDocumentType = 'Languages';
export const VCardTimeZoneDocumentType = 'TimeZone';
export const VCardGeoLocationDocumentType = 'GeoLocation';
export const VCardTitleDocumentType = 'Title';
export const VCardRoleDocumentType = 'Role';
export const VCardLogoDocumentType = 'Logo';
export const VCardOrganisationDocumentType = 'Organisation';
export const VCardMemberDocumentType = 'Member';
export const VCardRelatedDocumentType = 'Related';
export const VCardCategoriesDocumentType = 'Categories';
export const VCardNoteDocumentType = 'Note';
export const VCardProductIdDocumentType = 'ProductId';
export const VCardRevisionDocumentType = 'Revision';
export const VCardSoundDocumentType = 'Sound';
export const VCardUIDDocumentType = 'UID';
export const VCardClientPIDMapDocumentType = 'ClientPIDMap';
export const VCardURLDocumentType = 'URL';
export const VCardPublicKeyDocumentType = 'PublicKey';
export const VCardBusyTimeURLDocumentType = 'BusyTimeURL';
export const VCardCalendarURIForRequestsDocumentType = 'CalendarURIForRequests';
export const VCardCalendarURIDocumentType = 'CalendarURI';
export const VCardCustomDocumentType = 'Custom';
export const AAMVADocumentType = 'AAMVA';
export const AAMVATitleDataDocumentType = 'TitleData';
export const AAMVARegistrationDataDocumentType = 'RegistrationData';
export const AAMVAMotorCarrierDataDocumentType = 'MotorCarrierData';
export const AAMVARegistrantAndVehicleDataDocumentType = 'RegistrantAndVehicleData';
export const AAMVAVehicleOwnerDataDocumentType = 'VehicleOwnerData';
export const AAMVAVehicleDataDocumentType = 'VehicleData';
export const AAMVAVehicleSafetyInspectionDataDocumentType = 'VehicleSafetyInspectionData';
export const AAMVADLIDDocumentType = 'DLID';
export const AAMVADriverLicenseDocumentType = 'DriverLicense';
export const AAMVAIDCardDocumentType = 'IDCard';
export const AAMVAEnhancedDriverLicenseDocumentType = 'EnhancedDriverLicense';
export const AAMVARawDocumentDocumentType = 'RawDocument';
/** Boarding Pass */
export class BoardingPass {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return BoardingPassDocumentType;
}
/** Electronic Ticket */
get electronicTicket() {
return this.document.fields.find(f => f.type.name === 'ElectronicTicket');
}
/** Name */
get name() {
return this.document.fields.find(f => f.type.name === 'Name');
}
/** Number Of Legs */
get numberOfLegs() {
return this.document.fields.find(f => f.type.name === 'NumberOfLegs');
}
/** Security Data */
get securityData() {
return this.document.fields.find(f => f.type.name === 'SecurityData');
}
/** An array of all children of type "Leg". */
get legs() {
return this.document.children.filter(c => c.type.name === 'Leg').map(c => new BoardingPass.Leg(c));
}
}
(function (_BoardingPass) {
class Leg {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return BoardingPassLegDocumentType;
}
/** Airline Designator Of Boarding Pass Issuer */
get airlineDesignatorOfBoardingPassIssuer() {
return this.document.fields.find(f => f.type.name === 'AirlineDesignatorOfBoardingPassIssuer');
}
/** Airline Numeric Code */
get airlineNumericCode() {
return this.document.fields.find(f => f.type.name === 'AirlineNumericCode');
}
/** Baggage Tag License Plate Numbers */
get baggageTagLicensePlateNumbers() {
return this.document.fields.find(f => f.type.name === 'BaggageTagLicensePlateNumbers');
}
/** Check In Sequence Number */
get checkInSequenceNumber() {
return this.document.fields.find(f => f.type.name === 'CheckInSequenceNumber');
}
/** Compartment Code */
get compartmentCode() {
return this.document.fields.find(f => f.type.name === 'CompartmentCode');
}
/** Date Of Boarding Pass Issuance Julian */
get dateOfBoardingPassIssuanceJulian() {
return this.document.fields.find(f => f.type.name === 'DateOfBoardingPassIssuanceJulian');
}
/** Date Of Flight Julian */
get dateOfFlightJulian() {
return this.document.fields.find(f => f.type.name === 'DateOfFlightJulian');
}
/** Departure Airport Code */
get departureAirportCode() {
return this.document.fields.find(f => f.type.name === 'DepartureAirportCode');
}
/** Destination Airport Code */
get destinationAirportCode() {
return this.document.fields.find(f => f.type.name === 'DestinationAirportCode');
}
/** Document Form Serial Number */
get documentFormSerialNumber() {
return this.document.fields.find(f => f.type.name === 'DocumentFormSerialNumber');
}
/** Document Type */
get documentType() {
return this.document.fields.find(f => f.type.name === 'DocumentType');
}
/** Fast Track */
get fastTrack() {
return this.document.fields.find(f => f.type.name === 'FastTrack');
}
/** First Non Consecutive Baggage Tag License Plate Number */
get firstNonConsecutiveBaggageTagLicensePlateNumber() {
return this.document.fields.find(f => f.type.name === 'FirstNonConsecutiveBaggageTagLicensePlateNumber');
}
/** Flight Number */
get flightNumber() {
return this.document.fields.find(f => f.type.name === 'FlightNumber');
}
/** For Individual Airline Use */
get forIndividualAirlineUse() {
return this.document.fields.find(f => f.type.name === 'ForIndividualAirlineUse');
}
/** Free Baggage Allowance */
get freeBaggageAllowance() {
return this.document.fields.find(f => f.type.name === 'FreeBaggageAllowance');
}
/** Frequent Flyer Airline Designator */
get frequentFlyerAirlineDesignator() {
return this.document.fields.find(f => f.type.name === 'FrequentFlyerAirlineDesignator');
}
/** Frequent Flyer Number */
get frequentFlyerNumber() {
return this.document.fields.find(f => f.type.name === 'FrequentFlyerNumber');
}
/** IDAD Indicator */
get idadIndicator() {
return this.document.fields.find(f => f.type.name === 'IDADIndicator');
}
/** International Documentation Verification */
get internationalDocumentationVerification() {
return this.document.fields.find(f => f.type.name === 'InternationalDocumentationVerification');
}
/** Marketing Carrier Designator */
get marketingCarrierDesignator() {
return this.document.fields.find(f => f.type.name === 'MarketingCarrierDesignator');
}
/** Operating Carrier Designator */
get operatingCarrierDesignator() {
return this.document.fields.find(f => f.type.name === 'OperatingCarrierDesignator');
}
/** Operating Carrier PNR Code */
get operatingCarrierPNRCode() {
return this.document.fields.find(f => f.type.name === 'OperatingCarrierPNRCode');
}
/** Passenger Description */
get passengerDescription() {
return this.document.fields.find(f => f.type.name === 'PassengerDescription');
}
/** Passenger Status */
get passengerStatus() {
return this.document.fields.find(f => f.type.name === 'PassengerStatus');
}
/** Seat Number */
get seatNumber() {
return this.document.fields.find(f => f.type.name === 'SeatNumber');
}
/** Second Non Consecutive Baggage Tag License Plate Number */
get secondNonConsecutiveBaggageTagLicensePlateNumber() {
return this.document.fields.find(f => f.type.name === 'SecondNonConsecutiveBaggageTagLicensePlateNumber');
}
/** Selectee Indicator */
get selecteeIndicator() {
return this.document.fields.find(f => f.type.name === 'SelecteeIndicator');
}
/** Source Of Boarding Pass Issuance */
get sourceOfBoardingPassIssuance() {
return this.document.fields.find(f => f.type.name === 'SourceOfBoardingPassIssuance');
}
/** Source Of Check In */
get sourceOfCheckIn() {
return this.document.fields.find(f => f.type.name === 'SourceOfCheckIn');
}
/** VersionNumber */
get versionNumber() {
return this.document.fields.find(f => f.type.name === 'VersionNumber');
}
}
_BoardingPass.Leg = Leg;
})(BoardingPass || (BoardingPass = {}));
/** SwissQR */
export class SwissQR {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return SwissQRDocumentType;
}
/** Additional Billing Information */
get additionalBillingInformation() {
return this.document.fields.find(f => f.type.name === 'AdditionalBillingInformation');
}
/** Additional Info Trailer */
get additionalInfoTrailer() {
return this.document.fields.find(f => f.type.name === 'AdditionalInfoTrailer');
}
/** Additional Info Unstructured */
get additionalInfoUnstructured() {
return this.document.fields.find(f => f.type.name === 'AdditionalInfoUnstructured');
}
/** Alternative Procedure Parameter */
get alternativeProcedureParameter() {
return this.document.fields.find(f => f.type.name === 'AlternativeProcedureParameter');
}
/** Amount */
get amount() {
return this.document.fields.find(f => f.type.name === 'Amount');
}
/** Currency */
get currency() {
return this.document.fields.find(f => f.type.name === 'Currency');
}
/** Debtor Address Type */
get debtorAddressType() {
return this.document.fields.find(f => f.type.name === 'DebtorAddressType');
}
/** Debtor Building Or Address Line 2 */
get debtorBuildingOrAddressLine2() {
return this.document.fields.find(f => f.type.name === 'DebtorBuildingOrAddressLine2');
}
/** Debtor Country */
get debtorCountry() {
return this.document.fields.find(f => f.type.name === 'DebtorCountry');
}
/** Debtor Name */
get debtorName() {
return this.document.fields.find(f => f.type.name === 'DebtorName');
}
/** Debtor Place */
get debtorPlace() {
return this.document.fields.find(f => f.type.name === 'DebtorPlace');
}
/** Debtor Postal Code */
get debtorPostalCode() {
return this.document.fields.find(f => f.type.name === 'DebtorPostalCode');
}
/** Debtor Street Or Address Line 1 */
get debtorStreetOrAddressLine1() {
return this.document.fields.find(f => f.type.name === 'DebtorStreetOrAddressLine1');
}
/** Due Date */
get dueDate() {
return this.document.fields.find(f => f.type.name === 'DueDate');
}
/** Encoding */
get encoding() {
return this.document.fields.find(f => f.type.name === 'Encoding');
}
/** Final Payee Address Type */
get finalPayeeAddressType() {
return this.document.fields.find(f => f.type.name === 'FinalPayeeAddressType');
}
/** Final Payee Building Or Address Line 2 */
get finalPayeeBuildingOrAddressLine2() {
return this.document.fields.find(f => f.type.name === 'FinalPayeeBuildingOrAddressLine2');
}
/** Final Payee Country */
get finalPayeeCountry() {
return this.document.fields.find(f => f.type.name === 'FinalPayeeCountry');
}
/** Final Payee Name */
get finalPayeeName() {
return this.document.fields.find(f => f.type.name === 'FinalPayeeName');
}
/** Final Payee Place */
get finalPayeePlace() {
return this.document.fields.find(f => f.type.name === 'FinalPayeePlace');
}
/** Final Payee Postal Code */
get finalPayeePostalCode() {
return this.document.fields.find(f => f.type.name === 'FinalPayeePostalCode');
}
/** Final Payee Street Or Address Line 1 */
get finalPayeeStreetOrAddressLine1() {
return this.document.fields.find(f => f.type.name === 'FinalPayeeStreetOrAddressLine1');
}
/** IBAN */
get iban() {
return this.document.fields.find(f => f.type.name === 'IBAN');
}
/** Payee Address Type */
get payeeAddressType() {
return this.document.fields.find(f => f.type.name === 'PayeeAddressType');
}
/** Payee Building Or Address Line 2 */
get payeeBuildingOrAddressLine2() {
return this.document.fields.find(f => f.type.name === 'PayeeBuildingOrAddressLine2');
}
/** Payee Country */
get payeeCountry() {
return this.document.fields.find(f => f.type.name === 'PayeeCountry');
}
/** Payee Name */
get payeeName() {
return this.document.fields.find(f => f.type.name === 'PayeeName');
}
/** Payee Place */
get payeePlace() {
return this.document.fields.find(f => f.type.name === 'PayeePlace');
}
/** Payee Postal Code */
get payeePostalCode() {
return this.document.fields.find(f => f.type.name === 'PayeePostalCode');
}
/** Payee Street Or Address Line 1 */
get payeeStreetOrAddressLine1() {
return this.document.fields.find(f => f.type.name === 'PayeeStreetOrAddressLine1');
}
/** Payment Reference */
get paymentReference() {
return this.document.fields.find(f => f.type.name === 'PaymentReference');
}
/** Payment Reference Type */
get paymentReferenceType() {
return this.document.fields.find(f => f.type.name === 'PaymentReferenceType');
}
/** Version */
get version() {
return this.document.fields.find(f => f.type.name === 'Version');
}
}
/** Medical Plan */
export class DEMedicalPlan {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanDocumentType;
}
/** Current Page */
get currentPage() {
return this.document.fields.find(f => f.type.name === 'CurrentPage');
}
/** Document Version Number */
get documentVersionNumber() {
return this.document.fields.find(f => f.type.name === 'DocumentVersionNumber');
}
/** GUID */
get guid() {
return this.document.fields.find(f => f.type.name === 'GUID');
}
/** Language Country Code */
get languageCountryCode() {
return this.document.fields.find(f => f.type.name === 'LanguageCountryCode');
}
/** Patch Version Number */
get patchVersionNumber() {
return this.document.fields.find(f => f.type.name === 'PatchVersionNumber');
}
/** Total Number Of Pages */
get totalNumberOfPages() {
return this.document.fields.find(f => f.type.name === 'TotalNumberOfPages');
}
/** The child document of type "Patient". */
get patient() {
const child = this.document.children.find(c => c.type.name === 'Patient');
return new DEMedicalPlan.Patient(child);
}
/** The child document of type "Doctor". */
get doctor() {
const child = this.document.children.find(c => c.type.name === 'Doctor');
return new DEMedicalPlan.Doctor(child);
}
/** An array of all children of type "Subheading". */
get subheadings() {
return this.document.children.filter(c => c.type.name === 'Subheading').map(c => new DEMedicalPlan.Subheading(c));
}
}
(function (_DEMedicalPlan) {
class Patient {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanPatientDocumentType;
}
/** Allergies And Intolerances */
get allergiesAndIntolerances() {
return this.document.fields.find(f => f.type.name === 'AllergiesAndIntolerances');
}
/** Birth Date */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Breast Feeding */
get breastFeeding() {
return this.document.fields.find(f => f.type.name === 'BreastFeeding');
}
/** Creatinine Value */
get creatinineValue() {
return this.document.fields.find(f => f.type.name === 'CreatinineValue');
}
/** First Name */
get firstName() {
return this.document.fields.find(f => f.type.name === 'FirstName');
}
/** Gender */
get gender() {
return this.document.fields.find(f => f.type.name === 'Gender');
}
/** Height */
get height() {
return this.document.fields.find(f => f.type.name === 'Height');
}
/** Last Name */
get lastName() {
return this.document.fields.find(f => f.type.name === 'LastName');
}
/** Patient Free Text */
get patientFreeText() {
return this.document.fields.find(f => f.type.name === 'PatientFreeText');
}
/** Patient ID */
get patientID() {
return this.document.fields.find(f => f.type.name === 'PatientID');
}
/** Pre Name */
get preName() {
return this.document.fields.find(f => f.type.name === 'PreName');
}
/** Pregnant */
get pregnant() {
return this.document.fields.find(f => f.type.name === 'Pregnant');
}
/** Name Suffix */
get suffix() {
return this.document.fields.find(f => f.type.name === 'Suffix');
}
/** Title */
get title() {
return this.document.fields.find(f => f.type.name === 'Title');
}
/** Weight */
get weight() {
return this.document.fields.find(f => f.type.name === 'Weight');
}
}
_DEMedicalPlan.Patient = Patient;
class Doctor {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanDoctorDocumentType;
}
/** Doctor Number */
get doctorNumber() {
return this.document.fields.find(f => f.type.name === 'DoctorNumber');
}
/** Email */
get email() {
return this.document.fields.find(f => f.type.name === 'Email');
}
/** Hospital ID */
get hospitalID() {
return this.document.fields.find(f => f.type.name === 'HospitalID');
}
/** Issuer Name */
get issuerName() {
return this.document.fields.find(f => f.type.name === 'IssuerName');
}
/** Issuing Date And Time */
get issuingDateAndTime() {
return this.document.fields.find(f => f.type.name === 'IssuingDateAndTime');
}
/** Pharmacy ID */
get pharmacyID() {
return this.document.fields.find(f => f.type.name === 'PharmacyID');
}
/** Place */
get place() {
return this.document.fields.find(f => f.type.name === 'Place');
}
/** Postal Code */
get postalCode() {
return this.document.fields.find(f => f.type.name === 'PostalCode');
}
/** Street */
get street() {
return this.document.fields.find(f => f.type.name === 'Street');
}
/** Telephone Number */
get telephoneNumber() {
return this.document.fields.find(f => f.type.name === 'TelephoneNumber');
}
}
_DEMedicalPlan.Doctor = Doctor;
class Subheading {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanSubheadingDocumentType;
}
/** General Note */
get generalNotes() {
return this.document.fields.filter(f => f.type.name === 'GeneralNote');
}
/** Key Words */
get keyWords() {
return this.document.fields.find(f => f.type.name === 'KeyWords');
}
/** Subheading Free Text */
get subheadingFreeText() {
return this.document.fields.find(f => f.type.name === 'SubheadingFreeText');
}
/** An array of all children of type "Medicine". */
get medicines() {
return this.document.children.filter(c => c.type.name === 'Medicine').map(c => new DEMedicalPlan.Subheading.Medicine(c));
}
/** An array of all children of type "Prescription". */
get prescriptions() {
return this.document.children.filter(c => c.type.name === 'Prescription').map(c => new DEMedicalPlan.Subheading.Prescription(c));
}
}
_DEMedicalPlan.Subheading = Subheading;
(function (_Subheading) {
class Medicine {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanSubheadingMedicineDocumentType;
}
/** Dosage Form */
get dosageForm() {
return this.document.fields.find(f => f.type.name === 'DosageForm');
}
/** Dosage Form Free Text */
get dosageFormFreeText() {
return this.document.fields.find(f => f.type.name === 'DosageFormFreeText');
}
/** Dosage Free Text */
get dosageFreeText() {
return this.document.fields.find(f => f.type.name === 'DosageFreeText');
}
/** Dosing Unit */
get dosingUnit() {
return this.document.fields.find(f => f.type.name === 'DosingUnit');
}
/** Dosing Unit Free Text */
get dosingUnitFreeText() {
return this.document.fields.find(f => f.type.name === 'DosingUnitFreeText');
}
/** Drug Name */
get drugName() {
return this.document.fields.find(f => f.type.name === 'DrugName');
}
/** Evening Intake Dose */
get evening() {
return this.document.fields.find(f => f.type.name === 'Evening');
}
/** General Notes */
get generalNotes() {
return this.document.fields.find(f => f.type.name === 'GeneralNotes');
}
/** Midday Intake Dose */
get midday() {
return this.document.fields.find(f => f.type.name === 'Midday');
}
/** Morning Intake Dose */
get morning() {
return this.document.fields.find(f => f.type.name === 'Morning');
}
/** Night Intake Dose */
get night() {
return this.document.fields.find(f => f.type.name === 'Night');
}
/** Pharmaceutical Number */
get pharmaceuticalNumber() {
return this.document.fields.find(f => f.type.name === 'PharmaceuticalNumber');
}
/** Reason For Treatment */
get reasonForTreatment() {
return this.document.fields.find(f => f.type.name === 'ReasonForTreatment');
}
/** Relevant Info */
get relevantInfo() {
return this.document.fields.find(f => f.type.name === 'RelevantInfo');
}
/** An array of all children of type "Substance". */
get substances() {
return this.document.children.filter(c => c.type.name === 'Substance').map(c => new DEMedicalPlan.Subheading.Medicine.Substance(c));
}
}
_Subheading.Medicine = Medicine;
(function (_Medicine) {
class Substance {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanSubheadingMedicineSubstanceDocumentType;
}
/** Active Substance */
get activeSubstance() {
return this.document.fields.find(f => f.type.name === 'ActiveSubstance');
}
/** Potency */
get potency() {
return this.document.fields.find(f => f.type.name === 'Potency');
}
}
_Medicine.Substance = Substance;
})(Medicine || (Medicine = _Subheading.Medicine || (_Subheading.Medicine = {})));
class Prescription {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DEMedicalPlanSubheadingPrescriptionDocumentType;
}
/** General Information */
get generalInformation() {
return this.document.fields.find(f => f.type.name === 'GeneralInformation');
}
/** Prescription Free Text */
get prescriptionFreeText() {
return this.document.fields.find(f => f.type.name === 'PrescriptionFreeText');
}
}
_Subheading.Prescription = Prescription;
})(Subheading || (Subheading = _DEMedicalPlan.Subheading || (_DEMedicalPlan.Subheading = {})));
})(DEMedicalPlan || (DEMedicalPlan = {}));
/** ID Card */
export class IDCardPDF417 {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return IDCardPDF417DocumentType;
}
/** Birth Date. The format is ISO8601 with delimiters */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Date Expired. The format is ISO8601 with delimiters */
get dateExpired() {
return this.document.fields.find(f => f.type.name === 'DateExpired');
}
/** Date Issued. The format is ISO8601 with delimiters */
get dateIssued() {
return this.document.fields.find(f => f.type.name === 'DateIssued');
}
/** Document Code */
get documentCode() {
return this.document.fields.find(f => f.type.name === 'DocumentCode');
}
/** First Name */
get firstName() {
return this.document.fields.find(f => f.type.name === 'FirstName');
}
/** Last Name */
get lastName() {
return this.document.fields.find(f => f.type.name === 'LastName');
}
/** Optional */
get optional() {
return this.document.fields.find(f => f.type.name === 'Optional');
}
}
/** GS1 */
export class GS1 {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return GS1DocumentType;
}
/** An array of all children of type "Element". */
get elements() {
return this.document.children.filter(c => c.type.name === 'Element').map(c => new GS1.Element(c));
}
}
(function (_GS) {
class Element {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return GS1ElementDocumentType;
}
/** Application Identifier */
get applicationIdentifier() {
return this.document.fields.find(f => f.type.name === 'ApplicationIdentifier');
}
/** Data Title */
get dataTitle() {
return this.document.fields.find(f => f.type.name === 'DataTitle');
}
/** Description */
get elementDescription() {
return this.document.fields.find(f => f.type.name === 'ElementDescription');
}
/** Raw Value */
get rawValue() {
return this.document.fields.find(f => f.type.name === 'RawValue');
}
/** An array of all children of type "ValidationError". */
get validationErrors() {
return this.document.children.filter(c => c.type.name === 'ValidationError').map(c => new GS1.Element.ValidationError(c));
}
}
_GS.Element = Element;
(function (_Element) {
class ValidationError {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return GS1ElementValidationErrorDocumentType;
}
/** Error Code */
get code() {
return this.document.fields.find(f => f.type.name === 'Code');
}
/** Reason */
get reason() {
return this.document.fields.find(f => f.type.name === 'Reason');
}
}
_Element.ValidationError = ValidationError;
})(Element || (Element = _GS.Element || (_GS.Element = {})));
})(GS1 || (GS1 = {}));
/** SEPA */
export class SEPA {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return SEPADocumentType;
}
/** Amount */
get amount() {
return this.document.fields.find(f => f.type.name === 'Amount');
}
/** Character Set */
get characterSet() {
return this.document.fields.find(f => f.type.name === 'CharacterSet');
}
/** Identification */
get identification() {
return this.document.fields.find(f => f.type.name === 'Identification');
}
/** Information */
get information() {
return this.document.fields.find(f => f.type.name === 'Information');
}
/** Amount */
get purpose() {
return this.document.fields.find(f => f.type.name === 'Purpose');
}
/** Receiver BIC */
get receiverBIC() {
return this.document.fields.find(f => f.type.name === 'ReceiverBIC');
}
/** Receiver IBAN */
get receiverIBAN() {
return this.document.fields.find(f => f.type.name === 'ReceiverIBAN');
}
/** Receiver Name */
get receiverName() {
return this.document.fields.find(f => f.type.name === 'ReceiverName');
}
/** Remittance */
get remittance() {
return this.document.fields.find(f => f.type.name === 'Remittance');
}
/** Service Tag */
get serviceTag() {
return this.document.fields.find(f => f.type.name === 'ServiceTag');
}
/** Version */
get version() {
return this.document.fields.find(f => f.type.name === 'Version');
}
}
/** Medical Certificate */
export class MedicalCertificate {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return MedicalCertificateDocumentType;
}
/** Accident */
get accident() {
return this.document.fields.find(f => f.type.name === 'Accident');
}
/** Assigned To Accident Insurance Doctor */
get assignedToAccidentInsuranceDoctor() {
return this.document.fields.find(f => f.type.name === 'AssignedToAccidentInsuranceDoctor');
}
/** Birth Date. The format is ISO8601 with delimiters */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Child Needs Care From */
get childNeedsCareFrom() {
return this.document.fields.find(f => f.type.name === 'ChildNeedsCareFrom');
}
/** Child Needs Care Until */
get childNeedsCareUntil() {
return this.document.fields.find(f => f.type.name === 'ChildNeedsCareUntil');
}
/** Diagnose */
get diagnose() {
return this.document.fields.find(f => f.type.name === 'Diagnose');
}
/** Diagnosed On. The format is ISO8601 with delimiters */
get diagnosedOn() {
return this.document.fields.find(f => f.type.name === 'DiagnosedOn');
}
/** Doctor Number */
get doctorNumber() {
return this.document.fields.find(f => f.type.name === 'DoctorNumber');
}
/** Document Date. The format is ISO8601 with delimiters */
get documentDate() {
return this.document.fields.find(f => f.type.name === 'DocumentDate');
}
/** First Name */
get firstName() {
return this.document.fields.find(f => f.type.name === 'FirstName');
}
/** Health Insurance Number */
get healthInsuranceNumber() {
return this.document.fields.find(f => f.type.name === 'HealthInsuranceNumber');
}
/** Incapable Of Work Since. The format is ISO8601 with delimiters */
get incapableOfWorkSince() {
return this.document.fields.find(f => f.type.name === 'IncapableOfWorkSince');
}
/** Incapable Of Work Until. The format is ISO8601 with delimiters */
get incapableOfWorkUntil() {
return this.document.fields.find(f => f.type.name === 'IncapableOfWorkUntil');
}
/** Initial Certificate */
get initialCertificate() {
return this.document.fields.find(f => f.type.name === 'InitialCertificate');
}
/** Insured Person Number */
get insuredPersonNumber() {
return this.document.fields.find(f => f.type.name === 'InsuredPersonNumber');
}
/** Last Name */
get lastName() {
return this.document.fields.find(f => f.type.name === 'LastName');
}
/** Place Of Operation Number */
get placeOfOperationNumber() {
return this.document.fields.find(f => f.type.name === 'PlaceOfOperationNumber');
}
/** Renewed Certificate */
get renewedCertificate() {
return this.document.fields.find(f => f.type.name === 'RenewedCertificate');
}
/** Requires Care */
get requiresCare() {
return this.document.fields.find(f => f.type.name === 'RequiresCare');
}
/** Status */
get status() {
return this.document.fields.find(f => f.type.name === 'Status');
}
/** Work Accident */
get workAccident() {
return this.document.fields.find(f => f.type.name === 'WorkAccident');
}
}
/** VCard */
export class VCard {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return VCardDocumentType;
}
/** The child document of type "Version". */
get version() {
const child = this.document.children.find(c => c.type.name === 'Version');
return new VCard.Version(child);
}
/** The child document of type "Source". */
get source() {
const child = this.document.children.find(c => c.type.name === 'Source');
return child ? new VCard.Source(child) : undefined;
}
/** The child document of type "Kind". */
get kind() {
const child = this.document.children.find(c => c.type.name === 'Kind');
return child ? new VCard.Kind(child) : undefined;
}
/** The child document of type "XML". */
get xml() {
const child = this.document.children.find(c => c.type.name === 'XML');
return child ? new VCard.XML(child) : undefined;
}
/** The child document of type "Name". */
get name() {
const child = this.document.children.find(c => c.type.name === 'Name');
return child ? new VCard.Name(child) : undefined;
}
/** The child document of type "FirstName". */
get firstName() {
const child = this.document.children.find(c => c.type.name === 'FirstName');
return child ? new VCard.FirstName(child) : undefined;
}
/** The child document of type "Nickname". */
get nickname() {
const child = this.document.children.find(c => c.type.name === 'Nickname');
return child ? new VCard.Nickname(child) : undefined;
}
/** The child document of type "Birthday". */
get birthday() {
const child = this.document.children.find(c => c.type.name === 'Birthday');
return child ? new VCard.Birthday(child) : undefined;
}
/** The child document of type "Anniversary". */
get anniversary() {
const child = this.document.children.find(c => c.type.name === 'Anniversary');
return child ? new VCard.Anniversary(child) : undefined;
}
/** The child document of type "Gender". */
get gender() {
const child = this.document.children.find(c => c.type.name === 'Gender');
return child ? new VCard.Gender(child) : undefined;
}
/** The child document of type "DeliveryAddress". */
get deliveryAddress() {
const child = this.document.children.find(c => c.type.name === 'DeliveryAddress');
return child ? new VCard.DeliveryAddress(child) : undefined;
}
/** The child document of type "Photo". */
get photo() {
const child = this.document.children.find(c => c.type.name === 'Photo');
return child ? new VCard.Photo(child) : undefined;
}
/** The child document of type "TelephoneNumber". */
get telephoneNumber() {
const child = this.document.children.find(c => c.type.name === 'TelephoneNumber');
return child ? new VCard.TelephoneNumber(child) : undefined;
}
/** The child document of type "Email". */
get email() {
const child = this.document.children.find(c => c.type.name === 'Email');
return child ? new VCard.Email(child) : undefined;
}
/** The child document of type "IMPP". */
get impp() {
const child = this.document.children.find(c => c.type.name === 'IMPP');
return child ? new VCard.IMPP(child) : undefined;
}
/** The child document of type "Languages". */
get languages() {
const child = this.document.children.find(c => c.type.name === 'Languages');
return child ? new VCard.Languages(child) : undefined;
}
/** The child document of type "TimeZone". */
get timeZone() {
const child = this.document.children.find(c => c.type.name === 'TimeZone');
return child ? new VCard.TimeZone(child) : undefined;
}
/** The child document of type "GeoLocation". */
get geoLocation() {
const child = this.document.children.find(c => c.type.name === 'GeoLocation');
return child ? new VCard.GeoLocation(child) : undefined;
}
/** The child document of type "Title". */
get title() {
const child = this.document.children.find(c => c.type.name === 'Title');
return child ? new VCard.Title(child) : undefined;
}
/** The child document of type "Role". */
get role() {
const child = this.document.children.find(c => c.type.name === 'Role');
return child ? new VCard.Role(child) : undefined;
}
/** The child document of type "Logo". */
get logo() {
const child = this.document.children.find(c => c.type.name === 'Logo');
return child ? new VCard.Logo(child) : undefined;
}
/** The child document of type "Organisation". */
get organisation() {
const child = this.document.children.find(c => c.type.name === 'Organisation');
return child ? new VCard.Organisation(child) : undefined;
}
/** The child document of type "Member". */
get member() {
const child = this.document.children.find(c => c.type.name === 'Member');
return child ? new VCard.Member(child) : undefined;
}
/** The child document of type "Related". */
get related() {
const child = this.document.children.find(c => c.type.name === 'Related');
return child ? new VCard.Related(child) : undefined;
}
/** The child document of type "Categories". */
get categories() {
const child = this.document.children.find(c => c.type.name === 'Categories');
return child ? new VCard.Categories(child) : undefined;
}
/** The child document of type "Note". */
get note() {
const child = this.document.children.find(c => c.type.name === 'Note');
return child ? new VCard.Note(child) : undefined;
}
/** The child document of type "ProductId". */
get productId() {
const child = this.document.children.find(c => c.type.name === 'ProductId');
return child ? new VCard.ProductId(child) : undefined;
}
/** The child document of type "Revision". */
get revision() {
const child = this.document.children.find(c => c.type.name === 'Revision');
return child ? new VCard.Revision(child) : undefined;
}
/** The child document of type "Sound". */
get sound() {
const child = this.document.children.find(c => c.type.name === 'Sound');
return child ? new VCard.Sound(child) : undefined;
}
/** The child document of type "UID". */
get uid() {
const child = this.document.children.find(c => c.type.name === 'UID');
return child ? new VCard.UID(child) : undefined;
}
/** The child document of type "ClientPIDMap". */
get clientPIDMap() {
const child = this.document.children.find(c => c.type.name === 'ClientPIDMap');
return child ? new VCard.ClientPIDMap(child) : undefined;
}
/** The child document of type "URL". */
get url() {
const child = this.document.children.find(c => c.type.name === 'URL');
return child ? new VCard.URL(child) : undefined;
}
/** The child document of type "PublicKey". */
get publicKey() {
const child = this.document.children.find(c => c.type.name === 'PublicKey');
return child ? new VCard.PublicKey(child) : undefined;
}
/** The child document of type "BusyTimeURL". */
get busyTimeURL() {
const child = this.document.children.find(c => c.type.name === 'BusyTimeURL');
return child ? new VCard.BusyTimeURL(child) : undefined;
}
/** The child document of type "CalendarURIForRequests". */
get calendarURIForRequests() {
const child = this.document.children.find(c => c.type.name === 'CalendarURIForRequests');
return child ? new VCard.CalendarURIForRequests(child) : undefined;
}
/** The child document of type "CalendarURI". */
get calendarURI() {
const child = this.document.children.find(c => c.type.name === 'CalendarURI');
return child ? new VCard.CalendarURI(child) : undefined;
}
/** An array of all children of type "Custom". */
get customs() {
return this.document.children.filter(c => c.type.name === 'Custom').map(c => new VCard.Custom(c));
}
}
(function (_VCard) {
class Entry {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
/** Raw Value */
get rawValue() {
return this.document.fields.find(f => f.type.name === 'RawValue');
}
/** Type Modifier */
get typeModifiers() {
return this.document.fields.filter(f => f.type.name === 'TypeModifier');
}
/** Value */
get values() {
return this.document.fields.filter(f => f.type.name === 'Value');
}
}
_VCard.Entry = Entry;
class Version extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardVersionDocumentType;
}
}
_VCard.Version = Version;
class Source extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardSourceDocumentType;
}
}
_VCard.Source = Source;
class Kind extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardKindDocumentType;
}
}
_VCard.Kind = Kind;
class XML extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardXMLDocumentType;
}
}
_VCard.XML = XML;
class Name extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardNameDocumentType;
}
}
_VCard.Name = Name;
class FirstName extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardFirstNameDocumentType;
}
}
_VCard.FirstName = FirstName;
class Nickname extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardNicknameDocumentType;
}
}
_VCard.Nickname = Nickname;
class Birthday extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardBirthdayDocumentType;
}
}
_VCard.Birthday = Birthday;
class Anniversary extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardAnniversaryDocumentType;
}
}
_VCard.Anniversary = Anniversary;
class Gender extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardGenderDocumentType;
}
}
_VCard.Gender = Gender;
class DeliveryAddress extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardDeliveryAddressDocumentType;
}
}
_VCard.DeliveryAddress = DeliveryAddress;
class Photo extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardPhotoDocumentType;
}
}
_VCard.Photo = Photo;
class TelephoneNumber extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardTelephoneNumberDocumentType;
}
}
_VCard.TelephoneNumber = TelephoneNumber;
class Email extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardEmailDocumentType;
}
}
_VCard.Email = Email;
class IMPP extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardIMPPDocumentType;
}
}
_VCard.IMPP = IMPP;
class Languages extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardLanguagesDocumentType;
}
}
_VCard.Languages = Languages;
class TimeZone extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardTimeZoneDocumentType;
}
}
_VCard.TimeZone = TimeZone;
class GeoLocation extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardGeoLocationDocumentType;
}
}
_VCard.GeoLocation = GeoLocation;
class Title extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardTitleDocumentType;
}
}
_VCard.Title = Title;
class Role extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardRoleDocumentType;
}
}
_VCard.Role = Role;
class Logo extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardLogoDocumentType;
}
}
_VCard.Logo = Logo;
class Organisation extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType() {
return VCardOrganisationDocumentType;
}
}
_VCard.Organisation = Organisation;
class Member extends Entry {
constructor(document) {
super(document);
}
requiredDocumentType()