@lowlysre/icd-10-cm 0.0.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Retrieves the description for a given ICD-10-CM code.
3
+ *
4
+ * @param {string} code - The ICD-10-CM code for which to get the description.
5
+ * @returns {string | undefined} The description of the ICD-10-CM code, or `undefined` if the code is not found.
6
+ *
7
+ * @example
8
+ * // Example usage with valid code:
9
+ * const description = getICD10Description('A000');
10
+ * console.log(description); // Outputs: 'Cholera due to Vibrio cholerae 01, biovar cholerae'
11
+ *
12
+ * // Example usage with invalid code:
13
+ * const unknownDescription = getICD10Description('Z999');
14
+ * console.log(unknownDescription); // Outputs: undefined (if the code does not exist)
15
+ */
16
+ export declare const getICD10Description: (code: string) => string | undefined;
17
+ export default getICD10Description;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getICD10Description = void 0;
7
+ const icd10_min_json_1 = __importDefault(require("../data/icd10.min.json"));
8
+ /**
9
+ * Retrieves the description for a given ICD-10-CM code.
10
+ *
11
+ * @param {string} code - The ICD-10-CM code for which to get the description.
12
+ * @returns {string | undefined} The description of the ICD-10-CM code, or `undefined` if the code is not found.
13
+ *
14
+ * @example
15
+ * // Example usage with valid code:
16
+ * const description = getICD10Description('A000');
17
+ * console.log(description); // Outputs: 'Cholera due to Vibrio cholerae 01, biovar cholerae'
18
+ *
19
+ * // Example usage with invalid code:
20
+ * const unknownDescription = getICD10Description('Z999');
21
+ * console.log(unknownDescription); // Outputs: undefined (if the code does not exist)
22
+ */
23
+ const getICD10Description = (code) => {
24
+ const icd10Data = icd10_min_json_1.default;
25
+ const icd10Dictionary = icd10Data;
26
+ return icd10Dictionary[code];
27
+ };
28
+ exports.getICD10Description = getICD10Description;
29
+ exports.default = exports.getICD10Description;
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@lowlysre/icd-10-cm",
3
+ "version": "0.0.1",
4
+ "description": "ICD-10-CM data",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "jest",
8
+ "lint": "eslint . --ext .ts",
9
+ "build": "tsc --declaration",
10
+ "parse-icd": "ts-node scripts/parseICD.ts"
11
+ },
12
+ "types": "./src/ICD10Dictionary.d.ts",
13
+ "author": "John McCall",
14
+ "license": "MIT",
15
+ "files": [
16
+ "/dist"
17
+ ],
18
+ "publishConfig": {
19
+ "registry": "https://registry.npmjs.org/",
20
+ "access": "public",
21
+ "tag": "latest"
22
+ },
23
+ "repository": {
24
+ "url": "https://github.com/lowlysre/icd-10-cm"
25
+ },
26
+ "devDependencies": {
27
+ "@types/jest": "^29.5.12",
28
+ "@typescript-eslint/eslint-plugin": "^7.15.0",
29
+ "@typescript-eslint/parser": "^7.15.0",
30
+ "eslint": "^8.57.0",
31
+ "eslint-config-prettier": "^9.1.0",
32
+ "eslint-plugin-jest": "^28.6.0",
33
+ "eslint-plugin-prettier": "^5.1.3",
34
+ "jest": "^29.7.0",
35
+ "node": "^22.4.0",
36
+ "prettier": "^3.3.2",
37
+ "ts-jest": "^29.1.5",
38
+ "ts-node": "^10.9.2",
39
+ "typescript": "^5.5.3"
40
+ }
41
+ }