Skip to content

Commit 91836c6

Browse files
Casper BollenCasper Bollen
Casper Bollen
authored and
Casper Bollen
committed
fix: products in component limit
1 parent 63b4fa0 commit 91836c6

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/Informedica.GenForm.Lib/DoseRule.fs

-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module DoseRule =
2525
let limit =
2626
{
2727
Component = ""
28-
Products = [||]
2928
DoseLimitTarget = NoLimitTarget
3029
AdjustUnit = None
3130
DoseUnit = NoUnit
@@ -89,13 +88,9 @@ module DoseRule =
8988
| _ -> false
9089

9190

92-
let hasProducts (dl : DoseLimit) = dl.Products |> Array.isEmpty |> not
93-
94-
9591
let hasNoLimits (dl : DoseLimit) =
9692
{ limit with
9793
Component = dl.Component
98-
Products = dl.Products
9994
DoseLimitTarget = dl.DoseLimitTarget
10095
AdjustUnit = dl.AdjustUnit
10196
DoseUnit = dl.DoseUnit
@@ -739,7 +734,6 @@ cannot map {r}
739734

740735
{
741736
Component = r.Component
742-
Products = r.Products
743737
DoseLimitTarget =
744738
if r.Substance |> String.isNullOrWhiteSpace then
745739
dr.Shape |> ShapeLimitTarget

src/Informedica.GenForm.Lib/Scripts/DoseRule.fsx

+10
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ open Informedica.Utils.Lib.BCL
3434
DoseRule.get ()
3535
|> Array.tryFind (_.Generic >> String.equalsCapInsens "nutrilon pepti 1")
3636
|> Option.map _.ComponentLimits
37+
38+
39+
Web.getDataUrlIdGenPres ()
40+
|> DoseRule.get_
41+
|> Array.tryFind (fst >> _.Generic >> String.equalsCapInsens "nutrilon pepti 1")
42+
|> Option.map (fun (dr, rs) ->
43+
dr
44+
|> DoseRule.addDoseLimits rs
45+
)
46+
|> Option.get

src/Informedica.GenForm.Lib/Types.fs

-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ module Types =
152152
type DoseLimit =
153153
{
154154
Component : string
155-
// The list of associated Products of the DoseLimit.
156-
Products : Product array
157155
DoseLimitTarget : LimitTarget
158156
// The unit to adjust dosing with
159157
AdjustUnit : Unit option

src/Informedica.GenOrder.Lib/DrugOrder.fs

+1-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ module DrugOrder =
195195
)
196196
Dose = lim.Limit
197197
Substances =
198-
lim.SubstanceLimits
199-
|> Array.collect _.Products
198+
lim.Products
200199
|> Array.collect _.Substances
201200
|> Array.groupBy _.Name
202201
|> Array.map (fun (n, xs) ->

0 commit comments

Comments
 (0)