@openhealth/oht-custom-parser-lib 0.2.76 → 0.2.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  export { postDataImportFileUploadToCore, postReportPreviewToCore } from './service/reportCreator.service';
2
2
  export { parseExternalPatientId, parseGender, isPatientAgeValid, handleRejection, queryFileUploadsWithFilters, postFileUploadSetStatus, DigitalizationUpdateFields } from './service/auxiliaryFunctions.service';
3
- export { ohtReportMeasurementsExtractor, } from './service/ohtReportMeasurementsExtractor.service';
4
3
  export { ohtMeasurementsExtractor, checkValueForPlausibleValues, extractReferenceRanges, extractReferenceAnnotation, parseExamValue, getRangeFromPositionAndRegex, extractUnit, extractValueFromGreaterLowerThan } from './service/ohtMeasurementsExtractor.service';
5
4
  export { getSlackFileIssueNotificationMessage, sendMessageToSlack } from './service/slackMessages.service';
6
5
  export { aggregateMessages, aggregateBiMessages, publishToTopic, generateBIMessages } from './service/errorHandling.service';
7
6
  export { applyRules as applyTransformationRules, validateJsonataExpression as validateTransformationRuleExpression, } from './service/transformationRules.service';
8
7
  export { LabToOhtContract, LabToOhtMapper, UnknownMeasurementExtraction, ReferenceAsAnnotation, UnitExtraction, RangeExtraction, RangeExtractionResponse, ValueExtraction, unitSynonyms, ValueExtractionResponse, SynonymUnit, UnknownUnits, } from './types/custom-parser.types';
9
- export { AcfBiomarkerRangeAnnotationCheck, AcfBiomarkerGenericDisclaimerLogic, ManualCheck, BiomarkerCompatibility, ReferenceRangeType, AcfReferenceRange, VisualRange, NameAlias, AlternativeUnit, BiomarkerAcf, Biomarker, PipelineStep, DigitizationStatus, MeasurementValueComparator, BiomarkerValueType, DataImportFileUploadStatus, Sex, Digitization, PatientInfo, UnknownMeasurement, UnmappedLabKey, Measurement, DataImportFileUpload, MessagePayload, SignedUpload, ReportStyleConfig, LanguageCode, BiomarkerCustomisation, PartnerCustomPanel, ReportDisplaySettings, ReportCustomisation, OHTPartner, UploadType, RejectReason, } from './types/oht.types';
8
+ export { AcfBiomarkerRangeAnnotationCheck, AcfBiomarkerGenericDisclaimerLogic, ManualCheck, BiomarkerCompatibility, ReferenceRangeType, AcfReferenceRange, VisualRange, NameAlias, AlternativeUnit, BiomarkerAcf, Biomarker, PipelineStep, DigitizationStatus, MeasurementValueComparator, BiomarkerValueType, DataImportFileUploadStatus, Sex, Digitization, PatientInfo, UnknownMeasurement, Measurement, DataImportFileUpload, MessagePayload, SignedUpload, ReportStyleConfig, LanguageCode, BiomarkerCustomisation, PartnerCustomPanel, ReportDisplaySettings, ReportCustomisation, OHTPartner, UploadType, RejectReason, } from './types/oht.types';
10
9
  export { ErrorMessage } from './types/error.types';
11
10
  export type { TransformationRule, TransformationContext, ApplyRulesResult as TransformationApplyRulesResult, ApplyRulesOptions as TransformationApplyRulesOptions, ValidationResult as TransformationValidationResult, } from './types/transformationRules.types';
12
11
  export { makeApiCallWithRetry, parseErrorObj } from './util-ts/apiUtils';
@@ -15,4 +14,3 @@ export { readFileFromBucket, uploadFileBufferToGCS } from './util-ts/googleStora
15
14
  export { default as pinoLogger } from './util-ts/pinoLogger';
16
15
  export { getGreaterThanPatterns, getLowerThanPatterns } from './util-ts/regexUtils';
17
16
  export { getMappedBiomarkers, } from './util-ts/dataUtils';
