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,113 @@
1
+ "use strict";
2
+ /**
3
+ * Shared FHIR primitives used by every per-resource tool module.
4
+ *
5
+ * Per-resource files (allergies.ts, medications.ts, ...) import from here
6
+ * for Bundle parsing, code/reference extraction, date-range params, the
7
+ * MCP result formatter, and the Observation summarizer (shared by vitals
8
+ * and lab-results).
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.getFhirConfig = exports.fhirRequest = void 0;
12
+ exports.extractBundleResources = extractBundleResources;
13
+ exports.codeDisplay = codeDisplay;
14
+ exports.codeValue = codeValue;
15
+ exports.refDisplay = refDisplay;
16
+ exports.addDateRange = addDateRange;
17
+ exports.formatFhirResult = formatFhirResult;
18
+ exports.summarizeObservation = summarizeObservation;
19
+ const fhir_client_js_1 = require("../../fhir-client.js");
20
+ Object.defineProperty(exports, "fhirRequest", { enumerable: true, get: function () { return fhir_client_js_1.fhirRequest; } });
21
+ Object.defineProperty(exports, "getFhirConfig", { enumerable: true, get: function () { return fhir_client_js_1.getFhirConfig; } });
22
+ function extractBundleResources(bundle) {
23
+ const b = bundle;
24
+ if (!b?.entry || !Array.isArray(b.entry))
25
+ return [];
26
+ return b.entry
27
+ .filter((e) => e.resource)
28
+ .map((e) => e.resource);
29
+ }
30
+ function codeDisplay(concept) {
31
+ if (!concept || typeof concept !== 'object')
32
+ return '';
33
+ const c = concept;
34
+ if (c.text)
35
+ return c.text;
36
+ if (c.coding?.[0]?.display)
37
+ return c.coding[0].display;
38
+ if (c.coding?.[0]?.code)
39
+ return c.coding[0].code;
40
+ return '';
41
+ }
42
+ function codeValue(concept) {
43
+ if (!concept || typeof concept !== 'object')
44
+ return '';
45
+ const c = concept;
46
+ return c.coding?.[0]?.code ?? '';
47
+ }
48
+ function refDisplay(ref) {
49
+ if (!ref || typeof ref !== 'object')
50
+ return '';
51
+ const r = ref;
52
+ return r.display ?? r.reference ?? '';
53
+ }
54
+ function addDateRange(params, args) {
55
+ if (args.fromDate)
56
+ params.date = `ge${String(args.fromDate)}`;
57
+ if (args.toDate) {
58
+ if (params.date) {
59
+ params.date = `${params.date}&date=le${String(args.toDate)}`;
60
+ }
61
+ else {
62
+ params.date = `le${String(args.toDate)}`;
63
+ }
64
+ }
65
+ }
66
+ function formatFhirResult(resources, label, summarizer) {
67
+ if (resources.length === 0) {
68
+ return {
69
+ content: [{ type: 'text', text: `No ${label} found for this patient.` }],
70
+ };
71
+ }
72
+ const summarized = resources.map(summarizer);
73
+ return {
74
+ content: [{ type: 'text', text: JSON.stringify(summarized, null, 2) }],
75
+ };
76
+ }
77
+ function summarizeObservation(r) {
78
+ const result = {
79
+ id: r.id,
80
+ type: codeDisplay(r.code),
81
+ code: codeValue(r.code),
82
+ status: r.status,
83
+ effectiveDateTime: r.effectiveDateTime,
84
+ issued: r.issued,
85
+ };
86
+ if (r.valueQuantity) {
87
+ const vq = r.valueQuantity;
88
+ result.value = vq.value;
89
+ result.unit = vq.unit;
90
+ }
91
+ else if (r.valueCodeableConcept) {
92
+ result.value = codeDisplay(r.valueCodeableConcept);
93
+ }
94
+ else if (r.valueString) {
95
+ result.value = r.valueString;
96
+ }
97
+ if (Array.isArray(r.referenceRange)) {
98
+ result.referenceRange = r.referenceRange.map((rr) => ({
99
+ low: rr.low ? `${rr.low.value} ${rr.low.unit ?? ''}`.trim() : undefined,
100
+ high: rr.high ? `${rr.high.value} ${rr.high.unit ?? ''}`.trim() : undefined,
101
+ text: rr.text,
102
+ }));
103
+ }
104
+ if (Array.isArray(r.component)) {
105
+ result.components = r.component.map((comp) => ({
106
+ type: codeDisplay(comp.code),
107
+ value: comp.valueQuantity?.value,
108
+ unit: comp.valueQuantity?.unit,
109
+ }));
110
+ }
111
+ return result;
112
+ }
113
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/tools/fhir/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAqBH,wDAMC;AAED,kCAOC;AAED,8BAIC;AAED,gCAIC;AAED,oCAYC;AAED,4CAeC;AAED,oDA4CC;AA3HD,yDAAkE;AA6HzD,4FA7HA,4BAAW,OA6HA;AAAE,8FA7HA,8BAAa,OA6HA;AA1GnC,SAAgB,sBAAsB,CAAC,MAAe;IACpD,MAAM,CAAC,GAAG,MAAoB,CAAC;IAC/B,IAAI,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACpD,OAAO,CAAC,CAAC,KAAK;SACX,MAAM,CAAC,CAAC,CAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;SAC1C,GAAG,CAAC,CAAC,CAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,QAAwB,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,WAAW,CAAC,OAAgB;IAC1C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACvD,MAAM,CAAC,GAAG,OAAiF,CAAC;IAC5F,IAAI,CAAC,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC1B,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAA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CAAC,WAAW,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC;QACpC,MAAM,CAAC,cAAc,GAAI,CAAC,CAAC,cAIxB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACf,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;YACvE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;YAC3E,IAAI,EAAE,EAAE,CAAC,IAAI;SACd,CAAC,CAAC,CAAC;IACN,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,MAAM,CAAC,UAAU,GAAI,CAAC,CAAC,SAGpB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACjB,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK;YAChC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI;SAC/B,CAAC,CAAC,CAAC;IACN,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * FHIR Immunization — patient immunization history.
3
+ */
4
+ export declare const fhirImmunizationTools: {
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 handleFhirImmunizationTool(_name: string, args: Record<string, unknown>): Promise<{
19
+ content: Array<{
20
+ type: string;
21
+ text: string;
22
+ }>;
23
+ }>;
24
+ //# sourceMappingURL=immunizations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"immunizations.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/immunizations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;GAgBjC,CAAC;AAeF,wBAAsB,0BAA0B,CAC9C,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,46 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR Immunization — patient immunization history.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirImmunizationTools = void 0;
7
+ exports.handleFhirImmunizationTool = handleFhirImmunizationTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirImmunizationTools = [
10
+ {
11
+ name: 'tebra_fhir_get_immunizations',
12
+ description: 'Get patient immunization history from Tebra FHIR API. Returns vaccine name, date administered, and status.',
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
+ vaccine: (0, helpers_js_1.codeDisplay)(r.vaccineCode),
29
+ status: r.status,
30
+ occurrenceDateTime: r.occurrenceDateTime,
31
+ primarySource: r.primarySource,
32
+ performer: Array.isArray(r.performer)
33
+ ? r.performer.map((p) => (0, helpers_js_1.refDisplay)(p.actor))
34
+ : [],
35
+ };
36
+ }
37
+ async function handleFhirImmunizationTool(_name, args) {
38
+ const config = (0, helpers_js_1.getFhirConfig)();
39
+ const patientId = String(args.patientId ?? '');
40
+ if (!patientId)
41
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
42
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'Immunization', { patient: patientId });
43
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
44
+ return (0, helpers_js_1.formatFhirResult)(resources, 'immunizations', summarize);
45
+ }
46
+ //# sourceMappingURL=immunizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"immunizations.js","sourceRoot":"","sources":["../../../src/tools/fhir/immunizations.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA2CH,gEAWC;AApDD,6CAQsB;AAET,QAAA,qBAAqB,GAAG;IACnC;QACE,IAAI,EAAE,8BAA8B;QACpC,WAAW,EACT,4GAA4G;QAC9G,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,OAAO,EAAE,IAAA,wBAAW,EAAC,CAAC,CAAC,WAAW,CAAC;QACnC,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,kBAAkB,EAAE,CAAC,CAAC,kBAAkB;QACxC,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YACnC,CAAC,CAAE,CAAC,CAAC,SAAwC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7E,CAAC,CAAC,EAAE;KACP,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,0BAA0B,CAC9C,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,cAAc,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC/E,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * FHIR Observation (laboratory category) — lab results with reference ranges.
3
+ */
4
+ export declare const fhirLabResultsTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ fromDate: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ toDate: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ code: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ };
27
+ required: string[];
28
+ };
29
+ }[];
30
+ export declare function handleFhirLabResultsTool(_name: string, args: Record<string, unknown>): Promise<{
31
+ content: Array<{
32
+ type: string;
33
+ text: string;
34
+ }>;
35
+ }>;
36
+ //# sourceMappingURL=lab-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lab-results.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/lab-results.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;GA4B/B,CAAC;AAEF,wBAAsB,wBAAwB,CAC5C,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,CAe7D"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR Observation (laboratory category) — lab results with reference ranges.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirLabResultsTools = void 0;
7
+ exports.handleFhirLabResultsTool = handleFhirLabResultsTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirLabResultsTools = [
10
+ {
11
+ name: 'tebra_fhir_get_lab_results',
12
+ description: 'Get patient laboratory results from Tebra FHIR API. Returns test name, value, units, reference ranges.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ fromDate: {
21
+ type: 'string',
22
+ description: 'Date range start (YYYY-MM-DD)',
23
+ },
24
+ toDate: {
25
+ type: 'string',
26
+ description: 'Date range end (YYYY-MM-DD)',
27
+ },
28
+ code: {
29
+ type: 'string',
30
+ description: 'LOINC code to filter by',
31
+ },
32
+ },
33
+ required: ['patientId'],
34
+ },
35
+ },
36
+ ];
37
+ async function handleFhirLabResultsTool(_name, args) {
38
+ const config = (0, helpers_js_1.getFhirConfig)();
39
+ const patientId = String(args.patientId ?? '');
40
+ if (!patientId)
41
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
42
+ const params = {
43
+ patient: patientId,
44
+ category: 'laboratory',
45
+ };
46
+ (0, helpers_js_1.addDateRange)(params, args);
47
+ if (args.code)
48
+ params.code = String(args.code);
49
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'Observation', params);
50
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
51
+ return (0, helpers_js_1.formatFhirResult)(resources, 'lab results', helpers_js_1.summarizeObservation);
52
+ }
53
+ //# sourceMappingURL=lab-results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lab-results.js","sourceRoot":"","sources":["../../../src/tools/fhir/lab-results.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAyCH,4DAkBC;AAzDD,6CAOsB;AAET,QAAA,mBAAmB,GAAG;IACjC;QACE,IAAI,EAAE,4BAA4B;QAClC,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;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6BAA6B;iBAC3C;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACvC;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC;AAEK,KAAK,UAAU,wBAAwB,CAC5C,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;QACrC,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,YAAY;KACvB,CAAC;IACF,IAAA,yBAAY,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3B,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,aAAa,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,aAAa,EAAE,iCAAoB,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * FHIR MedicationRequest — patient medication orders.
3
+ */
4
+ export declare const fhirMedicationTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ status: {
15
+ type: string;
16
+ enum: string[];
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ };
22
+ }[];
23
+ export declare function handleFhirMedicationTool(_name: string, args: Record<string, unknown>): Promise<{
24
+ content: Array<{
25
+ type: string;
26
+ text: string;
27
+ }>;
28
+ }>;
29
+ //# sourceMappingURL=medications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medications.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/medications.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;GAqB/B,CAAC;AAgBF,wBAAsB,wBAAwB,CAC5C,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,55 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR MedicationRequest — patient medication orders.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirMedicationTools = void 0;
7
+ exports.handleFhirMedicationTool = handleFhirMedicationTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirMedicationTools = [
10
+ {
11
+ name: 'tebra_fhir_get_medications',
12
+ description: 'Get patient medication requests from Tebra FHIR API. Returns medication name, dosage, status, and prescriber.',
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', 'stopped'],
23
+ description: 'Filter by medication status',
24
+ },
25
+ },
26
+ required: ['patientId'],
27
+ },
28
+ },
29
+ ];
30
+ function summarize(r) {
31
+ return {
32
+ id: r.id,
33
+ medication: (0, helpers_js_1.codeDisplay)(r.medicationCodeableConcept) || (0, helpers_js_1.refDisplay)(r.medicationReference),
34
+ status: r.status,
35
+ intent: r.intent,
36
+ authoredOn: r.authoredOn,
37
+ requester: (0, helpers_js_1.refDisplay)(r.requester),
38
+ dosageInstructions: Array.isArray(r.dosageInstruction)
39
+ ? r.dosageInstruction.map((d) => d.text).filter(Boolean)
40
+ : [],
41
+ };
42
+ }
43
+ async function handleFhirMedicationTool(_name, args) {
44
+ const config = (0, helpers_js_1.getFhirConfig)();
45
+ const patientId = String(args.patientId ?? '');
46
+ if (!patientId)
47
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
48
+ const params = { patient: patientId };
49
+ if (args.status)
50
+ params.status = String(args.status);
51
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'MedicationRequest', params);
52
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
53
+ return (0, helpers_js_1.formatFhirResult)(resources, 'medications', summarize);
54
+ }
55
+ //# sourceMappingURL=medications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medications.js","sourceRoot":"","sources":["../../../src/tools/fhir/medications.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAiDH,4DAcC;AA7DD,6CAQsB;AAET,QAAA,mBAAmB,GAAG;IACjC;QACE,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACT,+GAA+G;QACjH,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,SAAS,CAAC;oBACxC,WAAW,EAAE,6BAA6B;iBAC3C;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,UAAU,EAAE,IAAA,wBAAW,EAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,IAAA,uBAAU,EAAC,CAAC,CAAC,mBAAmB,CAAC;QACzF,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,SAAS,EAAE,IAAA,uBAAU,EAAC,CAAC,CAAC,SAAS,CAAC;QAClC,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC;YACpD,CAAC,CAAE,CAAC,CAAC,iBAA8C,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;YACtF,CAAC,CAAC,EAAE;KACP,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,wBAAwB,CAC5C,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,MAAM;QAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAErD,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,aAAa,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * FHIR Procedure — patient procedure history.
3
+ */
4
+ export declare const fhirProcedureTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ fromDate: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ toDate: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ }[];
26
+ export declare function handleFhirProcedureTool(_name: string, args: Record<string, unknown>): Promise<{
27
+ content: Array<{
28
+ type: string;
29
+ text: string;
30
+ }>;
31
+ }>;
32
+ //# sourceMappingURL=procedures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/procedures.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;GAwB9B,CAAC;AAmBF,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,60 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR Procedure — patient procedure history.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirProcedureTools = void 0;
7
+ exports.handleFhirProcedureTool = handleFhirProcedureTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirProcedureTools = [
10
+ {
11
+ name: 'tebra_fhir_get_procedures',
12
+ description: 'Get patient procedure history from Tebra FHIR API. Returns procedure name, CPT code, date, and performer.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ fromDate: {
21
+ type: 'string',
22
+ description: 'Date range start (YYYY-MM-DD)',
23
+ },
24
+ toDate: {
25
+ type: 'string',
26
+ description: 'Date range end (YYYY-MM-DD)',
27
+ },
28
+ },
29
+ required: ['patientId'],
30
+ },
31
+ },
32
+ ];
33
+ function summarize(r) {
34
+ return {
35
+ id: r.id,
36
+ procedure: (0, helpers_js_1.codeDisplay)(r.code),
37
+ code: (0, helpers_js_1.codeValue)(r.code),
38
+ status: r.status,
39
+ performedDateTime: r.performedDateTime,
40
+ performedPeriod: r.performedPeriod,
41
+ performer: Array.isArray(r.performer)
42
+ ? r.performer.map((p) => (0, helpers_js_1.refDisplay)(p.actor))
43
+ : [],
44
+ reasonCode: Array.isArray(r.reasonCode)
45
+ ? r.reasonCode.map((c) => (0, helpers_js_1.codeDisplay)(c))
46
+ : [],
47
+ };
48
+ }
49
+ async function handleFhirProcedureTool(_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
+ (0, helpers_js_1.addDateRange)(params, args);
56
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'Procedure', params);
57
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
58
+ return (0, helpers_js_1.formatFhirResult)(resources, 'procedures', summarize);
59
+ }
60
+ //# sourceMappingURL=procedures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedures.js","sourceRoot":"","sources":["../../../src/tools/fhir/procedures.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAyDH,0DAcC;AArED,6CAUsB;AAET,QAAA,kBAAkB,GAAG;IAChC;QACE,IAAI,EAAE,2BAA2B;QACjC,WAAW,EACT,2GAA2G;QAC7G,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6BAA6B;iBAC3C;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,SAAS,EAAE,IAAA,wBAAW,EAAC,CAAC,CAAC,IAAI,CAAC;QAC9B,IAAI,EAAE,IAAA,sBAAS,EAAC,CAAC,CAAC,IAAI,CAAC;QAC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C,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * FHIR Observation (vital-signs category) — BP, HR, temp, weight, height, BMI, SpO2.
3
+ */
4
+ export declare const fhirVitalsTools: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ patientId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ fromDate: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ toDate: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ }[];
26
+ export declare function handleFhirVitalsTool(_name: string, args: Record<string, unknown>): Promise<{
27
+ content: Array<{
28
+ type: string;
29
+ text: string;
30
+ }>;
31
+ }>;
32
+ //# sourceMappingURL=vitals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitals.d.ts","sourceRoot":"","sources":["../../../src/tools/fhir/vitals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;GAwB3B,CAAC;AAEF,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,CAc7D"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * FHIR Observation (vital-signs category) — BP, HR, temp, weight, height, BMI, SpO2.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fhirVitalsTools = void 0;
7
+ exports.handleFhirVitalsTool = handleFhirVitalsTool;
8
+ const helpers_js_1 = require("./helpers.js");
9
+ exports.fhirVitalsTools = [
10
+ {
11
+ name: 'tebra_fhir_get_vitals',
12
+ description: 'Get patient vital signs from Tebra FHIR API. Returns BP, HR, temp, weight, height, BMI, SpO2, etc.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ patientId: {
17
+ type: 'string',
18
+ description: 'Tebra FHIR patient ID',
19
+ },
20
+ fromDate: {
21
+ type: 'string',
22
+ description: 'Date range start (YYYY-MM-DD)',
23
+ },
24
+ toDate: {
25
+ type: 'string',
26
+ description: 'Date range end (YYYY-MM-DD)',
27
+ },
28
+ },
29
+ required: ['patientId'],
30
+ },
31
+ },
32
+ ];
33
+ async function handleFhirVitalsTool(_name, args) {
34
+ const config = (0, helpers_js_1.getFhirConfig)();
35
+ const patientId = String(args.patientId ?? '');
36
+ if (!patientId)
37
+ return { content: [{ type: 'text', text: 'patientId is required.' }] };
38
+ const params = {
39
+ patient: patientId,
40
+ category: 'vital-signs',
41
+ };
42
+ (0, helpers_js_1.addDateRange)(params, args);
43
+ const data = await (0, helpers_js_1.fhirRequest)(config, 'Observation', params);
44
+ const resources = (0, helpers_js_1.extractBundleResources)(data);
45
+ return (0, helpers_js_1.formatFhirResult)(resources, 'vital signs', helpers_js_1.summarizeObservation);
46
+ }
47
+ //# sourceMappingURL=vitals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitals.js","sourceRoot":"","sources":["../../../src/tools/fhir/vitals.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAqCH,oDAiBC;AApDD,6CAOsB;AAET,QAAA,eAAe,GAAG;IAC7B;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,oGAAoG;QACtG,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6BAA6B;iBAC3C;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;CACF,CAAC;AAEK,KAAK,UAAU,oBAAoB,CACxC,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;QACrC,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,aAAa;KACxB,CAAC;IACF,IAAA,yBAAY,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE3B,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAW,EAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,IAAA,6BAAgB,EAAC,SAAS,EAAE,aAAa,EAAE,iCAAoB,CAAC,CAAC;AAC1E,CAAC"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes