Skip to content

Commit

Permalink
chore: sync commit, not sure what changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed Nov 11, 2023
1 parent edc622a commit cea36df
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
23 changes: 18 additions & 5 deletions src/Client/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ module private Elmish =
{ state with Scenarios = InProgress }, Cmd.fromAsync load

| LoadScenarios (Finished (Ok result)) ->
result.Scenarios
|> Array.iter (fun s ->
Logging.log "order" $"order: {s.Order}"
)
{ state with
Scenarios = Resolved result
},
Expand Down Expand Up @@ -497,6 +493,23 @@ module private Elmish =
state.SelectedScenarioOrder
|> Option.map (fun (sc, _) -> sc, o)
CalculatedOrder = o |> Some |> Resolved
// show only the calculated order scenario
Scenarios =
state.Scenarios
|> Deferred.map (fun scr ->
{ scr with
Scenarios =
scr.Scenarios
|> Array.filter (fun sc ->
sc.Order
|> Option.map (fun so ->
printfn $"comparing {so.Orderable} = {o.Orderable}"
so.Id = o.Id
)
|> Option.defaultValue true
)
}
)
}, Cmd.none
| Error s ->
printfn "eror calculating order"
Expand Down Expand Up @@ -620,7 +633,7 @@ let View () =
bolusMedication = bm
continuousMedication = cm
products = state.Products
scenario = state.Scenarios
scenarioResult = state.Scenarios
updateScenario = UpdateScenarios >> dispatch
formulary = state.Formulary
updateFormulary = UpdateFormulary >> dispatch
Expand Down
6 changes: 3 additions & 3 deletions src/Client/Pages/GenPres.fs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module GenPres =
bolusMedication: Deferred<Intervention list>
continuousMedication: Deferred<Intervention list>
products: Deferred<Product list>
scenario: Deferred<ScenarioResult>
scenarioResult: Deferred<ScenarioResult>
updateScenario : ScenarioResult -> unit
selectOrder : (Scenario * Order option) -> unit
order : Deferred<Order option>
Expand All @@ -136,7 +136,7 @@ module GenPres =
box props.page
box props.updatePage
box lang
box props.scenario
box props.scenarioResult
|]
let state, dispatch = React.useElmish (init lang props.localizationTerms props.page, update lang props.localizationTerms props.updatePage, deps)

Expand Down Expand Up @@ -218,7 +218,7 @@ module GenPres =
| Global.Pages.Prescribe ->
Views.Prescribe.View ({|
order = props.order
scenarios = props.scenario
scenarios = props.scenarioResult
updateScenario = props.updateScenario
selectOrder = props.selectOrder
loadOrder = props.loadOrder
Expand Down
4 changes: 3 additions & 1 deletion src/Informedica.GenOrder.Lib/Api.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ namespace Informedica.GenOrder.Lib

module Api =

open System

open MathNet.Numerics
open Informedica.Utils.Lib
open Informedica.Utils.Lib.BCL
Expand Down Expand Up @@ -192,7 +194,7 @@ module Api =
|> Option.defaultValue false

{ DrugOrder.drugOrder with
Id = "1" //Guid.NewGuid().ToString()
Id = Guid.NewGuid().ToString()
Name = pr.DoseRule.Generic
Products =
pr.DoseRule.Products
Expand Down

0 comments on commit cea36df

Please sign in to comment.