dhti-cli 0.1.1 → 0.3.0
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/README.md +2 -0
- package/dist/commands/elixir.js +4 -4
- package/dist/commands/mimic.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/resources/docker-compose-master.yml +238 -0
- package/dist/resources/genai/Dockerfile +27 -0
- package/dist/resources/genai/README.md +1 -0
- package/dist/resources/genai/app/__init__.py +0 -0
- package/dist/resources/genai/app/bootstrap.py +43 -0
- package/dist/resources/genai/app/server.py +57 -0
- package/dist/resources/genai/pyproject.toml +84 -0
- package/dist/resources/genai/whl/placeholder.md +0 -0
- package/dist/resources/spa/Dockerfile +16 -0
- package/dist/resources/spa/def/importmap.json +39 -0
- package/dist/resources/spa/def/routes.registry.json +1599 -0
- package/dist/resources/spa/def/spa-assemble-config.json +40 -0
- package/dist/utils/card.d.ts +4 -4
- package/dist/utils/card.js +7 -0
- package/dist/utils/getCard.d.ts +2 -2
- package/dist/utils/getCard.js +2 -2
- package/dist/utils/index.d.ts +2 -4
- package/dist/utils/index.js +2 -4
- package/dist/utils/useDhti.d.ts +1 -1
- package/dist/utils/useDhti.js +1 -1
- package/oclif.manifest.json +6 -6
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -234,6 +234,8 @@ You can remove the services by: `dhti-cli docker -d`
|
|
|
234
234
|
## Give us a star ⭐️
|
|
235
235
|
If you find this project useful, give us a star. It helps others discover the project.
|
|
236
236
|
|
|
237
|
+
## [Details of CLI Commands](/notes/README.md)
|
|
238
|
+
|
|
237
239
|
## Contributors
|
|
238
240
|
|
|
239
241
|
* [Bell Eapen](https://nuchange.ca) | [](https://twitter.com/beapen)
|
package/dist/commands/elixir.js
CHANGED
|
@@ -105,13 +105,13 @@ mcp_server.add_tool(${expoName}_mcp_tool) # type: ignore
|
|
|
105
105
|
`;
|
|
106
106
|
const newCliImport = fs
|
|
107
107
|
.readFileSync(`${flags.workdir}/elixir/app/server.py`, 'utf8')
|
|
108
|
-
.replace('#DHTI_CLI_IMPORT', `#DHTI_CLI_IMPORT\n${CliImport}`);
|
|
108
|
+
.replace('# DHTI_CLI_IMPORT', `#DHTI_CLI_IMPORT\n${CliImport}`);
|
|
109
109
|
const langfuseRoute = `add_routes(app, ${expoName}_chain.with_config(config), path="/langserve/${expoName}")`;
|
|
110
|
-
const newLangfuseRoute = newCliImport.replace('#DHTI_LANGFUSE_ROUTE', `#DHTI_LANGFUSE_ROUTE\n ${langfuseRoute}`);
|
|
110
|
+
const newLangfuseRoute = newCliImport.replace('# DHTI_LANGFUSE_ROUTE', `#DHTI_LANGFUSE_ROUTE\n ${langfuseRoute}`);
|
|
111
111
|
const normalRoute = `add_routes(app, ${expoName}_chain, path="/langserve/${expoName}")`;
|
|
112
|
-
const newNormalRoute = newLangfuseRoute.replace('#DHTI_NORMAL_ROUTE', `#DHTI_NORMAL_ROUTE\n ${normalRoute}`);
|
|
112
|
+
const newNormalRoute = newLangfuseRoute.replace('# DHTI_NORMAL_ROUTE', `#DHTI_NORMAL_ROUTE\n ${normalRoute}`);
|
|
113
113
|
const commonRoutes = `\nadd_invokes(app, path="/langserve/${expoName}")\nadd_services(app, path="/langserve/${expoName}")`;
|
|
114
|
-
const finalRoute = newNormalRoute.replace('#DHTI_COMMON_ROUTE', `#DHTI_COMMON_ROUTES${commonRoutes}`);
|
|
114
|
+
const finalRoute = newNormalRoute.replace('# DHTI_COMMON_ROUTE', `#DHTI_COMMON_ROUTES${commonRoutes}`);
|
|
115
115
|
// if args.op === install, add the line to the pyproject.toml file
|
|
116
116
|
if (args.op === 'install') {
|
|
117
117
|
fs.writeFileSync(`${flags.workdir}/elixir/pyproject.toml`, newPyproject);
|
package/dist/commands/mimic.js
CHANGED
|
@@ -145,12 +145,13 @@ export default class Mimic extends Command {
|
|
|
145
145
|
body: mimic_request,
|
|
146
146
|
headers: {
|
|
147
147
|
'Content-Type': 'application/fhir+json',
|
|
148
|
-
|
|
148
|
+
Prefer: 'respond-async',
|
|
149
149
|
},
|
|
150
150
|
method: 'POST',
|
|
151
151
|
});
|
|
152
152
|
if (!response.ok) {
|
|
153
153
|
console.error(`Error: ${response.status} ${response.statusText}`);
|
|
154
|
+
return;
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { Cards, handleBundle } from './utils/index.js';
|
|
2
2
|
export { run } from '@oclif/core';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { Cards, handleBundle } from './utils/index.js';
|
|
2
2
|
export { run } from '@oclif/core';
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
version: "3.7"
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
gateway:
|
|
5
|
+
image: beapen/dhti-gateway:latest
|
|
6
|
+
restart: "unless-stopped"
|
|
7
|
+
pull_policy: always
|
|
8
|
+
depends_on:
|
|
9
|
+
- frontend
|
|
10
|
+
- backend
|
|
11
|
+
ports:
|
|
12
|
+
- "80:80"
|
|
13
|
+
- "9000:80"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
frontend:
|
|
17
|
+
image: openmrs/openmrs-reference-application-3-frontend:3.0.0-beta.17
|
|
18
|
+
# image: openmrs/openmrs-reference-application-3-frontend:${TAG:-3.0.0-beta.17} # dev3, qa, demo, 3.0.0-beta.18
|
|
19
|
+
ports:
|
|
20
|
+
- "8003:80"
|
|
21
|
+
restart: "unless-stopped"
|
|
22
|
+
pull_policy: always
|
|
23
|
+
environment:
|
|
24
|
+
SPA_PATH: /openmrs/spa
|
|
25
|
+
API_URL: /openmrs
|
|
26
|
+
SPA_CONFIG_URLS: /openmrs/spa/config-core_demo.json
|
|
27
|
+
SPA_DEFAULT_LOCALE:
|
|
28
|
+
healthcheck:
|
|
29
|
+
test: ["CMD", "curl", "-f", "http://localhost/"]
|
|
30
|
+
timeout: 5s
|
|
31
|
+
depends_on:
|
|
32
|
+
- backend
|
|
33
|
+
# volumes:
|
|
34
|
+
# - ./spa:/usr/share/nginx/html
|
|
35
|
+
|
|
36
|
+
backend:
|
|
37
|
+
image: openmrs/openmrs-reference-application-3-backend:${TAG:-3.0.0-beta.17} # dev3, qa, demo, 3.0.0-beta.18
|
|
38
|
+
ports:
|
|
39
|
+
- "8002:8080"
|
|
40
|
+
restart: "unless-stopped"
|
|
41
|
+
depends_on:
|
|
42
|
+
- openmrs-db
|
|
43
|
+
environment:
|
|
44
|
+
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
|
|
45
|
+
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
|
|
46
|
+
OMRS_CONFIG_CREATE_TABLES: "true"
|
|
47
|
+
OMRS_CONFIG_CONNECTION_SERVER: openmrs-db
|
|
48
|
+
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
|
|
49
|
+
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
|
|
50
|
+
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
|
|
51
|
+
healthcheck:
|
|
52
|
+
test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
|
|
53
|
+
timeout: 5s
|
|
54
|
+
volumes:
|
|
55
|
+
- openmrs-data:/openmrs/data
|
|
56
|
+
|
|
57
|
+
openmrs-db:
|
|
58
|
+
image: mariadb:10.11.7
|
|
59
|
+
restart: "unless-stopped"
|
|
60
|
+
command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci"
|
|
61
|
+
healthcheck:
|
|
62
|
+
test: "mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute \"SHOW DATABASES;\""
|
|
63
|
+
interval: 3s
|
|
64
|
+
timeout: 1s
|
|
65
|
+
retries: 5
|
|
66
|
+
environment:
|
|
67
|
+
MYSQL_DATABASE: openmrs
|
|
68
|
+
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
|
|
69
|
+
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
|
|
70
|
+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
|
|
71
|
+
volumes:
|
|
72
|
+
- openmrs-db:/var/lib/mysql
|
|
73
|
+
|
|
74
|
+
langserve:
|
|
75
|
+
image: beapen/genai:latest
|
|
76
|
+
pull_policy: always
|
|
77
|
+
ports:
|
|
78
|
+
- "8001:8001"
|
|
79
|
+
restart: "unless-stopped"
|
|
80
|
+
environment:
|
|
81
|
+
- OLLAMA_SERVER_URL==http://ollama:11434
|
|
82
|
+
- OLLAMA_WEBUI=http://ollama-webui:8080
|
|
83
|
+
- LANGFUSE_HOST=http://langfuse:3000
|
|
84
|
+
- LANGFUSE_PUBLIC_KEY=pk-lf-abcd
|
|
85
|
+
- LANGFUSE_SECRET_KEY=sk-lf-abcd
|
|
86
|
+
|
|
87
|
+
ollama:
|
|
88
|
+
image: ollama/ollama:latest
|
|
89
|
+
ports:
|
|
90
|
+
- 11434:11434
|
|
91
|
+
volumes:
|
|
92
|
+
- ollama-code:/code
|
|
93
|
+
- ollama-root:/root/.ollama
|
|
94
|
+
tty: true
|
|
95
|
+
restart: "unless-stopped"
|
|
96
|
+
environment:
|
|
97
|
+
- OLLAMA_ORIGINS=*
|
|
98
|
+
|
|
99
|
+
ollama-webui:
|
|
100
|
+
image: ghcr.io/open-webui/open-webui:main
|
|
101
|
+
volumes:
|
|
102
|
+
- ollama-webui:/app/backend/data
|
|
103
|
+
depends_on:
|
|
104
|
+
- ollama
|
|
105
|
+
ports:
|
|
106
|
+
- 8080:8080
|
|
107
|
+
environment:
|
|
108
|
+
- '/ollama/api=http://ollama:11434/api'
|
|
109
|
+
extra_hosts:
|
|
110
|
+
- host.docker.internal:host-gateway
|
|
111
|
+
restart: unless-stopped
|
|
112
|
+
|
|
113
|
+
fhir:
|
|
114
|
+
image: alphora/cqf-ruler:0.14.0 # includes cql
|
|
115
|
+
ports:
|
|
116
|
+
- 8005:8080
|
|
117
|
+
restart: "unless-stopped"
|
|
118
|
+
depends_on:
|
|
119
|
+
- postgres-db
|
|
120
|
+
environment:
|
|
121
|
+
- "spring.datasource.url=jdbc:postgresql://postgres-db:5432/postgres"
|
|
122
|
+
- "spring.datasource.username=postgres"
|
|
123
|
+
- "spring.datasource.password=postgres"
|
|
124
|
+
- "spring.datasource.driverClassName=org.postgresql.Driver"
|
|
125
|
+
- "spring.jpa.properties.hibernate.dialect=ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgres94Dialect"
|
|
126
|
+
- "hapi.fhir.fhir_version=R4"
|
|
127
|
+
- "hapi.fhir.cors.allowed-origins=*"
|
|
128
|
+
- "hapi.fhir.cors.allowCredentials=true"
|
|
129
|
+
- "hapi.fhir.bulkdata.enabled=true"
|
|
130
|
+
- "hapi.fhir.bulk_export_enabled=true"
|
|
131
|
+
- "hapi.fhir.bulk_import_enabled=true"
|
|
132
|
+
- "hapi.fhir.enforce_referential_integrity_on_write=false"
|
|
133
|
+
- "hapi.fhir.enforce_referential_integrity_on_delete=false"
|
|
134
|
+
|
|
135
|
+
mcp-fhir:
|
|
136
|
+
image: beapen/fhir-mcp-server:1.0
|
|
137
|
+
ports:
|
|
138
|
+
- 8006:8000
|
|
139
|
+
restart: "unless-stopped"
|
|
140
|
+
depends_on:
|
|
141
|
+
- fhir
|
|
142
|
+
environment:
|
|
143
|
+
- FHIR_SERVER_BASE_URL="http://fhir:8005/baseR4"
|
|
144
|
+
- FHIR_SERVER_SCOPES="*"
|
|
145
|
+
- FHIR_SERVER_ACCESS_TOKEN="none"
|
|
146
|
+
|
|
147
|
+
cql-elm:
|
|
148
|
+
image: cqframework/cql-translation-service:latest
|
|
149
|
+
ports:
|
|
150
|
+
- 8091:8080
|
|
151
|
+
restart: "unless-stopped"
|
|
152
|
+
|
|
153
|
+
cql-web:
|
|
154
|
+
image: beapen/cql_runner:latest
|
|
155
|
+
ports:
|
|
156
|
+
- 8092:80
|
|
157
|
+
restart: "unless-stopped"
|
|
158
|
+
depends_on:
|
|
159
|
+
- fhir
|
|
160
|
+
|
|
161
|
+
langfuse:
|
|
162
|
+
image: ghcr.io/langfuse/langfuse:latest
|
|
163
|
+
depends_on:
|
|
164
|
+
- postgres-db
|
|
165
|
+
ports:
|
|
166
|
+
- "3000:3000"
|
|
167
|
+
environment:
|
|
168
|
+
- DATABASE_URL=postgresql://postgres:postgres@postgres-db:5432/postgres
|
|
169
|
+
- NEXTAUTH_SECRET=mysecret
|
|
170
|
+
- SALT=mysalt
|
|
171
|
+
- NEXTAUTH_URL=http://langfuse:3000
|
|
172
|
+
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-false}
|
|
173
|
+
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
|
|
174
|
+
|
|
175
|
+
postgres-db:
|
|
176
|
+
image: postgres
|
|
177
|
+
restart: "unless-stopped"
|
|
178
|
+
environment:
|
|
179
|
+
- POSTGRES_USER=postgres
|
|
180
|
+
- POSTGRES_PASSWORD=postgres
|
|
181
|
+
- POSTGRES_DB=postgres
|
|
182
|
+
ports:
|
|
183
|
+
- 5432:5432
|
|
184
|
+
volumes:
|
|
185
|
+
- postgres-db:/var/lib/postgresql/data
|
|
186
|
+
|
|
187
|
+
redis:
|
|
188
|
+
image: redislabs/redisearch:2.8.8
|
|
189
|
+
ports:
|
|
190
|
+
- 6379:6379
|
|
191
|
+
restart: "unless-stopped"
|
|
192
|
+
volumes:
|
|
193
|
+
- redis-db:/data
|
|
194
|
+
|
|
195
|
+
redis-commander:
|
|
196
|
+
image: rediscommander/redis-commander:latest
|
|
197
|
+
restart: "unless-stopped"
|
|
198
|
+
environment:
|
|
199
|
+
- REDIS_HOSTS=local:redis:6379
|
|
200
|
+
ports:
|
|
201
|
+
- "8081:8081"
|
|
202
|
+
|
|
203
|
+
neo4j:
|
|
204
|
+
image: neo4j:5.1-enterprise
|
|
205
|
+
ports:
|
|
206
|
+
- 7474:7474
|
|
207
|
+
- 7687:7687
|
|
208
|
+
environment:
|
|
209
|
+
- NEO4J_AUTH=neo4j/password
|
|
210
|
+
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
|
|
211
|
+
- NEO4J_PLUGINS=["apoc", "graph-data-science", "n10s"]
|
|
212
|
+
- NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.*,n10s.*
|
|
213
|
+
- NEO4J_dbms_security_procedures_whitelist=apoc.*,gds.*,n10s.*
|
|
214
|
+
restart: "unless-stopped"
|
|
215
|
+
volumes:
|
|
216
|
+
- neo4j-db:/data
|
|
217
|
+
|
|
218
|
+
fhirg:
|
|
219
|
+
image: beapen/fhirg:latest
|
|
220
|
+
ports:
|
|
221
|
+
- 8004:8080
|
|
222
|
+
restart: "unless-stopped"
|
|
223
|
+
environment:
|
|
224
|
+
- spring.neo4j.uri=bolt://neo4j:7687
|
|
225
|
+
- spring.neo4j.authentication.username=neo4j
|
|
226
|
+
- spring.neo4j.authentication.password=password
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
volumes:
|
|
230
|
+
openmrs-data: ~
|
|
231
|
+
openmrs-db: ~
|
|
232
|
+
fhir-db: ~
|
|
233
|
+
postgres-db: ~
|
|
234
|
+
redis-db: ~
|
|
235
|
+
neo4j-db: ~
|
|
236
|
+
ollama-code: ~
|
|
237
|
+
ollama-root: ~
|
|
238
|
+
ollama-webui: ~
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Use Python 3.12 slim as base image
|
|
2
|
+
FROM python:3.12-slim AS base
|
|
3
|
+
|
|
4
|
+
# Update package lists and install Git
|
|
5
|
+
RUN apt-get update && \
|
|
6
|
+
apt-get install -y --no-install-recommends git && \
|
|
7
|
+
rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
# Install uv
|
|
10
|
+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
|
11
|
+
|
|
12
|
+
# Set working directory
|
|
13
|
+
WORKDIR /app
|
|
14
|
+
|
|
15
|
+
# Copy pyproject.toml into the image
|
|
16
|
+
COPY pyproject.toml /app/pyproject.toml
|
|
17
|
+
COPY README.md /app/README.md
|
|
18
|
+
|
|
19
|
+
# Install dependencies and generate uv.lock
|
|
20
|
+
RUN uv sync --no-dev
|
|
21
|
+
|
|
22
|
+
# Copy the project into the image
|
|
23
|
+
COPY . /app
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Run the server
|
|
27
|
+
CMD ["uv", "run", "python", "app/server.py"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# README
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from kink import di
|
|
2
|
+
from os import getenv
|
|
3
|
+
from dotenv import load_dotenv
|
|
4
|
+
from langchain_core.prompts import PromptTemplate
|
|
5
|
+
from langchain_core.language_models.fake import FakeListLLM
|
|
6
|
+
|
|
7
|
+
## Override the default configuration of elixirs here if needed
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def bootstrap():
|
|
11
|
+
load_dotenv()
|
|
12
|
+
fake_llm = FakeListLLM(responses=["Paris", "I don't know"])
|
|
13
|
+
di["main_prompt"] = PromptTemplate.from_template(
|
|
14
|
+
"Summarize the following in 100 words: {input}"
|
|
15
|
+
)
|
|
16
|
+
di["main_llm"] = fake_llm
|
|
17
|
+
di["cds_hook_discovery"] = {
|
|
18
|
+
"services": [
|
|
19
|
+
{
|
|
20
|
+
"id": "dhti-service",
|
|
21
|
+
"hook": "order-select",
|
|
22
|
+
"title": "MyOrg Order Assistant",
|
|
23
|
+
"description": "Provides suggestions and actions for selected draft orders, including handling CommunicationRequest resources.",
|
|
24
|
+
"prefetch": {
|
|
25
|
+
"patient": "Patient/{{context.patientId}}",
|
|
26
|
+
"draftOrders": "Bundle?patient={{context.patientId}}&status=draft",
|
|
27
|
+
},
|
|
28
|
+
"scopes": [
|
|
29
|
+
"launch",
|
|
30
|
+
"patient/Patient.read",
|
|
31
|
+
"user/Practitioner.read",
|
|
32
|
+
"patient/CommunicationRequest.read",
|
|
33
|
+
],
|
|
34
|
+
"metadata": {
|
|
35
|
+
"author": "MyOrg CDS Team",
|
|
36
|
+
"version": "1.0.0",
|
|
37
|
+
"supportedResources": [
|
|
38
|
+
"CommunicationRequest",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from fastapi import FastAPI
|
|
2
|
+
from langserve import add_routes
|
|
3
|
+
from langchain_core.runnables.config import RunnableConfig
|
|
4
|
+
from dhti_elixir_base.cds_hook.routes import add_services, add_invokes
|
|
5
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
6
|
+
from mcp.server.fastmcp import FastMCP
|
|
7
|
+
mcp_server = FastMCP(name="dhti-mcp-server")
|
|
8
|
+
|
|
9
|
+
# ! DO NOT REMOVE THE COMMENT BELOW
|
|
10
|
+
# DHTI_CLI_IMPORT
|
|
11
|
+
import uvicorn
|
|
12
|
+
|
|
13
|
+
# Comes after elixir bootstraps, so can override elixir configurations
|
|
14
|
+
from bootstrap import bootstrap
|
|
15
|
+
bootstrap()
|
|
16
|
+
|
|
17
|
+
app = FastAPI(title="dhti-elixir-server")
|
|
18
|
+
# Mount the MCP server's ASGI application at a specific path (Exposes /messages and /sse endpoints)
|
|
19
|
+
app.mount("/langserve/mcp", mcp_server.sse_app())
|
|
20
|
+
|
|
21
|
+
origins = [
|
|
22
|
+
"*",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
app.add_middleware(
|
|
26
|
+
CORSMiddleware,
|
|
27
|
+
allow_origins=origins,
|
|
28
|
+
allow_credentials=True,
|
|
29
|
+
allow_methods=["*"],
|
|
30
|
+
allow_headers=["*"],
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Define a root endpoint
|
|
34
|
+
@app.get("/langserve")
|
|
35
|
+
async def read_root():
|
|
36
|
+
return {"message": "Hello from DHTI!"}
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
from langfuse import Langfuse
|
|
40
|
+
from langfuse.callback import CallbackHandler
|
|
41
|
+
langfuse_handler = CallbackHandler()
|
|
42
|
+
langfuse_handler.auth_check()
|
|
43
|
+
config = RunnableConfig(callbacks=[langfuse_handler])
|
|
44
|
+
# ! DO NOT REMOVE THE COMMENT BELOW
|
|
45
|
+
# DHTI_LANGFUSE_ROUTE
|
|
46
|
+
|
|
47
|
+
except:
|
|
48
|
+
# ! DO NOT REMOVE THE COMMENT BELOW
|
|
49
|
+
# DHTI_NORMAL_ROUTE
|
|
50
|
+
x = True
|
|
51
|
+
|
|
52
|
+
# ! DO NOT REMOVE THE COMMENT BELOW
|
|
53
|
+
# DHTI_COMMON_ROUTE
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
uvicorn.run(app, host="0.0.0.0", port=8001)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
[project]
|
|
3
|
+
name = "genai"
|
|
4
|
+
dynamic = ["version"]
|
|
5
|
+
description = "Langserve server for GenAI."
|
|
6
|
+
authors = [{ name = "Bell Eapen", email = "github_public@nuchange.ca" }]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
keywords = ["python"]
|
|
9
|
+
requires-python = ">=3.10,<4.0"
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
|
+
"Intended Audience :: Healthcare Industry",
|
|
13
|
+
"Programming Language :: Python",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Medical Science Apps.",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"langserve[server]>=0.0.51",
|
|
24
|
+
"langfuse>=2.31.0",
|
|
25
|
+
"tiktoken>=0.4.0",
|
|
26
|
+
"uvicorn[standard]>=0.22.0",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[tool.uv.sources]
|
|
30
|
+
# elixirs
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://dermatologist.github.io/dhti/"
|
|
34
|
+
Repository = "https://github.com/dermatologist/dhti"
|
|
35
|
+
Documentation = "https://dermatologist.github.io/dhti/"
|
|
36
|
+
|
|
37
|
+
[dependency-groups]
|
|
38
|
+
dev = [
|
|
39
|
+
"pytest>=8.2.1",
|
|
40
|
+
"pytest-asyncio>=0.21.1",
|
|
41
|
+
"mypy>=1.4.1",
|
|
42
|
+
"ruff>=0.0.278",
|
|
43
|
+
"black>=23.7.0",
|
|
44
|
+
"syrupy>=4.0.2",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["hatchling", "uv-dynamic-versioning"]
|
|
49
|
+
build-backend = "hatchling.build"
|
|
50
|
+
|
|
51
|
+
[tool.hatch.version]
|
|
52
|
+
source = "uv-dynamic-versioning"
|
|
53
|
+
|
|
54
|
+
[tool.hatch.metadata]
|
|
55
|
+
allow-direct-references = true
|
|
56
|
+
|
|
57
|
+
[[tool.uv.index]]
|
|
58
|
+
name = "testpypi"
|
|
59
|
+
url = "https://test.pypi.org/simple/"
|
|
60
|
+
publish-url = "https://test.pypi.org/legacy/"
|
|
61
|
+
explicit = true
|
|
62
|
+
|
|
63
|
+
[tool.uv-dynamic-versioning]
|
|
64
|
+
fallback-version = "0.1.0"
|
|
65
|
+
|
|
66
|
+
[tool.uv.build-backend]
|
|
67
|
+
source-exclude = ["tests/*", "examples/*", "docs/*", "notes/*", "notebooks/*"]
|
|
68
|
+
|
|
69
|
+
[tool.hatch.build.targets.wheel]
|
|
70
|
+
packages = ["app"]
|
|
71
|
+
|
|
72
|
+
[tool.mypy]
|
|
73
|
+
files = ["app"]
|
|
74
|
+
disallow_untyped_defs = true
|
|
75
|
+
ignore_missing_imports = true
|
|
76
|
+
|
|
77
|
+
[tool.pytest.ini_options]
|
|
78
|
+
addopts = "--strict-markers --strict-config --durations=5 --snapshot-warn-unused"
|
|
79
|
+
|
|
80
|
+
[tool.ruff]
|
|
81
|
+
target-version = "py310"
|
|
82
|
+
line-length = 120
|
|
83
|
+
fix = true
|
|
84
|
+
select = ["E", "F", "I"]
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|