@metriport/shared 0.21.1 → 0.22.0-alpha.0

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.
Files changed (29) hide show
  1. package/dist/validators/driver-license/__tests__/index.test.d.ts +2 -0
  2. package/dist/validators/driver-license/__tests__/index.test.d.ts.map +1 -0
  3. package/dist/validators/driver-license/__tests__/index.test.js +87 -0
  4. package/dist/validators/driver-license/__tests__/index.test.js.map +1 -0
  5. package/dist/validators/driver-license/ca-dl.d.ts +6 -0
  6. package/dist/validators/driver-license/ca-dl.d.ts.map +1 -0
  7. package/dist/validators/driver-license/ca-dl.js +87 -0
  8. package/dist/validators/driver-license/ca-dl.js.map +1 -0
  9. package/dist/validators/driver-license/index.d.ts +18 -0
  10. package/dist/validators/driver-license/index.d.ts.map +1 -0
  11. package/dist/validators/driver-license/index.js +86 -0
  12. package/dist/validators/driver-license/index.js.map +1 -0
  13. package/dist/validators/driver-license/interfaces.d.ts +33 -0
  14. package/dist/validators/driver-license/interfaces.d.ts.map +1 -0
  15. package/dist/validators/driver-license/interfaces.js +3 -0
  16. package/dist/validators/driver-license/interfaces.js.map +1 -0
  17. package/dist/validators/driver-license/us-dl.d.ts +6 -0
  18. package/dist/validators/driver-license/us-dl.d.ts.map +1 -0
  19. package/dist/validators/driver-license/us-dl.js +471 -0
  20. package/dist/validators/driver-license/us-dl.js.map +1 -0
  21. package/package.json +2 -2
  22. package/dist/interface/external/ehr/fhir-resource.d.ts +0 -89
  23. package/dist/interface/external/ehr/fhir-resource.d.ts.map +0 -1
  24. package/dist/interface/external/ehr/fhir-resource.js +0 -17
  25. package/dist/interface/external/ehr/fhir-resource.js.map +0 -1
  26. package/dist/interface/external/ehr/resource-diff.d.ts +0 -6
  27. package/dist/interface/external/ehr/resource-diff.d.ts.map +0 -1
  28. package/dist/interface/external/ehr/resource-diff.js +0 -13
  29. package/dist/interface/external/ehr/resource-diff.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -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;YAChC,MAAM,CAAC,IAAA,eAAO,EAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,CAAC,IAAA,eAAO,EAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB;YAC5D,MAAM,CAAC,IAAA,eAAO,EAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB;QACjE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;YAClC,MAAM,CAAC,IAAA,eAAO,EAAC,UAAU,EAAE,EA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AC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAEpC,IAAI,YAAY,EAAE;gBAChB,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAEpC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;gBACxD,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;aACzC;QACH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YACjD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,kBAAU,EAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { CountryFormats } from './interfaces';
