tebra-mcp-server 0.2.0 → 0.2.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.
Files changed (167) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +21 -1
  3. package/dist/config.d.ts +0 -0
  4. package/dist/config.d.ts.map +0 -0
  5. package/dist/config.js +0 -0
  6. package/dist/config.js.map +0 -0
  7. package/dist/fhir-client.d.ts +0 -0
  8. package/dist/fhir-client.d.ts.map +0 -0
  9. package/dist/fhir-client.js +0 -0
  10. package/dist/fhir-client.js.map +0 -0
  11. package/dist/index.d.ts +0 -0
  12. package/dist/index.d.ts.map +0 -0
  13. package/dist/index.js +40 -8
  14. package/dist/index.js.map +1 -1
  15. package/dist/integrations/epic-notes-integration.d.ts +0 -0
  16. package/dist/integrations/epic-notes-integration.d.ts.map +0 -0
  17. package/dist/integrations/epic-notes-integration.js +0 -0
  18. package/dist/integrations/epic-notes-integration.js.map +0 -0
  19. package/dist/integrations/fal-integration.d.ts +0 -0
  20. package/dist/integrations/fal-integration.d.ts.map +0 -0
  21. package/dist/integrations/fal-integration.js +0 -0
  22. package/dist/integrations/fal-integration.js.map +0 -0
  23. package/dist/soap-client.d.ts +0 -0
  24. package/dist/soap-client.d.ts.map +1 -1
  25. package/dist/soap-client.js +42 -9
  26. package/dist/soap-client.js.map +1 -1
  27. package/dist/tools/appointment-crud.d.ts +0 -0
  28. package/dist/tools/appointment-crud.d.ts.map +0 -0
  29. package/dist/tools/appointment-crud.js +0 -0
  30. package/dist/tools/appointment-crud.js.map +0 -0
  31. package/dist/tools/appointment-detail.d.ts +0 -0
  32. package/dist/tools/appointment-detail.d.ts.map +0 -0
  33. package/dist/tools/appointment-detail.js +0 -0
  34. package/dist/tools/appointment-detail.js.map +0 -0
  35. package/dist/tools/appointment-reasons.d.ts +0 -0
  36. package/dist/tools/appointment-reasons.d.ts.map +0 -0
  37. package/dist/tools/appointment-reasons.js +0 -0
  38. package/dist/tools/appointment-reasons.js.map +0 -0
  39. package/dist/tools/appointments.d.ts +0 -0
  40. package/dist/tools/appointments.d.ts.map +0 -0
  41. package/dist/tools/appointments.js +0 -0
  42. package/dist/tools/appointments.js.map +0 -0
  43. package/dist/tools/authorizations.d.ts +0 -0
  44. package/dist/tools/authorizations.d.ts.map +0 -0
  45. package/dist/tools/authorizations.js +0 -0
  46. package/dist/tools/authorizations.js.map +0 -0
  47. package/dist/tools/bulk-patients.d.ts +0 -0
  48. package/dist/tools/bulk-patients.d.ts.map +0 -0
  49. package/dist/tools/bulk-patients.js +0 -0
  50. package/dist/tools/bulk-patients.js.map +0 -0
  51. package/dist/tools/charges.d.ts +0 -0
  52. package/dist/tools/charges.d.ts.map +0 -0
  53. package/dist/tools/charges.js +0 -0
  54. package/dist/tools/charges.js.map +0 -0
  55. package/dist/tools/documents.d.ts +0 -0
  56. package/dist/tools/documents.d.ts.map +0 -0
  57. package/dist/tools/documents.js +0 -0
  58. package/dist/tools/documents.js.map +0 -0
  59. package/dist/tools/eligibility.d.ts +0 -0
  60. package/dist/tools/eligibility.d.ts.map +0 -0
  61. package/dist/tools/eligibility.js +0 -0
  62. package/dist/tools/eligibility.js.map +0 -0
  63. package/dist/tools/encounter-status.d.ts +0 -0
  64. package/dist/tools/encounter-status.d.ts.map +0 -0
  65. package/dist/tools/encounter-status.js +0 -0
  66. package/dist/tools/encounter-status.js.map +0 -0
  67. package/dist/tools/encounters.d.ts +0 -0
  68. package/dist/tools/encounters.d.ts.map +0 -0
  69. package/dist/tools/encounters.js +0 -0
  70. package/dist/tools/encounters.js.map +0 -0
  71. package/dist/tools/external-ids.d.ts +0 -0
  72. package/dist/tools/external-ids.d.ts.map +0 -0
  73. package/dist/tools/external-ids.js +0 -0
  74. package/dist/tools/external-ids.js.map +0 -0
  75. package/dist/tools/fhir/allergies.d.ts +24 -0
  76. package/dist/tools/fhir/allergies.d.ts.map +1 -0
  77. package/dist/tools/fhir/allergies.js +52 -0
  78. package/dist/tools/fhir/allergies.js.map +1 -0
  79. package/dist/tools/fhir/care-plans.d.ts +29 -0
  80. package/dist/tools/fhir/care-plans.d.ts.map +1 -0
  81. package/dist/tools/fhir/care-plans.js +61 -0
  82. package/dist/tools/fhir/care-plans.js.map +1 -0
  83. package/dist/tools/fhir/care-team.d.ts +24 -0
  84. package/dist/tools/fhir/care-team.d.ts.map +1 -0
  85. package/dist/tools/fhir/care-team.js +47 -0
  86. package/dist/tools/fhir/care-team.js.map +1 -0
  87. package/dist/tools/fhir/conditions.d.ts +29 -0
  88. package/dist/tools/fhir/conditions.d.ts.map +1 -0
  89. package/dist/tools/fhir/conditions.js +57 -0
  90. package/dist/tools/fhir/conditions.js.map +1 -0
  91. package/dist/tools/fhir/devices.d.ts +24 -0
  92. package/dist/tools/fhir/devices.d.ts.map +1 -0
  93. package/dist/tools/fhir/devices.js +48 -0
  94. package/dist/tools/fhir/devices.js.map +1 -0
  95. package/dist/tools/fhir/diagnostic-reports.d.ts +29 -0
  96. package/dist/tools/fhir/diagnostic-reports.d.ts.map +1 -0
  97. package/dist/tools/fhir/diagnostic-reports.js +58 -0
  98. package/dist/tools/fhir/diagnostic-reports.js.map +1 -0
  99. package/dist/tools/fhir/documents.d.ts +30 -0
  100. package/dist/tools/fhir/documents.d.ts.map +1 -0
  101. package/dist/tools/fhir/documents.js +61 -0
  102. package/dist/tools/fhir/documents.js.map +1 -0
  103. package/dist/tools/fhir/helpers.d.ts +37 -0
  104. package/dist/tools/fhir/helpers.d.ts.map +1 -0
  105. package/dist/tools/fhir/helpers.js +113 -0
  106. package/dist/tools/fhir/helpers.js.map +1 -0
  107. package/dist/tools/fhir/immunizations.d.ts +24 -0
  108. package/dist/tools/fhir/immunizations.d.ts.map +1 -0
  109. package/dist/tools/fhir/immunizations.js +46 -0
  110. package/dist/tools/fhir/immunizations.js.map +1 -0
  111. package/dist/tools/fhir/lab-results.d.ts +36 -0
  112. package/dist/tools/fhir/lab-results.d.ts.map +1 -0
  113. package/dist/tools/fhir/lab-results.js +53 -0
  114. package/dist/tools/fhir/lab-results.js.map +1 -0
  115. package/dist/tools/fhir/medications.d.ts +29 -0
  116. package/dist/tools/fhir/medications.d.ts.map +1 -0
  117. package/dist/tools/fhir/medications.js +55 -0
  118. package/dist/tools/fhir/medications.js.map +1 -0
  119. package/dist/tools/fhir/procedures.d.ts +32 -0
  120. package/dist/tools/fhir/procedures.d.ts.map +1 -0
  121. package/dist/tools/fhir/procedures.js +60 -0
  122. package/dist/tools/fhir/procedures.js.map +1 -0
  123. package/dist/tools/fhir/vitals.d.ts +32 -0
  124. package/dist/tools/fhir/vitals.d.ts.map +1 -0
  125. package/dist/tools/fhir/vitals.js +47 -0
  126. package/dist/tools/fhir/vitals.js.map +1 -0
  127. package/dist/tools/fhir-clinical.d.ts +0 -0
  128. package/dist/tools/fhir-clinical.d.ts.map +0 -0
  129. package/dist/tools/fhir-clinical.js +0 -0
  130. package/dist/tools/fhir-clinical.js.map +0 -0
  131. package/dist/tools/patient-crud.d.ts +0 -0
  132. package/dist/tools/patient-crud.d.ts.map +0 -0
  133. package/dist/tools/patient-crud.js +0 -0
  134. package/dist/tools/patient-crud.js.map +0 -0
  135. package/dist/tools/patients.d.ts +0 -0
  136. package/dist/tools/patients.d.ts.map +0 -0
  137. package/dist/tools/patients.js +0 -0
  138. package/dist/tools/patients.js.map +0 -0
  139. package/dist/tools/payments.d.ts +0 -0
  140. package/dist/tools/payments.d.ts.map +0 -0
  141. package/dist/tools/payments.js +0 -0
  142. package/dist/tools/payments.js.map +0 -0
  143. package/dist/tools/practices.d.ts +0 -0
  144. package/dist/tools/practices.d.ts.map +0 -0
  145. package/dist/tools/practices.js +0 -0
  146. package/dist/tools/practices.js.map +0 -0
  147. package/dist/tools/procedure-codes.d.ts +0 -0
  148. package/dist/tools/procedure-codes.d.ts.map +0 -0
  149. package/dist/tools/procedure-codes.js +0 -0
  150. package/dist/tools/procedure-codes.js.map +0 -0
  151. package/dist/tools/providers.d.ts +0 -0
  152. package/dist/tools/providers.d.ts.map +0 -0
  153. package/dist/tools/providers.js +0 -0
  154. package/dist/tools/providers.js.map +0 -0
  155. package/dist/tools/service-locations.d.ts +0 -0
  156. package/dist/tools/service-locations.d.ts.map +0 -0
  157. package/dist/tools/service-locations.js +0 -0
  158. package/dist/tools/service-locations.js.map +0 -0
  159. package/dist/tools/system.d.ts +0 -0
  160. package/dist/tools/system.d.ts.map +0 -0
  161. package/dist/tools/system.js +0 -0
  162. package/dist/tools/system.js.map +0 -0
  163. package/dist/tools/transactions.d.ts +0 -0
  164. package/dist/tools/transactions.d.ts.map +0 -0
  165. package/dist/tools/transactions.js +0 -0
  166. package/dist/tools/transactions.js.map +0 -0
  167. package/package.json +61 -60
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR CarePlan — patient care plans with activities and goals.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirCarePlanTools = void 0;
7
+ exports.handleFhirCarePlanTool = handleFhirCarePlanTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirCarePlanTools = [
10
+ {
11
+ name: 'tebra_fhir_get_care_plans',
12
+ description: 'Get patient care plans from Tebra FHIR API. Returns plan title, status, activities, and goals.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ status: {
21
+ type: 'string',
22
+ enum: ['active', 'completed', 'draft', 'revoked'],
23
+ description: 'Filter by care plan status',
24
+ },
25
+ },
26
+ required: ['patientId'],
27
+ },
28
+ },
29
+ ];
30
+ function summarize(r) {
31
+ return {
32
+ id: r.id,
33
+ title: r.title,
34
+ status: r.status,
35
+ intent: r.intent,
36
+ category: Array.isArray(r.category)
37
+ ? r.category.map((c) => (0, helpers_js_1.codeDisplay)(c))
38
+ : [],
39
+ period: r.period,
40
+ activities: Array.isArray(r.activity)
41
+ ? r.activity.map((a) => ({
42
+ description: a.detail?.description,
43
+ code: (0, helpers_js_1.codeDisplay)(a.detail?.code),
44
+ status: a.detail?.status,
45
+ }))
46
+ : [],
47
+ };
48
+ }
49
+ async function handleFhirCarePlanTool(_name, args) {
50
+ const config = (0, helpers_js_1.getFhirConfig)();
51
+ const patientId = String(args.patientId ?? '');
52
+ if (!patientId)
53
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
54
+ const params = { patient: patientId };
55
+ if (args.status)
56
+ params.status = String(args.status);
57
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'CarePlan', params);
58
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
59
+ return (0, helpers_js_1.formatFhirResult)(resources, 'care plans', summarize);
60
+ }
61
+ //# sourceMappingURL=care-plans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"care-plans.js","sourceRoot":"","sources":["../../../src/tools/fhir/care-plans.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAsDH,wDAcC;AAlED,6CAOsB;AAET,QAAA,iBAAiB,GAAG;IAC/B;QACE,IAAI,EAAE,2BAA2B;QACjC,WAAW,EACT,gGAAgG;QAClG,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC;oBACjD,WAAW,EAAE,4BAA4B;iBAC1C;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC;AAEF,SAAS,SAAS,CAAC,CAAe;IAChC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,QAAQ,EAAE,KAAK,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sB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * FHIR CareTeam — patient care team members and roles.
3
+ */
4
+ export declare const fhirCareTeamTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ };
15
+ required: string[];
16
+ };
17
+ }[];
18
+ export declare function handleFhirCareTeamTool(_name: string, args: Record<string, unknown>): Promise<{
19
+ content: Array<{
20
+ type: string;
21
+ text: string;
22
+ }>;
23
+ }>;
24
+ //# sourceMappingURL=care-team.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"care-team.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/care-team.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;GAgB7B,CAAC;AAgBF,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAQ7D"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR CareTeam — patient care team members and roles.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirCareTeamTools = void 0;
7
+ exports.handleFhirCareTeamTool = handleFhirCareTeamTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirCareTeamTools = [
10
+ {
11
+ name: 'tebra_fhir_get_care_team',
12
+ description: 'Get patient care team from Tebra FHIR API. Returns team members with roles.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ },
21
+ required: ['patientId'],
22
+ },
23
+ },
24
+ ];
25
+ function summarize(r) {
26
+ return {
27
+ id: r.id,
28
+ name: r.name,
29
+ status: r.status,
30
+ participants: Array.isArray(r.participant)
31
+ ? r.participant.map((p) => ({
32
+ role: p.role?.map((role) => (0, helpers_js_1.codeDisplay)(role)),
33
+ member: (0, helpers_js_1.refDisplay)(p.member),
34
+ }))
35
+ : [],
36
+ };
37
+ }
38
+ async function handleFhirCareTeamTool(_name, args) {
39
+ const config = (0, helpers_js_1.getFhirConfig)();
40
+ const patientId = String(args.patientId ?? '');
41
+ if (!patientId)
42
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
43
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'CareTeam', { patient: patientId });
44
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
45
+ return (0, helpers_js_1.formatFhirResult)(resources, 'care team records', summarize);
46
+ }
47
+ //# sourceMappingURL=care-team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"care-team.js","sourceRoot":"","sources":["../../../src/tools/fhir/care-team.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA4CH,wDAWC;AArDD,6CAQsB;AAET,QAAA,iBAAiB,GAAG;IAC/B;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,6EAA6E;QAC/E,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC;AAEF,SAAS,SAAS,CAAC,CAAe;IAChC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;YACxC,CAAC,CAAE,CAAC,CAAC,WAA6D,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC3E,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAa,EAAE,EAAE,CAAC,IAAA,wBAAW,EAAC,IAAI,CAAC,CAAC;gBACvD,MAAM,EAAE,IAAA,uBAAU,EAAC,CAAC,CAAC,MAAM,CAAC;aAC7B,CAAC,CAAC;YACL,CAAC,CAAC,EAAE;KACP,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,KAAa,EACb,IAA6B;IAE7B,MAAM,MAAM,GAAG,IAAA,0BAAa,GAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,EAAE,CAAC;IAEvF,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAW,EAAC,MAAM,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * FHIR Condition — patient diagnoses / problem list.
3
+ */
4
+ export declare const fhirConditionTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ clinicalStatus: {
15
+ type: string;
16
+ enum: string[];
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ };
22
+ }[];
23
+ export declare function handleFhirConditionTool(_name: string, args: Record<string, unknown>): Promise<{
24
+ content: Array<{
25
+ type: string;
26
+ text: string;
27
+ }>;
28
+ }>;
29
+ //# sourceMappingURL=conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/conditions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;GAqB9B,CAAC;AAkBF,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAW7D"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR Condition — patient diagnoses / problem list.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirConditionTools = void 0;
7
+ exports.handleFhirConditionTool = handleFhirConditionTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirConditionTools = [
10
+ {
11
+ name: 'tebra_fhir_get_conditions',
12
+ description: 'Get patient conditions/diagnoses from Tebra FHIR API. Returns condition name, ICD code, clinical status, and onset date.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ clinicalStatus: {
21
+ type: 'string',
22
+ enum: ['active', 'resolved', 'inactive'],
23
+ description: 'Filter by clinical status',
24
+ },
25
+ },
26
+ required: ['patientId'],
27
+ },
28
+ },
29
+ ];
30
+ function summarize(r) {
31
+ return {
32
+ id: r.id,
33
+ condition: (0, helpers_js_1.codeDisplay)(r.code),
34
+ code: (0, helpers_js_1.codeValue)(r.code),
35
+ clinicalStatus: (0, helpers_js_1.codeDisplay)(r.clinicalStatus),
36
+ verificationStatus: (0, helpers_js_1.codeDisplay)(r.verificationStatus),
37
+ category: Array.isArray(r.category)
38
+ ? r.category.map((c) => (0, helpers_js_1.codeDisplay)(c))
39
+ : [],
40
+ onsetDateTime: r.onsetDateTime,
41
+ abatementDateTime: r.abatementDateTime,
42
+ recordedDate: r.recordedDate,
43
+ };
44
+ }
45
+ async function handleFhirConditionTool(_name, args) {
46
+ const config = (0, helpers_js_1.getFhirConfig)();
47
+ const patientId = String(args.patientId ?? '');
48
+ if (!patientId)
49
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
50
+ const params = { patient: patientId };
51
+ if (args.clinicalStatus)
52
+ params['clinical-status'] = String(args.clinicalStatus);
53
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'Condition', params);
54
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
55
+ return (0, helpers_js_1.formatFhirResult)(resources, 'conditions', summarize);
56
+ }
57
+ //# sourceMappingURL=conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../src/tools/fhir/conditions.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAmDH,0DAcC;AA/DD,6CAQsB;AAET,QAAA,kBAAkB,GAAG;IAChC;QACE,IAAI,EAAE,2BAA2B;QACjC,WAAW,EACT,0HAA0H;QAC5H,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC;oBACxC,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,WAA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AM,IAAA,wBAAW,EAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * FHIR Device — patient-associated implantable / wearable devices.
3
+ */
4
+ export declare const fhirDeviceTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ };
15
+ required: string[];
16
+ };
17
+ }[];
18
+ export declare function handleFhirDeviceTool(_name: string, args: Record<string, unknown>): Promise<{
19
+ content: Array<{
20
+ type: string;
21
+ text: string;
22
+ }>;
23
+ }>;
24
+ //# sourceMappingURL=devices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/devices.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,eAAe;;;;;;;;;;;;;GAgB3B,CAAC;AAiBF,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAQ7D"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR Device — patient-associated implantable / wearable devices.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirDeviceTools = void 0;
7
+ exports.handleFhirDeviceTool = handleFhirDeviceTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirDeviceTools = [
10
+ {
11
+ name: 'tebra_fhir_get_devices',
12
+ description: 'Get patient-associated devices from Tebra FHIR API. Returns device type, manufacturer, model, and UDI.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ },
21
+ required: ['patientId'],
22
+ },
23
+ },
24
+ ];
25
+ function summarize(r) {
26
+ return {
27
+ id: r.id,
28
+ type: (0, helpers_js_1.codeDisplay)(r.type),
29
+ status: r.status,
30
+ manufacturer: r.manufacturer,
31
+ model: r.modelNumber,
32
+ serialNumber: r.serialNumber,
33
+ patient: (0, helpers_js_1.refDisplay)(r.patient),
34
+ udiCarrier: Array.isArray(r.udiCarrier)
35
+ ? r.udiCarrier.map((u) => u.deviceIdentifier)
36
+ : [],
37
+ };
38
+ }
39
+ async function handleFhirDeviceTool(_name, args) {
40
+ const config = (0, helpers_js_1.getFhirConfig)();
41
+ const patientId = String(args.patientId ?? '');
42
+ if (!patientId)
43
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
44
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'Device', { patient: patientId });
45
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
46
+ return (0, helpers_js_1.formatFhirResult)(resources, 'devices', summarize);
47
+ }
48
+ //# sourceMappingURL=devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.js","sourceRoot":"","sources":["../../../src/tools/fhir/devices.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA6CH,oDAWC;AAtDD,6CAQsB;AAET,QAAA,eAAe,GAAG;IAC7B;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EACT,wGAAwG;QAC1G,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB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ostic reports (LAB / RAD / PATH).
3
+ */
4
+ export declare const fhirDiagnosticReportTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ category: {
15
+ type: string;
16
+ enum: string[];
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ };
22
+ }[];
23
+ export declare function handleFhirDiagnosticReportTool(_name: string, args: Record<string, unknown>): Promise<{
24
+ content: Array<{
25
+ type: string;
26
+ text: string;
27
+ }>;
28
+ }>;
29
+ //# sourceMappingURL=diagnostic-reports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic-reports.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/diagnostic-reports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;GAqBrC,CAAC;AAmBF,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAW7D"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR DiagnosticReport — patient diagnostic reports (LAB / RAD / PATH).
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirDiagnosticReportTools = void 0;
7
+ exports.handleFhirDiagnosticReportTool = handleFhirDiagnosticReportTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirDiagnosticReportTools = [
10
+ {
11
+ name: 'tebra_fhir_get_diagnostic_reports',
12
+ description: 'Get patient diagnostic reports from Tebra FHIR API. Returns report type, status, conclusion, and linked results.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ category: {
21
+ type: 'string',
22
+ enum: ['LAB', 'RAD', 'PATH'],
23
+ description: 'Filter by category: LAB=Laboratory, RAD=Radiology, PATH=Pathology',
24
+ },
25
+ },
26
+ required: ['patientId'],
27
+ },
28
+ },
29
+ ];
30
+ function summarize(r) {
31
+ return {
32
+ id: r.id,
33
+ type: (0, helpers_js_1.codeDisplay)(r.code),
34
+ status: r.status,
35
+ category: Array.isArray(r.category)
36
+ ? r.category.map((c) => (0, helpers_js_1.codeDisplay)(c))
37
+ : [],
38
+ effectiveDateTime: r.effectiveDateTime,
39
+ issued: r.issued,
40
+ conclusion: r.conclusion,
41
+ results: Array.isArray(r.result)
42
+ ? r.result.map((res) => (0, helpers_js_1.refDisplay)(res))
43
+ : [],
44
+ };
45
+ }
46
+ async function handleFhirDiagnosticReportTool(_name, args) {
47
+ const config = (0, helpers_js_1.getFhirConfig)();
48
+ const patientId = String(args.patientId ?? '');
49
+ if (!patientId)
50
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
51
+ const params = { patient: patientId };
52
+ if (args.category)
53
+ params.category = String(args.category);
54
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'DiagnosticReport', params);
55
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
56
+ return (0, helpers_js_1.formatFhirResult)(resources, 'diagnostic reports', summarize);
57
+ }
58
+ //# sourceMappingURL=diagnostic-reports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic-reports.js","sourceRoot":"","sources":["../../../src/tools/fhir/diagnostic-reports.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAoDH,wEAcC;AAhED,6CAQsB;AAET,QAAA,yBAAyB,GAAG;IACvC;QACE,IAAI,EAAE,mCAAmC;QACzC,WAAW,EACT,kHAAkH;QACpH,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oB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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,EAAE,CAAC;IAEvF,MAAM,MAAM,GAA2B,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAC9D,IAAI,IAAI,CAAC,QAAQ;QAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE3D,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAW,EAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * FHIR DocumentReference — clinical documents (notes, reports, scanned items).
3
+ *
4
+ * Distinct from src/tools/documents.ts (SOAP create/delete document attachments).
5
+ */
6
+ export declare const fhirDocumentTools: {
7
+ name: string;
8
+ description: string;
9
+ inputSchema: {
10
+ type: "object";
11
+ properties: {
12
+ patientId: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ type: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ };
21
+ required: string[];
22
+ };
23
+ }[];
24
+ export declare function handleFhirDocumentTool(_name: string, args: Record<string, unknown>): Promise<{
25
+ content: Array<{
26
+ type: string;
27
+ text: string;
28
+ }>;
29
+ }>;
30
+ //# sourceMappingURL=documents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/documents.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;GAoB7B,CAAC;AAqBF,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAW7D"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR DocumentReference — clinical documents (notes, reports, scanned items).
4
+ *
5
+ * Distinct from src/tools/documents.ts (SOAP create/delete document attachments).
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.fhirDocumentTools = void 0;
9
+ exports.handleFhirDocumentTool = handleFhirDocumentTool;
10
+ const helpers_js_1 = require("./helpers.js");
11
+ exports.fhirDocumentTools = [
12
+ {
13
+ name: 'tebra_fhir_get_documents',
14
+ description: 'Get patient document references from Tebra FHIR API. Returns document type, author, date, and content metadata.',
15
+ inputSchema: {
16
+ type: 'object',
17
+ properties: {
18
+ patientId: {
19
+ type: 'string',
20
+ description: 'Tebra FHIR patient ID',
21
+ },
22
+ type: {
23
+ type: 'string',
24
+ description: 'Document type code filter',
25
+ },
26
+ },
27
+ required: ['patientId'],
28
+ },
29
+ },
30
+ ];
31
+ function summarize(r) {
32
+ return {
33
+ id: r.id,
34
+ type: (0, helpers_js_1.codeDisplay)(r.type),
35
+ status: r.status,
36
+ date: r.date,
37
+ description: r.description,
38
+ author: Array.isArray(r.author)
39
+ ? r.author.map((a) => (0, helpers_js_1.refDisplay)(a))
40
+ : [],
41
+ contentTypes: Array.isArray(r.content)
42
+ ? r.content.map((c) => ({
43
+ contentType: c.attachment?.contentType,
44
+ title: c.attachment?.title,
45
+ }))
46
+ : [],
47
+ };
48
+ }
49
+ async function handleFhirDocumentTool(_name, args) {
50
+ const config = (0, helpers_js_1.getFhirConfig)();
51
+ const patientId = String(args.patientId ?? '');
52
+ if (!patientId)
53
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
54
+ const params = { patient: patientId };
55
+ if (args.type)
56
+ params.type = String(args.type);
57
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'DocumentReference', params);
58
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
59
+ return (0, helpers_js_1.formatFhirResult)(resources, 'documents', summarize);
60
+ }
61
+ //# sourceMappingURL=documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents.js","sourceRoot":"","sources":["../../../src/tools/fhir/documents.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAqDH,wDAcC;AAjED,6CAQsB;AAET,QAAA,iBAAiB,GAAG;IAC/B;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,iHAAiH;QACnH,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC;AAEF,SAAS,SAAS,CAAC,CAAe;IAChC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,IAAA,wBAAW,EAAC,CAAC,CAAC,IAAI,CAAC;QACzB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7B,CAAC,CAAE,CAAC,CAAC,MAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,CAAC,CAAC,CAAC;YACnD,CAAC,CAAC,EAAE;QACN,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;YACpC,CAAC,CAAE,CAAC,CAAC,OAA4E,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC1F,WAAW,EAAE,CAAC,CAAC,UAAU,EAAE,WAAW;gBACtC,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,KAAK;aAC3B,CAAC,CAAC;YACL,CAAC,CAAC,EAAE;KACP,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,KAAa,EACb,IAA6B;IAE7B,MAAM,MAAM,GAAG,IAAA,0BAAa,GAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,EAAE,CAAC;IAEvF,MAAM,MAAM,GAA2B,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAC9D,IAAI,IAAI,CAAC,IAAI;QAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/C,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAW,EAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Shared FHIR primitives used by every per-resource tool module.
3
+ *
4
+ * Per-resource files (allergies.ts, medications.ts, ...) import from here
5
+ * for Bundle parsing, code/reference extraction, date-range params, the
6
+ * MCP result formatter, and the Observation summarizer (shared by vitals
7
+ * and lab-results).
8
+ */
9
+ import { fhirRequest, getFhirConfig } from '../../fhir-client.js';
10
+ export interface FhirResource {
11
+ resourceType: string;
12
+ [key: string]: unknown;
13
+ }
14
+ export interface FhirBundleEntry {
15
+ resource?: FhirResource;
16
+ [key: string]: unknown;
17
+ }
18
+ export interface FhirBundle {
19
+ resourceType: string;
20
+ total?: number;
21
+ entry?: FhirBundleEntry[];
22
+ [key: string]: unknown;
23
+ }
24
+ export declare function extractBundleResources(bundle: unknown): FhirResource[];
25
+ export declare function codeDisplay(concept: unknown): string;
26
+ export declare function codeValue(concept: unknown): string;
27
+ export declare function refDisplay(ref: unknown): string;
28
+ export declare function addDateRange(params: Record<string, string>, args: Record<string, unknown>): void;
29
+ export declare function formatFhirResult(resources: FhirResource[], label: string, summarizer: (r: FhirResource) => Record<string, unknown>): {
30
+ content: Array<{
31
+ type: string;
32
+ text: string;
33
+ }>;
34
+ };
35
+ export declare function summarizeObservation(r: FhirResource): Record<string, unknown>;
36
+ export { fhirRequest, getFhirConfig };
37
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,EAAE,CAMtE;AAED,wBAAgB,WAA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