Skip to content

Commit

Permalink
fix: adjust abs vu in renalrule
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed Jun 15, 2024
1 parent aa3b3e0 commit 8b505a7
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/Informedica.GenForm.Lib/RenalRule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,7 @@ module RenalRule =
| Some v1, Some v2 ->
if v1 <? v2 then v1 else v2
|> Some
| None, Some _ -> vu2
| Some _, None -> vu1
| None, None -> None
| _ -> vu2
| NoReduction -> vu1

let adjustMinMax dr mm2 mm1 =
Expand All @@ -397,21 +395,17 @@ module RenalRule =
Min =
match mm1.Min, mm2.Min with
| Some lim1, Some lim2 ->
if Limit.st true true lim1 lim2 then lim1 |> Some
if lim1 |> Limit.st true true lim2 then lim1 |> Some
else
lim2 |> Some
| None, Some lim2 -> Some lim2
| Some lim1, None -> lim1 |> Some
| None, None -> None
| _ -> mm2.Min
Max =
match mm1.Max, mm2.Max with
| Some lim1, Some lim2 ->
if Limit.st false false lim1 lim2 then lim1 |> Some
if lim1 |> Limit.st false false lim2 then lim1 |> Some
else
lim2 |> Some
| None, Some lim2 -> lim2 |> Some
| Some lim1, None -> lim1 |> Some
| None, None -> None
| _ -> mm2.Max
}
| Relative ->
if mm1 = MinMax.empty || mm2 = MinMax.empty then mm1
Expand Down

0 comments on commit 8b505a7

Please sign in to comment.