Initial Checking with all 820 MLMs
This commit is contained in:
298
MLMStripper/bin/Debug/STD/STD_FUNC_DOSAGE_MULTUM.mlm
Normal file
298
MLMStripper/bin/Debug/STD/STD_FUNC_DOSAGE_MULTUM.mlm
Normal file
@@ -0,0 +1,298 @@
|
||||
maintenance:
|
||||
|
||||
title: Executes the stored procedure that retrieves Multum dosage ranges from the database;;
|
||||
mlmname: STD_FUNC_DOSAGE_MULTUM;;
|
||||
arden: version 2.5;;
|
||||
version: 18.4;;
|
||||
institution: Allscripts, Standard 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: Finds the appropriate dose-range from the multum grouper dose ranges and
|
||||
returns the information to the calling MLM.
|
||||
;;
|
||||
explanation: The MLM assists the STD_Func_Dosage_Rules MLM to retrieve Multum dosage ranges
|
||||
from the database that may be out of range
|
||||
;;
|
||||
keywords: single dose; average daily dose; total daily dose; dosage range
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
// include common data structures
|
||||
std_dosage_includes := MLM {{{SINGLE-QUOTE}}}std_func_dosage_includes{{{SINGLE-QUOTE}}};
|
||||
include std_dosage_includes;
|
||||
|
||||
(
|
||||
drc_grouper_id,
|
||||
drug_name,
|
||||
multum_dnum,
|
||||
multum_mmdc,
|
||||
order_med_route,
|
||||
order_med_route_id,
|
||||
is_generic_route,
|
||||
order_med_significant_date,
|
||||
order_med_units,
|
||||
order_med_uom_id,
|
||||
order_med_frequency,
|
||||
multum_freq_id,
|
||||
med_order_type,
|
||||
patient_birthday_info_on_order,
|
||||
wt_kg,
|
||||
BSA_value,
|
||||
intl_patient_gender,
|
||||
has_liver_disease_bit,
|
||||
dialysis_type_str,
|
||||
serum_creatinine,
|
||||
intentionally_unmapped_frequency_list,
|
||||
alert_if_missing_flags,
|
||||
is_order,
|
||||
patient_info,
|
||||
core_uom_const
|
||||
) := ARGUMENT;
|
||||
|
||||
// Set to true if logging is needed.
|
||||
log_execution_info := false;
|
||||
|
||||
// Declare the MLMs that can be called
|
||||
xml_params := MLM {{{SINGLE-QUOTE}}}STD_Func_Dosage_XML_Params{{{SINGLE-QUOTE}}};
|
||||
|
||||
// Change the internal patient gender to XML
|
||||
if (intl_patient_gender = "O")
|
||||
then
|
||||
patient_gender := "U";
|
||||
else
|
||||
patient_gender := intl_patient_gender;
|
||||
endif;
|
||||
|
||||
// Need User GUID for security purposes
|
||||
//user_GUID := read last { UserInfo: GUID }; // fails under specflow
|
||||
user_GUID := read last { StateInfo: UserGUID };
|
||||
|
||||
// XML parameter
|
||||
( input_param_xml,
|
||||
missing_route,
|
||||
unmapped_route,
|
||||
missing_uom,
|
||||
unmapped_uom
|
||||
) := call xml_params with
|
||||
(
|
||||
// Common medication data
|
||||
drc_grouper_id,
|
||||
multum_dnum,
|
||||
multum_mmdc,
|
||||
order_med_route,
|
||||
order_med_route_id,
|
||||
is_generic_route,
|
||||
order_med_significant_date,
|
||||
order_med_units,
|
||||
order_med_uom_id,
|
||||
multum_freq_id,
|
||||
med_order_type,
|
||||
is_order,
|
||||
// Patient data
|
||||
patient_birthday_info_on_order,
|
||||
true, //has_valid_birthdate,
|
||||
wt_kg,
|
||||
BSA_value,
|
||||
patient_gender,
|
||||
// Item Catalog only
|
||||
false, //for_item_catalog
|
||||
null, //catalog_item_obj,
|
||||
// Multum only
|
||||
has_liver_disease_bit,
|
||||
dialysis_type_str,
|
||||
serum_creatinine,
|
||||
// Flags and constants
|
||||
alert_if_missing_flags,
|
||||
patient_info,
|
||||
core_uom_const
|
||||
);
|
||||
|
||||
debug_db_str:="EXEC SCMMultumGrouperDosageRangePR "
|
||||
|| SQL(input_param_xml) || ", "
|
||||
|| SQL(user_GUID);
|
||||
|
||||
if (exists drc_grouper_id
|
||||
or alert_if_missing_flags.cannot_check_DNUM_Rx_to_Multum)
|
||||
then
|
||||
// Call the stored procedure
|
||||
(
|
||||
found_matching_case_list,
|
||||
dosage_type_list,
|
||||
case_id_list,
|
||||
grouper_id_list,
|
||||
route_id_list,
|
||||
route_list,
|
||||
contraindication_list,
|
||||
recommendation_list,
|
||||
actual_lower_dose_list,
|
||||
actual_upper_dose_list,
|
||||
actual_uom_id_list,
|
||||
actual_dose_uom_list,
|
||||
conversion_factor_list,
|
||||
actual_dose_freq_list,
|
||||
is_PER_WT_list,
|
||||
is_PER_M2_list,
|
||||
age_criteria_list,
|
||||
weight_criteria_list,
|
||||
gender_criteria_list,
|
||||
renal_criteria_list,
|
||||
creatinine_criteria_list,
|
||||
liver_criteria_list,
|
||||
condition_criteria_list,
|
||||
uom_conversion_issue_list,
|
||||
route_conversion_issue_list,
|
||||
frequency_issue_list,
|
||||
is_default_list,
|
||||
hard_stop_high_list,
|
||||
hard_stop_low_list,
|
||||
crcl_within_range_list,
|
||||
estimated_age_used_list
|
||||
) := read { "EXEC SCMMultumGrouperDosageRangePR "
|
||||
|| SQL(input_param_xml) || ", "
|
||||
|| SQL(user_GUID)
|
||||
};
|
||||
|
||||
endif;
|
||||
;;
|
||||
evoke:
|
||||
;;
|
||||
logic:
|
||||
|
||||
multum_dosage_range_list := ();
|
||||
|
||||
if exists found_matching_case_list
|
||||
then
|
||||
row_count := count found_matching_case_list;
|
||||
list_indices := 1 seqto row_count;
|
||||
|
||||
// Step through the multum results and create the dosage range list
|
||||
for ind in list_indices
|
||||
do
|
||||
dosage_range_item := new Dosage_Range_Object;
|
||||
multum_dosage_range_list := multum_dosage_range_list, dosage_range_item;
|
||||
|
||||
dosage_range_item.med_name := drug_name;
|
||||
if found_matching_case_list[ind] = 1 or found_matching_case_list[ind] = true
|
||||
then
|
||||
dosage_range_item.match_found := true;
|
||||
else
|
||||
dosage_range_item.match_found := false;
|
||||
endif;
|
||||
|
||||
if ((dosage_type_list[ind] = "daily dose range checking (metric)" ) or
|
||||
(dosage_type_list[ind] = "daily dose range checking (formulation)" ))
|
||||
then
|
||||
dosage_range_item.dosage_type := "total";
|
||||
dosage_range_item.is_range := true;
|
||||
elseif ((dosage_type_list[ind] = "single dose range checking (metric)" ) or
|
||||
(dosage_type_list[ind] = "single dose range checking (formulation)" ))
|
||||
then
|
||||
dosage_range_item.dosage_type := "single";
|
||||
dosage_range_item.is_range := true;
|
||||
else
|
||||
dosage_range_item.dosage_type := "contraindication";
|
||||
dosage_range_item.is_range := false;
|
||||
endif;
|
||||
|
||||
dosage_range_item.contraindication_msg := contraindication_list[ind];
|
||||
dosage_range_item.recommendation_msg := recommendation_list[ind];
|
||||
|
||||
dosage_range_item.lower_dose := actual_lower_dose_list[ind];
|
||||
dosage_range_item.upper_dose := actual_upper_dose_list[ind];
|
||||
dosage_range_item.unit_of_measure := actual_dose_uom_list[ind];
|
||||
dosage_range_item.age_criteria := age_criteria_list[ind];
|
||||
dosage_range_item.weight_criteria := weight_criteria_list[ind];
|
||||
dosage_range_item.gender_criteria := gender_criteria_list[ind];
|
||||
dosage_range_item.renal_criteria := renal_criteria_list[ind];
|
||||
dosage_range_item.creatinine_criteria := creatinine_criteria_list[ind];
|
||||
dosage_range_item.liver_criteria := liver_criteria_list[ind];
|
||||
dosage_range_item.condition_criteria := condition_criteria_list[ind];
|
||||
dosage_range_item.is_PER_WT := is_PER_WT_list[ind];
|
||||
dosage_range_item.is_PER_M2 := is_PER_M2_list[ind];
|
||||
dosage_range_item.conversion_factor := conversion_factor_list[ind];
|
||||
dosage_range_item.uom_conversion_issue := uom_conversion_issue_list[ind] in (1, true);
|
||||
dosage_range_item.crcl_within_range := crcl_within_range_list[ind] in (1, true);
|
||||
|
||||
route_conversion_issue := route_conversion_issue_list[ind] in (1, true);
|
||||
|
||||
if is_generic_route
|
||||
then
|
||||
dosage_range_item.unrecognized_route_conversion_issue := route_conversion_issue;
|
||||
else
|
||||
dosage_range_item.inapplicable_route_conversion_issue := route_conversion_issue;
|
||||
endif;
|
||||
|
||||
// Dose range frequency
|
||||
dosage_range_item.dose_frequency := actual_dose_freq_list[ind];
|
||||
if multum_freq_id is null
|
||||
then
|
||||
if ( order_med_frequency not in (intentionally_unmapped_frequency_list, null)
|
||||
and alert_if_missing_flags.unmapped_frequency )
|
||||
then
|
||||
dosage_range_item.frequency_issue := "unmapped";
|
||||
endif;
|
||||
else
|
||||
if frequency_issue_list[ind] in (1, true)
|
||||
then
|
||||
dosage_range_item.frequency_issue := "too frequent";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// multum data will always be "Dose Reg", as the denominator will be multiplied
|
||||
dosage_range_item.dose_calc_method := "Dose Reg";
|
||||
dosage_range_item.corrected_uom := actual_dose_uom_list[ind];
|
||||
|
||||
dosage_range_item.is_multum := true;
|
||||
dosage_range_item.grouper_id := grouper_id_list[ind];
|
||||
dosage_range_item.case_id := case_id_list[ind];
|
||||
dosage_range_item.route := route_list[ind];
|
||||
dosage_range_item.route_id := route_id_list[ind];
|
||||
dosage_range_item.med_route := order_med_route;
|
||||
dosage_range_item.med_route_id := order_med_route_id;
|
||||
|
||||
is_default := false;
|
||||
if (is_default_list[ind] = 1)
|
||||
then
|
||||
is_default := true;
|
||||
endif;
|
||||
|
||||
dosage_range_item.is_default := is_default;
|
||||
|
||||
dosage_range_item.hard_stop_high := hard_stop_high_list[ind];
|
||||
dosage_range_item.hard_stop_low := hard_stop_low_list[ind];
|
||||
dosage_range_item.estimated_age_used := estimated_age_used_list[ind];
|
||||
enddo;
|
||||
|
||||
uom_conversion_issue := any (uom_conversion_issue_list = 1);
|
||||
endif;
|
||||
|
||||
/* Always conclude true to return variables to calling MLM */
|
||||
CONCLUDE TRUE;
|
||||
|
||||
;;
|
||||
action:
|
||||
|
||||
|
||||
return (multum_dosage_range_list, missing_route, unmapped_route, missing_uom, unmapped_uom, uom_conversion_issue);
|
||||
;;
|
||||
end:
|
||||
Reference in New Issue
Block a user