Skip to content

Commit

Permalink
chore: filter solution rule prods with dose rule prods
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed Mar 5, 2024
1 parent 9f02f94 commit ea96542
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Informedica.GenForm.Lib/PrescriptionRule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ module PrescriptionRule =
Route = dr.Route |> Some
DoseType = dr.DoseType |> DoseType.toString |> Some
}
|> Array.map (fun sr ->
{ sr with
Products =
sr.Products
|> Array.filter (fun sr_p ->
dr.Products
|> Array.exists (fun dr_p ->
sr_p.GPK = dr_p.GPK
)
)
}
)
}
)
|> Array.filter (fun pr ->
Expand Down
19 changes: 19 additions & 0 deletions src/Informedica.GenOrder.Lib/Scripts/Api2.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@ Product.get ()
}
|> Array.filter (fun p -> p.Generic |> String.equalsCapInsens "nicu mix")

let pr =
Patient.teenager
|> fun p ->
{ p with
VenousAccess = [VenousAccess.CVL]
Department = Some "ICK"
Age =
Units.Time.year
|> ValueUnit.singleWithValue 12N
|> Some
Weight =
Units.Weight.kiloGram
|> ValueUnit.singleWithValue (30N)
|> Some
}
//|> Api.scenarioResult |> Api.filter
//|> fun p -> { p with VenousAccess = CVL; AgeInDays = Some 0N }
|> PrescriptionRule.get
|> Array.item 0 //|> Api.evaluate (OrderLogger.logger.Logger)

Patient.teenager
|> fun p ->
Expand Down

0 comments on commit ea96542

Please sign in to comment.