Skip to content

Commit a126320

Browse files
ICD-10 microservice, Docker stack, and CI improvements (#25)
# TLDR; - New ICD-10 API + CLI microservice with semantic search via pgvector/embeddings - Docker Compose stack for running all healthcare samples together - CI: added ICD-10 and Docker build jobs, Postgres service containers for gatekeeper/samples jobs - Clinical and Scheduling queries migrated from raw SQL to LQL - Claude Code skills added for common dev workflows - Dashboard: new ICD-10 clinical coding UI page # Brief Details **ICD-10 microservice** (`Samples/ICD10/`): Full ICD-10-AM/ACHI code lookup API backed by PostgreSQL with pgvector. Includes a Python embedding service (`embedding-service/`) using MedEmbed for semantic RAG search, an import pipeline (`scripts/CreateDb/`) to seed codes and generate embeddings, and an interactive CLI (`ICD10.Cli/`). **Docker stack** (`Samples/docker/`): `docker-compose.yml` + `Dockerfile.app`/`Dockerfile.dashboard` + `nginx.conf` for running Clinical, Scheduling, ICD-10, Gatekeeper, Embedding Service, and Dashboard behind a single compose stack. Scripts reorganised under `Samples/scripts/`. **CI** (`.github/workflows/ci.yml`): Added `icd10-tests` job (pgvector Postgres + embedded Docker embedding service); `docker-build` job (validates app and dashboard container builds); Postgres service containers added to `gatekeeper-tests` and `sample-api-tests`; `Dashboard.Web.Tests` removed from sample matrix (replaced by `Dashboard.Integration.Tests`). **LQL migrations**: Clinical and Scheduling `.sql` queries replaced with equivalent `.lql` files; `filter_like` operator added to LQL grammar and tested across SQLite, Postgres, and SQL Server. **Dashboard** (`Dashboard.Web/`): `ClinicalCodingPage.cs` (1500+ lines) adds ICD-10 code browsing/search UI; `ApiClient.cs` centralises HTTP calls; new `Icons.cs` and CSS components. **Tooling**: 7 Claude Code skills added under `.claude/skills/`; `tasks.json` reorganised with labelled groups; `CLAUDE.md` updated with clearer rules. # How Do The Tests Prove This Works? **`Samples/ICD10/ICD10.Api.Tests/`** (new, ~2300 LOC): - `HealthEndpointTests` – asserts the `/health` endpoint returns 200 and a healthy status, confirming the API boots and DB migrations ran. - `ChapterEndpointTests` / `ChapterCategoryTests` – seed specific chapters/blocks/categories, then assert the hierarchy endpoints return the correct counts and codes, proving the schema and queries are correct. - `CodeLookupTests` – look up codes by exact code string, assert properties like description and billability; verifies `GetCodeByCode.lql` and the generated extension methods. - `SearchEndpointTests` – full-text and semantic search against seeded codes; asserts result ordering and relevance, exercising the pgvector cosine-similarity path in `SearchIcd10Codes.sql`. - `AchiEndpointTests` – same pattern for ACHI surgical codes including block/chapter hierarchy. **`Samples/ICD10/ICD10.Cli.Tests/CliE2ETests.cs`** (new, ~1170 LOC): - Launches the real CLI against a live test database and sends commands; asserts parsed output matches expected codes. Proves the CLI correctly calls the API and formats responses. **`Samples/Dashboard/Dashboard.Integration.Tests/Icd10E2ETests.cs`** (new, ~588 LOC): - Playwright E2E test that opens the Dashboard, navigates to Clinical Coding, searches for ICD-10 codes, and asserts expected codes appear in the UI. Proves the full front-to-back flow: Dashboard → ICD10 API → Postgres. **`Lql/Lql.Tests/LqlFileBasedTests.BasicOperations.cs`**: - `filter_like` test case added with expected SQL output for all three DB targets (`SQLite/filter_like.sql`, `PostgreSql/filter_like.sql`, `SqlServer/filter_like.sql`), proving the new grammar rule transpiles correctly and platform-independently. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a7f61a5 commit a126320

277 files changed

Lines changed: 47279 additions & 40983 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/build/SKILL.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: build
3+
description: Build the DataProvider .NET solution or specific projects. Use when asked to build, compile, or check for compilation errors.
4+
disable-model-invocation: true
5+
allowed-tools: Bash(dotnet build *)
6+
---
7+
8+
# Build
9+
10+
Build the entire solution or a specific project.
11+
12+
## Full solution
13+
14+
```bash
15+
dotnet build /Users/christianfindlay/Documents/Code/DataProvider/DataProvider.sln
16+
```
17+
18+
## Specific project
19+
20+
If `$ARGUMENTS` names a component, build only that project:
21+
22+
| Argument | Project path |
23+
|----------|-------------|
24+
| dataprovider | DataProvider/DataProvider/DataProvider.csproj |
25+
| dataprovider-sqlite | DataProvider/DataProvider.SQLite/DataProvider.SQLite.csproj |
26+
| sqlite-cli | DataProvider/DataProvider.SQLite.Cli/DataProvider.SQLite.Cli.csproj |
27+
| migration | Migration/Migration.Cli/Migration.Cli.csproj |
28+
| lql | Lql/Lql/Lql.csproj |
29+
| sync | Sync/Sync/Sync.csproj |
30+
| gatekeeper | Gatekeeper/Gatekeeper.Api/Gatekeeper.Api.csproj |
31+
| clinical | Samples/Clinical/Clinical.Api/Clinical.Api.csproj |
32+
| scheduling | Samples/Scheduling/Scheduling.Api/Scheduling.Api.csproj |
33+
| icd10 | Samples/ICD10/ICD10.Api/ICD10.Api.csproj |
34+
35+
If no argument is provided, build the full solution.
36+
37+
## Notes
38+
39+
- Generated `.g.cs` files are in `.gitignore` and must be generated at build time
40+
- MSBuild targets in sample projects handle code generation automatically
41+
- If stale `Generated/` folders cause issues, delete them to force regeneration
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: container-logs
3+
description: View Docker container logs for the Healthcare Samples stack. Use when asked to check logs, debug container issues, or see service output.
4+
disable-model-invocation: true
5+
allowed-tools: Bash(docker compose *), Bash(docker logs *)
6+
argument-hint: "[container-name] [--tail N]"
7+
---
8+
9+
# Container Logs
10+
11+
View logs from the Healthcare Samples Docker stack.
12+
13+
## Usage
14+
15+
`/container-logs` - show recent logs from all containers
16+
`/container-logs app` - show logs from the app container
17+
`/container-logs db` - show logs from the Postgres container
18+
19+
## Commands
20+
21+
All logs (last 100 lines):
22+
```bash
23+
docker compose -f /Users/christianfindlay/Documents/Code/DataProvider/Samples/docker/docker-compose.yml logs --tail 100
24+
```
25+
26+
Specific container:
27+
```bash
28+
docker compose -f /Users/christianfindlay/Documents/Code/DataProvider/Samples/docker/docker-compose.yml logs --tail 100 $ARGUMENTS
29+
```
30+
31+
Follow logs in real-time (use timeout to avoid hanging):
32+
```bash
33+
timeout 10 docker compose -f /Users/christianfindlay/Documents/Code/DataProvider/Samples/docker/docker-compose.yml logs -f $ARGUMENTS
34+
```
35+
36+
## Container names
37+
38+
| Name | Service |
39+
|------|---------|
40+
| app | All .NET APIs + embedding service |
41+
| db | Postgres 16 + pgvector |
42+
| dashboard | nginx serving static files |
43+
44+
## Check container status
45+
46+
```bash
47+
docker compose -f /Users/christianfindlay/Documents/Code/DataProvider/Samples/docker/docker-compose.yml ps
48+
```

.claude/skills/format/SKILL.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: format
3+
description: Format C# code with CSharpier. Use when asked to format code, fix formatting, or before committing changes.
4+
disable-model-invocation: true
5+
allowed-tools: Bash(dotnet csharpier *)
6+
---
7+
8+
# Format
9+
10+
Run CSharpier to format all C# code in the repository.
11+
12+
```bash
13+
dotnet csharpier /Users/christianfindlay/Documents/Code/DataProvider
14+
```
15+
16+
If formatting a specific directory:
17+
18+
```bash
19+
dotnet csharpier /Users/christianfindlay/Documents/Code/DataProvider/$ARGUMENTS
20+
```

.claude/skills/migrate/SKILL.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: migrate
3+
description: Run database migrations using the Migration CLI with YAML schemas. Use when asked to create databases, run migrations, or set up schema.
4+
disable-model-invocation: true
5+
allowed-tools: Bash(dotnet run --project *Migration*)
6+
argument-hint: "[schema.yaml] [output.db] [provider]"
7+
---
8+
9+
# Migrate
10+
11+
Run the Migration CLI to create or update databases from YAML schema files.
12+
13+
## Usage
14+
15+
`/migrate` - show help
16+
`/migrate icd10` - create ICD10 SQLite database from its schema
17+
18+
## Shortcuts
19+
20+
| Argument | Schema | Output | Provider |
21+
|----------|--------|--------|----------|
22+
| icd10 | Samples/ICD10/ICD10.Api/icd10-schema.yaml | Samples/ICD10/ICD10.Api/icd10.db | sqlite |
23+
24+
## Manual usage
25+
26+
```bash
27+
dotnet run --project /Users/christianfindlay/Documents/Code/DataProvider/Migration/Migration.Cli -- \
28+
--schema <path-to-schema.yaml> \
29+
--output <output-path> \
30+
--provider <sqlite|postgres>
31+
```
32+
33+
## Notes
34+
35+
- YAML schemas are the ONLY valid way to define database schema (raw SQL DDL is ILLEGAL)
36+
- Schema files live alongside their API projects
37+
- Supported providers: `sqlite`, `postgres`
38+
- The Migration CLI converts YAML to SQL DDL and applies it
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: run-samples
3+
description: Start the Healthcare Samples stack (Postgres, APIs, Dashboard). Use when asked to run, start, or launch the sample applications.
4+
---
5+
6+
# Run Samples
7+
8+
Start the full Healthcare Samples stack. Decide based on `$ARGUMENTS`:
9+
10+
IMPORTANT: Do NOT run in the background. Run in the foreground so the user can see all output streaming in real-time. Set a long timeout (600000ms).
11+
12+
## Default (no args) - keep existing data
13+
14+
Run with existing database volumes intact:
15+
16+
```bash
17+
cd /Users/christianfindlay/Documents/Code/DataProvider/Samples/scripts && ./start.sh
18+
```
19+
20+
## Fresh start - blow away databases
21+
22+
If the user says "fresh", "clean", "reset", or `$ARGUMENTS` contains `--fresh`:
23+
24+
```bash
25+
cd /Users/christianfindlay/Documents/Code/DataProvider/Samples/scripts && ./start.sh --fresh
26+
```
27+
28+
## Force rebuild containers
29+
30+
If the user says "rebuild" or `$ARGUMENTS` contains `--build`:
31+
32+
```bash
33+
cd /Users/christianfindlay/Documents/Code/DataProvider/Samples/scripts && ./start.sh --build
34+
```
35+
36+
## Both fresh + rebuild
37+
38+
```bash
39+
cd /Users/christianfindlay/Documents/Code/DataProvider/Samples/scripts && ./start.sh --fresh --build
40+
```
41+
42+
## Services
43+
44+
| Service | Port |
45+
|---------|------|
46+
| Gatekeeper API | 5002 |
47+
| Clinical API | 5080 |
48+
| Scheduling API | 5001 |
49+
| ICD10 API | 5090 |
50+
| Embedding Service | 8000 |
51+
| Dashboard | 5173 |
52+
| Postgres | 5432 |

.claude/skills/submit-pr/SKILL.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: submit-pr
3+
description: Submit a pull request following DataProvider project standards
4+
---
5+
6+
# Submit Pull Request
7+
8+
Create a pull request following project requirements.
9+
10+
## Get Context
11+
12+
Get the diff between main and current branch:
13+
14+
```bash
15+
git diff main...HEAD
16+
```
17+
18+
DO NOT include commit messages or branch names in analysis.
19+
20+
Read the PR template:
21+
22+
```bash
23+
cat .github/PULL_REQUEST_TEMPLATE.md
24+
```
25+
26+
## Write PR Description
27+
28+
The template has three sections (gh will auto-populate structure):
29+
30+
### TLDR
31+
- Few lines maximum
32+
- Bullet points if many changes
33+
- For people who won't read details
34+
35+
### Brief Details
36+
- Keep BRIEF
37+
- May reference code/files
38+
- What changed and why
39+
40+
### How Do The Tests Prove This Works? (CRITICAL)
41+
- Point to specific test files/methods
42+
- Explain WHAT each test verifies
43+
- Show HOW tests prove correctness, not just "tests added"
44+
45+
## Requirements
46+
47+
- TIGHT - no fluff
48+
- ACCURATE - based on actual diff
49+
50+
## Submit
51+
52+
```bash
53+
gh pr create
54+
```

.claude/skills/test/SKILL.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: test
3+
description: Run tests for the DataProvider solution or specific test projects. Use when asked to run tests, verify changes, or check test results.
4+
disable-model-invocation: true
5+
allowed-tools: Bash(dotnet test *)
6+
argument-hint: "[component|project-path]"
7+
---
8+
9+
# Test
10+
11+
Run tests for a specific component or the full solution.
12+
13+
## Usage
14+
15+
`/test` - run all tests
16+
`/test dataprovider` - run DataProvider tests
17+
`/test icd10` - run ICD10 API tests
18+
19+
## Test projects by component
20+
21+
| Argument | Test project path |
22+
|----------|------------------|
23+
| dataprovider | DataProvider/DataProvider.Tests |
24+
| dataprovider-example | DataProvider/DataProvider.Example.Tests |
25+
| lql | Lql/Lql.Tests |
26+
| lql-cli | Lql/LqlCli.SQLite.Tests |
27+
| migration | Migration/Migration.Tests |
28+
| sync | Sync/Sync.Tests |
29+
| sync-sqlite | Sync/Sync.SQLite.Tests |
30+
| sync-postgres | Sync/Sync.Postgres.Tests |
31+
| sync-http | Sync/Sync.Http.Tests |
32+
| sync-integration | Sync/Sync.Integration.Tests |
33+
| gatekeeper | Gatekeeper/Gatekeeper.Api.Tests |
34+
| clinical | Samples/Clinical/Clinical.Api.Tests |
35+
| scheduling | Samples/Scheduling/Scheduling.Api.Tests |
36+
| icd10 | Samples/ICD10/ICD10.Api.Tests |
37+
| icd10-cli | Samples/ICD10/ICD10.Cli.Tests |
38+
| dashboard | Samples/Dashboard/Dashboard.Integration.Tests |
39+
40+
## Commands
41+
42+
Run a specific test project:
43+
```bash
44+
dotnet test <project-path> --no-restore --verbosity normal
45+
```
46+
47+
Run all tests in the solution:
48+
```bash
49+
dotnet test /Users/christianfindlay/Documents/Code/DataProvider/DataProvider.sln --no-restore --verbosity normal
50+
```
51+
52+
## Notes
53+
54+
- Tests use xUnit 2.9.2
55+
- Coverage config: `coverlet.runsettings`
56+
- Sync and Gatekeeper tests require a running Postgres instance
57+
- Dashboard tests use Playwright (E2E)
58+
- NEVER skip tests - failing tests are OK, skipped tests are ILLEGAL

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"rollForward": false
1111
},
1212
"h5-compiler": {
13-
"version": "24.11.53871",
13+
"version": "26.3.64893",
1414
"commands": [
1515
"h5"
1616
],

0 commit comments

Comments
 (0)