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

219 lines
8.5 KiB
Plaintext

maintenance:
title: Calculate Body Surface Area (BSA);;
mlmname: SYS_CALC_BSA;;
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: Calculates a patient{{{SINGLE-QUOTE}}}s BSA.
;;
explanation: Calculates the BSA using the following rules:
1. If the formula preference = Standard or Pediatric and if the patient{{{SINGLE-QUOTE}}}s age can be calculated, then:
- For patients <= 18.0 years, the standard pediatric BSA formula is used.
pediatric BSA = SQRT(HeightCm * (WeightKg/3600))
- For patient{{{SINGLE-QUOTE}}}s > 18.0 years, the standard BSA formula is used.
standard BSA = (WeightKg^0.425) * (HeightCm^0.725) * 0.007184)
2. If the formula preference = Standard or Pediatric and if the patient{{{SINGLE-QUOTE}}}s age cannot be calculated, then
- The facility{{{SINGLE-QUOTE}}}s preference for BSAFormula in the Enterprise Profile is used.
If the preference is not set, then the Standard BSA formula will be used.
3. If the formula preference = Ideal, then the ideal weight is used in the calculation.
4. If the formula preference = Adjusted, then the adjusted weight is used in the calculation.
Facility may customize this MLM to use their own formulas for BSA calculations.
;;
keywords: BSA Calculation; Age ;
;;
knowledge:
type: data-driven;;
data:
/* Arguments are passed in from the calling C++ program or MLM */
(BSA_formula_preference, //string - valid strings are Standard, Pediatric, Ideal, or Adjusted
ht_val, //number in centimeters (cm)
wt_val, //number in kilograms (kg)
client_info_obj //Arden ClientInfo object
) := argument;
/*******************Make Changes To Spelling And Flags In This Section*******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := false;
/* What is the Upper AGE limit for using the Pediatric BSA calculation? */
/* The calculation will use LESS THAN OR EQUAL TO this number listed below */
pediatric_BSA_upper_age_limit:= 18; /* years */
/***************************************************************************************/
/* MLM to calculate weight. */
func_calc_weight := MLM {{{SINGLE-QUOTE}}}SYS_CALC_WT{{{SINGLE-QUOTE}}};
calculate_actual := "Standard";
calculate_pediatric := "Pediatric";
calculate_ideal := "Ideal";
calculate_adjusted := "Adjusted";
/* initialize values to be returned */
BSA_number := 0;
BSA_formula := "";
weight_used:= 0;
/*----------------------------------------------------------------*/
/* Convert a string representation of a number to an Arden number */
/*----------------------------------------------------------------*/
ht_val := ht_val as number;
wt_val := wt_val as number;
/* Retrieves birthdate and gender from ClientInfo Object that is passed as an argument */
if exist client_info_obj
then
(birthdate,
birth_year,
patient_gender ):= read last
{ClientInfo: birthdate, BirthYearNum, GenderTypeIntlCode
REFERENCING client_info_obj};
endif;
;;
evoke:
;;
logic:
/*------------------------------*/
/* Save original BSA preference */
/*------------------------------*/
original_BSA_formula_preference := BSA_formula_preference;
/*-----------------------------------------------------*/
/* Calculate a patient{{{SINGLE-QUOTE}}}s age and */
/* Reset BSA preference based on the patient{{{SINGLE-QUOTE}}}s age */
/* Reset only if preference is Standard or Pediatric */
/*-----------------------------------------------------*/
if exist birthdate
and birth_year > 0
and birthdate is time
and (BSA_formula_preference = "Pediatric" OR BSA_formula_preference = "Standard")
then
patient_age:= (NOW - birthdate) / (1 year);
if patient_age <= pediatric_BSA_upper_age_limit
then
BSA_formula_preference := "Pediatric";
else
BSA_formula_preference := "Standard";
endif; /* if patient_age */
endif; /* if exist birthdate */
/*-----------------------------------*/
/* Calculate Body Surface Area (BSA) */
/*-----------------------------------*/
if exist ht_val
and ht_val > 0
then
/*-----------------------------------------------------------------------------------------------*/
/* Pediatric BSA calculation */
/*-----------------------------------------------------------------------------------------------*/
IF BSA_formula_preference = "Pediatric"
and exist wt_val
and wt_val > 0
then
BSA_number := SQRT(ht_val * (wt_val/3600));
BSA_formula := "BSA calculated using formula: SQRT(HeightCm * (WeightKg/3600))";
weight_used := wt_val;
/*-----------------------------------------------------------------------------------------------*/
/* Standard BSA calculation */
/*-----------------------------------------------------------------------------------------------*/
ELSEIF (BSA_formula_preference = "Standard" )
and exist wt_val
and wt_val > 0
then
BSA_number := (ht_val**0.725) * (wt_val**0.425) * 0.007184;
BSA_formula := "BSA calculated using formula: (WeightKg^0.425) * (HeightCm^0.725) * 0.007184)";
weight_used := wt_val;
/*-----------------------------------------------------------------------------------------------*/
/* Ideal Weight BSA calculation */
/*-----------------------------------------------------------------------------------------------*/
ELSEIF (BSA_formula_preference = "Ideal" )
then
(IdealWeightKg, Tooltip_formula, display_message) := call func_calc_weight
with (BSA_formula_preference, ht_val, wt_val, client_info_obj);
if exist IdealWeightKg and IdealWeightKg > 0
then
BSA_number := IdealWeightKg**0.425 * (ht_val)**0.725 * 0.007184;
BSA_formula := "BSA formula: (IdealWeightKg^0.425 * (HeightCm^0.725) * 0.007184)";
weight_used := IdealWeightKg;
else
BSA_number := 0;
endif; //if exist IdealWeightKg and IdealWeightKg > 0
/*-----------------------------------------------------------------------------------------------*/
/* Adjusted Weight BSA calculation */
/*-----------------------------------------------------------------------------------------------*/
ELSEIF (BSA_formula_preference = "Adjusted")
then
(AdjustedWeightKg, Tooltip_formula, display_message) := call func_calc_weight
with (BSA_formula_preference, ht_val, wt_val, client_info_obj );
if exist AdjustedWeightKg and AdjustedWeightKg > 0
then
BSA_number := AdjustedWeightKg**0.425 * (ht_val)**0.725 * 0.007184;
BSA_formula := "BSA formula: (AdjustedWeightKg^0.425 * (HeightCm^0.725) * 0.007184)";
weight_used := AdjustedWeightKg;
else
BSA_number := 0;
endif; //if exist AdjustedWeightKg and AdjustedWeightKg > 0
ENDIF; /* if BSA_formula_preference */
/*-----------------------------------------------------------------------------------------------*/
/* Rounds the BSA to two decimal points */
/*-----------------------------------------------------------------------------------------------*/
BSA_number_rounded:= (int ((BSA_number + 0.005) * 100))/100;
conclude TRUE;
else
/* The Object Layer will convert an Arden NULL to a zero or -1 */
conclude FALSE;
endif; /* if exist ht_val */
;;
action:
/* Returns the BSA */
return ( BSA_number_rounded, BSA_formula, weight_used ) ;
;;
end: