@metriport/shared 0.21.1-alpha.0 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/__tests__/date.test.js +27 -0
- package/dist/common/__tests__/date.test.js.map +1 -1
- package/dist/common/date.d.ts +1 -0
- package/dist/common/date.d.ts.map +1 -1
- package/dist/common/date.js +25 -1
- package/dist/common/date.js.map +1 -1
- package/dist/common/titleCase.d.ts +2 -0
- package/dist/common/titleCase.d.ts.map +1 -0
- package/dist/common/titleCase.js +10 -0
- package/dist/common/titleCase.js.map +1 -0
- package/dist/domain/address/__tests__/normalize-zip.test.d.ts +2 -0
- package/dist/domain/address/__tests__/normalize-zip.test.d.ts.map +1 -0
- package/dist/domain/address/__tests__/normalize-zip.test.js +83 -0
- package/dist/domain/address/__tests__/normalize-zip.test.js.map +1 -0
- package/dist/interface/external/athenahealth/appointment.d.ts +63 -0
- package/dist/interface/external/athenahealth/appointment.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/appointment.js +18 -0
- package/dist/interface/external/athenahealth/appointment.js.map +1 -0
- package/dist/interface/external/athenahealth/cx-mapping.d.ts +10 -0
- package/dist/interface/external/athenahealth/cx-mapping.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/cx-mapping.js +8 -0
- package/dist/interface/external/athenahealth/cx-mapping.js.map +1 -0
- package/dist/interface/external/athenahealth/department.d.ts +28 -0
- package/dist/interface/external/athenahealth/department.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/department.js +11 -0
- package/dist/interface/external/athenahealth/department.js.map +1 -0
- package/dist/interface/external/athenahealth/index.d.ts +9 -0
- package/dist/interface/external/athenahealth/index.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/index.js +25 -0
- package/dist/interface/external/athenahealth/index.js.map +1 -0
- package/dist/interface/external/athenahealth/jwt-token.d.ts +34 -0
- package/dist/interface/external/athenahealth/jwt-token.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/jwt-token.js +18 -0
- package/dist/interface/external/athenahealth/jwt-token.js.map +1 -0
- package/dist/interface/external/athenahealth/medication.d.ts +50 -0
- package/dist/interface/external/athenahealth/medication.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/medication.js +19 -0
- package/dist/interface/external/athenahealth/medication.js.map +1 -0
- package/dist/interface/external/athenahealth/patient.d.ts +44 -0
- package/dist/interface/external/athenahealth/patient.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/patient.js +15 -0
- package/dist/interface/external/athenahealth/patient.js.map +1 -0
- package/dist/interface/external/athenahealth/problem.d.ts +27 -0
- package/dist/interface/external/athenahealth/problem.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/problem.js +14 -0
- package/dist/interface/external/athenahealth/problem.js.map +1 -0
- package/dist/interface/external/athenahealth/subscription.d.ts +20 -0
- package/dist/interface/external/athenahealth/subscription.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/subscription.js +11 -0
- package/dist/interface/external/athenahealth/subscription.js.map +1 -0
- package/dist/interface/external/athenahealth/vitals.d.ts +82 -0
- package/dist/interface/external/athenahealth/vitals.d.ts.map +1 -0
- package/dist/interface/external/athenahealth/vitals.js +15 -0
- package/dist/interface/external/athenahealth/vitals.js.map +1 -0
- package/dist/interface/external/canvas/appointment.d.ts +68 -0
- package/dist/interface/external/canvas/appointment.d.ts.map +1 -0
- package/dist/interface/external/canvas/appointment.js +15 -0
- package/dist/interface/external/canvas/appointment.js.map +1 -0
- package/dist/interface/external/canvas/index.d.ts +3 -0
- package/dist/interface/external/canvas/index.d.ts.map +1 -0
- package/dist/interface/external/canvas/index.js +19 -0
- package/dist/interface/external/canvas/index.js.map +1 -0
- package/dist/interface/external/canvas/jwt-token.d.ts +31 -0
- package/dist/interface/external/canvas/jwt-token.d.ts.map +1 -0
- package/dist/interface/external/canvas/jwt-token.js +17 -0
- package/dist/interface/external/canvas/jwt-token.js.map +1 -0
- package/dist/interface/external/elation/appointment.d.ts +68 -0
- package/dist/interface/external/elation/appointment.d.ts.map +1 -0
- package/dist/interface/external/elation/appointment.js +15 -0
- package/dist/interface/external/elation/appointment.js.map +1 -0
- package/dist/interface/external/elation/index.d.ts +4 -0
- package/dist/interface/external/elation/index.d.ts.map +1 -0
- package/dist/interface/external/elation/index.js +20 -0
- package/dist/interface/external/elation/index.js.map +1 -0
- package/dist/interface/external/elation/jwt-token.d.ts +20 -0
- package/dist/interface/external/elation/jwt-token.d.ts.map +1 -0
- package/dist/interface/external/elation/jwt-token.js +13 -0
- package/dist/interface/external/elation/jwt-token.js.map +1 -0
- package/dist/interface/external/elation/patient.d.ts +96 -0
- package/dist/interface/external/elation/patient.d.ts.map +1 -0
- package/dist/interface/external/elation/patient.js +33 -0
- package/dist/interface/external/elation/patient.js.map +1 -0
- package/dist/interface/external/elation/subscription.d.ts +2 -0
- package/dist/interface/external/elation/subscription.d.ts.map +1 -0
- package/dist/interface/external/elation/subscription.js +3 -0
- package/dist/interface/external/elation/subscription.js.map +1 -0
- package/dist/interface/external/shared/ehr/patient.d.ts +250 -0
- package/dist/interface/external/shared/ehr/patient.d.ts.map +1 -0
- package/dist/interface/external/shared/ehr/patient.js +35 -0
- package/dist/interface/external/shared/ehr/patient.js.map +1 -0
- package/dist/validators/driver-license/__tests__/index.test.d.ts +2 -0
- package/dist/validators/driver-license/__tests__/index.test.d.ts.map +1 -0
- package/dist/validators/driver-license/__tests__/index.test.js +87 -0
- package/dist/validators/driver-license/__tests__/index.test.js.map +1 -0
- package/dist/validators/driver-license/ca-dl.d.ts +6 -0
- package/dist/validators/driver-license/ca-dl.d.ts.map +1 -0
- package/dist/validators/driver-license/ca-dl.js +87 -0
- package/dist/validators/driver-license/ca-dl.js.map +1 -0
- package/dist/validators/driver-license/index.d.ts +18 -0
- package/dist/validators/driver-license/index.d.ts.map +1 -0
- package/dist/validators/driver-license/index.js +86 -0
- package/dist/validators/driver-license/index.js.map +1 -0
- package/dist/validators/driver-license/interfaces.d.ts +33 -0
- package/dist/validators/driver-license/interfaces.d.ts.map +1 -0
- package/dist/validators/driver-license/interfaces.js +3 -0
- package/dist/validators/driver-license/interfaces.js.map +1 -0
- package/dist/validators/driver-license/us-dl.d.ts +6 -0
- package/dist/validators/driver-license/us-dl.d.ts.map +1 -0
- package/dist/validators/driver-license/us-dl.js +471 -0
- package/dist/validators/driver-license/us-dl.js.map +1 -0
- package/package.json +2 -2
- package/dist/interface/external/ehr/fhir-resource.d.ts +0 -89
- package/dist/interface/external/ehr/fhir-resource.d.ts.map +0 -1
- package/dist/interface/external/ehr/fhir-resource.js +0 -17
- package/dist/interface/external/ehr/fhir-resource.js.map +0 -1
- package/dist/interface/external/ehr/resource-diff.d.ts +0 -6
- package/dist/interface/external/ehr/resource-diff.d.ts.map +0 -1
- package/dist/interface/external/ehr/resource-diff.js +0 -13
- package/dist/interface/external/ehr/resource-diff.js.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const patientSchema: z.ZodObject<{
|
|
3
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
4
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
5
|
+
middle_name: z.ZodNullable<z.ZodString>;
|
|
6
|
+
sex: z.ZodString;
|
|
7
|
+
address: z.ZodNullable<z.ZodObject<{
|
|
8
|
+
state: z.ZodNullable<z.ZodString>;
|
|
9
|
+
address_line1: z.ZodNullable<z.ZodString>;
|
|
10
|
+
address_line2: z.ZodNullable<z.ZodString>;
|
|
11
|
+
city: z.ZodNullable<z.ZodString>;
|
|
12
|
+
zip: z.ZodNullable<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
state: string | null;
|
|
15
|
+
address_line1: string | null;
|
|
16
|
+
address_line2: string | null;
|
|
17
|
+
city: string | null;
|
|
18
|
+
zip: string | null;
|
|
19
|
+
}, {
|
|
20
|
+
state: string | null;
|
|
21
|
+
address_line1: string | null;
|
|
22
|
+
address_line2: string | null;
|
|
23
|
+
city: string | null;
|
|
24
|
+
zip: string | null;
|
|
25
|
+
}>>;
|
|
26
|
+
dob: z.ZodString;
|
|
27
|
+
phones: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
28
|
+
phone: z.ZodString;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
phone: string;
|
|
31
|
+
}, {
|
|
32
|
+
phone: string;
|
|
33
|
+
}>, "many">>;
|
|
34
|
+
emails: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
email: string;
|
|
38
|
+
}, {
|
|
39
|
+
email: string;
|
|
40
|
+
}>, "many">>;
|
|
41
|
+
ssn: z.ZodNullable<z.ZodString>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
ssn: string | null;
|
|
44
|
+
first_name: string | null;
|
|
45
|
+
last_name: string | null;
|
|
46
|
+
middle_name: string | null;
|
|
47
|
+
sex: string;
|
|
48
|
+
address: {
|
|
49
|
+
state: string | null;
|
|
50
|
+
address_line1: string | null;
|
|
51
|
+
address_line2: string | null;
|
|
52
|
+
city: string | null;
|
|
53
|
+
zip: string | null;
|
|
54
|
+
} | null;
|
|
55
|
+
dob: string;
|
|
56
|
+
phones: {
|
|
57
|
+
phone: string;
|
|
58
|
+
}[] | null;
|
|
59
|
+
emails: {
|
|
60
|
+
email: string;
|
|
61
|
+
}[] | null;
|
|
62
|
+
}, {
|
|
63
|
+
ssn: string | null;
|
|
64
|
+
first_name: string | null;
|
|
65
|
+
last_name: string | null;
|
|
66
|
+
middle_name: string | null;
|
|
67
|
+
sex: string;
|
|
68
|
+
address: {
|
|
69
|
+
state: string | null;
|
|
70
|
+
address_line1: string | null;
|
|
71
|
+
address_line2: string | null;
|
|
72
|
+
city: string | null;
|
|
73
|
+
zip: string | null;
|
|
74
|
+
} | null;
|
|
75
|
+
dob: string;
|
|
76
|
+
phones: {
|
|
77
|
+
phone: string;
|
|
78
|
+
}[] | null;
|
|
79
|
+
emails: {
|
|
80
|
+
email: string;
|
|
81
|
+
}[] | null;
|
|
82
|
+
}>;
|
|
83
|
+
export type Patient = z.infer<typeof patientSchema>;
|
|
84
|
+
declare const metadata: z.ZodObject<{
|
|
85
|
+
object_id: z.ZodString;
|
|
86
|
+
object_web_link: z.ZodString;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
object_id: string;
|
|
89
|
+
object_web_link: string;
|
|
90
|
+
}, {
|
|
91
|
+
object_id: string;
|
|
92
|
+
object_web_link: string;
|
|
93
|
+
}>;
|
|
94
|
+
export type Metadata = z.infer<typeof metadata>;
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=patient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/elation/patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,QAAA,MAAM,QAAQ;;;;;;;;;EAGZ,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patientSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const address = zod_1.z.object({
|
|
6
|
+
state: zod_1.z.string().nullable(),
|
|
7
|
+
address_line1: zod_1.z.string().nullable(),
|
|
8
|
+
address_line2: zod_1.z.string().nullable(),
|
|
9
|
+
city: zod_1.z.string().nullable(),
|
|
10
|
+
zip: zod_1.z.string().nullable(),
|
|
11
|
+
});
|
|
12
|
+
const phone = zod_1.z.object({
|
|
13
|
+
phone: zod_1.z.string(),
|
|
14
|
+
});
|
|
15
|
+
const email = zod_1.z.object({
|
|
16
|
+
email: zod_1.z.string(),
|
|
17
|
+
});
|
|
18
|
+
exports.patientSchema = zod_1.z.object({
|
|
19
|
+
first_name: zod_1.z.string().nullable(),
|
|
20
|
+
last_name: zod_1.z.string().nullable(),
|
|
21
|
+
middle_name: zod_1.z.string().nullable(),
|
|
22
|
+
sex: zod_1.z.string(),
|
|
23
|
+
address: address.nullable(),
|
|
24
|
+
dob: zod_1.z.string(),
|
|
25
|
+
phones: phone.array().nullable(),
|
|
26
|
+
emails: email.array().nullable(),
|
|
27
|
+
ssn: zod_1.z.string().nullable(),
|
|
28
|
+
});
|
|
29
|
+
const metadata = zod_1.z.object({
|
|
30
|
+
object_id: zod_1.z.string(),
|
|
31
|
+
object_web_link: zod_1.z.string(),
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=patient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient.js","sourceRoot":"","sources":["../../../../src/interface/external/elation/patient.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IACvB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,OAAC,CAAC,MAAM,CAAC;IACrB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,OAAC,CAAC,MAAM,CAAC;IACrB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAIH,MAAM,QAAQ,GAAG,OAAC,CAAC,MAAM,CAAC;IACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/elation/subscription.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../../../src/interface/external/elation/subscription.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const patientSchema: z.ZodObject<{
|
|
3
|
+
gender: z.ZodString;
|
|
4
|
+
name: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5
|
+
family: z.ZodOptional<z.ZodString>;
|
|
6
|
+
given: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
family?: string | undefined;
|
|
9
|
+
given?: string[] | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
family?: string | undefined;
|
|
12
|
+
given?: string[] | undefined;
|
|
13
|
+
}>, "many">>;
|
|
14
|
+
address: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
state: z.ZodOptional<z.ZodString>;
|
|
16
|
+
line: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
city: z.ZodOptional<z.ZodString>;
|
|
18
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
19
|
+
country: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
state?: string | undefined;
|
|
22
|
+
city?: string | undefined;
|
|
23
|
+
line?: string[] | undefined;
|
|
24
|
+
postalCode?: string | undefined;
|
|
25
|
+
country?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
state?: string | undefined;
|
|
28
|
+
city?: string | undefined;
|
|
29
|
+
line?: string[] | undefined;
|
|
30
|
+
postalCode?: string | undefined;
|
|
31
|
+
country?: string | undefined;
|
|
32
|
+
}>, "many">>;
|
|
33
|
+
birthDate: z.ZodString;
|
|
34
|
+
telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
+
value: z.ZodOptional<z.ZodString>;
|
|
36
|
+
system: z.ZodOptional<z.ZodEnum<["phone", "email"]>>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
value?: string | undefined;
|
|
39
|
+
system?: "phone" | "email" | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
value?: string | undefined;
|
|
42
|
+
system?: "phone" | "email" | undefined;
|
|
43
|
+
}>, "many">>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
gender: string;
|
|
46
|
+
birthDate: string;
|
|
47
|
+
address?: {
|
|
48
|
+
state?: string | undefined;
|
|
49
|
+
city?: string | undefined;
|
|
50
|
+
line?: string[] | undefined;
|
|
51
|
+
postalCode?: string | undefined;
|
|
52
|
+
country?: string | undefined;
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
name?: {
|
|
55
|
+
family?: string | undefined;
|
|
56
|
+
given?: string[] | undefined;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
telecom?: {
|
|
59
|
+
value?: string | undefined;
|
|
60
|
+
system?: "phone" | "email" | undefined;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
gender: string;
|
|
64
|
+
birthDate: string;
|
|
65
|
+
address?: {
|
|
66
|
+
state?: string | undefined;
|
|
67
|
+
city?: string | undefined;
|
|
68
|
+
line?: string[] | undefined;
|
|
69
|
+
postalCode?: string | undefined;
|
|
70
|
+
country?: string | undefined;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
name?: {
|
|
73
|
+
family?: string | undefined;
|
|
74
|
+
given?: string[] | undefined;
|
|
75
|
+
}[] | undefined;
|
|
76
|
+
telecom?: {
|
|
77
|
+
value?: string | undefined;
|
|
78
|
+
system?: "phone" | "email" | undefined;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
export type Patient = z.infer<typeof patientSchema>;
|
|
82
|
+
export declare const patientSearchSchema: z.ZodObject<{
|
|
83
|
+
entry: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
84
|
+
resource: z.ZodObject<{
|
|
85
|
+
gender: z.ZodString;
|
|
86
|
+
name: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
87
|
+
family: z.ZodOptional<z.ZodString>;
|
|
88
|
+
given: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
family?: string | undefined;
|
|
91
|
+
given?: string[] | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
family?: string | undefined;
|
|
94
|
+
given?: string[] | undefined;
|
|
95
|
+
}>, "many">>;
|
|
96
|
+
address: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
+
state: z.ZodOptional<z.ZodString>;
|
|
98
|
+
line: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
99
|
+
city: z.ZodOptional<z.ZodString>;
|
|
100
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
101
|
+
country: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
state?: string | undefined;
|
|
104
|
+
city?: string | undefined;
|
|
105
|
+
line?: string[] | undefined;
|
|
106
|
+
postalCode?: string | undefined;
|
|
107
|
+
country?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
state?: string | undefined;
|
|
110
|
+
city?: string | undefined;
|
|
111
|
+
line?: string[] | undefined;
|
|
112
|
+
postalCode?: string | undefined;
|
|
113
|
+
country?: string | undefined;
|
|
114
|
+
}>, "many">>;
|
|
115
|
+
birthDate: z.ZodString;
|
|
116
|
+
telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
117
|
+
value: z.ZodOptional<z.ZodString>;
|
|
118
|
+
system: z.ZodOptional<z.ZodEnum<["phone", "email"]>>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
value?: string | undefined;
|
|
121
|
+
system?: "phone" | "email" | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
value?: string | undefined;
|
|
124
|
+
system?: "phone" | "email" | undefined;
|
|
125
|
+
}>, "many">>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
gender: string;
|
|
128
|
+
birthDate: string;
|
|
129
|
+
address?: {
|
|
130
|
+
state?: string | undefined;
|
|
131
|
+
city?: string | undefined;
|
|
132
|
+
line?: string[] | undefined;
|
|
133
|
+
postalCode?: string | undefined;
|
|
134
|
+
country?: string | undefined;
|
|
135
|
+
}[] | undefined;
|
|
136
|
+
name?: {
|
|
137
|
+
family?: string | undefined;
|
|
138
|
+
given?: string[] | undefined;
|
|
139
|
+
}[] | undefined;
|
|
140
|
+
telecom?: {
|
|
141
|
+
value?: string | undefined;
|
|
142
|
+
system?: "phone" | "email" | undefined;
|
|
143
|
+
}[] | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
gender: string;
|
|
146
|
+
birthDate: string;
|
|
147
|
+
address?: {
|
|
148
|
+
state?: string | undefined;
|
|
149
|
+
city?: string | undefined;
|
|
150
|
+
line?: string[] | undefined;
|
|
151
|
+
postalCode?: string | undefined;
|
|
152
|
+
country?: string | undefined;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
name?: {
|
|
155
|
+
family?: string | undefined;
|
|
156
|
+
given?: string[] | undefined;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
telecom?: {
|
|
159
|
+
value?: string | undefined;
|
|
160
|
+
system?: "phone" | "email" | undefined;
|
|
161
|
+
}[] | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
resource: {
|
|
165
|
+
gender: string;
|
|
166
|
+
birthDate: string;
|
|
167
|
+
address?: {
|
|
168
|
+
state?: string | undefined;
|
|
169
|
+
city?: string | undefined;
|
|
170
|
+
line?: string[] | undefined;
|
|
171
|
+
postalCode?: string | undefined;
|
|
172
|
+
country?: string | undefined;
|
|
173
|
+
}[] | undefined;
|
|
174
|
+
name?: {
|
|
175
|
+
family?: string | undefined;
|
|
176
|
+
given?: string[] | undefined;
|
|
177
|
+
}[] | undefined;
|
|
178
|
+
telecom?: {
|
|
179
|
+
value?: string | undefined;
|
|
180
|
+
system?: "phone" | "email" | undefined;
|
|
181
|
+
}[] | undefined;
|
|
182
|
+
};
|
|
183
|
+
}, {
|
|
184
|
+
resource: {
|
|
185
|
+
gender: string;
|
|
186
|
+
birthDate: string;
|
|
187
|
+
address?: {
|
|
188
|
+
state?: string | undefined;
|
|
189
|
+
city?: string | undefined;
|
|
190
|
+
line?: string[] | undefined;
|
|
191
|
+
postalCode?: string | undefined;
|
|
192
|
+
country?: string | undefined;
|
|
193
|
+
}[] | undefined;
|
|
194
|
+
name?: {
|
|
195
|
+
family?: string | undefined;
|
|
196
|
+
given?: string[] | undefined;
|
|
197
|
+
}[] | undefined;
|
|
198
|
+
telecom?: {
|
|
199
|
+
value?: string | undefined;
|
|
200
|
+
system?: "phone" | "email" | undefined;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
};
|
|
203
|
+
}>, "many">>;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
entry?: {
|
|
206
|
+
resource: {
|
|
207
|
+
gender: string;
|
|
208
|
+
birthDate: string;
|
|
209
|
+
address?: {
|
|
210
|
+
state?: string | undefined;
|
|
211
|
+
city?: string | undefined;
|
|
212
|
+
line?: string[] | undefined;
|
|
213
|
+
postalCode?: string | undefined;
|
|
214
|
+
country?: string | undefined;
|
|
215
|
+
}[] | undefined;
|
|
216
|
+
name?: {
|
|
217
|
+
family?: string | undefined;
|
|
218
|
+
given?: string[] | undefined;
|
|
219
|
+
}[] | undefined;
|
|
220
|
+
telecom?: {
|
|
221
|
+
value?: string | undefined;
|
|
222
|
+
system?: "phone" | "email" | undefined;
|
|
223
|
+
}[] | undefined;
|
|
224
|
+
};
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
entry?: {
|
|
228
|
+
resource: {
|
|
229
|
+
gender: string;
|
|
230
|
+
birthDate: string;
|
|
231
|
+
address?: {
|
|
232
|
+
state?: string | undefined;
|
|
233
|
+
city?: string | undefined;
|
|
234
|
+
line?: string[] | undefined;
|
|
235
|
+
postalCode?: string | undefined;
|
|
236
|
+
country?: string | undefined;
|
|
237
|
+
}[] | undefined;
|
|
238
|
+
name?: {
|
|
239
|
+
family?: string | undefined;
|
|
240
|
+
given?: string[] | undefined;
|
|
241
|
+
}[] | undefined;
|
|
242
|
+
telecom?: {
|
|
243
|
+
value?: string | undefined;
|
|
244
|
+
system?: "phone" | "email" | undefined;
|
|
245
|
+
}[] | undefined;
|
|
246
|
+
};
|
|
247
|
+
}[] | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
export type PatientSearch = z.infer<typeof patientSearchSchema>;
|
|
250
|
+
//# sourceMappingURL=patient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/shared/ehr/patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patientSearchSchema = exports.patientSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const address = zod_1.z.object({
|
|
6
|
+
state: zod_1.z.string().optional(),
|
|
7
|
+
line: zod_1.z.string().array().optional(),
|
|
8
|
+
city: zod_1.z.string().optional(),
|
|
9
|
+
postalCode: zod_1.z.string().optional(),
|
|
10
|
+
country: zod_1.z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
const telecome = zod_1.z.object({
|
|
13
|
+
value: zod_1.z.string().optional(),
|
|
14
|
+
system: zod_1.z.enum(["phone", "email"]).optional(),
|
|
15
|
+
});
|
|
16
|
+
const name = zod_1.z.object({
|
|
17
|
+
family: zod_1.z.string().optional(),
|
|
18
|
+
given: zod_1.z.string().array().optional(),
|
|
19
|
+
});
|
|
20
|
+
exports.patientSchema = zod_1.z.object({
|
|
21
|
+
gender: zod_1.z.string(),
|
|
22
|
+
name: name.array().optional(),
|
|
23
|
+
address: address.array().optional(),
|
|
24
|
+
birthDate: zod_1.z.string(),
|
|
25
|
+
telecom: telecome.array().optional(),
|
|
26
|
+
});
|
|
27
|
+
exports.patientSearchSchema = zod_1.z.object({
|
|
28
|
+
entry: zod_1.z
|
|
29
|
+
.object({
|
|
30
|
+
resource: exports.patientSchema,
|
|
31
|
+
})
|
|
32
|
+
.array()
|
|
33
|
+
.optional(),
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=patient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient.js","sourceRoot":"","sources":["../../../../../src/interface/external/shared/ehr/patient.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IACvB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,OAAC,CAAC,MAAM,CAAC;IACxB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,OAAC;SACL,MAAM,CAAC;QACN,QAAQ,EAAE,qBAAa;KACxB,CAAC;SACD,KAAK,EAAE;SACP,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/validators/driver-license/__tests__/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("../index");
|
|
4
|
+
describe("driver-license-validator", () => {
|
|
5
|
+
describe("isValid", () => {
|
|
6
|
+
it("should return true for valid driver license numbers", () => {
|
|
7
|
+
expect((0, index_1.isValid)("A1234567")).toBe(true);
|
|
8
|
+
expect((0, index_1.isValid)("123456789")).toBe(true);
|
|
9
|
+
expect((0, index_1.isValid)("AB12345")).toBe(true);
|
|
10
|
+
expect((0, index_1.isValid)("1234567")).toBe(true);
|
|
11
|
+
});
|
|
12
|
+
it("should return false for invalid driver license numbers", () => {
|
|
13
|
+
expect((0, index_1.isValid)("")).toBe(false);
|
|
14
|
+
expect((0, index_1.isValid)("invalid_dl")).toBe(false);
|
|
15
|
+
expect((0, index_1.isValid)("AB@123")).toBe(false); // Invalid characters
|
|
16
|
+
expect((0, index_1.isValid)("ABCDEFGHIJKLM")).toBe(false); // Invalid format
|
|
17
|
+
});
|
|
18
|
+
it("should filter by country", () => {
|
|
19
|
+
expect((0, index_1.isValid)("A1234567", { country: "CA" })).toBe(false);
|
|
20
|
+
expect((0, index_1.isValid)("A123456789", { country: "CA" })).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
it("should filter by state", () => {
|
|
23
|
+
expect((0, index_1.isValid)("A1234567", { states: "CA" })).toBe(true);
|
|
24
|
+
expect((0, index_1.isValid)("A1234567", { states: "TX" })).toBe(false);
|
|
25
|
+
expect((0, index_1.isValid)("A1234567", { states: ["CA", "NY"] })).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it("should respect ignoreCase option", () => {
|
|
28
|
+
expect((0, index_1.isValid)("a1234567")).toBe(false);
|
|
29
|
+
expect((0, index_1.isValid)("a1234567", { ignoreCase: true })).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
// Massachusetts driver's license formats
|
|
32
|
+
it("should validate Massachusetts driver's license formats", () => {
|
|
33
|
+
// Test the "SA + 7 numbers" format (2 letters followed by 7 numbers)
|
|
34
|
+
expect((0, index_1.isValid)("SA1234567", { states: "MA" })).toBe(true);
|
|
35
|
+
expect((0, index_1.isValid)("S12345678", { states: "MA" })).toBe(true);
|
|
36
|
+
expect((0, index_1.isValid)("123456789", { states: "MA" })).toBe(true);
|
|
37
|
+
expect((0, index_1.isValid)("S123456", { states: "MA" })).toBe(false); // Invalid format for MA
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe("getMatches", () => {
|
|
41
|
+
it("should return matching formats for valid driver license numbers", () => {
|
|
42
|
+
const matches = (0, index_1.getMatches)("A1234567");
|
|
43
|
+
expect(matches).not.toBeNull();
|
|
44
|
+
if (matches) {
|
|
45
|
+
expect(Array.isArray(matches)).toBe(true);
|
|
46
|
+
expect(matches.length).toBeGreaterThan(0);
|
|
47
|
+
const caMatch = matches.find(m => m.state === "CA");
|
|
48
|
+
expect(caMatch).toBeDefined();
|
|
49
|
+
if (caMatch) {
|
|
50
|
+
expect(caMatch.description).toBe("1 letter followed by 7 numbers");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
it("should return null for invalid driver license numbers", () => {
|
|
55
|
+
expect((0, index_1.getMatches)("invalid_dl")).toBeNull();
|
|
56
|
+
});
|
|
57
|
+
it("should filter matches by country", () => {
|
|
58
|
+
const matches = (0, index_1.getMatches)("A123456789", { country: "CA" });
|
|
59
|
+
expect(matches).not.toBeNull();
|
|
60
|
+
if (matches) {
|
|
61
|
+
matches.forEach(match => {
|
|
62
|
+
expect(["AB", "BC", "MB", "NB", "NL", "NT", "NS", "NU", "ON", "PE", "QC", "SK", "YT"]).toContain(match.state);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
it("should filter matches by state", () => {
|
|
67
|
+
const matches = (0, index_1.getMatches)("A1234567", { states: "CA" });
|
|
68
|
+
expect(matches).not.toBeNull();
|
|
69
|
+
if (matches) {
|
|
70
|
+
expect(matches.length).toBe(1);
|
|
71
|
+
const firstMatch = matches[0];
|
|
72
|
+
expect(firstMatch.state).toBe("CA");
|
|
73
|
+
}
|
|
74
|
+
const multiMatches = (0, index_1.getMatches)("A1234567", { states: ["CA", "NY"] });
|
|
75
|
+
expect(multiMatches).not.toBeNull();
|
|
76
|
+
if (multiMatches) {
|
|
77
|
+
expect(multiMatches.length).toBe(2);
|
|
78
|
+
const stateList = multiMatches.map(m => m.state).sort();
|
|
79
|
+
expect(stateList).toEqual(["CA", "NY"]);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
it("should throw an error for invalid state", () => {
|
|
83
|
+
expect(() => (0, index_1.getMatches)("A1234567", { states: "XX" })).toThrow();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/validators/driver-license/__tests__/index.test.ts"],"names":[],"mappings":";;AAAA,oCAA+C;AAG/C,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC7D,MAAM,CAAC,IAAA,eAAO,EAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,MAAM,CAAC,IAAA,eAAO,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxC,MAAM,CAAC,IAAA,eAAO,EAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,IAAA,eAAO,EAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;YAChE,MAAM,CAAC,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACh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GAEG;AACH,eAAO,MAAM,KAAK,EAAE,cA+EnB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CA_DL = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Canada driver license formats.
|
|
6
|
+
*/
|
|
7
|
+
exports.CA_DL = {
|
|
8
|
+
AB: [
|
|
9
|
+
{
|
|
10
|
+
regex: /^[0-9]{9}$/,
|
|
11
|
+
description: '9 numbers',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
BC: [
|
|
15
|
+
{
|
|
16
|
+
regex: /^[0-9]{7}$/,
|
|
17
|
+
description: '7 numbers',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
MB: [
|
|
21
|
+
{
|
|
22
|
+
regex: /^[A-Z0-9]{12}$/,
|
|
23
|
+
description: 'any combination of letters or numbers for a total of 12 characters',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
NB: [
|
|
27
|
+
{
|
|
28
|
+
regex: /^[0-9]{5,7}$/,
|
|
29
|
+
description: '5-7 numbers',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
NL: [
|
|
33
|
+
{
|
|
34
|
+
regex: /^[A-Z]{1}[0-9]{9}$/,
|
|
35
|
+
description: '1 letter followed by 9 numbers',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
NT: [
|
|
39
|
+
{
|
|
40
|
+
regex: /^[0-9]{6}$/,
|
|
41
|
+
description: '6 numbers',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
NS: [
|
|
45
|
+
{
|
|
46
|
+
regex: /^[A-Z]{5}[0-9]{9}$/,
|
|
47
|
+
description: '5 letters followed by 9 numbers',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
NU: [
|
|
51
|
+
{
|
|
52
|
+
regex: /^[0-9]{9}$/,
|
|
53
|
+
description: '9 numbers',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
ON: [
|
|
57
|
+
{
|
|
58
|
+
regex: /^[A-Z]{1}[0-9]{14}$/,
|
|
59
|
+
description: '1 letter followed by 14 numbers',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
PE: [
|
|
63
|
+
{
|
|
64
|
+
regex: /^[0-9]{5,6}$/,
|
|
65
|
+
description: '5-6 numbers',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
QC: [
|
|
69
|
+
{
|
|
70
|
+
regex: /^[A-Z]{1}[0-9]{12}$/,
|
|
71
|
+
description: '1 letter followed by 12 numbers',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
SK: [
|
|
75
|
+
{
|
|
76
|
+
regex: /^[0-9]{8}$/,
|
|
77
|
+
description: '8 numbers',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
YT: [
|
|
81
|
+
{
|
|
82
|
+
regex: /^[0-9]{10}$/,
|
|
83
|
+
description: '10 numbers',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=ca-dl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ca-dl.js","sourceRoot":"","sources":["../../../src/validators/driver-license/ca-dl.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,KAAK,GAAmB;IACnC,EAAE,EAAE;QACF;YACE,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,WAAW;SACzB;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,WAAW;SACzB;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,oEAAoE;SAClF;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,aAAa;SAC3B;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,gCAAgC;SAC9C;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,WAAW;SACzB;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,iCAAiC;SAC/C;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,WAAW;SACzB;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,iCAAiC;SAC/C;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,aAAa;SAC3B;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,iCAAiC;SAC/C;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,WAAW;SACzB;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,YAAY;SAC1B;KACF;CACF,CAAC"}
|