18
- export { parseRange } from './util-ts/extractionUtils';
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.pinoLogger = exports.uploadFileBufferToGCS = exports.readFileFromBucket = exports.resolveUnitFromSynonyms = exports.fetchSynonymUnits = exports.processAppendedMappings = exports.isBiomarkerExternalNoVisualRange = exports.isBiomarkerValueNumerical = exports.extractValue = exports.parseErrorObj = exports.makeApiCallWithRetry = exports.RejectReason = exports.UploadType = exports.Sex = exports.DataImportFileUploadStatus = exports.BiomarkerValueType = exports.MeasurementValueComparator = exports.DigitizationStatus = exports.PipelineStep = exports.ReferenceRangeType = exports.BiomarkerCompatibility = exports.ManualCheck = exports.AcfBiomarkerGenericDisclaimerLogic = exports.AcfBiomarkerRangeAnnotationCheck = exports.unitSynonyms = exports.validateTransformationRuleExpression = exports.applyTransformationRules = exports.generateBIMessages = exports.publishToTopic = exports.aggregateBiMessages = exports.aggregateMessages = exports.sendMessageToSlack = exports.getSlackFileIssueNotificationMessage = exports.extractValueFromGreaterLowerThan = exports.extractUnit = exports.getRangeFromPositionAndRegex = exports.parseExamValue = exports.extractReferenceAnnotation = exports.extractReferenceRanges = exports.checkValueForPlausibleValues = exports.ohtMeasurementsExtractor = exports.ohtReportMeasurementsExtractor = exports.postFileUploadSetStatus = exports.queryFileUploadsWithFilters = exports.handleRejection = exports.isPatientAgeValid = exports.parseGender = exports.parseExternalPatientId = exports.postReportPreviewToCore = exports.postDataImportFileUploadToCore = void 0;
7
- exports.parseRange = exports.getMappedBiomarkers = exports.getLowerThanPatterns = exports.getGreaterThanPatterns = void 0;
6
+ exports.getGreaterThanPatterns = exports.pinoLogger = exports.uploadFileBufferToGCS = exports.readFileFromBucket = exports.resolveUnitFromSynonyms = exports.fetchSynonymUnits = exports.processAppendedMappings = exports.isBiomarkerExternalNoVisualRange = exports.isBiomarkerValueNumerical = exports.extractValue = exports.parseErrorObj = exports.makeApiCallWithRetry = exports.RejectReason = exports.UploadType = exports.Sex = exports.DataImportFileUploadStatus = exports.BiomarkerValueType = exports.MeasurementValueComparator = exports.DigitizationStatus = exports.PipelineStep = exports.ReferenceRangeType = exports.BiomarkerCompatibility = exports.ManualCheck = exports.AcfBiomarkerGenericDisclaimerLogic = exports.AcfBiomarkerRangeAnnotationCheck = exports.unitSynonyms = exports.validateTransformationRuleExpression = exports.applyTransformationRules = exports.generateBIMessages = exports.publishToTopic = exports.aggregateBiMessages = exports.aggregateMessages = exports.sendMessageToSlack = exports.getSlackFileIssueNotificationMessage = exports.extractValueFromGreaterLowerThan = exports.extractUnit = exports.getRangeFromPositionAndRegex = exports.parseExamValue = exports.extractReferenceAnnotation = exports.extractReferenceRanges = exports.checkValueForPlausibleValues = exports.ohtMeasurementsExtractor = exports.postFileUploadSetStatus = exports.queryFileUploadsWithFilters = exports.handleRejection = exports.isPatientAgeValid = exports.parseGender = exports.parseExternalPatientId = exports.postReportPreviewToCore = exports.postDataImportFileUploadToCore = void 0;
7
+ exports.getMappedBiomarkers = exports.getLowerThanPatterns = void 0;
8
8
  // ### SERVICES ###
9
9
  var reportCreator_service_1 = require("./service/reportCreator.service");
