Files
St.Clair/MLMStripper/bin/Debug/SYS/SYS_CALC_AUC_COEF.mlm

437 lines
20 KiB
Plaintext

maintenance:
title: AUC Dose Calculation Coefficient;;
mlmname: SYS_CALC_AUC_COEF;;
arden: version 2.5;;
version: 18.4;;
institution: Allscripts, System MLM;;
author: Allscripts Healthcare Solutions, Inc.;;
specialist: ;;
date: 2018-10-26;;
validation: testing;;
/* P r o p r i e t a r y N o t i c e */
/* Unpublished (c) 2013 - 2018 Allscripts Healthcare, LLC. and/or its affiliates. All Rights Reserved.
P r o p r i e t a r y N o t i c e: This software has been provided pursuant to a License Agreement, with
Allscripts Healthcare, LLC. and/or its affiliates, containing restrictions on its use. This software contains
valuable trade secrets and proprietary information of Allscripts Healthcare, LLC. and/or its affiliates and is
protected by trade secret and copyright law. This software may not be copied or distributed in any form or medium,
disclosed to any third parties, or used in any manner not provided for in said License Agreement except with prior
written authorization from Allscripts Healthcare, LLC. and/or its affiliates. Notice to U.S. Government Users:
This software is {{{SINGLE-QUOTE}}}Commercial Computer Software{{{SINGLE-QUOTE}}}.
All product names are the trademarks or registered trademarks of Allscripts Healthcare, LLC. and/or its affiliates.
*/
/* P r o p r i e t a r y N o t i c e */
library:
purpose:
The sys_calc_AUC_coef MLM determines the computation coefficient for Area Under
the Curve (AUC) dosing and returns it to the sys_calc_dosage MLM for final calculation
of the Dose, along with a text string showing the formula used.
;;
explanation:
Four different computations for carboplatin dosage are implemented by this MLM.
The Calvert formula, used mostly for adults, requires a value for a Glomerular
Filtration Rate (GFR), which is approximated by Estimated Creatinine Clearance (ECC).
The ECC is calculated by the Cockcroft-Gault or Jellife method as selected by the user
or the user may supply a measured or "Actual" value. A clinically-determined constant
value is added to ECC (or GFR), and the sum is multiplied by a value for the Area
Under the Curve (AUC). The Calvert formula is as follows:
Carboplatin dose (mg) = AUC x (GFR + 25)
For Pediatric patients less than 18 years old and weighing 10 Kg or more,
the dose calculation requires a "raw CrCl" test result or user-entered
lab value. The modified Calvert formula is:
Carboplatin Dose (mg) = AUC x [CrCl + (BSA x 15)]
For pediatric patients less than 18 years old and weighing less than 10 Kg,
the dose calculation requires a "raw CrCl" test result or user-entered
lab value. The modified Calvert formula is:
Carboplatin Dose (mg) = AUC x [CrCl + (Wt x 0.36)]
A third choice for all pediatric patients less than 18 years old is the
St. Jude{{{SINGLE-QUOTE}}}s modified Calvert formula, which requires a measured Creatinine
Clearance. The St. Jude{{{SINGLE-QUOTE}}}s modified Calvert formula is :
Carboplatin Dose (mg) = target AUC x [(0.93 x CrCl/BSA) + 15] x BSA.
The Dose Basis and BSA preference are selected by the user and determine which data elements
are used and how to calculate the ECC. The patient{{{SINGLE-QUOTE}}}s age determines whether to use Pediatric
BSA, and the patient{{{SINGLE-QUOTE}}}s height constrains the use of Ideal or Adjusted weights. The Dose Basis
strings and the calculations to which they correspond are listed:
Dose Basis string Dose Calculation Considerations
AUC (Cockcroft-Gault) Dose = AUC x (CrCl+25)
AUC (Cockcroft-Gault ideal) Dose = AUC x (CrCl+25) Ht >= 150 cm
AUC (Cockcroft-Gault adjusted) Dose = AUC x (CrCl+25)
AUC (Jelliffe) Dose = AUC x (CrCl+25)
AUC (Jelliffe ideal) Dose = AUC x (CrCl+25) Ht >= 150 cm
AUC (Jelliffe adjusted) Dose = AUC x (CrCl+25)
AUC (Jelliffe no BSA) Dose = AUC x (CrCl+25)
AUC (measured CrCl) Dose = AUC x (CrCl+25) Adult or Peds
AUC (measured CrCl) Dose = AUC x (CrCl+(BSA x 15)) Age <= 18y, Wt >= 10 kg
AUC (measured CrCl) Dose = AUC x (CrCl+(Wt x 0.36)) Age <= 18y, Wt < 10 kg
AUC (St. Jude{{{SINGLE-QUOTE}}}s modified-Peds) Dose = AUC x ((0.93 x ClCl/BSA)+15) x BSA Age <= 18y
Note that all of the above Dose Calculations have the general pattern of
Dose = AUC_value x AUC_coefficient
The AUC_value is entered by the user and this MLM determines the AUC_coefficient, which
are then used to calculate the dose.
The sys_calc_AUC_coef MLM requires the arguments listed below from the calling MLM or program.
Note that Units of measure are assumed to always be US standard: ml/min for for Creatinine
Clearance and mg/dL for Serum Creatinine. Any conversion required is done by the application.
Arguments:
ht_val - in centimeters, used in BSA and Ideal weight
wt_val - in Kg, used in BSA and Adjusted weight calcs
BSA_val - in m^2, for use in various calculations
dose_val - user entry in Requested field, to be used as AUC_value
dose_basis - string selected by user
serum_creatinine - either entered by user into ECC control or sent by application
creat_clearance - either entered by user into ECC control or sent by application
is_actual_CrCl - state of "Actual" button on the ECC control - True = set, False = clear
client_info_obj - used for accessing client demographic info as needed
The sys_calc_AUC_dose mlm returns the following values:
error_message - string, or "" if no error was generated
AUC_coef - number computed from the values received, for the chosen dose basis
dose_calc_formula - a string containing the formula by which the values are computed
;;
keywords: Carboplatin dosage, Calvert{{{SINGLE-QUOTE}}}s formula
;;
knowledge:
type: data-driven;;
data:
/* ------------------------------------------ */
/* Arguments passed in by sys_calc_dosage mlm */
/* ------------------------------------------ */
(ht_val,
wt_val,
BSA_val,
dose_val,
dose_basis,
serum_creatinine, // from ECC control via sys_dose_calc mlm
creat_clearance, // from ECC control via sys_dose_calc mlm
is_actual_CrCl, // from ECC control via sys_dose_calc mlm
client_info_obj
) := argument;
/****************** Make Changes To Spelling And Flags In This Section *****************/
/* Set to true if a decision.log is needed.*/
log_execution_info := false;
/*-----------------------------------*/
/* Declare MLMs and variables */
/*-----------------------------------*/
/* MLM to get the Estimated Creatinine Clearance. */
func_calc_estCrCl := MLM {{{SINGLE-QUOTE}}}SYS_CALC_EST_CRCL{{{SINGLE-QUOTE}}};
/* MLM to get the BSA */
func_calc_BSA := MLM {{{SINGLE-QUOTE}}}SYS_CALC_BSA{{{SINGLE-QUOTE}}};
pediatric_BSA_age_limit := 18; // years
calculate_with_BSA := true; // assume we will use BSA in Jelliffe formula
BSA_pref := "Standard"; // default BSA calculation will be done
EstCrCl_equation_pref := ""; // will be set for Cockcroft-Gault or Jelliffe only
use_ECC_mlm := true; // assume we will use the EstCrCl mlm
calc_pedi_dose := false; // assume we will do an adult dosage
error_message := ""; // to be populated if errors are found
fatal_error := false; // will be used to determine if we can continue
/*----------------------------------------------------------*/
/* define dose basis string sets for AUC dose calculations */
/*----------------------------------------------------------*/
AUC_cg_string := ("AUC (Cockcroft-Gault)", "AUC (Cockcroft-Gault ideal)",
"AUC (Cockcroft-Gault adjusted)");
AUC_jlf_string := ("AUC (Jelliffe)", "AUC (Jelliffe ideal)", "AUC (Jelliffe adjusted)",
"AUC (Jelliffe no BSA)");
AUC_mCrCl_string := ("AUC (measured CrCl)", "AUC (St. Jude{{{SINGLE-QUOTE}}}s modified-Peds)");
AUC_ideal_string := ("AUC (Cockcroft-Gault ideal)", "AUC (Jelliffe ideal)");
AUC_adjusted_string := ("AUC (Cockcroft-Gault adjusted)", "AUC (Jelliffe adjusted)");
AUC_strings := (AUC_cg_string, AUC_jlf_string, AUC_mCrCl_string);
/***************************************************************************************/
/*---------------------------*/
/* convert values to numbers */
/*---------------------------*/
ht_val := ht_val as number;
wt_val := wt_val as number;
BSA_val := BSA_val as number;
dose_val := dose_val as number;
serum_creatinine := serum_creatinine as number;
creat_clearance := creat_clearance as number;
/*----------------------------------------*/
/* set up Pediatric calculation if needed */
/*----------------------------------------*/
if exist client_info_obj
then
(birthdatetime,
birth_year,
patient_gender ):= read last
{ClientInfo: birthdatetime, BirthYearNum, GenderTypeIntlCode
REFERENCING client_info_obj};
endif;
if exist birthdatetime
and birth_year > 0
and birthdatetime is time
then
patient_age:= (NOW - birthdatetime) / (1 year);
calc_pedi_dose := (patient_age <= pediatric_BSA_age_limit);
endif; /* if exist birthdatetime */
/*------------------------------------------*/
/* set EstCrCl equation and BSA preference */
/*------------------------------------------*/
if (dose_basis is in AUC_mCrCl_string)
then
EstCrCl_equation_pref := "";
use_ECC_mlm := false;
elseif dose_basis is in AUC_cg_string
then
EstCrCl_equation_pref := "Cockcroft-Gault";
elseif dose_basis is in AUC_jlf_string
then
EstCrCl_equation_pref := "Jelliffe";
if dose_basis = "AUC (Jelliffe no BSA)"
then
calculate_with_BSA := false;
endif;
endif;
/*------------------------------*/
/* set BSA formula preference */
/*------------------------------*/
if dose_basis is in AUC_ideal_string
then
BSA_pref := "Ideal";
elseif dose_basis is in AUC_adjusted_string
then
BSA_pref := "Adjusted";
else
BSA_pref := "Standard";
endif;
/*--------------*/
/* trap errors */
/*--------------*/
if use_ECC_mlm
then
if calc_pedi_dose
then
error_message := error_message || "Est. CrCl formula not valid for pediatric patient. ";
fatal_error := true;
else // calculating adult EstCrCl
if not (exist serum_creatinine and serum_creatinine > 0)
then
error_message := error_message || "Missing or invalid Serum Creatinine value. ";
fatal_error := true;
endif; // serum Creat not given
endif; //calc_pedi_dose
else
if is_actual_CrCl
then
if not (exist creat_clearance and creat_clearance > 0)
then
error_message := error_message || "Missing or invalid measured CrCl value. ";
fatal_error := true;
else // CrCl exists, check for other errors
if (dose_basis is not in AUC_mCrCl_string)
then
error_message := error_message || "Estimated CrCl is required to calculate AUC dose. ";
fatal_error := true;
elseif (dose_basis = "AUC (St. Jude{{{SINGLE-QUOTE}}}s modified-Peds)")
then
if not calc_pedi_dose
then
error_message := error_message || "Cannot use pediatric calculation for adult dosage.";
fatal_error := true;
else
if not (exist BSA_val and BSA_val > 0)
then
error_message := error_message || "BSA is required to calculate AUC dose.";
fatal_error := true;
endif;
endif; // not pedi patient
elseif (dose_basis = "AUC (measured CrCl)")
then
if calc_pedi_dose
then
if not (exist wt_val and wt_val > 0)
then
error_message := error_message || "Weight is required to calculate AUC dose. ";
fatal_error := true;
elseif (wt_val >= 10)
then
if not (exist BSA_val and BSA_val > 0)
then
error_message := error_message || "BSA is required to calculate AUC dose. ";
fatal_error := true;
endif; // not exist BSA
endif; // not exist weight
endif; // calc pedi dose
endif; // dose basis = St. Jude{{{SINGLE-QUOTE}}}s or measured CrCl
endif; // not exist CrCl
else // is Actual CrCl = false
error_message := error_message || "Measured CrCl is required to calculate AUC dose. ";
fatal_error := true;
endif; // is Actual CrCl
endif; // using ECC_mlm
/*----------------------------------------------------------*/
/* Call EstCrCl mlm to get values if using C-G or Jelliffe */
/*----------------------------------------------------------*/
if use_ECC_mlm
then
(ECC_mlm_error_message,
EstCrCl_number_rounded,
EstCrCl_formula,
weight_used,
BSA_used) := call func_calc_estCrCl with
EstCrCl_equation_pref,
BSA_pref,
ht_val,
wt_val,
Serum_Creatinine,
calculate_with_BSA,
client_info_obj;
if ECC_mlm_error_message <> "" // and EstCrCl_number_rounded = NULL
then
error_message := error_message || ECC_mlm_error_message;
fatal_error := true;
endif; // error occured
/*-----------------------------------------------------------*/
/* otherwise set values for the calculation to be done here */
/*-----------------------------------------------------------*/
else
if (is_actual_CrCl and creat_clearance > 0)
then
weight_used := wt_val;
endif;
endif; /* using the EstCrCl mlm */
;;
evoke:
;;
logic:
/*-------------------------------------------------------------------*/
/* perform and return calculation only if no fatal errors were found */
/*-------------------------------------------------------------------*/
if not fatal_error
then
formula_tail := "";
wt_or_bsa_type := "";
/*------------------------------------------------------*/
/* dose calculation using "standard" Calvert formula */
/*------------------------------------------------------*/
if use_ECC_mlm // only for Jelliffe or Cockcroft-Gault EstCrCl
then
creat_clearance := EstCrCl_number_rounded;
AUC_coef := creat_clearance + 25;
AUC_coef_formula := "(CrCl + 25)";
if BSA_pref <> "Standard"
then
wt_or_bsa_type := "(" || BSA_pref || ")";
endif;
if EstCrCl_equation_pref = "Cockcroft-Gault"
then
formula_tail := "; Wt" || wt_or_bsa_type || " = " || weight_used;
elseif EstCrCl_equation_pref = "Jelliffe"
then
if calculate_with_BSA
then
formula_tail := "; BSA" || wt_or_bsa_type ||" = " || BSA_used;
endif;
endif;
/*---------------------------------------------*/
/* Calvert formula with measured CrCl - Adults */
/*---------------------------------------------*/
else
if not calc_pedi_dose // i.e., dose basis is measured CrCl, adult
then
AUC_coef := creat_clearance + 25;
AUC_coef_formula := "(CrCl + 25)";
/*--------------------------------------------*/
/* St. Jude{{{SINGLE-QUOTE}}}s modified Calvert formula - Peds */
/*--------------------------------------------*/
else
if (dose_basis = "AUC (St. Jude{{{SINGLE-QUOTE}}}s modified-Peds)")
then
GFR := creat_clearance / BSA_val;
AUC_coef := ((0.93 * GFR) + 15) * BSA_val;
AUC_coef_formula := "((0.93 x (CrCl/BSA)) + 15) x BSA";
formula_tail := "; BSA = " || BSA_val;
/*----------------------------------------------------------------*/
/* Modified Calvert{{{SINGLE-QUOTE}}}s formula for peds patients weighing >= 10 kg */
/*----------------------------------------------------------------*/
elseif (dose_basis = "AUC (measured CrCl)") then
if wt_val >= 10
then
AUC_coef := (creat_clearance + (BSA_val * 15));
AUC_coef_formula := "(CrCl + (BSA x 15))";
formula_tail := "; BSA = " || BSA_val;
/*----------------------------------------------------------------*/
/* Modified Calvert{{{SINGLE-QUOTE}}}s formula for peds patients weighing < 10 kg */
/*----------------------------------------------------------------*/
elseif wt_val < 10
then
AUC_coef := (creat_clearance + (wt_val * 0.36));
AUC_coef_formula := "(CrCl + (Wt x 0.36))";
formula_tail := "; Wt = " || wt_val;
endif; // wt_val
endif; // dose basis
endif; // not calc pedi
endif; // use ecc mlm
/*-------------------------------------------------------*/
/* Format Dose calc formula to return to calling program */
/*-------------------------------------------------------*/
AUC_dose_calc_formula := "formula: " || AUC_coef_formula
|| "; CrCl = " || creat_clearance
|| formula_tail;
endif; // not fatal error
conclude true; // always, to return values or error message
;;
action:
if fatal_error
then
return error_message;
else
return ( "", AUC_coef, AUC_dose_calc_formula );
endif;
;;
end: