UNPKG

mindee

Version:

Mindee Client Library for Node.js

44 lines (43 loc) 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HealthCardV1Document = void 0; const common_1 = require("../../../parsing/common"); const standard_1 = require("../../../parsing/standard"); /** * Health Card API version 1.0 document data. */ class HealthCardV1Document { constructor(rawPrediction, pageId) { /** The given names of the card holder. */ this.givenNames = []; rawPrediction["given_names"] && rawPrediction["given_names"].map((itemPrediction) => this.givenNames.push(new standard_1.StringField({ prediction: itemPrediction, pageId: pageId, }))); this.issuanceDate = new standard_1.DateField({ prediction: rawPrediction["issuance_date"], pageId: pageId, }); this.socialSecurity = new standard_1.StringField({ prediction: rawPrediction["social_security"], pageId: pageId, }); this.surname = new standard_1.StringField({ prediction: rawPrediction["surname"], pageId: pageId, }); } /** * Default string representation. */ toString() { const givenNames = this.givenNames.join("\n "); const outStr = `:Given Name(s): ${givenNames} :Surname: ${this.surname} :Social Security Number: ${this.socialSecurity} :Issuance Date: ${this.issuanceDate}`.trimEnd(); return (0, common_1.cleanOutString)(outStr); } } exports.HealthCardV1Document = HealthCardV1Document;