@openhealth/oht-custom-parser-lib 0.2.67 → 0.2.68
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.
|
@@ -17,7 +17,7 @@ declare function parseGender(patientGender?: string): {
|
|
|
17
17
|
* @param errorMessages - Array to append error messages to
|
|
18
18
|
* @returns Object containing rejectedStatus and rejectReason
|
|
19
19
|
*/
|
|
20
|
-
declare function handleRejection(parseType: string, errorMessages: ErrorMessage[]): {
|
|
20
|
+
declare function handleRejection(parseType: string, errorMessages: ErrorMessage[], notifySlack?: boolean, notifyNotes?: boolean, notifyBi?: boolean): {
|
|
21
21
|
rejectedStatus: string;
|
|
22
22
|
rejectReason: RejectReason;
|
|
23
23
|
};
|
|
@@ -63,7 +63,7 @@ function parseGender(patientGender) {
|
|
|
63
63
|
* @param errorMessages - Array to append error messages to
|
|
64
64
|
* @returns Object containing rejectedStatus and rejectReason
|
|
65
65
|
*/
|
|
66
|
-
function handleRejection(parseType, errorMessages) {
|
|
66
|
+
function handleRejection(parseType, errorMessages, notifySlack = true, notifyNotes = false, notifyBi = false) {
|
|
67
67
|
const rejectedStatus = 'REJECTED';
|
|
68
68
|
const lowerParseType = parseType.toLowerCase();
|
|
69
69
|
// Priority-based mapping: check most specific cases first
|
|
@@ -138,7 +138,7 @@ function handleRejection(parseType, errorMessages) {
|
|
|
138
138
|
rejectReason = oht_types_1.RejectReason.INVALID_DATA_NO_BIOMARKER_DATA;
|
|
139
139
|
}
|
|
140
140
|
errorMessages.push({
|
|
141
|
-
destination: { slack:
|
|
141
|
+
destination: { slack: notifySlack, notes: notifyNotes, bi: notifyBi },
|
|
142
142
|
message: `File rejected: ${parseType} parsing failed. Reason: ${rejectReason}`,
|
|
143
143
|
});
|
|
144
144
|
return { rejectedStatus, rejectReason };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auxiliaryFunctions.service.js","sourceRoot":"","sources":["../../service/auxiliaryFunctions.service.ts"],"names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AAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CACxC,CAAC;IACN,CAAC,EAAE,IAAI,GAAG,EAAgC,CAAC,CAAC;AACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@openhealth/oht-custom-parser-lib",
|
|
3
|
-
"version": "0.2.
|
|
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.68",
|
|
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.
|