@gravity-platform/aws-medical 1.1.1

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 (34) hide show
  1. package/README.md +89 -0
  2. package/dist/AWSComprehendMedical/node/executor.d.ts +12 -0
  3. package/dist/AWSComprehendMedical/node/executor.d.ts.map +1 -0
  4. package/dist/AWSComprehendMedical/node/executor.js +65 -0
  5. package/dist/AWSComprehendMedical/node/executor.js.map +1 -0
  6. package/dist/AWSComprehendMedical/node/index.d.ts +10 -0
  7. package/dist/AWSComprehendMedical/node/index.d.ts.map +1 -0
  8. package/dist/AWSComprehendMedical/node/index.js +104 -0
  9. package/dist/AWSComprehendMedical/node/index.js.map +1 -0
  10. package/dist/AWSComprehendMedical/service/comprehendMedical.d.ts +9 -0
  11. package/dist/AWSComprehendMedical/service/comprehendMedical.d.ts.map +1 -0
  12. package/dist/AWSComprehendMedical/service/comprehendMedical.js +107 -0
  13. package/dist/AWSComprehendMedical/service/comprehendMedical.js.map +1 -0
  14. package/dist/AWSComprehendMedical/service/processText.d.ts +7 -0
  15. package/dist/AWSComprehendMedical/service/processText.d.ts.map +1 -0
  16. package/dist/AWSComprehendMedical/service/processText.js +14 -0
  17. package/dist/AWSComprehendMedical/service/processText.js.map +1 -0
  18. package/dist/AWSComprehendMedical/util/types.d.ts +256 -0
  19. package/dist/AWSComprehendMedical/util/types.d.ts.map +1 -0
  20. package/dist/AWSComprehendMedical/util/types.js +6 -0
  21. package/dist/AWSComprehendMedical/util/types.js.map +1 -0
  22. package/dist/credentials/index.d.ts +3 -0
  23. package/dist/credentials/index.d.ts.map +1 -0
  24. package/dist/credentials/index.js +7 -0
  25. package/dist/credentials/index.js.map +1 -0
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +58 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/shared/platform.d.ts +11 -0
  31. package/dist/shared/platform.d.ts.map +1 -0
  32. package/dist/shared/platform.js +21 -0
  33. package/dist/shared/platform.js.map +1 -0
  34. package/package.json +48 -0
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # @gravityai-dev/aws-medical
2
+
3
+ AWS Comprehend Medical integration plugin for the Gravity workflow system. Extract medical entities and PHI from clinical text using AWS Comprehend Medical.
4
+
5
+ ## Features
6
+
7
+ - **AWSComprehendMedical**: Extract medical entities, PHI, and insights from clinical text
8
+ - Support for both medical entities and PHI detection
9
+ - Multiple output formats: raw JSON, simplified structure, or both
10
+ - Optional S3 storage for analysis results
11
+ - Full AWS SDK v3 integration with client caching
12
+ - Comprehensive error handling and logging
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @gravityai-dev/aws-medical
18
+ ```
19
+
20
+ ## Nodes
21
+
22
+ ### AWSComprehendMedical
23
+
24
+ Analyzes clinical text using AWS Comprehend Medical to extract medical entities, PHI, and insights.
25
+
26
+ **Inputs:**
27
+ - `text`: Clinical text to analyze
28
+
29
+ **Outputs:**
30
+ - `result`: Comprehend Medical analysis results (format based on settings)
31
+ - `outputKey`: S3 key where results were saved (if saveToS3 is enabled)
32
+
33
+ **Configuration:**
34
+ - `text`: The clinical text to analyze
35
+ - `analysisType`: Type of analysis (Medical Entities Only, PHI Only, Both Entities and PHI)
36
+ - `outputFormat`: Format of output data (Raw JSON, Simplified Structure, Both)
37
+ - `saveToS3`: Save the analysis results to S3
38
+ - `outputPrefix`: Prefix for S3 output files
39
+ - `language`: Language of the clinical text (English)
40
+
41
+ ## Credentials
42
+
43
+ Requires AWS credentials with the following fields:
44
+ - `accessKeyId`: Your AWS access key ID
45
+ - `secretAccessKey`: Your AWS secret access key
46
+ - `region`: AWS region (e.g., us-east-1)
47
+
48
+ ## Usage Example
49
+
50
+ 1. Add AWSComprehendMedical node to analyze clinical text
51
+ 2. Configure analysis type (entities, PHI, or both)
52
+ 3. Choose output format (raw JSON or simplified structure)
53
+ 4. Optionally save results to S3 for archival
54
+ 5. Process extracted medical information in downstream nodes
55
+
56
+ ## Medical Entity Types
57
+
58
+ The node can extract various medical entities including:
59
+ - **Medications**: Dosage, frequency, strength, route, duration, form
60
+ - **Medical Conditions**: Diagnoses, symptoms, medical history
61
+ - **Test Results**: Lab values, test names, units, reference ranges
62
+ - **Procedures**: Medical procedures, treatments, surgeries
63
+ - **Anatomy**: Body parts, anatomical locations
64
+
65
+ ## PHI Detection
66
+
67
+ Detects and categorizes Protected Health Information (PHI):
68
+ - **Names**: Patient names, healthcare provider names
69
+ - **Dates**: Birth dates, appointment dates, treatment dates
70
+ - **Locations**: Addresses, cities, states, countries
71
+ - **Identifiers**: SSN, account numbers, device identifiers
72
+ - **Contact**: Phone numbers, email addresses, URLs
73
+
74
+ ## Development
75
+
76
+ ```bash
77
+ # Install dependencies
78
+ npm install
79
+
80
+ # Build the package
81
+ npm run build
82
+
83
+ # Run tests
84
+ npm test
85
+ ```
86
+
87
+ ## License
88
+
89
+ MIT
@@ -0,0 +1,12 @@
1
+ import { type NodeExecutionContext } from "@gravity-platform/plugin-base";
2
+ import { AWSComprehendMedicalConfig, AWSComprehendMedicalOutput } from "../util/types";
3
+ import { PromiseNode } from "../../shared/platform";
4
+ export declare class AWSComprehendMedicalExecutor extends PromiseNode<AWSComprehendMedicalConfig> {
5
+ constructor();
6
+ protected executeNode(inputs: Record<string, any>, config: AWSComprehendMedicalConfig, context: NodeExecutionContext): Promise<AWSComprehendMedicalOutput>;
7
+ /**
8
+ * Build credential context from execution context
9
+ */
10
+ private buildCredentialContext;
11
+ }
12
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/node/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EAAE,WAAW,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,qBAAa,4BAA6B,SAAQ,WAAW,CAAC,0BAA0B,CAAC;;cAKvE,WAAW,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,0BAA0B,CAAC;IAgDtC;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAW/B"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AWSComprehendMedicalExecutor = void 0;
4
+ const processText_1 = require("../service/processText");
5
+ const platform_1 = require("../../shared/platform");
6
+ const NODE_TYPE = "AWSComprehendMedical";
7
+ class AWSComprehendMedicalExecutor extends platform_1.PromiseNode {
8
+ constructor() {
9
+ super(NODE_TYPE);
10
+ }
11
+ async executeNode(inputs, config, context) {
12
+ const logger = (0, platform_1.createLogger)("AWSComprehendMedical");
13
+ // Build credential context for service
14
+ const credentialContext = this.buildCredentialContext(context);
15
+ try {
16
+ // Use input text if provided, otherwise use config text
17
+ const textToAnalyze = inputs.text || config.text;
18
+ if (!textToAnalyze || textToAnalyze.trim().length === 0) {
19
+ throw new Error("No clinical text provided for analysis");
20
+ }
21
+ const result = await (0, processText_1.processComprehendMedicalText)({
22
+ ...config,
23
+ text: textToAnalyze,
24
+ }, credentialContext.credentials?.awsCredential, logger);
25
+ logger.info("AWSComprehendMedical execution completed", {
26
+ analysisType: config.analysisType,
27
+ outputFormat: config.outputFormat,
28
+ textLength: textToAnalyze.length,
29
+ entityCount: result.metadata.entityCount,
30
+ phiCount: result.metadata.phiCount,
31
+ processingTime: result.metadata.processingTime
32
+ });
33
+ return {
34
+ __outputs: {
35
+ result,
36
+ outputKey: result.outputKey
37
+ }
38
+ };
39
+ }
40
+ catch (error) {
41
+ logger.error("AWSComprehendMedical execution failed", {
42
+ error: error.message,
43
+ code: error.code,
44
+ stack: error.stack,
45
+ });
46
+ throw error;
47
+ }
48
+ }
49
+ /**
50
+ * Build credential context from execution context
51
+ */
52
+ buildCredentialContext(context) {
53
+ return {
54
+ credentials: {
55
+ awsCredential: context.credentials?.awsCredential || {},
56
+ },
57
+ nodeType: NODE_TYPE,
58
+ workflowId: context.workflow?.id || "",
59
+ executionId: context.executionId || "",
60
+ nodeId: context.nodeId || "",
61
+ };
62
+ }
63
+ }
64
+ exports.AWSComprehendMedicalExecutor = AWSComprehendMedicalExecutor;
65
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/node/executor.ts"],"names":[],"mappings":";;;AAEA,wDAAsE;AACtE,oDAAkE;AAElE,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAEzC,MAAa,4BAA6B,SAAQ,sBAAuC;IACvF;QACE,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;IAES,KAAK,CAAC,WAAW,CACzB,MAA2B,EAC3B,MAAkC,EAClC,OAA6B;QAE7B,MAAM,MAAM,GAAG,IAAA,uBAAY,EAAC,sBAAsB,CAAC,CAAC;QAEpD,uCAAuC;QACvC,MAAM,iBAAiB,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAE/D,IAAI,CAAC;YACH,wDAAwD;YACxD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC;YAEjD,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACxD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC5D,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,IAAA,0CAA4B,EAC/C;gBACE,GAAG,MAAM;gBACT,IAAI,EAAE,aAAa;aACpB,EACD,iBAAiB,CAAC,WAAW,EAAE,aAAa,EAC5C,MAAM,CACP,CAAC;YAEF,MAAM,CAAC,IAAI,CAAC,0CAA0C,EAAE;gBACtD,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,UAAU,EAAE,aAAa,CAAC,MAAM;gBAChC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW;gBACxC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;gBAClC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc;aAC/C,CAAC,CAAC;YAEH,OAAO;gBACL,SAAS,EAAE;oBACT,MAAM;oBACN,SAAS,EAAE,MAAM,CAAC,SAAS;iBAC5B;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE;gBACpD,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;aACnB,CAAC,CAAC;YACH,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,OAA6B;QAC1D,OAAO;YACL,WAAW,EAAE;gBACX,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,aAAa,IAAI,EAAE;aACxD;YACD,QAAQ,EAAE,SAAS;YACnB,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE;YACtC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;YACtC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;SAC7B,CAAC;IACJ,CAAC;CACF;AAvED,oEAuEC"}
@@ -0,0 +1,10 @@
1
+ import { type EnhancedNodeDefinition } from "@gravity-platform/plugin-base";
2
+ import { AWSComprehendMedicalExecutor } from "./executor";
3
+ export declare const NODE_TYPE = "AWSComprehendMedical";
4
+ declare function createNodeDefinition(): EnhancedNodeDefinition;
5
+ export declare const AWSComprehendMedicalNode: {
6
+ definition: any;
7
+ executor: typeof AWSComprehendMedicalExecutor;
8
+ };
9
+ export { createNodeDefinition };
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,SAAS,yBAAyB,CAAC;AAEhD,iBAAS,oBAAoB,IAAI,sBAAsB,CA+FtD;AAID,eAAO,MAAM,wBAAwB;;;CAGpC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AWSComprehendMedicalNode = exports.NODE_TYPE = void 0;
4
+ exports.createNodeDefinition = createNodeDefinition;
5
+ const plugin_base_1 = require("@gravity-platform/plugin-base");
6
+ const executor_1 = require("./executor");
7
+ exports.NODE_TYPE = "AWSComprehendMedical";
8
+ function createNodeDefinition() {
9
+ const { NodeInputType } = (0, plugin_base_1.getPlatformDependencies)();
10
+ return {
11
+ packageVersion: "1.1.0",
12
+ type: exports.NODE_TYPE,
13
+ name: "AWS Comprehend Medical",
14
+ description: "Extract medical entities, PHI, and insights from clinical text using AWS Comprehend Medical",
15
+ category: "ingest",
16
+ logoUrl: "https://res.cloudinary.com/sonik/image/upload/v1755603269/gravity/icons/ComprehendMedical.png",
17
+ color: "#FF9900",
18
+ inputs: [
19
+ {
20
+ name: "text",
21
+ type: NodeInputType.STRING,
22
+ description: "Clinical text to analyze",
23
+ },
24
+ ],
25
+ outputs: [
26
+ {
27
+ name: "result",
28
+ type: NodeInputType.OBJECT,
29
+ description: "Comprehend Medical analysis results (format based on settings)",
30
+ },
31
+ {
32
+ name: "outputKey",
33
+ type: NodeInputType.STRING,
34
+ description: "S3 key where results were saved (if saveToS3 is enabled)",
35
+ },
36
+ ],
37
+ configSchema: {
38
+ type: "object",
39
+ required: ["text", "analysisType", "outputFormat"],
40
+ properties: {
41
+ text: {
42
+ type: "string",
43
+ title: "Clinical Text",
44
+ description: "The clinical text to analyze",
45
+ default: "",
46
+ "ui:field": "template",
47
+ },
48
+ analysisType: {
49
+ type: "string",
50
+ title: "Analysis Type",
51
+ description: "Type of analysis to perform",
52
+ enum: ["ENTITIES", "PHI", "BOTH"],
53
+ enumNames: ["Medical Entities Only", "PHI Only", "Both Entities and PHI"],
54
+ default: "ENTITIES",
55
+ },
56
+ outputFormat: {
57
+ type: "string",
58
+ title: "Output Format",
59
+ description: "Format of the output data",
60
+ enum: ["json", "simplified", "both"],
61
+ enumNames: ["Raw JSON", "Simplified Structure", "Both"],
62
+ default: "simplified",
63
+ },
64
+ saveToS3: {
65
+ type: "boolean",
66
+ title: "Save to S3",
67
+ description: "Save the analysis results to S3",
68
+ default: false,
69
+ },
70
+ outputPrefix: {
71
+ type: "string",
72
+ title: "S3 Output Prefix",
73
+ description: "Prefix for S3 output files",
74
+ default: "comprehend-medical-output",
75
+ "ui:dependencies": {
76
+ saveToS3: true,
77
+ },
78
+ },
79
+ language: {
80
+ type: "string",
81
+ title: "Language",
82
+ description: "Language of the clinical text",
83
+ enum: ["en"],
84
+ enumNames: ["English"],
85
+ default: "en",
86
+ },
87
+ },
88
+ },
89
+ credentials: [
90
+ {
91
+ name: "awsCredential",
92
+ required: true,
93
+ displayName: "AWS",
94
+ description: "AWS credentials for Comprehend Medical and S3 access",
95
+ },
96
+ ],
97
+ };
98
+ }
99
+ const definition = createNodeDefinition();
100
+ exports.AWSComprehendMedicalNode = {
101
+ definition,
102
+ executor: executor_1.AWSComprehendMedicalExecutor,
103
+ };
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/node/index.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C;oBACzE,OAAO,EAAE,UAAU;iBACpB;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,eAAe;oBACtB,WAAW,EAAE,2BAA2B;oBACxC,IAAI,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC;oBACpC,SAAS,EAAE,CAAC,UAAU,EAAE,sBAAsB,EAAE,MAAM,CAAC;oBACvD,OAAO,EAAE,YAAY;iBACtB;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,YAAY;oBACnB,WAAW,EAAE,iCAAiC;oBAC9C,OAAO,EAAE,KAAK;iBACf;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,kBAAkB;oBACzB,WAAW,EAAE,4BAA4B;oBACzC,OAAO,EAAE,2BAA2B;oBACpC,iBAAiB,EAAE;wBACjB,QAAQ,EAAE,IAAI;qBACf;iBACF;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,UAAU;oBACjB,WAAW,EAAE,+BAA+B;oBAC5C,IAAI,EAAE,CAAC,IAAI,CAAC;oBACZ,SAAS,EAAE,CAAC,SAAS,CAAC;oBACtB,OAAO,EAAE,IAAI;iBACd;aACF;SACF;QAED,WAAW,EAAE;YACX;gBACE,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,KAAK;gBAClB,WAAW,EAAE,sDAAsD;aACpE;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;AAE7B,QAAA,wBAAwB,GAAG;IACtC,UAAU;IACV,QAAQ,EAAE,uCAA4B;CACvC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { AWSComprehendMedicalConfig, ComprehendMedicalResult } from "../util/types";
2
+ export interface AWSCredentials {
3
+ accessKeyId: string;
4
+ secretAccessKey: string;
5
+ region: string;
6
+ sessionToken?: string;
7
+ }
8
+ export declare function processTextWithComprehendMedical(text: string, config: AWSComprehendMedicalConfig, credentials: AWSCredentials, logger: any): Promise<ComprehendMedicalResult>;
9
+ //# sourceMappingURL=comprehendMedical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comprehendMedical.d.ts","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/service/comprehendMedical.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoDD,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,0BAA0B,EAClC,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,GAAG,GACV,OAAO,CAAC,uBAAuB,CAAC,CAoElC"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processTextWithComprehendMedical = processTextWithComprehendMedical;
4
+ /**
5
+ * AWS Comprehend Medical text processing service
6
+ */
7
+ const client_comprehendmedical_1 = require("@aws-sdk/client-comprehendmedical");
8
+ const client_s3_1 = require("@aws-sdk/client-s3");
9
+ // Client caching
10
+ const clientCache = new Map();
11
+ const s3ClientCache = new Map();
12
+ function initializeComprehendMedicalClient(credentials, logger) {
13
+ const cacheKey = `${credentials.accessKeyId}_${credentials.region}`;
14
+ if (clientCache.has(cacheKey)) {
15
+ logger.debug('Using cached Comprehend Medical client', { cacheKey });
16
+ return clientCache.get(cacheKey);
17
+ }
18
+ const client = new client_comprehendmedical_1.ComprehendMedicalClient({
19
+ region: credentials.region || "us-east-1",
20
+ credentials: {
21
+ accessKeyId: credentials.accessKeyId,
22
+ secretAccessKey: credentials.secretAccessKey,
23
+ sessionToken: credentials.sessionToken,
24
+ },
25
+ });
26
+ clientCache.set(cacheKey, client);
27
+ logger.debug('Created and cached new Comprehend Medical client', { cacheKey, region: credentials.region });
28
+ return client;
29
+ }
30
+ function initializeS3Client(credentials, logger) {
31
+ const cacheKey = `s3_${credentials.accessKeyId}_${credentials.region}`;
32
+ if (s3ClientCache.has(cacheKey)) {
33
+ logger.debug('Using cached S3 client', { cacheKey });
34
+ return s3ClientCache.get(cacheKey);
35
+ }
36
+ const client = new client_s3_1.S3Client({
37
+ region: credentials.region || "us-east-1",
38
+ credentials: {
39
+ accessKeyId: credentials.accessKeyId,
40
+ secretAccessKey: credentials.secretAccessKey,
41
+ sessionToken: credentials.sessionToken,
42
+ },
43
+ });
44
+ s3ClientCache.set(cacheKey, client);
45
+ logger.debug('Created and cached new S3 client', { cacheKey, region: credentials.region });
46
+ return client;
47
+ }
48
+ async function processTextWithComprehendMedical(text, config, credentials, logger) {
49
+ const startTime = Date.now();
50
+ const client = initializeComprehendMedicalClient(credentials, logger);
51
+ const result = {
52
+ metadata: {
53
+ textLength: text.length,
54
+ processingTime: 0
55
+ }
56
+ };
57
+ try {
58
+ // Detect medical entities if requested
59
+ if (config.analysisType === 'ENTITIES' || config.analysisType === 'BOTH') {
60
+ logger.info("Detecting medical entities...");
61
+ const entitiesCommand = new client_comprehendmedical_1.DetectEntitiesV2Command({ Text: text });
62
+ const entitiesResponse = await client.send(entitiesCommand);
63
+ result.entities = entitiesResponse.Entities;
64
+ result.metadata.entityCount = entitiesResponse.Entities?.length || 0;
65
+ if (entitiesResponse.ModelVersion) {
66
+ result.modelVersion = entitiesResponse.ModelVersion;
67
+ }
68
+ }
69
+ // Detect PHI if requested
70
+ if (config.analysisType === 'PHI' || config.analysisType === 'BOTH') {
71
+ logger.info("Detecting PHI...");
72
+ const phiCommand = new client_comprehendmedical_1.DetectPHICommand({ Text: text });
73
+ const phiResponse = await client.send(phiCommand);
74
+ result.phi = phiResponse.Entities;
75
+ result.metadata.phiCount = phiResponse.Entities?.length || 0;
76
+ if (!result.modelVersion && phiResponse.ModelVersion) {
77
+ result.modelVersion = phiResponse.ModelVersion;
78
+ }
79
+ }
80
+ // Save to S3 if requested
81
+ if (config.saveToS3) {
82
+ const s3Client = initializeS3Client(credentials, logger);
83
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
84
+ const outputKey = `${config.outputPrefix || 'comprehend-medical-output'}/${timestamp}.json`;
85
+ const putCommand = new client_s3_1.PutObjectCommand({
86
+ Bucket: process.env.GRAVITY_S3_BUCKET || 'gravity-default-bucket',
87
+ Key: outputKey,
88
+ Body: JSON.stringify(result, null, 2),
89
+ ContentType: 'application/json'
90
+ });
91
+ await s3Client.send(putCommand);
92
+ result.outputKey = outputKey;
93
+ logger.info("Results saved to S3", { outputKey });
94
+ }
95
+ result.metadata.processingTime = Date.now() - startTime;
96
+ return result;
97
+ }
98
+ catch (error) {
99
+ logger.error("Error processing text with Comprehend Medical:", {
100
+ error: error.message,
101
+ code: error.code,
102
+ stack: error.stack
103
+ });
104
+ throw error;
105
+ }
106
+ }
107
+ //# sourceMappingURL=comprehendMedical.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comprehendMedical.js","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/service/comprehendMedical.ts"],"names":[],"mappings":";;AAoEA,4EAyEC;AA7ID;;GAEG;AACH,gFAI2C;AAC3C,kDAAgE;AAUhE,iBAAiB;AACjB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAmC,CAAC;AAC/D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAoB,CAAC;AAElD,SAAS,iCAAiC,CAAC,WAA2B,EAAE,MAAW;IACjF,MAAM,QAAQ,GAAG,GAAG,WAAW,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;IAEpE,IAAI,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,wCAAwC,EA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AAc,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QACxD,OAAO,MAAM,CAAC;IAEhB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,CAAC,KAAK,CAAC,gDAAgD,EAAE;YAC7D,KAAK,EAAE,KAAK,CAAC,OAAO;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC;QACH,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * AWS Comprehend Medical text processing service
3
+ */
4
+ import { AWSComprehendMedicalConfig, ComprehendMedicalResult } from "../util/types";
5
+ import { AWSCredentials } from "./comprehendMedical";
6
+ export declare function processComprehendMedicalText(config: AWSComprehendMedicalConfig, credentials: AWSCredentials, logger: any): Promise<ComprehendMedicalResult>;
7
+ //# sourceMappingURL=processText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processText.d.ts","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/service/processText.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAoC,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEvF,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,0BAA0B,EAClC,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,GAAG,GACV,OAAO,CAAC,uBAAuB,CAAC,CAYlC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * AWS Comprehend Medical text processing service
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.processComprehendMedicalText = processComprehendMedicalText;
7
+ const comprehendMedical_1 = require("./comprehendMedical");
8
+ async function processComprehendMedicalText(config, credentials, logger) {
9
+ if (!config.text || config.text.trim().length === 0) {
10
+ throw new Error("No text provided for analysis");
11
+ }
12
+ return await (0, comprehendMedical_1.processTextWithComprehendMedical)(config.text, config, credentials, logger);
13
+ }
14
+ //# sourceMappingURL=processText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processText.js","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/service/processText.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAKH,oEAgBC;AAlBD,2DAAuF;AAEhF,KAAK,UAAU,4BAA4B,CAChD,MAAkC,EAClC,WAA2B,EAC3B,MAAW;IAGX,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,MAAM,IAAA,oDAAgC,EAC3C,MAAM,CAAC,IAAI,EACX,MAAM,EACN,WAAW,EACX,MAAM,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,256 @@
1
+ /**
2
+ * Type definitions for AWSComprehendMedical node
3
+ */
4
+ export interface AWSComprehendMedicalConfig {
5
+ text: string;
6
+ analysisType: 'ENTITIES' | 'PHI' | 'BOTH';
7
+ outputFormat: 'json' | 'simplified' | 'both';
8
+ saveToS3?: boolean;
9
+ outputPrefix?: string;
10
+ language?: "en";
11
+ }
12
+ export interface ComprehendMedicalEntity {
13
+ id?: number;
14
+ text?: string;
15
+ category?: string;
16
+ type?: string;
17
+ score?: number;
18
+ beginOffset?: number;
19
+ endOffset?: number;
20
+ attributes?: Array<{
21
+ type?: string;
22
+ score?: number;
23
+ relationshipScore?: number;
24
+ id?: number;
25
+ beginOffset?: number;
26
+ endOffset?: number;
27
+ text?: string;
28
+ }>;
29
+ traits?: Array<{
30
+ name?: string;
31
+ score?: number;
32
+ }>;
33
+ }
34
+ export interface ComprehendMedicalPHI {
35
+ id?: number;
36
+ text?: string;
37
+ category?: string;
38
+ type?: string;
39
+ score?: number;
40
+ beginOffset?: number;
41
+ endOffset?: number;
42
+ }
43
+ export interface ComprehendMedicalResult {
44
+ entities?: ComprehendMedicalEntity[];
45
+ phi?: ComprehendMedicalPHI[];
46
+ modelVersion?: string;
47
+ simplifiedEntities?: {
48
+ medications?: Array<{
49
+ name: string;
50
+ confidence: number;
51
+ type?: string;
52
+ category?: string;
53
+ beginOffset?: number;
54
+ endOffset?: number;
55
+ dosage?: string;
56
+ frequency?: string;
57
+ strength?: string;
58
+ route?: string;
59
+ duration?: string;
60
+ form?: string;
61
+ rate?: string;
62
+ traits?: Array<{
63
+ name: string;
64
+ score?: number;
65
+ }>;
66
+ }>;
67
+ conditions?: Array<{
68
+ name: string;
69
+ confidence: number;
70
+ type?: string;
71
+ category?: string;
72
+ beginOffset?: number;
73
+ endOffset?: number;
74
+ attributes?: Array<{
75
+ type: string;
76
+ text: string;
77
+ score?: number;
78
+ }>;
79
+ traits?: Array<{
80
+ name: string;
81
+ score?: number;
82
+ }>;
83
+ }>;
84
+ testResults?: Array<{
85
+ name: string;
86
+ confidence: number;
87
+ type?: string;
88
+ category?: string;
89
+ beginOffset?: number;
90
+ endOffset?: number;
91
+ value?: string;
92
+ valueScore?: number;
93
+ unit?: string;
94
+ unitScore?: number;
95
+ otherAttributes?: Array<{
96
+ type: string;
97
+ text: string;
98
+ score?: number;
99
+ }>;
100
+ traits?: Array<{
101
+ name: string;
102
+ score?: number;
103
+ }>;
104
+ }>;
105
+ procedures?: Array<{
106
+ name: string;
107
+ confidence: number;
108
+ type?: string;
109
+ category?: string;
110
+ beginOffset?: number;
111
+ endOffset?: number;
112
+ attributes?: Array<{
113
+ type: string;
114
+ text: string;
115
+ score?: number;
116
+ }>;
117
+ traits?: Array<{
118
+ name: string;
119
+ score?: number;
120
+ }>;
121
+ }>;
122
+ anatomy?: Array<{
123
+ name: string;
124
+ confidence: number;
125
+ type?: string;
126
+ category?: string;
127
+ beginOffset?: number;
128
+ endOffset?: number;
129
+ attributes?: Array<{
130
+ type: string;
131
+ text: string;
132
+ score?: number;
133
+ }>;
134
+ traits?: Array<{
135
+ name: string;
136
+ score?: number;
137
+ }>;
138
+ }>;
139
+ };
140
+ simplifiedPHI?: {
141
+ names?: Array<{
142
+ text: string;
143
+ type: string;
144
+ confidence: number;
145
+ beginOffset?: number;
146
+ endOffset?: number;
147
+ category?: string;
148
+ attributes?: Array<{
149
+ type: string;
150
+ text: string;
151
+ score?: number;
152
+ beginOffset?: number;
153
+ endOffset?: number;
154
+ }>;
155
+ traits?: Array<{
156
+ name: string;
157
+ score?: number;
158
+ }>;
159
+ }>;
160
+ dates?: Array<{
161
+ text: string;
162
+ type: string;
163
+ confidence: number;
164
+ beginOffset?: number;
165
+ endOffset?: number;
166
+ category?: string;
167
+ isDate?: boolean;
168
+ isAge?: boolean;
169
+ attributes?: Array<{
170
+ type: string;
171
+ text: string;
172
+ score?: number;
173
+ beginOffset?: number;
174
+ endOffset?: number;
175
+ }>;
176
+ traits?: Array<{
177
+ name: string;
178
+ score?: number;
179
+ }>;
180
+ }>;
181
+ locations?: Array<{
182
+ text: string;
183
+ type: string;
184
+ confidence: number;
185
+ beginOffset?: number;
186
+ endOffset?: number;
187
+ category?: string;
188
+ attributes?: Array<{
189
+ type: string;
190
+ text: string;
191
+ score?: number;
192
+ beginOffset?: number;
193
+ endOffset?: number;
194
+ }>;
195
+ traits?: Array<{
196
+ name: string;
197
+ score?: number;
198
+ }>;
199
+ }>;
200
+ identifiers?: Array<{
201
+ text: string;
202
+ type: string;
203
+ confidence: number;
204
+ beginOffset?: number;
205
+ endOffset?: number;
206
+ category?: string;
207
+ isProfession?: boolean;
208
+ unknownType?: boolean;
209
+ attributes?: Array<{
210
+ type: string;
211
+ text: string;
212
+ score?: number;
213
+ beginOffset?: number;
214
+ endOffset?: number;
215
+ }>;
216
+ traits?: Array<{
217
+ name: string;
218
+ score?: number;
219
+ }>;
220
+ }>;
221
+ contact?: Array<{
222
+ text: string;
223
+ type: string;
224
+ confidence: number;
225
+ beginOffset?: number;
226
+ endOffset?: number;
227
+ category?: string;
228
+ contactType?: string;
229
+ attributes?: Array<{
230
+ type: string;
231
+ text: string;
232
+ score?: number;
233
+ beginOffset?: number;
234
+ endOffset?: number;
235
+ }>;
236
+ traits?: Array<{
237
+ name: string;
238
+ score?: number;
239
+ }>;
240
+ }>;
241
+ };
242
+ metadata: {
243
+ entityCount?: number;
244
+ phiCount?: number;
245
+ textLength: number;
246
+ processingTime?: number;
247
+ };
248
+ outputKey?: string;
249
+ }
250
+ export interface AWSComprehendMedicalOutput {
251
+ __outputs: {
252
+ result: ComprehendMedicalResult;
253
+ outputKey?: string;
254
+ };
255
+ }
256
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/util/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1C,YAAY,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;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C,CAAC;SACJ,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,KAAK,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,UAAU,CAAC,EAAE,KAAK,CAAC;gBACjB,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;gBACb,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,SAAS,CAAC,EAAE,MAAM,CAAC;aACpB,CAAC,CAAC;YACH,MAAM,CAAC,EAAE,KAAK,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;gBACb,KAAK,CAAC,EAAE,MAAM,CAAC;aAChB,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ,CAAC;IACF,QAAQ,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE;QACT,MAAM,EAAE,uBAAuB,CAAC;QAChC,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for AWSComprehendMedical node
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/AWSComprehendMedical/util/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,3 @@
1
+ import { AWSCredential } from "@gravity-platform/plugin-base";
2
+ export { AWSCredential };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AWSCredential = void 0;
4
+ // Import shared credentials from plugin-base
5
+ const plugin_base_1 = require("@gravity-platform/plugin-base");
6
+ Object.defineProperty(exports, "AWSCredential", { enumerable: true, get: function () { return plugin_base_1.AWSCredential; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,+DAA8D;AAGrD,8FAHA,2BAAa,OAGA"}
@@ -0,0 +1,3 @@
1
+ declare const plugin: import("@gravity-platform/plugin-base").GravityPlugin;
2
+ export default plugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,uDAkBV,CAAC;AAEH,eAAe,MAAM,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const plugin_base_1 = require("@gravity-platform/plugin-base");
40
+ const package_json_1 = __importDefault(require("../package.json"));
41
+ const plugin = (0, plugin_base_1.createPlugin)({
42
+ name: package_json_1.default.name,
43
+ version: package_json_1.default.version,
44
+ description: package_json_1.default.description,
45
+ async setup(api) {
46
+ // Initialize platform dependencies
47
+ const { initializePlatformFromAPI } = await Promise.resolve().then(() => __importStar(require("@gravity-platform/plugin-base")));
48
+ initializePlatformFromAPI(api);
49
+ // Import and register AWSComprehendMedical node
50
+ const { AWSComprehendMedicalNode } = await Promise.resolve().then(() => __importStar(require("./AWSComprehendMedical/node/index")));
51
+ api.registerNode(AWSComprehendMedicalNode);
52
+ // Import and register AWS credential
53
+ const { AWSCredential } = await Promise.resolve().then(() => __importStar(require("./credentials")));
54
+ api.registerCredential(AWSCredential);
55
+ },
56
+ });
57
+ exports.default = plugin;
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAoF;AACpF,mEAA0C;AAE1C,MAAM,MAAM,GAAG,IAAA,0BAAY,EAAC;IAC1B,IAAI,EAAE,sBAAW,CAAC,IAAI;IACtB,OAAO,EAAE,sBAAW,CAAC,OAAO;IAC5B,WAAW,EAAE,sBAAW,CAAC,WAAW;IAEpC,KAAK,CAAC,KAAK,CAAC,GAAqB;QAC/B,mCAAmC;QACnC,MAAM,EAAE,yBAAyB,EAAE,GAAG,wDAAa,+BAA+B,GAAC,CAAC;QACpF,yBAAyB,CAAC,GAAG,CAAC,CAAC;QAE/B,gDAAgD;QAChD,MAAM,EAAE,wBAAwB,EAAE,GAAG,wDAAa,mCAAmC,GAAC,CAAC;QACvF,GAAG,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;QAE3C,qCAAqC;QACrC,MAAM,EAAE,aAAa,EAAE,GAAG,wDAAa,eAAe,GAAC,CAAC;QACxD,GAAG,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const getNodeCredentials: (context: any, credentialName: string) => Promise<any>;
2
+ export declare const saveTokenUsage: (usage: any) => Promise<void>;
3
+ export declare const createLogger: (name: string) => any;
4
+ export declare const getConfig: () => any;
5
+ export declare const PromiseNode: any;
6
+ export declare const CallbackNode: any;
7
+ export declare const NodeExecutionContext: any;
8
+ export declare const EnhancedNodeDefinition: any;
9
+ export declare const NodeInputType: any;
10
+ export declare const medicalLogger: any;
11
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/shared/platform.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB,wDAA0B,CAAC;AAC1D,eAAO,MAAM,cAAc,+BAAsB,CAAC;AAClD,eAAO,MAAM,YAAY,uBAAoB,CAAC;AAC9C,eAAO,MAAM,SAAS,WAAiB,CAAC;AACxC,eAAO,MAAM,WAAW,KAAmB,CAAC;AAC5C,eAAO,MAAM,YAAY,KAAoB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,KAA4B,CAAC;AAC9D,eAAO,MAAM,sBAAsB,KAA8B,CAAC;AAClE,eAAO,MAAM,aAAa,KAAqB,CAAC;AAGhD,eAAO,MAAM,aAAa,KAA6B,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.medicalLogger = exports.NodeInputType = exports.EnhancedNodeDefinition = exports.NodeExecutionContext = exports.CallbackNode = exports.PromiseNode = exports.getConfig = exports.createLogger = exports.saveTokenUsage = exports.getNodeCredentials = void 0;
4
+ /**
5
+ * Shared platform dependencies for AWS Medical services
6
+ */
7
+ const plugin_base_1 = require("@gravity-platform/plugin-base");
8
+ // Get platform dependencies once
9
+ const deps = (0, plugin_base_1.getPlatformDependencies)();
10
+ exports.getNodeCredentials = deps.getNodeCredentials;
11
+ exports.saveTokenUsage = deps.saveTokenUsage;
12
+ exports.createLogger = deps.createLogger;
13
+ exports.getConfig = deps.getConfig;
14
+ exports.PromiseNode = deps.PromiseNode;
15
+ exports.CallbackNode = deps.CallbackNode;
16
+ exports.NodeExecutionContext = deps.NodeExecutionContext;
17
+ exports.EnhancedNodeDefinition = deps.EnhancedNodeDefinition;
18
+ exports.NodeInputType = deps.NodeInputType;
19
+ // Create shared loggers
20
+ exports.medicalLogger = (0, exports.createLogger)("AWSMedical");
21
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/shared/platform.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAwE;AAExE,iCAAiC;AACjC,MAAM,IAAI,GAAG,IAAA,qCAAuB,GAAE,CAAC;AAE1B,QAAA,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;AAC7C,QAAA,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;AACrC,QAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;AACjC,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AAC3B,QAAA,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;AAC/B,QAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;AACjC,QAAA,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC;AACjD,QAAA,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;AACrD,QAAA,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAEhD,wBAAwB;AACX,QAAA,aAAa,GAAG,IAAA,oBAAY,EAAC,YAAY,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@gravity-platform/aws-medical",
3
+ "version": "1.1.1",
4
+ "description": "AWS Comprehend Medical integration for Gravity workflow system - extract medical entities and PHI from clinical text",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "dev": "tsc --watch",
10
+ "test": "jest",
11
+ "lint": "eslint src --ext .ts",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "files": [
15
+ "dist/**/*",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "keywords": [
20
+ "gravity",
21
+ "workflow",
22
+ "aws",
23
+ "comprehend",
24
+ "medical",
25
+ "healthcare",
26
+ "nlp",
27
+ "phi"
28
+ ],
29
+ "author": "Gravity Team",
30
+ "license": "MIT",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "dependencies": {
35
+ "@aws-sdk/client-comprehendmedical": "^3.956.0",
36
+ "@aws-sdk/client-s3": "^3.886.0",
37
+ "@gravity-platform/plugin-base": "*",
38
+ "zod": "^4.4.3"
39
+ },
40
+ "devDependencies": {
41
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
42
+ "@typescript-eslint/parser": "^6.0.0",
43
+ "eslint": "^8.0.0",
44
+ "jest": "^29.0.0",
45
+ "ts-jest": "^29.0.0",
46
+ "typescript": "^5.0.0"
47
+ }
48
+ }