2
+ /**
3
+ * Canada driver license formats.
4
+ */
5
+ export declare const CA_DL: CountryFormats;
6
+ //# sourceMappingURL=ca-dl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ca-dl.d.ts","sourceRoot":"","sources":["../../../src/validators/driver-license/ca-dl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;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"}
@@ -0,0 +1,18 @@
1
+ import { ValidateOptions, ValidationMatch } from "./interfaces";
2
+ /**
3
+ * Validates if a driver license number is valid.
4
+ *
5
+ * @param dl Driver license number
6
+ * @param options Validation options
7
+ * @returns True if valid, false otherwise
8
+ */
9
+ export declare function isValid(dl: string, options?: ValidateOptions): boolean;
10
+ /**
11
+ * Gets all matching formats for a driver license number.
12
+ *
13
+ * @param dl Driver license number
14
+ * @param options Validation options
15
+ * @returns Array of matching formats or null if no matches
16
+ */
17
+ export declare function getMatches(dl: string, options?: ValidateOptions): ValidationMatch[] | null;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validators/driver-license/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,WAGhE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,4BA0DnE"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMatches = exports.isValid = void 0;
4
+ const us_dl_1 = require("./us-dl");
5
+ const ca_dl_1 = require("./ca-dl");
6
+ const metriport_error_1 = require("../../error/metriport-error");
7
+ /**
8
+ * Supported countries.
9
+ */
10
+ const COUNTRIES = {
11
+ US: us_dl_1.US_DL,
12
+ CA: ca_dl_1.CA_DL,
13
+ };
14
+ /**
15
+ * Validates if a driver license number is valid.
16
+ *
17
+ * @param dl Driver license number
18
+ * @param options Validation options
19
+ * @returns True if valid, false otherwise
20
+ */
21
+ function isValid(dl, options = {}) {
22
+ const result = getMatches(dl, options);
23
+ return result !== null && result.length > 0;
24
+ }
25
+ exports.isValid = isValid;
26
+ /**
27
+ * Gets all matching formats for a driver license number.
28
+ *
29
+ * @param dl Driver license number
30
+ * @param options Validation options
31
+ * @returns Array of matching formats or null if no matches
32
+ */
33
+ function getMatches(dl, options = {}) {
34
+ if (!dl) {
35
+ return null;
36
+ }
37
+ const country = options.country || "US";
38
+ const countryFormats = COUNTRIES[country];
39
+ if (!countryFormats) {
40
+ throw new metriport_error_1.MetriportError(`Country ${country} not supported`, undefined, { country });
41
+ }
42
+ // Filter by state if provided
43
+ let states = [];
44
+ if (options.states) {
45
+ if (typeof options.states === "string") {
46
+ states = [options.states];
47
+ }
48
+ else {
49
+ states = options.states;
50
+ }
51
+ // Validate states
52
+ for (const state of states) {
53
+ if (!countryFormats[state]) {
54
+ throw new metriport_error_1.MetriportError(`State ${state} not supported for country ${country}`, undefined, {
55
+ state,
56
+ country,
57
+ });
58
+ }
59
+ }
60
+ }
61
+ else {
62
+ // Use all states if not specified
63
+ states = Object.keys(countryFormats);
64
+ }
65
+ const matches = [];
66
+ // Check each state
67
+ for (const state of states) {
68
+ const stateFormats = countryFormats[state];
69
+ if (!stateFormats)
70
+ continue;
71
+ // Check each format for the state
72
+ for (const format of stateFormats) {
73
+ const regex = options.ignoreCase ? new RegExp(format.regex.source, "i") : format.regex;
74
+ if (regex.test(dl)) {
75
+ matches.push({
76
+ state,
77
+ description: format.description,
78
+ });
79
+ break; // Found a match for this state, move to next state
80
+ }
81
+ }
82
+ }
83
+ return matches.length > 0 ? matches : null;
84
+ }
85
+ exports.getMatches = getMatches;
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validators/driver-license/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,mCAAgC;AAEhC,iEAA6D;AAE7D;;GAEG;AACH,MAAM,SAAS,GAAG;IAChB,EAAE,EAAE,aAAK;IACT,EAAE,EAAE,aAAK;CACV,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,EAAU,EAAE,UAA2B,EAAE;IAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACvC,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9C,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB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AC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAEvF,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBAClB,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK;oBACL,WAAW,EAAE,MAAM,CAAC,WAAW;iBAChC,CAAC,CAAC;gBACH,MAAM,CAAC,mDAAmD;aAC3D;SACF;KACF;IAED,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC;AA1DD,gCA0DC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Country formats.
3
+ */
4
+ export interface CountryFormats {
5
+ [index: string]: DriverLicenseFormat[];
6
+ }
7
+ /**
8
+ * Driver license format.
9
+ */
10
+ export interface DriverLicenseFormat {
11
+ regex: RegExp;
12
+ description: string;
13
+ }
14
+ /**
15
+ * Validation match results.
16
+ */
17
+ export interface ValidationMatch {
18
+ state: string;
19
+ description: string;
20
+ }
21
+ /**
22
+ * Supported country codes.
23
+ */
24
+ export type CountryCode = 'US' | 'CA';
25
+ /**
26
+ * Validate options.
27
+ */
28
+ export interface ValidateOptions {
29
+ country?: CountryCode;
30
+ states?: string | string[];
31
+ ignoreCase?: boolean;
32
+ }
33
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/validators/driver-license/interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/validators/driver-license/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { CountryFormats } from './interfaces';
2
+ /**
3
+ * USA driver license formats.
4
+ */
5
+ export declare const US_DL: CountryFormats;
6
+ //# sourceMappingURL=us-dl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"us-dl.d.ts","sourceRoot":"","sources":["../../../src/validators/driver-license/us-dl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,cA+cnB,CAAC"}
@@ -0,0 +1,471 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.US_DL = void 0;
4
+ /**
5
+ * USA driver license formats.
6
+ */
7
+ exports.US_DL = {
8
+ AL: [
9
+ {
10
+ regex: /^[0-9]{1,8}$/,
11
+ description: '1-8 numbers',
12
+ },
13
+ ],
14
+ AK: [
15
+ {
16
+ regex: /^[0-9]{1,7}$/,
17
+ description: '1-7 numbers',
18
+ },
19
+ ],
20
+ AZ: [
21
+ {
22
+ regex: /^[A-Z]{1}[0-9]{8,9}$/,
23
+ description: '1 letter followed by 8-9 numbers',
24
+ },
25
+ {
26
+ regex: /^[A-Z]{2}[0-9]{2,5}$/,
27
+ description: '2 letters followed by 2-5 numbers',
28
+ },
29
+ {
30
+ regex: /^[0-9]{9}$/,
31
+ description: '9 numbers',
32
+ },
33
+ ],
34
+ AR: [
35
+ {
36
+ regex: /^[0-9]{4,9}$/,
37
+ description: '4-9 numbers',
38
+ },
39
+ ],
40
+ CA: [
41
+ {
42
+ regex: /^[A-Z]{1}[0-9]{7}$/,
43
+ description: '1 letter followed by 7 numbers',
44
+ },
45
+ ],
46
+ CO: [
47
+ {
48
+ regex: /^[0-9]{9}$/,
49
+ description: '9 numbers',
50
+ },
51
+ {
52
+ regex: /^[A-Z]{1}[0-9]{3,6}$/,
53
+ description: '1 letter followed by 3-6 numbers',
54
+ },
55
+ {
56
+ regex: /^[A-Z]{2}[0-9]{2,5}$/,
57
+ description: '2 letters followed by 2-5 numbers',
58
+ },
59
+ ],
60
+ CT: [
61
+ {
62
+ regex: /^[0-9]{9}$/,
63
+ description: '9 numbers',
64
+ },
65
+ ],
66
+ DE: [
67
+ {
68
+ regex: /^[0-9]{1,7}$/,
69
+ description: '1-7 numbers',
70
+ },
71
+ ],
72
+ DC: [
73
+ {
74
+ regex: /^[0-9]{7}$/,
75
+ description: '7 numbers',
76
+ },
77
+ {
78
+ regex: /^[0-9]{9}$/,
79
+ description: '9 numbers',
80
+ },
81
+ ],
82
+ FL: [
83
+ {
84
+ regex: /^[A-Z]{1}[0-9]{12}$/,
85
+ description: '1 letter followed by 12 numbers',
86
+ },
87
+ ],
88
+ GA: [
89
+ {
90
+ regex: /^[0-9]{7,9}$/,
91
+ description: '7-9 numbers',
92
+ },
93
+ ],
94
+ HI: [
95
+ {
96
+ regex: /^[A-Z]{1}[0-9]{8}$/,
97
+ description: '1 letter followed by 8 numbers',
98
+ },
99
+ {
100
+ regex: /^[0-9]{9}$/,
101
+ description: '9 numbers',
102
+ },
103
+ ],
104
+ ID: [
105
+ {
106
+ regex: /^[A-Z]{2}[0-9]{6}[A-Z]{1}$/,
107
+ description: '2 letters followed by 6 numbers followed by 1 letter',
108
+ },
109
+ {
110
+ regex: /^[0-9]{9}$/,
111
+ description: '9 numbers',
112
+ },
113
+ ],
114
+ IL: [
115
+ {
116
+ regex: /^[A-Z]{1}[0-9]{11,12}$/,
117
+ description: '1 letter followed by 11-12 numbers',
118
+ },
119
+ ],
120
+ IN: [
121
+ {
122
+ regex: /^[A-Z]{1}[0-9]{9}$/,
123
+ description: '1 letter followed by 9 numbers',
124
+ },
125
+ {
126
+ regex: /^[0-9]{9,10}$/,
127
+ description: '9-10 numbers',
128
+ },
129
+ ],
130
+ IA: [
131
+ {
132
+ regex: /^[0-9]{9}$/,
133
+ description: '9 numbers',
134
+ },
135
+ {
136
+ regex: /^[0-9]{3}[A-Z]{2}[0-9]{4}$/,
137
+ description: '3 numbers followed by 2 letters followed by 4 numbers',
138
+ },
139
+ ],
140
+ KS: [
141
+ {
142
+ regex: /^([A-Z]{1}[0-9]{1}){2}[A-Z]{1}$/,
143
+ description: '1 letter then 1 number then 1 letter then 1 number then 1 letter',
144
+ },
145
+ {
146
+ regex: /^[A-Z]{1}[0-9]{8}$/,
147
+ description: '1 letter followed by 8 numbers',
148
+ },
149
+ {
150
+ regex: /^[0-9]{9}$/,
151
+ description: '9 numbers',
152
+ },
153
+ ],
154
+ KY: [
155
+ {
156
+ regex: /^[A-Z]{1}[0-9]{8,9}$/,
157
+ description: '1 letter followed by 8-9 numbers',
158
+ },
159
+ {
160
+ regex: /^[0-9]{9}$/,
161
+ description: '9 numbers',
162
+ },
163
+ ],
164
+ LA: [
165
+ {
166
+ regex: /^[0-9]{1,9}$/,
167
+ description: '1-9 numbers',
168
+ },
169
+ ],
170
+ ME: [
171
+ {
172
+ regex: /^[0-9]{7}$/,
173
+ description: '7 numbers',
174
+ },
175
+ {
176
+ regex: /^[0-9]{7}[A-Z]{1}$/,
177
+ description: '7 numbers followed by 1 letter',
178
+ },
179
+ {
180
+ regex: /^[0-9]{8}$/,
181
+ description: '8 numbers',
182
+ },
183
+ ],
184
+ MD: [
185
+ {
186
+ regex: /^[A-Z]{1}[0-9]{12}$/,
187
+ description: '1 letter followed by 12 numbers',
188
+ },
189
+ ],
190
+ MA: [
191
+ {
192
+ regex: /^[A-Z]{1}[0-9]{8}$/,
193
+ description: '1 letter followed by 8 numbers',
194
+ },
195
+ {
196
+ regex: /^[A-Z]{2}[0-9]{7}$/,
197
+ description: '2 letters followed by 7 numbers',
198
+ },
199
+ {
200
+ regex: /^[0-9]{9}$/,
201
+ description: '9 numbers',
202
+ },
203
+ ],
204
+ MI: [
205
+ {
206
+ regex: /^[A-Z]{1}[0-9]{10}$/,
207
+ description: '1 letter followed by 10 numbers',
208
+ },
209
+ {
210
+ regex: /^[A-Z]{1}[0-9]{12}$/,
211
+ description: '1 letter followed by 12 numbers',
212
+ },
213
+ ],
214
+ MN: [
215
+ {
216
+ regex: /^[A-Z]{1}[0-9]{12}$/,
217
+ description: '1 letter followed by 12 numbers',
218
+ },
219
+ ],
220
+ MS: [
221
+ {
222
+ regex: /^[0-9]{9}$/,
223
+ description: '9 numbers',
224
+ },
225
+ ],
226
+ MO: [
227
+ {
228
+ regex: /^[A-Z]{1}[0-9]{5,9}$/,
229
+ description: '1 letter followed by 5-9 numbers',
230
+ },
231
+ {
232
+ regex: /^[A-Z]{1}[0-9]{6}[R]$/,
233
+ description: '1 letter followed by 6 numbers followed by "R"',
234
+ },
235
+ {
236
+ regex: /^[0-9]{8}[A-Z]{2}$/,
237
+ description: '8 numbers followed by 2 letters',
238
+ },
239
+ {
240
+ regex: /^[0-9]{9}[A-Z]{1}$/,
241
+ description: '9 numbers followed by 1 letter',
242
+ },
243
+ {
244
+ regex: /^[0-9]{9}$/,
245
+ description: '9 numbers',
246
+ },
247
+ ],
248
+ MT: [
249
+ {
250
+ regex: /^[A-Z]{1}[0-9]{8}$/,
251
+ description: '1 letter followed by 8 numbers',
252
+ },
253
+ {
254
+ regex: /^[0-9]{13}$/,
255
+ description: '13 numbers',
256
+ },
257
+ {
258
+ regex: /^[0-9]{9}$/,
259
+ description: '9 numbers',
260
+ },
261
+ {
262
+ regex: /^[0-9]{14}$/,
263
+ description: '14 numbers',
264
+ },
265
+ ],
266
+ NE: [
267
+ {
268
+ regex: /^[A-Z]{1}[0-9]{6,8}$/,
269
+ description: '1 letter followed by 6-8 numbers',
270
+ },
271
+ ],
272
+ NV: [
273
+ {
274
+ regex: /^[0-9]{9,10}$/,
275
+ description: '9-10 numbers',
276
+ },
277
+ {
278
+ regex: /^[0-9]{12}$/,
279
+ description: '12 numbers',
280
+ },
281
+ {
282
+ regex: /^[X]{1}[0-9]{8}$/,
283
+ description: '"X" followed by 8 numbers',
284
+ },
285
+ ],
286
+ NH: [
287
+ {
288
+ regex: /^[0-9]{2}[A-Z]{3}[0-9]{5}$/,
289
+ description: '2 numbers followed by 3 letters followed by 5 numbers',
290
+ },
291
+ ],
292
+ NJ: [
293
+ {
294
+ regex: /^[A-Z]{1}[0-9]{14}$/,
295
+ description: '1 letter followed by 14 numbers',
296
+ },
297
+ ],
298
+ NM: [
299
+ {
300
+ regex: /^[0-9]{8,9}$/,
301
+ description: '8-9 numbers',
302
+ },
303
+ ],
304
+ NY: [
305
+ {
306
+ regex: /^[A-Z]{1}[0-9]{7}$/,
307
+ description: '1 letter followed by 7 numbers',
308
+ },
309
+ {
310
+ regex: /^[A-Z]{1}[0-9]{18}$/,
311
+ description: '1 letter followed by 18 numbers',
312
+ },
313
+ {
314
+ regex: /^[0-9]{8,9}$/,
315
+ description: '8-9 numbers',
316
+ },
317
+ {
318
+ regex: /^[0-9]{16}$/,
319
+ description: '16 numbers',
320
+ },
321
+ {
322
+ regex: /^[A-Z]{8}$/,
323
+ description: '8 letters',
324
+ },
325
+ ],
326
+ NC: [
327
+ {
328
+ regex: /^[0-9]{1,12}$/,
329
+ description: '1-12 numbers',
330
+ },
331
+ ],
332
+ ND: [
333
+ {
334
+ regex: /^[A-Z]{3}[0-9]{6}$/,
335
+ description: '3 letters followed by 6 numbers',
336
+ },
337
+ {
338
+ regex: /^[0-9]{9}$/,
339
+ description: '9 numbers',
340
+ },
341
+ ],
342
+ OH: [
343
+ {
344
+ regex: /^[A-Z]{1}[0-9]{4,8}$/,
345
+ description: '1 letter followed by 4-8 numbers',
346
+ },
347
+ {
348
+ regex: /^[A-Z]{2}[0-9]{3,7}$/,
349
+ description: '2 letters followed by 3-7 numbers',
350
+ },
351
+ {
352
+ regex: /^[0-9]{8}$/,
353
+ description: '8 numbers',
354
+ },
355
+ ],
356
+ OK: [
357
+ {
358
+ regex: /^[A-Z]{1}[0-9]{9}$/,
359
+ description: '1 letter followed by 9 numbers',
360
+ },
361
+ {
362
+ regex: /^[0-9]{9}$/,
363
+ description: '9 numbers',
364
+ },
365
+ ],
366
+ OR: [
367
+ {
368
+ regex: /^[0-9]{1,9}$/,
369
+ description: '1-9 numbers',
370
+ },
371
+ ],
372
+ PA: [
373
+ {
374
+ regex: /^[0-9]{8}$/,
375
+ description: '8 numbers',
376
+ },
377
+ ],
378
+ RI: [
379
+ {
380
+ regex: /^[0-9]{7}$/,
381
+ description: '7 numbers',
382
+ },
383
+ {
384
+ regex: /^[A-Z]{1}[0-9]{6}$/,
385
+ description: '1 letter followed by 6 numbers',
386
+ },
387
+ ],
388
+ SC: [
389
+ {
390
+ regex: /^[0-9]{5,11}$/,
391
+ description: '5-11 numbers',
392
+ },
393
+ ],
394
+ SD: [
395
+ {
396
+ regex: /^[0-9]{6,10}$/,
397
+ description: '6-10 numbers',
398
+ },
399
+ {
400
+ regex: /^[0-9]{12}$/,
401
+ description: '12 numbers',
402
+ },
403
+ ],
404
+ TN: [
405
+ {
406
+ regex: /^[0-9]{7,9}$/,
407
+ description: '7-9 numbers',
408
+ },
409
+ ],
410
+ TX: [
411
+ {
412
+ regex: /^[0-9]{7,8}$/,
413
+ description: '7-8 numbers',
414
+ },
415
+ ],
416
+ UT: [
417
+ {
418
+ regex: /^[0-9]{4,10}$/,
419
+ description: '4-10 numbers',
420
+ },
421
+ ],
422
+ VT: [
423
+ {
424
+ regex: /^[0-9]{8}$/,
425
+ description: '8 numbers',
426
+ },
427
+ {
428
+ regex: /^[0-9]{7}[A]$/,
429
+ description: '7 numbers followed by "A"',
430
+ },
431
+ ],
432
+ VA: [
433
+ {
434
+ regex: /^[A-Z]{1}[0-9]{8,11}$/,
435
+ description: '1 letter followed by 8-11 numbers',
436
+ },
437
+ {
438
+ regex: /^[0-9]{9}$/,
439
+ description: '9 numbers',
440
+ },
441
+ ],
442
+ WA: [
443
+ {
444
+ regex: /^(?=.{12}$)[A-Z]{1,7}[A-Z0-9\\*]{4,11}$/,
445
+ description: '1-7 letters followed by any combination of letters, numbers, or "*" for a total of 12 characters',
446
+ },
447
+ ],
448
+ WV: [
449
+ {
450
+ regex: /^[0-9]{7}$/,
451
+ description: '7 numbers',
452
+ },
453
+ {
454
+ regex: /^[A-Z]{1,2}[0-9]{5,6}$/,
455
+ description: '1-2 letters followed by 5-6 numbers',
456
+ },
457
+ ],
458
+ WI: [
459
+ {
460
+ regex: /^[A-Z]{1}[0-9]{13}$/,
461
+ description: '1 letter followed by 13 numbers',
462
+ },
463
+ ],
464
+ WY: [
465
+ {
466
+ regex: /^[0-9]{9,10}$/,
467
+ description: '9-10 numbers',
468
+ },
469
+ ],
470
+ };
471
+ //# sourceMappingURL=us-dl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"us-dl.js","sourceRoot":"","sources":["../../../src/validators/driver-license/us-dl.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,KAAK,GAAmB;IACnC,EAAE,EAAE;QACF;YACE,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,aAAa;SAC3B;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,aAAa;SAC3B;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,kCAAkC;SAChD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WAAW,EAAE,qCAAqC;SACnD;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,iCAAiC;SAC/C;KACF;IACD,EAAE,EAAE;QACF;YACE,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,cAAc;SAC5B;KACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.21.1",
3
+ "version": "0.22.0-alpha.0",
4
4
  "description": "Common code shared across packages - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -101,5 +101,5 @@
