Skip to content

Commit

Permalink
fix: improved dose limit target to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Bollen authored and Casper Bollen committed Nov 18, 2023
1 parent ae09ad5 commit b6580dc
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/Informedica.GenForm.Lib/DoseRule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ module DoseRule =
}


let doseLimitTargetToString =
function
| NoDoseLimitTarget -> ""
| ShapeDoseLimitTarget s
| SubstanceDoseLimitTarget s -> s


let substanceDoseLimitTargetToString =
function
| SubstanceDoseLimitTarget s -> s
| _ -> ""



module Print =

Expand Down Expand Up @@ -133,7 +146,7 @@ module DoseRule =
|> List.map String.trim
|> List.filter (String.IsNullOrEmpty >> not)
|> String.concat " "
|> fun s -> $"{dl.DoseLimitTarget} {wrap}{s}{wrap}"
|> fun s -> $"%s{dl.DoseLimitTarget |> DoseLimit.substanceDoseLimitTargetToString} {wrap}{s}{wrap}"
)


Expand All @@ -144,11 +157,11 @@ module DoseRule =
$"\n# {generic}\n---\n"

let route_md route products =
$"\n### Route: {route}\n\n#### Producten\n{products}\n"
$"\n### Route: {route}\n\n#### Producten\n%s{products}\n"

let product_md product = $"* {product}"

let indication_md indication = $"\n## Indicatie: {indication}\n---\n"
let indication_md indication = $"\n## Indicatie: %s{indication}\n---\n"

let doseCapt_md = "\n#### Doseringen\n"

Expand Down Expand Up @@ -178,9 +191,9 @@ module DoseRule =

let patient_md patient diagn =
if diagn |> String.isNullOrWhiteSpace then
$"\n##### Patient: **{patient}**\n"
$"\n##### Patient: **%s{patient}**\n"
else
$"\n##### Patient: **{patient}**\n\n%s{diagn}"
$"\n##### Patient: **%s{patient}**\n\n%s{diagn}"

let printDoses (rules : DoseRule array) =
("", rules |> Array.groupBy (fun d -> d.DoseType))
Expand Down

0 comments on commit b6580dc

Please sign in to comment.