@nhealth/fhir-terminology 0.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 (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +159 -0
  3. package/dist/module.d.mts +62 -0
  4. package/dist/module.json +9 -0
  5. package/dist/module.mjs +1161 -0
  6. package/dist/runtime/app/assets/tailwind.css +1 -0
  7. package/dist/runtime/app/components/OperationExpand.d.vue.ts +48 -0
  8. package/dist/runtime/app/components/OperationExpand.vue +263 -0
  9. package/dist/runtime/app/components/OperationExpand.vue.d.ts +48 -0
  10. package/dist/runtime/app/components/OperationLookup.d.vue.ts +32 -0
  11. package/dist/runtime/app/components/OperationLookup.vue +274 -0
  12. package/dist/runtime/app/components/OperationLookup.vue.d.ts +32 -0
  13. package/dist/runtime/app/components/OperationSubsumes.d.vue.ts +21 -0
  14. package/dist/runtime/app/components/OperationSubsumes.vue +84 -0
  15. package/dist/runtime/app/components/OperationSubsumes.vue.d.ts +21 -0
  16. package/dist/runtime/app/components/OperationValidate.d.vue.ts +27 -0
  17. package/dist/runtime/app/components/OperationValidate.vue +84 -0
  18. package/dist/runtime/app/components/OperationValidate.vue.d.ts +27 -0
  19. package/dist/runtime/app/components/ResourceJson.d.vue.ts +11 -0
  20. package/dist/runtime/app/components/ResourceJson.vue +37 -0
  21. package/dist/runtime/app/components/ResourceJson.vue.d.ts +11 -0
  22. package/dist/runtime/app/pages/index.d.vue.ts +3 -0
  23. package/dist/runtime/app/pages/index.vue +45 -0
  24. package/dist/runtime/app/pages/index.vue.d.ts +3 -0
  25. package/dist/runtime/app/pages/packages/[id]/import.d.vue.ts +3 -0
  26. package/dist/runtime/app/pages/packages/[id]/import.vue +712 -0
  27. package/dist/runtime/app/pages/packages/[id]/import.vue.d.ts +3 -0
  28. package/dist/runtime/app/pages/packages/[id].d.vue.ts +3 -0
  29. package/dist/runtime/app/pages/packages/[id].vue +303 -0
  30. package/dist/runtime/app/pages/packages/[id].vue.d.ts +3 -0
  31. package/dist/runtime/app/pages/packages/index.d.vue.ts +3 -0
  32. package/dist/runtime/app/pages/packages/index.vue +118 -0
  33. package/dist/runtime/app/pages/packages/index.vue.d.ts +3 -0
  34. package/dist/runtime/app/pages/server.d.vue.ts +3 -0
  35. package/dist/runtime/app/pages/server.vue +947 -0
  36. package/dist/runtime/app/pages/server.vue.d.ts +3 -0
  37. package/dist/runtime/ig/CodeSystem-terminology-import-status.json +19 -0
  38. package/dist/runtime/ig/StructureDefinition-terminology-import-state.json +81 -0
  39. package/dist/runtime/server/api/fhir/terminology/[id]/concepts.get.d.ts +40 -0
  40. package/dist/runtime/server/api/fhir/terminology/[id]/concepts.get.js +60 -0
  41. package/dist/runtime/server/api/fhir/terminology/[id]/import/history.get.d.ts +11 -0
  42. package/dist/runtime/server/api/fhir/terminology/[id]/import/history.get.js +28 -0
  43. package/dist/runtime/server/api/fhir/terminology/[id]/import/index.get.d.ts +12 -0
  44. package/dist/runtime/server/api/fhir/terminology/[id]/import/index.get.js +16 -0
  45. package/dist/runtime/server/api/fhir/terminology/[id]/import/index.post.d.ts +20 -0
  46. package/dist/runtime/server/api/fhir/terminology/[id]/import/index.post.js +38 -0
  47. package/dist/runtime/server/api/fhir/terminology/[id]/resources/[resourceId].get.d.ts +8 -0
  48. package/dist/runtime/server/api/fhir/terminology/[id]/resources/[resourceId].get.js +25 -0
  49. package/dist/runtime/server/api/fhir/terminology/[id]/resources.get.d.ts +8 -0
  50. package/dist/runtime/server/api/fhir/terminology/[id]/resources.get.js +17 -0
  51. package/dist/runtime/server/api/fhir/terminology/[id].get.d.ts +19 -0
  52. package/dist/runtime/server/api/fhir/terminology/[id].get.js +32 -0
  53. package/dist/runtime/server/api/fhir/terminology/packages.get.d.ts +31 -0
  54. package/dist/runtime/server/api/fhir/terminology/packages.get.js +46 -0
  55. package/dist/runtime/server/api/fhir/terminology/server/expand.get.d.ts +7 -0
  56. package/dist/runtime/server/api/fhir/terminology/server/expand.get.js +85 -0
  57. package/dist/runtime/server/api/fhir/terminology/server/expand.post.d.ts +2 -0
  58. package/dist/runtime/server/api/fhir/terminology/server/expand.post.js +33 -0
  59. package/dist/runtime/server/api/fhir/terminology/server/lookup.get.d.ts +7 -0
  60. package/dist/runtime/server/api/fhir/terminology/server/lookup.get.js +31 -0
  61. package/dist/runtime/server/api/fhir/terminology/server/resource.get.d.ts +7 -0
  62. package/dist/runtime/server/api/fhir/terminology/server/resource.get.js +15 -0
  63. package/dist/runtime/server/api/fhir/terminology/server/resources.get.d.ts +29 -0
  64. package/dist/runtime/server/api/fhir/terminology/server/resources.get.js +110 -0
  65. package/dist/runtime/server/api/fhir/terminology/server/subsumes.get.d.ts +7 -0
  66. package/dist/runtime/server/api/fhir/terminology/server/subsumes.get.js +25 -0
  67. package/dist/runtime/server/api/fhir/terminology/server/validate.get.d.ts +7 -0
  68. package/dist/runtime/server/api/fhir/terminology/server/validate.get.js +38 -0
  69. package/dist/runtime/server/api/fhir/terminology/tasks/[taskId].get.d.ts +8 -0
  70. package/dist/runtime/server/api/fhir/terminology/tasks/[taskId].get.js +14 -0
  71. package/dist/runtime/server/functions/import.d.ts +19 -0
  72. package/dist/runtime/server/functions/import.js +706 -0
  73. package/dist/runtime/server/functions/packages.d.ts +13 -0
  74. package/dist/runtime/server/functions/packages.js +25 -0
  75. package/dist/runtime/server/tsconfig.json +7 -0
  76. package/dist/runtime/server/utils/audit.d.ts +18 -0
  77. package/dist/runtime/server/utils/audit.js +97 -0
  78. package/dist/runtime/server/utils/fhir-generator.d.ts +142 -0
  79. package/dist/runtime/server/utils/fhir-generator.js +205 -0
  80. package/dist/runtime/server/utils/generated-artifacts.d.ts +30 -0
  81. package/dist/runtime/server/utils/generated-artifacts.js +27 -0
  82. package/dist/runtime/server/utils/generated-storage.d.ts +4 -0
  83. package/dist/runtime/server/utils/generated-storage.js +6 -0
  84. package/dist/runtime/server/utils/state-tracker.d.ts +55 -0
  85. package/dist/runtime/server/utils/state-tracker.js +105 -0
  86. package/dist/runtime/server/utils/storage.d.ts +4 -0
  87. package/dist/runtime/server/utils/storage.js +6 -0
  88. package/dist/runtime/server/utils/task.d.ts +59 -0
  89. package/dist/runtime/server/utils/task.js +181 -0
  90. package/dist/runtime/types/manifest.d.ts +165 -0
  91. package/dist/runtime/types/manifest.js +0 -0
  92. package/dist/runtime/types/state.d.ts +50 -0
  93. package/dist/runtime/types/state.js +0 -0
  94. package/dist/runtime/types/terminology.d.ts +102 -0
  95. package/dist/runtime/types/terminology.js +0 -0
  96. package/dist/types.d.mts +3 -0
  97. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nhealthorg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # @nhealth/fhir-terminology
2
+
3
+ Terminology module for Nuxt applications using FHIR resources.
4
+
5
+ `@nhealth/fhir-terminology` helps teams manage terminology packages from source files to generated FHIR artifacts and server import workflows.
6
+
7
+ ## Features
8
+
9
+ - Parse common terminology source formats (for example ICD-10, LOINC, OPS, SNOMED CT)
10
+ - Generate FHIR R4 terminology resources (CodeSystem and ValueSet)
11
+ - Incremental rebuild behavior for local terminology sources
12
+ - Package discovery and package-level metadata/indexing
13
+ - Import and dry-run workflows for connected FHIR servers
14
+ - Optional terminology UI app for exploration and operations
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pnpm add @nhealth/fhir-terminology
20
+ ```
21
+
22
+ Usually paired with:
23
+
24
+ ```bash
25
+ pnpm add @nhealth/fhir
26
+ ```
27
+
28
+ Optional (only if your setup requires workflow execution):
29
+
30
+ ```bash
31
+ pnpm add nvent
32
+ ```
33
+
34
+ ## Minimal Setup
35
+
36
+ ```ts
37
+ // nuxt.config.ts
38
+ export default defineNuxtConfig({
39
+ modules: [
40
+ '@nhealth/fhir',
41
+ '@nhealth/fhir-terminology',
42
+ ],
43
+
44
+ fhir: {
45
+ client: {
46
+ serverUrl: 'http://localhost:8103',
47
+ basePath: '/fhir/R4',
48
+ },
49
+ },
50
+
51
+ fhirTerminology: {
52
+ sourceDirs: ['./terminology'],
53
+ app: true,
54
+ appRoutePath: '/_terminology',
55
+ },
56
+ })
57
+ ```
58
+
59
+ Create terminology packages under:
60
+
61
+ ```text
62
+ terminology/<package>/
63
+ terminology.manifest.json
64
+ <source files>
65
+ ```
66
+
67
+ Then run:
68
+
69
+ ```bash
70
+ pnpm dev
71
+ # or
72
+ pnpm build
73
+ ```
74
+
75
+ ## Quick Workflow
76
+
77
+ 1. Create a package folder under `terminology/`.
78
+ 2. Add `terminology.manifest.json` and source files.
79
+ 3. Start the app (`pnpm dev`) to generate artifacts.
80
+ 4. Open the terminology app (for example `/_terminology`).
81
+ 5. Run dry-run/import and validate results with terminology operations.
82
+
83
+ Example package layout:
84
+
85
+ ```text
86
+ terminology/
87
+ icd10/
88
+ terminology.manifest.json
89
+ icd10gm2026syst-meta.zip
90
+ ```
91
+
92
+ Example manifest:
93
+
94
+ ```json
95
+ {
96
+ "id": "icd10-2026",
97
+ "name": "ICD-10 2026",
98
+ "version": "2026",
99
+ "system": "http://fhir.de/CodeSystem/bfarm/icd10",
100
+ "format": "auto",
101
+ "sources": ["icd10gm2026syst-meta.zip"],
102
+ "resources": ["CodeSystem", "ValueSet"],
103
+ "hierarchical": true
104
+ }
105
+ ```
106
+
107
+ ## What You Can Do with the Module
108
+
109
+ - Build CodeSystem/ValueSet artifacts from local source files
110
+ - Browse generated packages and concepts in the optional app
111
+ - Run terminology operations against your configured FHIR server
112
+ - Import generated resources with progress tracking
113
+
114
+ ## Supported Source Formats
115
+
116
+ | Format | Typical use |
117
+ |--------|-------------|
118
+ | `auto` | Recommended default (auto-detect parser) |
119
+ | `bfarm-icd10-csv` | ICD-10 BfArM sources |
120
+ | `bfarm-ops-csv` | OPS BfArM sources |
121
+ | `loinc-csv` | LOINC sources |
122
+ | `snomed-rf2-zip` | SNOMED CT RF2 releases |
123
+ | `fhir-json` | Prebuilt FHIR resources |
124
+ | `generic-csv` | Custom CSV-based terminologies |
125
+
126
+ ## Key Module Options
127
+
128
+ | Option | Type | Default | Purpose |
129
+ |--------|------|---------|---------|
130
+ | `sourceDirs` | `string[]` | `['./terminology']` | Terminology package discovery |
131
+ | `app` | `boolean` | `false` | Enable bundled terminology app |
132
+ | `appRoutePath` | `string` | module default | Route for terminology app |
133
+ | `appLayout` | `string \| false` | `false` | Use a Nuxt layout for app pages |
134
+
135
+ ## API Surface (High Level)
136
+
137
+ The module exposes server routes for:
138
+
139
+ - package listing and package details
140
+ - package resource inspection
141
+ - import and dry-run workflows
142
+ - task/progress retrieval
143
+
144
+ Exact route usage is documented in the guides below.
145
+
146
+ ## Documentation
147
+
148
+ - [Getting Started](./docs/getting-started.md)
149
+ - [Manifest Reference](./docs/manifest-reference.md)
150
+ - [Terminology UI Guide](./docs/terminology-server-ui.md)
151
+
152
+ Internal engineering specs:
153
+
154
+ - [Design Notes](./specs/DESIGN_NOTES.md)
155
+ - [Hierarchy Navigation](./specs/HIERARCHY_NAVIGATION.md)
156
+
157
+ ## License
158
+
159
+ MIT
@@ -0,0 +1,62 @@
1
+ import * as nuxt_schema from 'nuxt/schema';
2
+
3
+ type ModuleOptions = {
4
+ /**
5
+ * Directory that contains terminology source packages.
6
+ * Each sub-directory is treated as one package when it contains a
7
+ * `terminology.manifest.json` file.
8
+ * May be an absolute path or relative to the Nuxt project root.
9
+ * @default 'terminology'
10
+ */
11
+ sourcesDir?: string;
12
+ /**
13
+ * Storage mount used for generated terminology FHIR artifacts.
14
+ * Artifacts are generated into `.nuxt/fhir/terminology` during local build.
15
+ * @default 'fhir-terminology-generated'
16
+ */
17
+ generatedStorageBase?: string;
18
+ /**
19
+ * Automatically check and import missing/changed terminology packages on
20
+ * every server startup.
21
+ *
22
+ * RECOMMENDATION: Keep this `false` in production.
23
+ * Large terminologies (ICD-10: ~15 k codes, LOINC: ~100 k codes) can
24
+ * significantly delay startup. Use the admin API to trigger imports
25
+ * explicitly after deployments.
26
+ *
27
+ * @default false
28
+ */
29
+ autoSync?: boolean;
30
+ /**
31
+ * Maximum number of concepts per FHIR batch-bundle transaction.
32
+ * Reduce this value when upstream timeout errors occur on large imports.
33
+ * @default 500
34
+ */
35
+ batchSize?: number;
36
+ /**
37
+ * Register nvent iii workflow functions (upload/import/audit helpers) via
38
+ * `nvent:functions:extend` hook.
39
+ * @default true
40
+ */
41
+ nventWorkflows?: boolean;
42
+ /**
43
+ * Enable bundled terminology admin app route powered by nutils.
44
+ * @default false
45
+ */
46
+ app?: boolean;
47
+ /**
48
+ * Route path for the bundled terminology app.
49
+ * @default '/_terminology'
50
+ */
51
+ appRoutePath?: string;
52
+ /**
53
+ * Layout to use for the bundled app route.
54
+ * Set to false for standalone page.
55
+ * @default false
56
+ */
57
+ appLayout?: string | false;
58
+ };
59
+ declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
60
+
61
+ export { _default as default };
62
+ export type { ModuleOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@nhealth/fhir-terminology",
3
+ "version": "0.1.0",
4
+ "configKey": "fhirTerminology",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "unknown"
8
+ }
9
+ }