101
101
  "ts-jest": "29.1.1",
102
102
  "typescript": "^4.9.5"
103
103
  },
104
- "gitHead": "602d1430355c592194f1f3ce609831c16a7fc61c"
104
+ "gitHead": "05585217916a69709059d627effc542498139c91"
105
105
  }
@@ -1,89 +0,0 @@
1
- import { z } from "zod";
2
- export declare const fhirResourceSchema: z.ZodIntersection<z.ZodObject<{
3
- id: z.ZodString;
4
- resourceType: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- id: string;
7
- resourceType: string;
8
- }, {
9
- id: string;
10
- resourceType: string;
11
- }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
12
- export type FhirResource = z.infer<typeof fhirResourceSchema>;
13
- export declare const fhirResourcesSchema: z.ZodArray<z.ZodIntersection<z.ZodObject<{
14
- id: z.ZodString;
15
- resourceType: z.ZodString;
16
- }, "strip", z.ZodTypeAny, {
17
- id: string;
18
- resourceType: string;
19
- }, {
20
- id: string;
21
- resourceType: string;
22
- }>, z.ZodRecord<z.ZodString, z.ZodAny>>, "many">;
23
- export type FhirResources = z.infer<typeof fhirResourcesSchema>;
24
- export declare const fhirResourceWrapperSchema: z.ZodObject<{
25
- resource: z.ZodIntersection<z.ZodObject<{
26
- id: z.ZodString;
27
- resourceType: z.ZodString;
28
- }, "strip", z.ZodTypeAny, {
29
- id: string;
30
- resourceType: string;
31
- }, {
32
- id: string;
33
- resourceType: string;
34
- }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
35
- }, "strip", z.ZodTypeAny, {
36
- resource: {
37
- id: string;
38
- resourceType: string;
39
- } & Record<string, any>;
40
- }, {
41
- resource: {
42
- id: string;
43
- resourceType: string;
44
- } & Record<string, any>;
45
- }>;
46
- export type FhirResourceWrapper = z.infer<typeof fhirResourceWrapperSchema>;
47
- export declare const fhirResourceBundleSchema: z.ZodObject<{
48
- resourceType: z.ZodLiteral<"Bundle">;
49
- entry: z.ZodArray<z.ZodObject<{
50
- resource: z.ZodIntersection<z.ZodObject<{
51
- id: z.ZodString;
52
- resourceType: z.ZodString;
53
- }, "strip", z.ZodTypeAny, {
54
- id: string;
55
- resourceType: string;
56
- }, {
57
- id: string;
58
- resourceType: string;
59
- }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
60
- }, "strip", z.ZodTypeAny, {
61
- resource: {
62
- id: string;
63
- resourceType: string;
64
- } & Record<string, any>;
65
- }, {
66
- resource: {
67
- id: string;
68
- resourceType: string;
69
- } & Record<string, any>;
70
- }>, "many">;
71
- }, "strip", z.ZodTypeAny, {
72
- resourceType: "Bundle";
73
- entry: {
74
- resource: {
75
- id: string;
76
- resourceType: string;
77
- } & Record<string, any>;
78
- }[];
79
- }, {
80
- resourceType: "Bundle";
81
- entry: {
82
- resource: {
83
- id: string;
84
- resourceType: string;
85
- } & Record<string, any>;
86
- }[];
87
- }>;
88
- export type FhirResourceBundle = z.infer<typeof fhirResourceBundleSchema>;
89
- //# sourceMappingURL=fhir-resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fhir-resource.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/ehr/fhir-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;uCAM9B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;;;;gDAA6B,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;EAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fhirResourceBundleSchema = exports.fhirResourceWrapperSchema = exports.fhirResourcesSchema = exports.fhirResourceSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.fhirResourceSchema = zod_1.z.intersection(zod_1.z.object({
6
- id: zod_1.z.string(),
7
- resourceType: zod_1.z.string(),
8
- }), zod_1.z.record(zod_1.z.string(), zod_1.z.any()));
9
- exports.fhirResourcesSchema = exports.fhirResourceSchema.array();
10
- exports.fhirResourceWrapperSchema = zod_1.z.object({
11
- resource: exports.fhirResourceSchema,
12
- });
13
- exports.fhirResourceBundleSchema = zod_1.z.object({
14
- resourceType: zod_1.z.literal("Bundle"),
15
- entry: exports.fhirResourceWrapperSchema.array(),
16
- });
17
- //# sourceMappingURL=fhir-resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fhir-resource.js","sourceRoot":"","sources":["../../../../src/interface/external/ehr/fhir-resource.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,kBAAkB,GAAG,OAAC,CAAC,YAAY,CAC9C,OAAC,CAAC,MAAM,CAAC;IACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;CACzB,CAAC,EACF,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAC9B,CAAC;AAGW,QAAA,mBAAmB,GAAG,0BAAkB,CAAC,KAAK,EAAE,CAAC;AAGjD,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,QAAQ,EAAE,0BAAkB;CAC7B,CAAC,CAAC;AAGU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,YAAY,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACjC,KAAK,EAAE,iCAAyB,CAAC,KAAK,EAAE;CACzC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare enum ResourceDiffDirection {
2
- DIFF_EHR = "Ehr",
3
- DIFF_METRIPORT = "Metriport"
4
- }
5
- export declare function isResourceDiffDirection(direction: string): direction is ResourceDiffDirection;
6
- //# sourceMappingURL=resource-diff.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-diff.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/ehr/resource-diff.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,QAAQ,QAAQ;IAChB,cAAc,cAAc;CAC7B;AACD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,qBAAqB,CAE7F"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isResourceDiffDirection = exports.ResourceDiffDirection = void 0;
4
- var ResourceDiffDirection;
5
- (function (ResourceDiffDirection) {
6
- ResourceDiffDirection["DIFF_EHR"] = "Ehr";
7
- ResourceDiffDirection["DIFF_METRIPORT"] = "Metriport";
8
- })(ResourceDiffDirection = exports.ResourceDiffDirection || (exports.ResourceDiffDirection = {}));
9
- function isResourceDiffDirection(direction) {
10
- return Object.values(ResourceDiffDirection).includes(direction);
11
- }
12
- exports.isResourceDiffDirection = isResourceDiffDirection;
13
- //# sourceMappingURL=resource-diff.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-diff.js","sourceRoot":"","sources":["../../../../src/interface/external/ehr/resource-diff.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,yCAAgB,CAAA;IAChB,qDAA4B,CAAA;AAC9B,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC;AACD,SAAgB,uBAAuB,CAAC,SAAiB;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,SAAkC,CAAC,CAAC;AAC3F,CAAC;AAFD,0DAEC"}