Skip to content

Commit

Permalink
fix: comp logic in renal rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed Jun 17, 2024
1 parent 8b505a7 commit 1a55a4d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/Informedica.GenCore.Lib/MinMax.fs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,19 @@ module Limit =
|> fun (fInclIncl, fInclExcl, fExclIncl, fExclExcl) -> map2 fInclIncl fInclExcl fExclIncl fExclExcl


/// <summary>
/// Check whether v1 >= v2 using
/// inclusive and exclusive logic
/// </summary>
/// <example>
/// <code>
/// let gteMin = Limit.gte true true
/// let oneIncl = Units.Count.times |> ValueUnit.singleWithValue 1N |> Inclusive
/// let twoIncl = Units.Count.times |> ValueUnit.singleWithValue 2N |> Inclusive
/// gteMin oneIncl twoIncl // false
/// gteMin twoIncl oneIncl // true
/// </code>
/// </example>
let gte isMin1 isMin2 =
match isMin1, isMin2 with
// min >= min
Expand Down
4 changes: 2 additions & 2 deletions src/Informedica.GenForm.Lib/RenalRule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,14 @@ module RenalRule =
Min =
match mm1.Min, mm2.Min with
| Some lim1, Some lim2 ->
if lim1 |> Limit.st true true lim2 then lim1 |> Some
if lim1 |> (Limit.st true true) <| lim2 then lim1 |> Some
else
lim2 |> Some
| _ -> mm2.Min
Max =
match mm1.Max, mm2.Max with
| Some lim1, Some lim2 ->
if lim1 |> Limit.st false false lim2 then lim1 |> Some
if lim1 |> (Limit.st false false) <| lim2 then lim1 |> Some
else
lim2 |> Some
| _ -> mm2.Max
Expand Down
2 changes: 1 addition & 1 deletion src/Informedica.GenForm.Lib/Scripts/Scripts.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ open Informedica.Utils.Lib.BCL
open Informedica.GenUnits.Lib
open Informedica.GenForm.Lib


Units.Count.times |> ValueUnit.singleWithValue 2N

let pr =
{ Filter.filter with
Expand Down

0 comments on commit 1a55a4d

Please sign in to comment.