Skip to content

fix: fix the docker setup to include interactions and related data#212

Merged
halcwb merged 4 commits intoinformedica:masterfrom
halcwb:fix-docker
Mar 23, 2026
Merged

fix: fix the docker setup to include interactions and related data#212
halcwb merged 4 commits intoinformedica:masterfrom
halcwb:fix-docker

Conversation

@halcwb
Copy link
Collaborator

@halcwb halcwb commented Mar 23, 2026

This pull request updates the Docker configuration and server code to support the new Informedica.GenINTERACT.Lib library and to improve the handling of interaction data caching. The changes ensure that the new library is included in Docker builds, and that relevant cache files and directories are available in the container. Additionally, the server code is updated to simplify the path resolution for the interaction JSON cache.

Docker and file inclusion updates:

  • Added src/Informedica.GenINTERACT.Lib to the Docker build context and ensured it is not ignored by .dockerignore, allowing it to be copied into the Docker image. [1] [2]
  • Updated .dockerignore to allow the interactions cache directory and its JSON files to be included in the Docker build, ensuring these files are available at runtime.

Server code improvements:

  • Simplified the construction of the path to the interactions/Data.JSON cache file in ServerApi.Adapters.fs, making it more robust and easier to maintain.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR wires up the new Informedica.GenINTERACT.Lib library into the Docker build pipeline and ships the first Data.JSON interaction cache, while also fixing an incorrect relative path that would have prevented the cache from loading at all.

Key changes:

  • Dockerfile / .dockerignore: adds src/Informedica.GenINTERACT.Lib to the build so the library is compiled in the container image.
  • .dockerignore / .gitignore: un-ignores data/cache/interactions/*.JSON so the cache file is tracked in git and included in Docker builds.
  • ServerApi.Adapters.fs: removes the erroneous ../.. path segments from interactionJsonCache. The old path (getServerDataPath() + /../../data/cache/...) would have resolved to a directory two levels above the server root and never found the file; the new path (getServerDataPath() + /data/cache/...) correctly resolves to src/Informedica.GenPRES.Server/data/cache/interactions/Data.JSON in development and /app/data/cache/... in production.
  • Data.JSON: new drug-interaction cache file; contains three data quality issues flagged in inline comments (typo evafirenzefavirenz, duplicate bictegravir, trailing space on colchicine ).

Confidence Score: 4/5

  • Safe to merge after fixing the efavirenz typo and trailing space in colchicine in Data.JSON, as these can silently suppress correct interaction warnings at runtime.
  • The infrastructure changes (Dockerfile, ignore files, path fix) are clean and correct. The only concerns are three data quality issues in the newly committed Data.JSON: a drug name misspelling (evafirenz vs efavirenz) and a trailing space (colchicine ) could cause missed interaction lookups, while the duplicate bictegravir is cosmetic. The logic bug in the original path (../..) is correctly removed. Addressing the two logic-level data issues before merge would make this a 5.
  • src/Informedica.GenPRES.Server/data/cache/interactions/Data.JSON — contains drug name typo and trailing whitespace that can silently break interaction detection

Important Files Changed

Filename Overview
src/Informedica.GenPRES.Server/ServerApi.Adapters.fs Simplifies path construction for the interaction JSON cache by removing incorrect ../.. navigation segments that would have produced a wrong path relative to the server root returned by getServerDataPath().
Dockerfile Adds the new Informedica.GenINTERACT.Lib source directory to the Docker build context so it can be compiled as part of the image build.
.dockerignore Unblocks Informedica.GenINTERACT.Lib and the interactions/ cache directory so they are included in the Docker build context.
.gitignore Mirrors the .dockerignore change: un-ignores interactions/*.JSON so Data.JSON is tracked by git, consistent with how other cache files are handled.
src/Informedica.GenPRES.Server/data/cache/interactions/Data.JSON New drug-interaction cache file committed to the repo; contains three data quality issues: a misspelling of efavirenzevafirenz, a duplicate bictegravir entry, and a trailing space in colchicine .

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[loadInteractionJson called] --> B[lazy interactionJsonCache evaluated?]
    B -- already cached --> C[return cached value]
    B -- first call --> D[getServerDataPath]
    D --> E{Server.fs found in tree?}
    E -- yes dev --> F[return server source dir]
    E -- no --> G{Server.dll in currentDir?}
    G -- yes prod --> H[return currentDir /app]
    G -- no --> I[return Environment.CurrentDirectory]
    F --> J[Path.Combine path + data/cache/interactions/Data.JSON]
    H --> J
    I --> J
    J --> K[Path.GetFullPath]
    K --> L{File.Exists?}
    L -- yes --> M[File.ReadAllText → Some json]
    L -- no --> N[None]
    M --> O[GenInteract.Lib.Api.checkInteractions]
    N --> O
    O --> P[return interaction results]
Loading

Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix: fix the docker setup to include int..." | Re-trigger Greptile

halcwb and others added 3 commits March 23, 2026 23:33
…ns/Data.JSON

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@halcwb halcwb merged commit 43bcdf5 into informedica:master Mar 23, 2026
3 checks passed
@halcwb halcwb deleted the fix-docker branch March 23, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant