dhti-cli 0.7.1 → 1.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,80 @@
1
+ /**
2
+ * TypeScript models for CDS Hook Card
3
+ *
4
+ * Example:
5
+ * {
6
+ * "summary": "Patient is at high risk for opioid overdose.",
7
+ * "detail": "According to CDC guidelines, the patient's opioid dosage should be tapered to less than 50 MME. [Link to CDC Guideline](https://www.cdc.gov/drugoverdose/prescribing/guidelines.html)",
8
+ * "indicator": "warning",
9
+ * "source": {
10
+ * "label": "CDC Opioid Prescribing Guidelines",
11
+ * "url": "https://www.cdc.gov/drugoverdose/prescribing/guidelines.html",
12
+ * "icon": "https://example.org/img/cdc-icon.png"
13
+ * },
14
+ * "links": [
15
+ * {
16
+ * "label": "View MME Conversion Table",
17
+ * "url": "https://www.cdc.gov/drugoverdose/prescribing/mme.html"
18
+ * }
19
+ * ]
20
+ * }
21
+ */
22
+
23
+ /**
24
+ * The allowed indicators for a CDS Hook Card.
25
+ * Mirrors: Literal["info", "warning", "hard-stop"]
26
+ */
27
+ export type CDSHookCardIndicator = 'info' | 'warning' | 'hard-stop'
28
+
29
+ /**
30
+ * Source of the CDS Hook Card
31
+ */
32
+ export class CDSHookCardSource {
33
+ label!: string
34
+ url?: string
35
+ icon?: string
36
+
37
+ constructor(init?: Partial<CDSHookCardSource>) {
38
+ Object.assign(this, init)
39
+ }
40
+ }
41
+
42
+ /**
43
+ * Link associated with the CDS Hook Card
44
+ */
45
+ export class CDSHookCardLink {
46
+ label!: string
47
+ url!: string
48
+
49
+ constructor(init?: Partial<CDSHookCardLink>) {
50
+ Object.assign(this, init)
51
+ }
52
+ }
53
+
54
+ /**
55
+ * CDS Hook Card Model
56
+ */
57
+ export class CDSHookCard {
58
+ summary!: string
59
+ detail?: string
60
+ indicator?: CDSHookCardIndicator
61
+ source?: CDSHookCardSource
62
+ links?: CDSHookCardLink[]
63
+
64
+ constructor(init?: Partial<CDSHookCard>) {
65
+ if (init) {
66
+ // Shallow assign for primitives; nested objects handled below if present
67
+ const {source, links, ...rest} = init as CDSHookCard
68
+ Object.assign(this, rest)
69
+ if (source) this.source = new CDSHookCardSource(source)
70
+ if (links) this.links = links.map((l) => new CDSHookCardLink(l))
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Factory to build a CDSHookCard from a plain object, ensuring nested types are instantiated.
76
+ */
77
+ static from(obj: Partial<CDSHookCard>): CDSHookCard {
78
+ return new CDSHookCard(obj)
79
+ }
80
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * CDS Hook Request Model (TypeScript)
3
+ *
4
+ * Example:
5
+ * {
6
+ * "hookInstance": "d1577c69-dfbe-44ad-ba6d-3e05e953b2ea",
7
+ * "fhirServer": "https://example.com/fhir",
8
+ * "fhirAuthorization": { ... },
9
+ * "hook": "patient-view",
10
+ * "context": { ... },
11
+ * "prefetch": { ... }
12
+ * }
13
+ */
14
+
15
+ export class CDSHookRequest {
16
+ /** A unique identifier for this hook invocation */
17
+ hookInstance?: string
18
+
19
+ /** Base URL of the FHIR server associated with the hook */
20
+ fhirServer?: string
21
+
22
+ /** Authorization details (opaque to this model) */
23
+ fhirAuthorization?: Record<string, any> | null
24
+
25
+ /** Name of the hook (e.g., "patient-view", "order-select", etc.) */
26
+ hook?: string
27
+
28
+ /** Context object passed by the EHR */
29
+ context?: Record<string, any> | null
30
+
31
+ /** Prefetched FHIR resources keyed by name */
32
+ prefetch?: Record<string, any> | null
33
+
34
+ constructor(init?: Partial<CDSHookRequest>) {
35
+ Object.assign(this, init)
36
+ }
37
+
38
+ /** Factory to build a CDSHookRequest from a plain object. */
39
+ static from(obj: Partial<CDSHookRequest>): CDSHookRequest {
40
+ return new CDSHookRequest(obj)
41
+ }
42
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json.openmrs.org/routes.schema.json",
3
+ "backendDependencies": {
4
+ "fhir2": ">=2.0.0",
5
+ "webservices.rest": ">=2.2.0"
6
+ },
7
+ "extensions": [
8
+ {
9
+ "component": "glycemic",
10
+ "name": "dhti-glycemic-widget",
11
+ "slot": "patient-chart-summary-dashboard-slot",
12
+ "meta": {
13
+ "columnSpan": 4
14
+ }
15
+ }
16
+ ]
17
+ }
@@ -19,6 +19,14 @@
19
19
  "allowNo": false,
20
20
  "type": "boolean"
21
21
  },
22
+ "env": {
23
+ "char": "e",
24
+ "description": "Environment variable name (e.g. FHIR_BASE_URL)",
25
+ "name": "env",
26
+ "hasDynamicHelp": false,
27
+ "multiple": false,
28
+ "type": "option"
29
+ },
22
30
  "file": {
23
31
  "char": "f",
24
32
  "description": "Full path to the docker compose file to read from. Creates if it does not exist",
@@ -28,6 +36,12 @@
28
36
  "multiple": false,
29
37
  "type": "option"
30
38
  },
39
+ "host": {
40
+ "description": "Use host environment variable pattern (e.g. ${VAR_NAME:-default_value})",
41
+ "name": "host",
42
+ "allowNo": false,
43
+ "type": "boolean"
44
+ },
31
45
  "module": {
32
46
  "char": "m",
33
47
  "description": "Modules to add from ( langserve, openmrs, ollama, langfuse, cqlFhir, redis, neo4j, mcpFhir, mcpx and docktor)",
@@ -35,6 +49,23 @@
35
49
  "hasDynamicHelp": false,
36
50
  "multiple": true,
37
51
  "type": "option"
52
+ },
53
+ "service": {
54
+ "char": "s",
55
+ "description": "Service name to update environment variables",
56
+ "name": "service",
57
+ "default": "langserve",
58
+ "hasDynamicHelp": false,
59
+ "multiple": false,
60
+ "type": "option"
61
+ },
62
+ "value": {
63
+ "char": "v",
64
+ "description": "Environment variable value",
65
+ "name": "value",
66
+ "hasDynamicHelp": false,
67
+ "multiple": false,
68
+ "type": "option"
38
69
  }
39
70
  },
40
71
  "hasDynamicHelp": false,
@@ -56,42 +87,26 @@
56
87
  "aliases": [],
57
88
  "args": {
58
89
  "op": {
59
- "description": "Operation to perform (install, uninstall or dev)",
90
+ "description": "Operation to perform (init, install, or start)",
60
91
  "name": "op"
61
92
  }
62
93
  },
63
- "description": "Install or uninstall conchs to create a Docker image",
94
+ "description": "Initialize, install, or start OpenMRS frontend development",
64
95
  "examples": [
65
- "<%= config.bin %> <%= command.id %>"
96
+ "<%= config.bin %> <%= command.id %> install -n my-app -w ~/projects",
97
+ "<%= config.bin %> <%= command.id %> init -n my-app -w ~/projects",
98
+ "<%= config.bin %> <%= command.id %> start -n my-app -w ~/projects"
66
99
  ],
67
100
  "flags": {
68
101
  "branch": {
69
102
  "char": "b",
70
- "description": "Branch to install from",
103
+ "description": "Branch to install from (for install operation)",
71
104
  "name": "branch",
72
105
  "default": "develop",
73
106
  "hasDynamicHelp": false,
74
107
  "multiple": false,
75
108
  "type": "option"
76
109
  },
77
- "container": {
78
- "char": "c",
79
- "description": "Name of the container to copy the conch to while in dev mode",
80
- "name": "container",
81
- "default": "dhti-frontend-1",
82
- "hasDynamicHelp": false,
83
- "multiple": false,
84
- "type": "option"
85
- },
86
- "dev": {
87
- "char": "d",
88
- "description": "Dev folder to install",
89
- "name": "dev",
90
- "default": "none",
91
- "hasDynamicHelp": false,
92
- "multiple": false,
93
- "type": "option"
94
- },
95
110
  "dry-run": {
96
111
  "description": "Show what changes would be made without actually making them",
97
112
  "name": "dry-run",
@@ -100,42 +115,32 @@
100
115
  },
101
116
  "git": {
102
117
  "char": "g",
103
- "description": "Github repository to install",
118
+ "description": "GitHub repository to install (for install operation)",
104
119
  "name": "git",
105
- "default": "none",
106
- "hasDynamicHelp": false,
107
- "multiple": false,
108
- "type": "option"
109
- },
110
- "image": {
111
- "char": "i",
112
- "description": "Base image to use for the conch",
113
- "name": "image",
114
- "default": "openmrs/openmrs-reference-application-3-frontend:3.0.0-beta.17",
120
+ "default": "dermatologist/openmrs-esm-dhti-template",
115
121
  "hasDynamicHelp": false,
116
122
  "multiple": false,
117
123
  "type": "option"
118
124
  },
119
125
  "name": {
120
126
  "char": "n",
121
- "description": "Name of the elixir",
127
+ "description": "Name of the conch",
122
128
  "name": "name",
123
129
  "hasDynamicHelp": false,
124
130
  "multiple": false,
125
131
  "type": "option"
126
132
  },
127
- "repoVersion": {
128
- "char": "v",
129
- "description": "Version of the conch",
130
- "name": "repoVersion",
131
- "default": "1.0.0",
133
+ "sources": {
134
+ "char": "s",
135
+ "description": "Additional sources to include when starting (e.g., packages/esm-chatbot-agent)",
136
+ "name": "sources",
132
137
  "hasDynamicHelp": false,
133
138
  "multiple": false,
134
139
  "type": "option"
135
140
  },
136
141
  "workdir": {
137
142
  "char": "w",
138
- "description": "Working directory to install the conch",
143
+ "description": "Working directory for the conch",
139
144
  "name": "workdir",
140
145
  "default": "/home/runner/dhti",
141
146
  "hasDynamicHelp": false,
@@ -342,7 +347,7 @@
342
347
  "aliases": [],
343
348
  "args": {
344
349
  "op": {
345
- "description": "Operation to perform (install, uninstall or dev)",
350
+ "description": "Operation to perform (init, install, uninstall, dev or start)",
346
351
  "name": "op"
347
352
  }
348
353
  },
@@ -384,6 +389,23 @@
384
389
  "allowNo": false,
385
390
  "type": "boolean"
386
391
  },
392
+ "elixir": {
393
+ "char": "e",
394
+ "description": "Elixir endpoint URL",
395
+ "name": "elixir",
396
+ "hasDynamicHelp": false,
397
+ "multiple": false,
398
+ "type": "option"
399
+ },
400
+ "fhir": {
401
+ "char": "f",
402
+ "description": "FHIR endpoint URL",
403
+ "name": "fhir",
404
+ "default": "http://hapi.fhir.org/baseR4",
405
+ "hasDynamicHelp": false,
406
+ "multiple": false,
407
+ "type": "option"
408
+ },
387
409
  "git": {
388
410
  "char": "g",
389
411
  "description": "Github repository to install",
@@ -393,6 +415,15 @@
393
415
  "multiple": false,
394
416
  "type": "option"
395
417
  },
418
+ "local": {
419
+ "char": "l",
420
+ "description": "Local directory to install from",
421
+ "name": "local",
422
+ "default": "none",
423
+ "hasDynamicHelp": false,
424
+ "multiple": false,
425
+ "type": "option"
426
+ },
396
427
  "name": {
397
428
  "char": "n",
398
429
  "description": "Name of the elixir",
@@ -419,6 +450,15 @@
419
450
  "multiple": false,
420
451
  "type": "option"
421
452
  },
453
+ "subdirectory": {
454
+ "char": "s",
455
+ "description": "Subdirectory in the repository to install from (for monorepos)",
456
+ "name": "subdirectory",
457
+ "default": "none",
458
+ "hasDynamicHelp": false,
459
+ "multiple": false,
460
+ "type": "option"
461
+ },
422
462
  "whl": {
423
463
  "char": "e",
424
464
  "description": "Whl file to install",
@@ -756,5 +796,5 @@
756
796
  ]
757
797
  }
758
798
  },
759
- "version": "0.7.1"
799
+ "version": "1.0.1"
760
800
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dhti-cli",
3
3
  "description": "DHTI CLI",
4
- "version": "0.7.1",
4
+ "version": "1.0.1",
5
5
  "author": "Bell Eapen",
6
6
  "bin": {
7
7
  "dhti-cli": "bin/run.js"
@@ -29,6 +29,8 @@
29
29
  "@types/node": "^24",
30
30
  "@types/request": "^2.48.12",
31
31
  "@types/sinon": "^17.0.4",
32
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
33
+ "@typescript-eslint/parser": "^8.53.0",
32
34
  "chai": "^4",
33
35
  "eslint": "^8",
34
36
  "eslint-config-oclif": "^5",
@@ -1,16 +0,0 @@
1
- FROM node:20 as build
2
-
3
- ARG REACT_APP_SERVICES_HOST=/services/m
4
-
5
- WORKDIR /app
6
-
7
- COPY ./conch .
8
-
9
- RUN corepack enable
10
- RUN yarn install
11
- RUN yarn build
12
-
13
- FROM server-image as server
14
- COPY ./def /usr/share/nginx/html
15
- RUN mkdir /usr/share/nginx/html/conch-version
16
- COPY --from=build /app/dist /usr/share/nginx/html/conch-version
@@ -1,39 +0,0 @@
1
- {
2
- "imports": {
3
- "@openmrs/esm-home-app": "./openmrs-esm-home-app-5.2.2/openmrs-esm-home-app.js",
4
- "@openmrs/esm-patient-attachments-app": "./openmrs-esm-patient-attachments-app-7.0.1/openmrs-esm-patient-attachments-app.js",
5
- "@openmrs/esm-patient-flags-app": "./openmrs-esm-patient-flags-app-7.0.1/openmrs-esm-patient-flags-app.js",
6
- "@openmrs/esm-patient-appointments-app": "./openmrs-esm-patient-appointments-app-7.0.1/openmrs-esm-patient-appointments-app.js",
7
- "@openmrs/esm-patient-banner-app": "./openmrs-esm-patient-banner-app-7.0.1/openmrs-esm-patient-banner-app.js",
8
- "@openmrs/esm-patient-conditions-app": "./openmrs-esm-patient-conditions-app-7.0.1/openmrs-esm-patient-conditions-app.js",
9
- "@openmrs/esm-patient-immunizations-app": "./openmrs-esm-patient-immunizations-app-7.0.1/openmrs-esm-patient-immunizations-app.js",
10
- "@openmrs/esm-generic-patient-widgets-app": "./openmrs-esm-generic-patient-widgets-app-7.0.1/openmrs-esm-generic-patient-widgets-app.js",
11
- "@openmrs/esm-patient-chart-app": "./openmrs-esm-patient-chart-app-7.0.1/openmrs-esm-patient-chart-app.js",
12
- "@openmrs/esm-patient-forms-app": "./openmrs-esm-patient-forms-app-7.0.1/openmrs-esm-patient-forms-app.js",
13
- "@openmrs/esm-patient-labs-app": "./openmrs-esm-patient-labs-app-7.0.1/openmrs-esm-patient-labs-app.js",
14
- "@openmrs/esm-patient-programs-app": "./openmrs-esm-patient-programs-app-7.0.1/openmrs-esm-patient-programs-app.js",
15
- "@openmrs/esm-patient-orders-app": "./openmrs-esm-patient-orders-app-7.0.1/openmrs-esm-patient-orders-app.js",
16
- "@openmrs/esm-patient-list-management-app": "./openmrs-esm-patient-list-management-app-6.0.0/openmrs-esm-patient-list-management-app.js",
17
- "@openmrs/esm-patient-allergies-app": "./openmrs-esm-patient-allergies-app-7.0.1/openmrs-esm-patient-allergies-app.js",
18
- "@openmrs/esm-patient-lists-app": "./openmrs-esm-patient-lists-app-7.0.1/openmrs-esm-patient-lists-app.js",
19
- "@openmrs/esm-system-admin-app": "./openmrs-esm-system-admin-app-4.0.1/openmrs-esm-system-admin-app.js",
20
- "@openmrs/esm-form-entry-app": "./openmrs-esm-form-entry-app-7.0.1/openmrs-esm-form-entry-app.js",
21
- "@openmrs/esm-service-queues-app": "./openmrs-esm-service-queues-app-6.0.0/openmrs-esm-service-queues-app.js",
22
- "@openmrs/esm-patient-medications-app": "./openmrs-esm-patient-medications-app-7.0.1/openmrs-esm-patient-medications-app.js",
23
- "@openmrs/esm-patient-notes-app": "./openmrs-esm-patient-notes-app-7.0.1/openmrs-esm-patient-notes-app.js",
24
- "@openmrs/esm-patient-search-app": "./openmrs-esm-patient-search-app-6.0.0/openmrs-esm-patient-search-app.js",
25
- "@openmrs/esm-openconceptlab-app": "./openmrs-esm-openconceptlab-app-4.0.1/openmrs-esm-openconceptlab-app.js",
26
- "@openmrs/esm-login-app": "./openmrs-esm-login-app-5.4.0/openmrs-esm-login-app.js",
27
- "@openmrs/esm-active-visits-app": "./openmrs-esm-active-visits-app-6.0.0/openmrs-esm-active-visits-app.js",
28
- "@openmrs/esm-devtools-app": "./openmrs-esm-devtools-app-5.4.0/openmrs-esm-devtools-app.js",
29
- "@openmrs/esm-cohort-builder-app": "./openmrs-esm-cohort-builder-app-3.0.1-pre.183/openmrs-esm-cohort-builder-app.js",
30
- "@openmrs/esm-primary-navigation-app": "./openmrs-esm-primary-navigation-app-5.4.0/openmrs-esm-primary-navigation-app.js",
31
- "@openmrs/esm-patient-registration-app": "./openmrs-esm-patient-registration-app-6.0.0/openmrs-esm-patient-registration-app.js",
32
- "@openmrs/esm-implementer-tools-app": "./openmrs-esm-implementer-tools-app-5.4.0/openmrs-esm-implementer-tools-app.js",
33
- "@openmrs/esm-patient-vitals-app": "./openmrs-esm-patient-vitals-app-7.0.1/openmrs-esm-patient-vitals-app.js",
34
- "@openmrs/esm-appointments-app": "./openmrs-esm-appointments-app-6.0.0/openmrs-esm-appointments-app.js",
35
- "@openmrs/esm-dispensing-app": "./openmrs-esm-dispensing-app-1.3.0/openmrs-esm-dispensing-app.js",
36
- "@openmrs/esm-fast-data-entry-app": "./openmrs-esm-fast-data-entry-app-1.0.1-pre.128/openmrs-esm-fast-data-entry-app.js",
37
- "@openmrs/esm-form-builder-app": "./openmrs-esm-form-builder-app-2.3.1-pre.677/openmrs-esm-form-builder-app.js"
38
- }
39
- }