@medplum/core 2.0.21 → 2.0.22
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/cjs/index.cjs +380 -288
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/esm/client.mjs +132 -102
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/crypto.mjs +3 -1
- package/dist/esm/crypto.mjs.map +1 -1
- package/dist/esm/fhirpath/functions.mjs +179 -129
- package/dist/esm/fhirpath/functions.mjs.map +1 -1
- package/dist/esm/format.mjs +6 -4
- package/dist/esm/format.mjs.map +1 -1
- package/dist/esm/hl7.mjs +1 -1
- package/dist/esm/hl7.mjs.map +1 -1
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/jwt.mjs +4 -2
- package/dist/esm/jwt.mjs.map +1 -1
- package/dist/esm/schema.mjs +4 -10
- package/dist/esm/schema.mjs.map +1 -1
- package/dist/esm/search/details.mjs +0 -1
- package/dist/esm/search/details.mjs.map +1 -1
- package/dist/esm/search/match.mjs +1 -0
- package/dist/esm/search/match.mjs.map +1 -1
- package/dist/esm/search/search.mjs +1 -1
- package/dist/esm/search/search.mjs.map +1 -1
- package/dist/esm/storage.mjs +8 -0
- package/dist/esm/storage.mjs.map +1 -1
- package/dist/esm/types.mjs +1 -0
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/utils.mjs +8 -7
- package/dist/esm/utils.mjs.map +1 -1
- package/dist/types/client.d.ts +74 -64
- package/dist/types/crypto.d.ts +3 -1
- package/dist/types/hl7.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/jwt.d.ts +2 -1
- package/dist/types/schema.d.ts +4 -10
- package/dist/types/search/details.d.ts +0 -1
- package/dist/types/search/search.d.ts +1 -1
- package/dist/types/storage.d.ts +8 -0
- package/dist/types/typeschema/types.d.ts +0 -1
- package/dist/types/utils.d.ts +4 -4
- package/package.json +1 -1
package/dist/esm/hl7.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hl7.mjs","sources":["../../src/hl7.ts"],"sourcesContent":["import { isStringArray } from './utils';\n\n/**\n * The Hl7Context class represents the parsing context for an HL7 message.\n *\n * MSH-1:\n * https://hl7-definition.caristix.com/v2/HL7v2.6/Fields/MSH.1\n *\n * MSH-2:\n * https://hl7-definition.caristix.com/v2/HL7v2.6/Fields/MSH.2\n *\n * See this tutorial on MSH, and why it's a bad idea to use anything other than the default values:\n * https://www.hl7soup.com/HL7TutorialMSH.html\n */\nexport class Hl7Context {\n constructor(\n public readonly segmentSeparator = '\\r',\n public readonly fieldSeparator = '|',\n public readonly componentSeparator = '^',\n public readonly repetitionSeparator = '~',\n public readonly escapeCharacter = '\\\\',\n public readonly subcomponentSeparator = '&'\n ) {}\n\n /**\n * Returns the MSH-2 field value based on the configured separators.\n * @returns The HL7 MSH-2 field value.\n */\n getMsh2(): string {\n return (\n this.fieldSeparator +\n this.componentSeparator +\n this.repetitionSeparator +\n this.escapeCharacter +\n this.subcomponentSeparator\n );\n }\n}\n\n/**\n * The Hl7Message class represents one HL7 message.\n * A message is a collection of segments.\n */\nexport class Hl7Message {\n readonly context: Hl7Context;\n readonly segments: Hl7Segment[];\n\n /**\n * Creates a new HL7 message.\n * @param segments The HL7 segments.\n * @param context Optional HL7 parsing context.\n */\n constructor(segments: Hl7Segment[], context = new Hl7Context()) {\n this.context = context;\n this.segments = segments;\n }\n\n /**\n * Returns an HL7 segment by index or by name.\n * @param index The HL7 segment index or name.\n * @returns The HL7 segment if found; otherwise, undefined.\n */\n get(index: number | string): Hl7Segment | undefined {\n if (typeof index === 'number') {\n return this.segments[index];\n }\n return this.segments.find((s) => s.name === index);\n }\n\n /**\n * Returns all HL7 segments of a given name.\n * @param name The HL7 segment name.\n * @returns An array of HL7 segments with the specified name.\n */\n getAll(name: string): Hl7Segment[] {\n return this.segments.filter((s) => s.name === name);\n }\n\n /**\n * Returns the HL7 message as a string.\n * @returns The HL7 message as a string.\n */\n toString(): string {\n return this.segments.map((s) => s.toString()).join(this.context.segmentSeparator);\n }\n\n /**\n * Returns an HL7 \"ACK\" (acknowledgement) message for this message.\n * @returns The HL7 \"ACK\" message.\n */\n buildAck(): Hl7Message {\n const now = new Date();\n const msh = this.get('MSH');\n const sendingApp = msh?.get(2)?.toString() || '';\n const sendingFacility = msh?.get(3)?.toString() || '';\n const receivingApp = msh?.get(4)?.toString() || '';\n const receivingFacility = msh?.get(5)?.toString() || '';\n const controlId = msh?.get(9)?.toString() || '';\n const versionId = msh?.get(12)?.toString() || '2.5.1';\n\n return new Hl7Message([\n new Hl7Segment(\n [\n 'MSH',\n this.context.getMsh2(),\n receivingApp,\n receivingFacility,\n sendingApp,\n sendingFacility,\n now.toISOString(),\n '',\n 'ACK',\n now.getTime().toString(),\n 'P',\n versionId,\n ],\n this.context\n ),\n new Hl7Segment(['MSA', 'AA', controlId, 'OK'], this.context),\n ]);\n }\n\n /**\n * Parses an HL7 message string into an Hl7Message object.\n * @param text The HL7 message text.\n * @returns The parsed HL7 message.\n */\n static parse(text: string): Hl7Message {\n if (!text.startsWith('MSH')) {\n const err = new Error('Invalid HL7 message');\n (err as any).type = 'entity.parse.failed';\n throw err;\n }\n const context = new Hl7Context(\n '\\r',\n text.charAt(3), // Field separator, recommended \"|\"\n text.charAt(4), // Component separator, recommended \"^\"\n text.charAt(5), // Repetition separator, recommended \"~\"\n text.charAt(6), // Escape character, recommended \"\\\"\n text.charAt(7) // Subcomponent separator, recommended \"&\"\n );\n return new Hl7Message(\n text.split(/[\\r\\n]+/).map((line) => Hl7Segment.parse(line, context)),\n context\n );\n }\n}\n\n/**\n * The Hl7Segment class represents one HL7 segment.\n * A segment is a collection of fields.\n * The name field is the first field.\n */\nexport class Hl7Segment {\n readonly context: Hl7Context;\n readonly name: string;\n readonly fields: Hl7Field[];\n\n /**\n * Creates a new HL7 segment.\n * @param fields The HL7 fields.\n * @param context Optional HL7 parsing context.\n */\n constructor(fields: Hl7Field[] | string[], context = new Hl7Context()) {\n this.context = context;\n if (isStringArray(fields)) {\n this.fields = fields.map((f) => Hl7Field.parse(f));\n } else {\n this.fields = fields;\n }\n this.name = this.fields[0].components[0][0];\n }\n\n /**\n * Returns an HL7 field by index.\n * @param index The HL7 field index.\n * @returns The HL7 field.\n */\n get(index: number): Hl7Field {\n return this.fields[index];\n }\n\n /**\n * Returns the HL7 segment as a string.\n * @returns The HL7 segment as a string.\n */\n toString(): string {\n return this.fields.map((f) => f.toString()).join(this.context.fieldSeparator);\n }\n\n /**\n * Parses an HL7 segment string into an Hl7Segment object.\n * @param text The HL7 segment text.\n * @param context Optional HL7 parsing context.\n * @returns The parsed HL7 segment.\n */\n static parse(text: string, context = new Hl7Context()): Hl7Segment {\n return new Hl7Segment(\n text.split(context.fieldSeparator).map((f) => Hl7Field.parse(f, context)),\n context\n );\n }\n}\n\n/**\n * The Hl7Field class represents one HL7 field.\n * A field is a collection of components.\n */\nexport class Hl7Field {\n readonly context: Hl7Context;\n readonly components: string[][];\n\n /**\n * Creates a new HL7 field.\n * @param components The HL7 components.\n * @param context Optional HL7 parsing context.\n */\n constructor(components: string[][], context = new Hl7Context()) {\n this.context = context;\n this.components = components;\n }\n\n /**\n * Returns an HL7 component by index.\n * @param component The component index.\n * @param subcomponent Optional subcomponent index.\n * @param repetition Optional repetition index.\n * @returns The string value of the specified component.\n */\n get(component: number, subcomponent?: number, repetition = 0): string {\n let value = this.components[repetition][component] || '';\n\n if (subcomponent !== undefined) {\n value = value.split(this.context.subcomponentSeparator)[subcomponent] || '';\n }\n\n return value;\n }\n\n /**\n * Returns the HL7 field as a string.\n * @returns The HL7 field as a string.\n */\n toString(): string {\n return this.components.map((r) => r.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);\n }\n\n /**\n * Parses an HL7 field string into an Hl7Field object.\n * @param text The HL7 field text.\n * @param context Optional HL7 parsing context.\n * @returns The parsed HL7 field.\n */\n static parse(text: string, context = new Hl7Context()): Hl7Field {\n return new Hl7Field(\n text.split(context.repetitionSeparator).map((r) => r.split(context.componentSeparator)),\n context\n );\n }\n}\n\ninterface Hl7DateParseOptions {\n seconds?: boolean;\n tzOffset?: string;\n}\n\n/**\n * Returns a formatted string representing the date in ISO-8601 format.\n * @param hl7Date Date string.\n * @param options Optional configuration Object\n * @returns\n */\nexport function parseHl7Date(hl7Date: string | undefined, options?: Hl7DateParseOptions): string | undefined {\n if (!hl7Date) {\n return undefined;\n }\n\n options = { ...{ seconds: true, tzOffset: 'Z' }, ...options };\n\n const year = Number.parseInt(hl7Date.substring(0, 4));\n const month = Number.parseInt(hl7Date.substring(4, 6));\n const date = Number.parseInt(hl7Date.substring(6, 8));\n const hours = Number.parseInt(hl7Date.substring(8, 10));\n const minutes = Number.parseInt(hl7Date.substring(10, 12));\n\n const seconds = options.seconds ? Number.parseInt(hl7Date.substring(12, 14)) : 0;\n\n return `${pad2(year)}-${pad2(month)}-${pad2(date)}T${pad2(hours)}:${pad2(minutes)}:${pad2(seconds)}.000${\n options.tzOffset\n }`;\n}\n\nfunction pad2(n: number): string {\n return n.toString().padStart(2, '0');\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;;AAWG;MACU,UAAU,CAAA;AACrB,IAAA,WAAA,CACkB,mBAAmB,IAAI,EACvB,cAAiB,GAAA,GAAG,EACpB,kBAAqB,GAAA,GAAG,EACxB,mBAAA,GAAsB,GAAG,EACzB,eAAA,GAAkB,IAAI,EACtB,wBAAwB,GAAG,EAAA;QAL3B,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAO;QACvB,IAAc,CAAA,cAAA,GAAd,cAAc,CAAM;QACpB,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAM;QACxB,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAM;QACzB,IAAe,CAAA,eAAA,GAAf,eAAe,CAAO;QACtB,IAAqB,CAA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AQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACxD,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AAEjF,IAAA,OAAO,CAAG,EAAA,IAAI,CAAC,IAAI,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,KAAK,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,IAAI,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,KAAK,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,OAAO,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,OAAO,CAAC,CAChG,IAAA,EAAA,OAAO,CAAC,QACV,EAAE,CAAC;AACL,CAAC;AAED,SAAS,IAAI,CAAC,CAAS,EAAA;IACrB,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACvC;;;;"}
|
|
1
|
+
{"version":3,"file":"hl7.mjs","sources":["../../src/hl7.ts"],"sourcesContent":["import { isStringArray } from './utils';\n\n/**\n * The Hl7Context class represents the parsing context for an HL7 message.\n *\n * MSH-1:\n * https://hl7-definition.caristix.com/v2/HL7v2.6/Fields/MSH.1\n *\n * MSH-2:\n * https://hl7-definition.caristix.com/v2/HL7v2.6/Fields/MSH.2\n *\n * See this tutorial on MSH, and why it's a bad idea to use anything other than the default values:\n * https://www.hl7soup.com/HL7TutorialMSH.html\n */\nexport class Hl7Context {\n constructor(\n public readonly segmentSeparator = '\\r',\n public readonly fieldSeparator = '|',\n public readonly componentSeparator = '^',\n public readonly repetitionSeparator = '~',\n public readonly escapeCharacter = '\\\\',\n public readonly subcomponentSeparator = '&'\n ) {}\n\n /**\n * Returns the MSH-2 field value based on the configured separators.\n * @returns The HL7 MSH-2 field value.\n */\n getMsh2(): string {\n return (\n this.fieldSeparator +\n this.componentSeparator +\n this.repetitionSeparator +\n this.escapeCharacter +\n this.subcomponentSeparator\n );\n }\n}\n\n/**\n * The Hl7Message class represents one HL7 message.\n * A message is a collection of segments.\n */\nexport class Hl7Message {\n readonly context: Hl7Context;\n readonly segments: Hl7Segment[];\n\n /**\n * Creates a new HL7 message.\n * @param segments The HL7 segments.\n * @param context Optional HL7 parsing context.\n */\n constructor(segments: Hl7Segment[], context = new Hl7Context()) {\n this.context = context;\n this.segments = segments;\n }\n\n /**\n * Returns an HL7 segment by index or by name.\n * @param index The HL7 segment index or name.\n * @returns The HL7 segment if found; otherwise, undefined.\n */\n get(index: number | string): Hl7Segment | undefined {\n if (typeof index === 'number') {\n return this.segments[index];\n }\n return this.segments.find((s) => s.name === index);\n }\n\n /**\n * Returns all HL7 segments of a given name.\n * @param name The HL7 segment name.\n * @returns An array of HL7 segments with the specified name.\n */\n getAll(name: string): Hl7Segment[] {\n return this.segments.filter((s) => s.name === name);\n }\n\n /**\n * Returns the HL7 message as a string.\n * @returns The HL7 message as a string.\n */\n toString(): string {\n return this.segments.map((s) => s.toString()).join(this.context.segmentSeparator);\n }\n\n /**\n * Returns an HL7 \"ACK\" (acknowledgement) message for this message.\n * @returns The HL7 \"ACK\" message.\n */\n buildAck(): Hl7Message {\n const now = new Date();\n const msh = this.get('MSH');\n const sendingApp = msh?.get(2)?.toString() || '';\n const sendingFacility = msh?.get(3)?.toString() || '';\n const receivingApp = msh?.get(4)?.toString() || '';\n const receivingFacility = msh?.get(5)?.toString() || '';\n const controlId = msh?.get(9)?.toString() || '';\n const versionId = msh?.get(12)?.toString() || '2.5.1';\n\n return new Hl7Message([\n new Hl7Segment(\n [\n 'MSH',\n this.context.getMsh2(),\n receivingApp,\n receivingFacility,\n sendingApp,\n sendingFacility,\n now.toISOString(),\n '',\n 'ACK',\n now.getTime().toString(),\n 'P',\n versionId,\n ],\n this.context\n ),\n new Hl7Segment(['MSA', 'AA', controlId, 'OK'], this.context),\n ]);\n }\n\n /**\n * Parses an HL7 message string into an Hl7Message object.\n * @param text The HL7 message text.\n * @returns The parsed HL7 message.\n */\n static parse(text: string): Hl7Message {\n if (!text.startsWith('MSH')) {\n const err = new Error('Invalid HL7 message');\n (err as any).type = 'entity.parse.failed';\n throw err;\n }\n const context = new Hl7Context(\n '\\r',\n text.charAt(3), // Field separator, recommended \"|\"\n text.charAt(4), // Component separator, recommended \"^\"\n text.charAt(5), // Repetition separator, recommended \"~\"\n text.charAt(6), // Escape character, recommended \"\\\"\n text.charAt(7) // Subcomponent separator, recommended \"&\"\n );\n return new Hl7Message(\n text.split(/[\\r\\n]+/).map((line) => Hl7Segment.parse(line, context)),\n context\n );\n }\n}\n\n/**\n * The Hl7Segment class represents one HL7 segment.\n * A segment is a collection of fields.\n * The name field is the first field.\n */\nexport class Hl7Segment {\n readonly context: Hl7Context;\n readonly name: string;\n readonly fields: Hl7Field[];\n\n /**\n * Creates a new HL7 segment.\n * @param fields The HL7 fields.\n * @param context Optional HL7 parsing context.\n */\n constructor(fields: Hl7Field[] | string[], context = new Hl7Context()) {\n this.context = context;\n if (isStringArray(fields)) {\n this.fields = fields.map((f) => Hl7Field.parse(f));\n } else {\n this.fields = fields;\n }\n this.name = this.fields[0].components[0][0];\n }\n\n /**\n * Returns an HL7 field by index.\n * @param index The HL7 field index.\n * @returns The HL7 field.\n */\n get(index: number): Hl7Field {\n return this.fields[index];\n }\n\n /**\n * Returns the HL7 segment as a string.\n * @returns The HL7 segment as a string.\n */\n toString(): string {\n return this.fields.map((f) => f.toString()).join(this.context.fieldSeparator);\n }\n\n /**\n * Parses an HL7 segment string into an Hl7Segment object.\n * @param text The HL7 segment text.\n * @param context Optional HL7 parsing context.\n * @returns The parsed HL7 segment.\n */\n static parse(text: string, context = new Hl7Context()): Hl7Segment {\n return new Hl7Segment(\n text.split(context.fieldSeparator).map((f) => Hl7Field.parse(f, context)),\n context\n );\n }\n}\n\n/**\n * The Hl7Field class represents one HL7 field.\n * A field is a collection of components.\n */\nexport class Hl7Field {\n readonly context: Hl7Context;\n readonly components: string[][];\n\n /**\n * Creates a new HL7 field.\n * @param components The HL7 components.\n * @param context Optional HL7 parsing context.\n */\n constructor(components: string[][], context = new Hl7Context()) {\n this.context = context;\n this.components = components;\n }\n\n /**\n * Returns an HL7 component by index.\n * @param component The component index.\n * @param subcomponent Optional subcomponent index.\n * @param repetition Optional repetition index.\n * @returns The string value of the specified component.\n */\n get(component: number, subcomponent?: number, repetition = 0): string {\n let value = this.components[repetition][component] || '';\n\n if (subcomponent !== undefined) {\n value = value.split(this.context.subcomponentSeparator)[subcomponent] || '';\n }\n\n return value;\n }\n\n /**\n * Returns the HL7 field as a string.\n * @returns The HL7 field as a string.\n */\n toString(): string {\n return this.components.map((r) => r.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);\n }\n\n /**\n * Parses an HL7 field string into an Hl7Field object.\n * @param text The HL7 field text.\n * @param context Optional HL7 parsing context.\n * @returns The parsed HL7 field.\n */\n static parse(text: string, context = new Hl7Context()): Hl7Field {\n return new Hl7Field(\n text.split(context.repetitionSeparator).map((r) => r.split(context.componentSeparator)),\n context\n );\n }\n}\n\ninterface Hl7DateParseOptions {\n seconds?: boolean;\n tzOffset?: string;\n}\n\n/**\n * Returns a formatted string representing the date in ISO-8601 format.\n * @param hl7Date Date string.\n * @param options Optional configuration Object\n * @returns The date in ISO-8601 format.\n */\nexport function parseHl7Date(hl7Date: string | undefined, options?: Hl7DateParseOptions): string | undefined {\n if (!hl7Date) {\n return undefined;\n }\n\n options = { ...{ seconds: true, tzOffset: 'Z' }, ...options };\n\n const year = Number.parseInt(hl7Date.substring(0, 4));\n const month = Number.parseInt(hl7Date.substring(4, 6));\n const date = Number.parseInt(hl7Date.substring(6, 8));\n const hours = Number.parseInt(hl7Date.substring(8, 10));\n const minutes = Number.parseInt(hl7Date.substring(10, 12));\n\n const seconds = options.seconds ? Number.parseInt(hl7Date.substring(12, 14)) : 0;\n\n return `${pad2(year)}-${pad2(month)}-${pad2(date)}T${pad2(hours)}:${pad2(minutes)}:${pad2(seconds)}.000${\n options.tzOffset\n }`;\n}\n\nfunction pad2(n: number): string {\n return n.toString().padStart(2, '0');\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;;AAWG;MACU,UAAU,CAAA;AACrB,IAAA,WAAA,CACkB,mBAAmB,IAAI,EACvB,cAAiB,GAAA,GAAG,EACpB,kBAAqB,GAAA,GAAG,EACxB,mBAAA,GAAsB,GAAG,EACzB,eAAA,GAAkB,IAAI,EACtB,wBAAwB,GAAG,EAAA;QAL3B,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAO;QACvB,IAAc,CAAA,cAAA,GAAd,cAAc,CAAM;QACpB,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAM;QACxB,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAM;QACzB,IAAe,CAAA,eAAA,GAAf,eAAe,CAAO;QACtB,IAAqB,CAAA,qBAAA,GAArB,qBAAqB,CAAM;KACzC;AAEJ;;;AAGG;IACH,OAAO,GAAA;QACL,QACE,IAAI,CAAC,cAAc;AACnB,YAAA,IAAI,CAAC,kBAAkB;AACvB,YAAA,IAAI,CAAC,mBAAmB;AACxB,YAAA,IAAI,CAAC,eAAe;YACpB,IAAI,CAAC,qBAAqB,EAC1B;KACH;AACF,CAAA;AAED;;;AAGG;MACU,UAAU,CAAA;AAIrB;;;;AAIG;AACH,IAAA,WAAA,CAAY,QAAsB,EAAE,OAAO,GAAG,IAAI,UAAU,EAAE,EAAA;AAC5D,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;KAC1B;AAED;;;;AAIG;AACH,IAAA,GAAG,CAAC,KAAsB,EAAA;A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