Conversation
Greptile SummaryThis PR introduces Key changes:
Issues to address:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Views.Interactions (Client)
participant App as App.fs (Elmish)
participant Shared as Shared.Api
participant Cmd as ServerApi.Command
participant Port as InteractionPort
participant Lib as GenINTERACT.Lib.Api
participant Data as Data.JSON
UI->>App: CheckInteractions drugNames
App->>Shared: InteractionCmd(CheckInteractions drugs)
Shared->>Cmd: handle InteractionCmd
Cmd->>Port: env.interaction.checkInteractions drugs
Port->>Data: read Data.JSON (if exists)
Port->>Lib: Api.checkInteractions json drugs
Lib->>Lib: Data.cacheToInteractions json
Lib->>Lib: Interactions.tupelizeInteractions (memoized)
Lib->>Lib: Interactions.check drugNames pairs
Lib-->>Port: DrugInteraction list
Port-->>Cmd: Result<DrugInteraction list, string[]>
Cmd-->>Shared: InteractionsChecked(interactions[]) wrapped in InteractionResp
Shared-->>App: LoadInteractionsResult(Finished(Ok msg))
App->>App: processOk → InteractionResp → Resolved interactions
App-->>UI: state.Interactions = Resolved interactions
Reviews (1): Last reviewed commit: "Merge branch 'master' into add-interacti..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR adds an initial drug-interaction checking capability to GenPRES by introducing a new F# library (Informedica.GenINTERACT.Lib), wiring it into the server command pipeline, and exposing a new Interactions page in the client UI.
Changes:
- Added
Informedica.GenINTERACT.Lib(types, JSON loading, interaction-checking logic, API) plus interaction dataset (data/cache/interactions/Data.JSON). - Extended the shared API/contracts and server ports/handlers to support
InteractionCmd(CheckInteractions ...)and return interaction results. - Added an Interactions page and view in the client, including Elmish state/messages and navigation.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Informedica.GenPRES.Server.Tests/Tests.fs | Updates stubs/fixtures to include the new interaction port and OrderPlan.Interactions field. |
| src/Informedica.GenPRES.Shared/Types.fs | Adds DrugInteraction type and OrderPlan.Interactions. |
| src/Informedica.GenPRES.Shared/Scripts/Localization.fsx | Adds translation entries for Terms.Interactions. |
| src/Informedica.GenPRES.Shared/Models.fs | Ensures OrderPlan.create initializes Interactions. |
| src/Informedica.GenPRES.Shared/Localization.fs | Adds Interactions to the Terms DU. |
| src/Informedica.GenPRES.Shared/Api.fs | Adds InteractionCmd, InteractionResp, and associated DU cases. |
| src/Informedica.GenPRES.Server/ServerApi.Ports.fs | Introduces InteractionPort and adds it to AppEnv. |
| src/Informedica.GenPRES.Server/ServerApi.Mappers.fs | Minor mapper argument ordering adjustments (unrelated to interactions feature logic). |
| src/Informedica.GenPRES.Server/ServerApi.Command.fs | Handles InteractionCmd(CheckInteractions ...) in the server command dispatcher. |
| src/Informedica.GenPRES.Server/ServerApi.AgentAdapters.fs | Adds an agent-backed adapter to load/check interactions using the new library. |
| src/Informedica.GenPRES.Server/ServerApi.Adapters.fs | Adds a non-agent interaction adapter implementation. |
| src/Informedica.GenPRES.Server/Informedica.GenPRES.Server.fsproj | References the new Informedica.GenINTERACT.Lib project. |
| src/Informedica.GenPRES.Client/Views/Interactions.fs | New Interactions UI view (drug input + results table). |
| src/Informedica.GenPRES.Client/Pages/GenPres.fs | Adds Interactions page to navigation and routing. |
| src/Informedica.GenPRES.Client/MUI.fs | Adds WarningAmber icon wrapper. |
| src/Informedica.GenPRES.Client/Informedica.GenPRES.Client.fsproj | Includes the new Views/Interactions.fs in compilation. |
| src/Informedica.GenPRES.Client/Global.fs | Adds Interactions to the global page enum + page title mapping. |
| src/Informedica.GenPRES.Client/App.fs | Adds Elmish state/messages and API dispatch for interaction checking. |
| src/Informedica.GenINTERACT.Lib/Types.fs | Defines interaction domain + cache/serialization DTOs. |
| src/Informedica.GenINTERACT.Lib/Scripts/load.fsx | Script loader for interactive use. |
| src/Informedica.GenINTERACT.Lib/Scripts/Interactions.fsx | Script-based interaction logic + tests (currently duplicates library logic). |
| src/Informedica.GenINTERACT.Lib/paket.references | Adds required packages (Newtonsoft.Json). |
| src/Informedica.GenINTERACT.Lib/Interactions.fs | Implements interaction tuple expansion + checking logic. |
| src/Informedica.GenINTERACT.Lib/Informedica.GenINTERACT.Lib.fsproj | New project definition and file list. |
| src/Informedica.GenINTERACT.Lib/Data.fs | JSON loading + transformation to domain interactions. |
| src/Informedica.GenINTERACT.Lib/Api.fs | Public API entrypoint checkInteractions. |
| GenPRES.sln | Registers the new library project in the solution. |
| data/cache/interactions/Data.JSON | Adds interaction dataset used by the checker. |
| .gitignore | Allows interaction cache JSON and new library folder to be committed. |
This pull request introduces a new F# library,
Informedica.GenINTERACT.Lib, for drug interaction checking, and integrates it into the solution. The library provides types, data loading, interaction checking logic, and a public API, along with scripts and tests for validation. Additionally, the solution and client app are updated to recognize and begin integrating this new functionality.Key changes:
1. Addition of the drug interaction checking library
Informedica.GenINTERACT.Libto the solution, including its project file, dependencies, and solution references. (GenPRES.sln,src/Informedica.GenINTERACT.Lib/Informedica.GenINTERACT.Lib.fsproj,src/Informedica.GenINTERACT.Lib/paket.references) [1] [2] [3]Types.fs(domain and serialization types),Interactions.fs(interaction logic),Data.fs(data loading and transformation), andApi.fs(public API). (src/Informedica.GenINTERACT.Lib/Types.fs,src/Informedica.GenINTERACT.Lib/Interactions.fs,src/Informedica.GenINTERACT.Lib/Data.fs,src/Informedica.GenINTERACT.Lib/Api.fs) [1] [2] [3] [4]src/Informedica.GenINTERACT.Lib/Scripts/load.fsx,src/Informedica.GenINTERACT.Lib/Scripts/Interactions.fsx) [1] [2]2. Solution and project structure updates
GenPRES.sln) [1] [2]3. Initial client application integration
src/Informedica.GenPRES.Client/App.fs) [1] [2] [3]src/Informedica.GenPRES.Client/App.fs)These changes lay the foundation for drug interaction checking within the application, providing a reusable library, associated tests, and the beginnings of client-side integration.