From c9b4ae8888f33b45fa4414d767f776c272aa1b0b Mon Sep 17 00:00:00 2001 From: Casper Bollen Date: Fri, 3 Nov 2023 15:54:54 +0100 Subject: [PATCH] docs: finished comments for order api --- src/Informedica.GenOrder.Lib/Api.fs | 40 +++++++++++----------------- src/Informedica.GenSolver.Lib/Api.fs | 5 +--- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/Informedica.GenOrder.Lib/Api.fs b/src/Informedica.GenOrder.Lib/Api.fs index fea54ab..e0234e2 100644 --- a/src/Informedica.GenOrder.Lib/Api.fs +++ b/src/Informedica.GenOrder.Lib/Api.fs @@ -1,7 +1,6 @@ namespace Informedica.GenOrder.Lib - module Api = open MathNet.Numerics @@ -276,6 +275,15 @@ module Api = let increaseIncrements logger ord = Order.increaseIncrements logger 10N 50N ord + /// + /// Evaluate a PrescriptionRule. The PrescriptionRule can result in + /// multiple Orders, depending on the SolutionRules. + /// + /// + /// + /// + /// An array of Results, containing the Order and the PrescriptionRule. + /// let evaluate logger (rule : PrescriptionRule) = let rec solve retry sr pr = pr @@ -348,29 +356,9 @@ module Api = |> Array.map (fun sr -> solve true (Some sr) rule) - // print an order list - let toScenarios ind sn (ords : Order[]) = - ords - |> Array.mapi (fun i o -> - o - |> Order.Print.printOrderToString sn - |> fun (pres, prep, adm) -> - { - No = i - Indication = ind - DoseType = "" - Name = o.Orderable.Name |> Informedica.GenSolver.Lib.Variable.Name.toString - Shape = o.Orderable.Components[0].Shape - Route = o.Route - Prescription = pres - Preparation = prep - Administration = adm - Order = Some o - } - ) - - - + /// + /// Create an initial ScenarioResult for a Patient. + /// let scenarioResult pat = let rules = pat |> PrescriptionRule.get { @@ -395,9 +383,11 @@ module Api = |> String.replace ">" "" + /// + /// Use a Filter and a ScenarioResult to create a new ScenarioResult. + /// let filter (sc : ScenarioResult) = - if Env.getItem "GENPRES_PROD" |> Option.isNone then let path = $"{__SOURCE_DIRECTORY__}/log.txt" OrderLogger.logger.Start (Some path) OrderLogger.Level.Informative diff --git a/src/Informedica.GenSolver.Lib/Api.fs b/src/Informedica.GenSolver.Lib/Api.fs index 1bafe86..d35cc2d 100644 --- a/src/Informedica.GenSolver.Lib/Api.fs +++ b/src/Informedica.GenSolver.Lib/Api.fs @@ -1,7 +1,7 @@ namespace Informedica.GenSolver.Lib -/// Public funtions to use the library +/// Public functions to use the library module Api = open System @@ -63,9 +63,6 @@ module Api = /// /// Solve an `Equations` list /// - /// True if only min, incr and max values are to be used - /// The logger to log operations - /// List of equations to solve /// A result type of the solved equations /// /// This function is a wrapper around `Solver.solveAll`