Skip to content

Commit

Permalink
fix: empty per dose print
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed May 9, 2024
1 parent ea66ed2 commit 8bd2618
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Informedica.GenOrder.Lib/Order.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,11 @@ module Order =
else
$"({s})"

let addPerDosis s =
if s |> String.isNullOrWhiteSpace then s
else
$"{s}/dosis"

let freq =
ord.Prescription
|> Prescription.Print.frequencyToMd
Expand Down Expand Up @@ -3037,7 +3042,7 @@ module Order =
itm.Dose |> Dose.Print.dosePerTimeAdjustConstraints 3
|> withBrackets
itm.Dose |> Dose.Print.doseQuantityAdjustConstraints 3
|> sprintf "%s/dosis"
|> addPerDosis
|> withBrackets
]
|> List.tryFind String.notEmpty
Expand All @@ -3055,7 +3060,7 @@ module Order =
itm.Dose |> Dose.Print.dosePerTimeConstraints 3
|> withBrackets
itm.Dose |> Dose.Print.doseQuantityConstraints 3
|> sprintf "%s/dosis"
|> addPerDosis
|> withBrackets
]
|> List.tryFind String.notEmpty
Expand Down Expand Up @@ -3096,11 +3101,13 @@ module Order =

if itm.Dose.QuantityAdjust |> QuantityAdjust.isSolved then
itm.Dose |> Dose.Print.doseQuantityAdjustConstraints 3
|> addPerDosis
|> withBrackets

else
if itm.Dose.Quantity |> Quantity.isSolved then
itm.Dose |> Dose.Print.doseQuantityConstraints 3
|> addPerDosis
|> withBrackets

|]
Expand Down

0 comments on commit 8bd2618

Please sign in to comment.