10
10
  Object.defineProperty(exports, "postDataImportFileUploadToCore", { enumerable: true, get: function () { return reportCreator_service_1.postDataImportFileUploadToCore; } });
@@ -16,8 +16,6 @@ Object.defineProperty(exports, "isPatientAgeValid", { enumerable: true, get: fun
16
16
  Object.defineProperty(exports, "handleRejection", { enumerable: true, get: function () { return auxiliaryFunctions_service_1.handleRejection; } });
17
17
  Object.defineProperty(exports, "queryFileUploadsWithFilters", { enumerable: true, get: function () { return auxiliaryFunctions_service_1.queryFileUploadsWithFilters; } });
18
18
  Object.defineProperty(exports, "postFileUploadSetStatus", { enumerable: true, get: function () { return auxiliaryFunctions_service_1.postFileUploadSetStatus; } });
19
- var ohtReportMeasurementsExtractor_service_1 = require("./service/ohtReportMeasurementsExtractor.service");
20
- Object.defineProperty(exports, "ohtReportMeasurementsExtractor", { enumerable: true, get: function () { return ohtReportMeasurementsExtractor_service_1.ohtReportMeasurementsExtractor; } });
21
19
  var ohtMeasurementsExtractor_service_1 = require("./service/ohtMeasurementsExtractor.service");
22
20
  Object.defineProperty(exports, "ohtMeasurementsExtractor", { enumerable: true, get: function () { return ohtMeasurementsExtractor_service_1.ohtMeasurementsExtractor; } });
23
21
  Object.defineProperty(exports, "checkValueForPlausibleValues", { enumerable: true, get: function () { return ohtMeasurementsExtractor_service_1.checkValueForPlausibleValues; } });
@@ -76,6 +74,4 @@ Object.defineProperty(exports, "getGreaterThanPatterns", { enumerable: true, get
76
74
  Object.defineProperty(exports, "getLowerThanPatterns", { enumerable: true, get: function () { return regexUtils_1.getLowerThanPatterns; } });
77
75
  var dataUtils_2 = require("./util-ts/dataUtils");
78
76
  Object.defineProperty(exports, "getMappedBiomarkers", { enumerable: true, get: function () { return dataUtils_2.getMappedBiomarkers; } });
79
- var extractionUtils_1 = require("./util-ts/extractionUtils");
80
- Object.defineProperty(exports, "parseRange", { enumerable: true, get: function () { return extractionUtils_1.parseRange; } });
81
77
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;AAAA,mBAAmB;AACnB,yEAGyC;AAFvC,uIAAA,8BAA8B,OAAA;AAC9B,gIAAA,uBAAuB,OAAA;AAEzB,mFAQ8C;AAP5C,oIAAA,sBAAsB,OAAA;AACtB,yHAAA,WAAW,OAAA;AACX,+HAAA,iBAAiB,OAAA;AACjB,6HAAA,eAAe,OAAA;AACf,yIAAA,2BAA2B,OAAA;AAC3B,qIAAA,uBAAuB,OAAA;AAIzB,2GAE0D;AADxD,wJAAA,8BAA8B,OAAA;AAGhC,+FASoD;AARlD,4IAAA,wBAAwB,OAAA;AACxB,gJAAA,4BAA4B,OAAA;AAC5B,0IAAA,sBAAsB,OAAA;AACtB,8IAAA,0BAA0B,OAAA;AAC1B,kIAAA,cAAc,OAAA;AACd,gJAAA,4BAA4B,OAAA;AAC5B,+HAAA,WAAW,OAAA;AACX,oJAAA,gCAAgC,OAAA;AAGlC,yEAEyC;AADvC,6IAAA,oCAAoC,OAAA;AAAE,2HAAA,kBAAkB,OAAA;AAE1D,yEAKyC;AAJvC,0HAAA,iBAAiB,OAAA;AACjB,4HAAA,mBAAmB,OAAA;AACnB,uHAAA,cAAc,OAAA;AACd,2HAAA,kBAAkB,OAAA;AAEpB,qFAG+C;AAF7C,uIAAA,UAAU,OAA4B;AACtC,mJA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AAA;AAAE,oHAAA,uBAAuB,OAAA;AACtJ,mEAAuF;AAA/E,wHAAA,kBAAkB,OAAA;AAAE,2HAAA,qBAAqB,OAAA;AACjD,mDAA2D;AAAnD,yHAAA,OAAO,OAAc;AAC7B,mDAAkF;AAA1E,oHAAA,sBAAsB,OAAA;AAAE,kHAAA,oBAAoB,OAAA;AACpD,iDAA0D;AAAlD,gHAAA,mBAAmB,OAAA"}
@@ -73,7 +73,7 @@ export interface OriginalExam {
73
73
  export interface LabToOhtMapper {
74
74
  ohtBmId?: number;
75
75
  biomarkerName?: string;
76
- labKey?: string;
76
+ labKey: string;
77
77
  rawExam?: string;
78
78
  material?: string;
79
79
  method?: string;
@@ -182,7 +182,6 @@ export interface OhtRange {
182
182
  text: string;
183
183
  age?: string;
184
184
  sex?: string;
185
- noSourceRanges?: boolean;
186
185
  }
187
186
  export interface OriginalExam {
188
187
  contentType: string;
@@ -445,9 +444,6 @@ export interface BackendBiomarkerMapping {
445
444
  jsonBlob?: any;
446
445
  isIgnored?: boolean;
447
446
  keepAsUnmapped?: boolean;
448
- /** Optional tagged LOINC code */
449
- taggedLoincCode?: string;
450
- /** all the following configurations will be deleted */
451
447
  /** Range extraction configuration */
452
448
  rangeExtraction: RangeExtractionConfig;
453
449
  /** Unit extraction configuration */
@@ -457,7 +453,9 @@ export interface BackendBiomarkerMapping {
457
453
  /** Reference as annotation configuration */
458
454
  referenceAsAnnotation: ReferenceAsAnnotationConfig;
459
455
  /** Annotation configuration for appended biomarkers */
460
- annotationConfig: AnnotationConfig;
456
+ annotationConfig?: AnnotationConfig;
457
+ /** Optional tagged LOINC code */
458
+ taggedLoincCode?: string;
461
459
  }
462
460
  /** Custom parser transformation rules */
463
461
  export type TransformationRule = {
@@ -1 +1 @@
1
- {"version":3,"file":"oht.types.js","sourceRoot":"","sources":["../../types/oht.types.ts"],"names":[],"mappings":";;;AA+OA,IAAY,GAIX;AAJD,WAAY,GAAG;IACb,oBAAa,CAAA;IACb,wBAAiB,CA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ACzB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,kCAGX;AAHD,WAAY,kCAAkC;IAC5C,6DAAuB,CAAA;IACvB,iEAA2B,CAAA;AAC7B,CAAC,EAHW,kCAAkC,kDAAlC,kCAAkC,QAG7C;AAED,IAAY,gCAMX;AAND,WAAY,gCAAgC;IAC1C,2DAAuB,CAAA;IACvB,6EAAyC,CAAA;IACzC,+EAA2C,CAAA;IAC3C,2FAAuD,CAAA;IACvD,uFAAmD,CAAA;AACrD,CAAC,EANW,gCAAgC,gDAAhC,gCAAgC,QAM3C"}
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
- {
2
- "name": "@openhealth/oht-custom-parser-lib",
3
- "version": "0.2.76",
4
- "description": "Shared nodejs lib with with reusable functions",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "/dist"
9
- ],
10
- "scripts": {
11
- "test": "jest"
12
- },
13
- "keywords": [],
14
- "author": "",
15
- "license": "ISC",
16
- "dependencies": {
17
- "@google-cloud/pubsub": "^4.10.0",
18
- "@google-cloud/storage": "^7.7.0",
19
- "axios": "^1.6.7",
20
- "bottleneck": "^2.19.5",
21
- "dayjs": "^1.11.13",
22
- "dotenv": "^16.4.5",
23
- "jsonata": "^2.1.0",
24
- "moment": "^2.30.1",
25
- "mongodb": "^6.3.0",
26
- "pino": "^8.19.0"
27
- },
28
- "devDependencies": {
29
- "@types/jest": "^29.5.14",
30
- "axios-mock-adapter": "^2.1.0",
31
- "jest": "^29.7.0",
32
- "ts-jest": "^29.2.5"
33
- }
34
- }
1
+ {
2
+ "name": "@openhealth/oht-custom-parser-lib",
3
+ "version": "0.2.77",
4
+ "description": "Shared nodejs lib with with reusable functions",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "test": "jest"
12
+ },
13
+ "keywords": [],
14
+ "author": "",
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "@google-cloud/pubsub": "^4.10.0",
18
+ "@google-cloud/storage": "^7.7.0",
19
+ "axios": "^1.6.7",
20
+ "bottleneck": "^2.19.5",
21
+ "dayjs": "^1.11.13",
22
+ "dotenv": "^16.4.5",
23
+ "jsonata": "^2.1.0",
24
+ "moment": "^2.30.1",
25
+ "mongodb": "^6.3.0",
26
+ "pino": "^8.19.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/jest": "^29.5.14",
30
+ "axios-mock-adapter": "^2.1.0",
31
+ "jest": "^29.7.0",
32
+ "ts-jest": "^29.2.5"
33
+ }
34
+ }
package/readme.md CHANGED
@@ -1,99 +1,99 @@
1
- # oht-custom-parser-lib
2
-
3
- `oht-custom-parser-lib` is a shared library designed for use across multiple Node.js cloud functions. It contains common MongoDB connectors and data utilities that can be reused to avoid code duplication and ensure consistency.
4
-
5
- ## Table of Contents
6
-
7
- - [Installation](#installation)
8
- - [Usage](#usage)
9
- - [Development](#development)
10
- - [Patch Versions](#patch-versions)
11
- - [Publish to npm Registry](#publish-to-npm-registry)
12
- - [Using the Library in Cloud Functions](#using-the-library-in-cloud-functions)
13
-
14
- ## Installation
15
-
16
- To install `oht-custom-parser-lib`, you can add it as a dependency in your project using npm:
17
-
18
- ```bash
19
- npm install oht-custom-parser-lib
20
- ```
21
-
22
- Or, if you want to install a specific version:
23
-
24
- ```bash
25
- npm install oht-custom-parser-lib@<version>
26
- ```
27
-
28
- ## Usage
29
-
30
- After installing, you can import and use the library in your cloud functions:
31
-
32
- ```javascript
33
- const { connectToMongoDB } = require('oht-custom-parser-lib');
34
- ```
35
-
36
- ## Development
37
-
38
- ### Patch Versions
39
-
40
- When making changes to the `oht-custom-parser-lib`, you need to update the version number before publishing. Follow these steps:
41
-
42
- 1. **Update the version number**: Use npm's version command to bump the version:
43
- - **Patch** for bug fixes:
44
- ```bash
45
- npm version patch
46
- ```
47
- - **Minor** for new features:
48
- ```bash
49
- npm version minor
50
- ```
51
- - **Major** for breaking changes:
52
- ```bash
53
- npm version major
54
- ```
55
-
56
- This command will automatically update the version in the `package.json` and create a git tag.
57
-
58
- 2. **Commit Changes**: Ensure your changes and the version bump are committed to the repository.
59
-
60
- ### Publish to npm Registry
61
-
62
- After updating the version, you can publish the library to the npm registry:
63
-
64
- 1. **Login to npm** (if you haven't already):
65
- ```bash
66
- npm login
67
- ```
68
-
69
- 2. **Publish the package**:
70
- ```bash
71
- npm publish
72
- ```
73
-
74
- If this is a private package, use:
75
- ```bash
76
- npm publish --access restricted
77
- ```
78
-
79
- 3. **Verify the publish**: You can check the package on [npmjs.com](https://www.npmjs.com/) to verify that the new version is available.
80
-
81
- ## Using the Library in Cloud Functions
82
-
83
- To use `oht-custom-parser-lib` in your cloud functions:
84
-
85
- 1. **Install the Library**: Add `oht-custom-parser-lib` as a dependency in the cloud function's `package.json`:
86
-
87
- ```json
88
- {
89
- "dependencies": {
90
- "oht-custom-parser-lib": "^1.0.0"
91
- }
92
- }
93
- ```
94
-
95
- Replace `^1.0.0` with the appropriate version as needed.
96
-
97
- 2. **Install Dependencies**: Run `npm install` to install the library along with other dependencies.
98
-
99
- 3. **Deploy Your Function**: Deploy your cloud function as usual, ensuring that the updated dependencies are included.
1
+ # oht-custom-parser-lib
2
+
3
+ `oht-custom-parser-lib` is a shared library designed for use across multiple Node.js cloud functions. It contains common MongoDB connectors and data utilities that can be reused to avoid code duplication and ensure consistency.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Installation](#installation)
8
+ - [Usage](#usage)
9
+ - [Development](#development)
10
+ - [Patch Versions](#patch-versions)
11
+ - [Publish to npm Registry](#publish-to-npm-registry)
12
+ - [Using the Library in Cloud Functions](#using-the-library-in-cloud-functions)
13
+
14
+ ## Installation
15
+
16
+ To install `oht-custom-parser-lib`, you can add it as a dependency in your project using npm:
17
+
18
+ ```bash
19
+ npm install oht-custom-parser-lib
20
+ ```
21
+
22
+ Or, if you want to install a specific version:
23
+
24
+ ```bash
25
+ npm install oht-custom-parser-lib@<version>
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ After installing, you can import and use the library in your cloud functions:
31
+
32
+ ```javascript
33
+ const { connectToMongoDB } = require('oht-custom-parser-lib');
34
+ ```
35
+
36
+ ## Development
37
+
38
+ ### Patch Versions
39
+
40
+ When making changes to the `oht-custom-parser-lib`, you need to update the version number before publishing. Follow these steps:
41
+
42
+ 1. **Update the version number**: Use npm's version command to bump the version:
43
+ - **Patch** for bug fixes:
44
+ ```bash
45
+ npm version patch
46
+ ```
47
+ - **Minor** for new features:
48
+ ```bash
49
+ npm version minor
50
+ ```
51
+ - **Major** for breaking changes:
52
+ ```bash
53
+ npm version major
54
+ ```
55
+
56
+ This command will automatically update the version in the `package.json` and create a git tag.
57
+
58
+ 2. **Commit Changes**: Ensure your changes and the version bump are committed to the repository.
59
+
60
+ ### Publish to npm Registry
61
+
62
+ After updating the version, you can publish the library to the npm registry:
63
+
64
+ 1. **Login to npm** (if you haven't already):
65
+ ```bash
66
+ npm login
67
+ ```
68
+
69
+ 2. **Publish the package**:
70
+ ```bash
71
+ npm publish
72
+ ```
73
+
74
+ If this is a private package, use:
75
+ ```bash
76
+ npm publish --access restricted
77
+ ```
78
+
79
+ 3. **Verify the publish**: You can check the package on [npmjs.com](https://www.npmjs.com/) to verify that the new version is available.
80
+
81
+ ## Using the Library in Cloud Functions
82
+
83
+ To use `oht-custom-parser-lib` in your cloud functions:
84
+
85
+ 1. **Install the Library**: Add `oht-custom-parser-lib` as a dependency in the cloud function's `package.json`:
86
+
87
+ ```json
88
+ {
89
+ "dependencies": {
90
+ "oht-custom-parser-lib": "^1.0.0"
91
+ }
92
+ }
93
+ ```
94
+
95
+ Replace `^1.0.0` with the appropriate version as needed.
96
+
97
+ 2. **Install Dependencies**: Run `npm install` to install the library along with other dependencies.
98
+
99
+ 3. **Deploy Your Function**: Deploy your cloud function as usual, ensuring that the updated dependencies are included.
@@ -1,59 +0,0 @@
1
- import { LabToOhtContract, LabToOhtMapper, RangeExtractionResponse, SynonymUnit, UnknownUnits, TransformationRulesChains } from "../types/custom-parser.types";
2
- import { Biomarker, BiomarkerValueType, Measurement, MeasurementValueComparator, PatientInfo, UnknownMeasurement, Exam } from "../types/oht.types";
3
- /**
4
- * Extracts unit from rawData (OhtExam object)
5
- * @param rawData - OhtExam object (not a JSON string)
6
- * @param ohtBiomarker - Biomarker information
7
- * @param synonymUnits - Synonym units for unit resolution
8
- * @param partnerId - Partner ID for synonym resolution
9
- */
10
- declare function agnosticExtractUnit(rawData: any, ohtBiomarker: Biomarker, synonymUnits?: SynonymUnit[] | null, partnerId?: string | null | undefined): {
11
- unit: string;
12
- isUnitParsedCorrectly: boolean;
13
- originalUnit: string;
14
- isArbitraryUnit: boolean;
15
- unknownUnit: string;
16
- };
17
- /**
18
- * Extracts reference annotation from rawExam (OhtExam object)
19
- * @param labToOhtMapper - Lab to OHT mapper configuration
20
- * @param rawExam - OhtExam object (not a JSON string)
21
- * @param patientInfo - Patient information
22
- * @param documentDate - Document date
23
- * @param exams - Array of exams for appended mappings
24
- */
25
- declare function agnosticExtractReferenceAnnotation(labToOhtMapper: LabToOhtMapper, rawExam: any, patientInfo: PatientInfo, documentDate?: Date, exams?: Exam[]): string;
26
- /**
27
- * Extracts reference ranges from rawData (OhtExam object)
28
- * Always uses parseRange function from extractionUtils for range extraction
29
- */
30
- declare function agnosticExtractReferenceRanges(labToOhtMapper: LabToOhtMapper, rawData: any, patientInfo: PatientInfo, documentDate?: Date): RangeExtractionResponse;
31
- declare function agnosticExtractValueFromGreaterLowerThan(value: string): {
32
- extractedValue: number | null;
33
- extractedValueComparator: MeasurementValueComparator | null;
34
- valueParsedCorrectly: boolean;
35
- };
36
- /**
37
- * Parses exam value from rawExamObj (OhtExam object)
38
- * Now uses value directly from ohtExam
39
- */
40
- declare function agnosticParseExamValue(rawExamObj: any, ohtBiomarker: Biomarker): {
41
- valueType: BiomarkerValueType;
42
- alphanumericalValue: string | null;
43
- numberValue: number | null;
44
- valueComparator: MeasurementValueComparator;
45
- isValueParsedCorrectly: boolean;
46
- };
47
- declare function agnosticCheckValueForPlausibleValues(labToOhtMapper: LabToOhtMapper, ohtBiomarker: Biomarker, unit: string, value: number, isUnitParsedCorrectly: boolean): boolean;
48
- type ApplyTransformationRulesResult = {
49
- transformedExams: Exam[];
50
- applicationErrorMessages: string[];
51
- };
52
- declare function ohtAgnosticMeasurementsExtractor(labToOhtContract: LabToOhtContract, exams: Exam[], transformationRules: TransformationRulesChains, ohtCoreApiKey: string, partnerId?: string | null | undefined): Promise<{
53
- measurements: Measurement[];
54
- unknownMeasurements: UnknownMeasurement[];
55
- unknownUnits: UnknownUnits[];
56
- isReportCorrectlyParsed: boolean;
57
- transformationRulesErrors: string[];
58
- }>;
59
- export { ApplyTransformationRulesResult, ohtAgnosticMeasurementsExtractor, agnosticCheckValueForPlausibleValues, agnosticExtractReferenceRanges, agnosticExtractReferenceAnnotation, agnosticParseExamValue, agnosticExtractUnit, agnosticExtractValueFromGreaterLowerThan };