maintenance: title: SRG_CHG_SCH_ANESTHESIA_POLICY - an MLM that is assigned as a policy based on Procedure;; mlmname: SRG_CHG_SCH_ANESTHESIA_POLICY ;; arden: version 2.5;; version: 16.3;; institution: St Claire ;; author: Allscripts Healthcare Solutions, Inc.;; specialist: R. Johnson;; date: 2017-04-14;; validation: testing;; /* P r o p r i e t a r y N o t i c e */ /* Unpublished (c) 2015 - 2015 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 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: to demonstrate an MLM that is assigned as a policy of a charging rule for Anesthesia times generating flat rate charges. ;; explanation: This MLM demonstrates an MLM that is assigned as a policy of a charging rule so that charging transactions will be generated based on the number of staff attending the surgery. It returns a list of charge codes to generate charging transactions for. A charging transaction will be created for each unique charge code in the list. The quantity of the charging transaction will be set to the number of occurrences of the charge code in the list. The MLM uses the following logic to determine what charge code to return. Change history 04/14/17 - finish initial build anesth master list 04/16/17 - ready list and loops for initial load into SCH DEV 163 05/15/17 - update master list and correct for proper Anestheisa Stop Time Event 06/20/17 - updated master list for more specificity in the members 07/24/17 - added for processing ECT falt fee anesthesia 10/09/17 - addition of Anesth Types: General 11/15/17 - tightened match on anesthesia names 01/05/18 - addition of General types and Regional types 01/09/18 - added listing for Spinal + Epidural to charge for Spinal 08.20.2018 DW CSR# 37047 - Remove ECT from Surgical Charge MLM ;; keywords: ;; knowledge: type: data-driven;; data: /// MLM dependenciy - needed to parse Master lists parse_MLM:= MLM {{{SINGLE-QUOTE}}}Util_String_Parse{{{SINGLE-QUOTE}}} ; ///////////////////////////////////////////////////// /// *** SCH Master lists for Anesthesia Charge Codes *** /// /// specific Anesthesia type codes // mac_15:= "10323" ; // spine_15:= "10321" ; /// codes for > top times for anesth //anesth_over:= "10301"; /// Ensure entries are as follows for General Anesthesia list: /// "|| get_anes_int then anes_num:= get_anes_int + 1; // round(get_qty_0); else anes_num := get_anes_int; endif; chg_code_proc:= ""; // for Anesthesia //endif; ENDIF; // MLM testing area - comment out when done If called_by_editor then ray:=15; // get_anesth := "Spinal"; // anes_m:= 181; // anes_num:= 12; endif; //////////////////////////////// /// 11/14/16 - Logic for the charge code accumulations ////////////////////////////////////////////// get_chg_code:= ""; // chg_code_proc:= ""; // for Anesthesia //chg_code_proc2:= ""; // for PACU ///Anesthesia /// 07/24/17 - added for ECT to just get a flat charge /* 08/20/2018 DW commented out for CSR# 37047 - stop passing ECT anesthesia charge IF is_ect > 0 then chg_code_proc:= ect_master; ELSEIF exists chg_code_proc //get_anesth matches pattern "MAC%" */ IF exists chg_code_proc //get_anesth matches pattern "MAC%" OR get_anesth matches pattern "Spinal%" then /// Get appropriate master list of charges list_use:= anesth_master ; ct_list:=count list_use; IF exists list_use then /// SCH - now cycle through master list to get the matching Charge for the Duration of the Anesthesia FOR i in 1 seqto count list_use DO If chg_code_proc = "" then chg_lst:= call parse_mlm with list_use[i], "|"; lst_chg:= trim (chg_lst[1]); lst_desc:= trim (chg_lst[2]); lst_desc_m := string(lst_desc||"%"); /// get high minute level from description /* ext_desc:= extract characters lst_desc; ct_ext:= count ext_desc; find_to:= find first "-" in string(lst_desc) ; use_to:= find_to ; // + 1; get_top_min_0:= string (last (ct_ext - use_to) from ext_desc); get_top_min:= call (get_top_min_0 as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}).Replace with "MIN", "" as string; /// pre_iona := call (get_src as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}).Replace with obs_nm, "" as string; hi_minute:= get_top_min as number; /// test for selecting correct charge */ /// 11/15/17 - change IF get_anesth = lst_desc // matches pattern lst_desc_m // <= hi_minute then chg_code_proc:= lst_chg; ENDIF; ///////////////////////////////// ENDIF; // chg_code proc = "" //// get the last upper time limit ///////////////////////////////// ENDDO; ENDIF;// exists List_use //endif; // exists get_proc_idp ///Do the loop to make the per min charges if over the last charge codes /// for testing //dur_m := 485; //for_over:= 420; //over_use:= minor_over; If exists for_over AND anes_m > for_over AND exists anesth_over then Get_remain:= int(anes_m - for_over) ; // as integer ; Get_qty_0:= (get_remain/15); get_qty_int := int (get_remain/15); if get_qty_0 > get_qty_int then get_qty:= get_qty_int + 1; // round(get_qty_0); else get_qty:= get_qty_int; endif; Get_gt_over:= ""; For i in 1 seqto get_qty DO If get_gt_over = "" then get_gt_over:= anesth_over; else get_gt_over:= get_gt_over, anesth_over; endif; Enddo; ENDIF; // for_over and dur_m //break; ///tally charges if dur_m > than last charge code time if exists get_gt_over then ct_over_a:= count get_gt_over; If ct_over_a >= 1// exists get_gt_over and get_gt_over <> "" then chg_code_proc:= chg_code_proc, get_gt_over; ENDIF; endif; //get_gt_over ENDIF; // if get_anesth logic //// End of Anesthesia /////////////////////////////////////////////////////// /// 12/08/16 new tally for both Anest and PACU IF exists chg_code_proc or exists chg_code_proc2 // ct_chg1 > 0 OR ct_chg2 > 0 //chg_code_proc <> "" OR chg_code_proc2 <> "" then ray:= 11; if not (exists chg_code_proc ) AND exists chg_code_proc2 then chg_code_proc := chg_code_proc2 ; elseif exists chg_code_proc AND exists chg_code_proc2 then chg_code_proc := chg_code_proc, chg_code_proc2 ; ///12/08/16 elseif not (exists chg_code_proc) AND not (exists chg_code_proc2 ) then ct_ch_co:= 0; //chg_code_proc := chg_code_proc, chg_code_proc2 ; endif; else ct_ch_co := 0; ENDIF; // if either <> "" if not (exists ct_ch_co) then ct_ch_co:= count chg_code_proc; endif; if u_name matches pattern "services%" then ray:=15; break; endif; idest_msg := "Evoke Charge MLM per minute"; idest:= destination{IntermediateMessage: Warning, idest_msg, low, chart, "RuleGroupHere1", 1001, "", "" }; msg_text:= dur_m||", "||get_proc_idp||"; " ; //// ;; priority: 50 ;; evoke: ;; logic: /* circulator_count := 0; scrub_count := 0; for case_participant in case_participants_list do for surgery_role_name in case_participant.SurgeryRoleName do if (surgery_role_name = "Circulator") then circulator_count := circulator_count + 1; endif; if (surgery_role_name = "Scrub") then scrub_count := scrub_count + 1; endif; enddo; enddo; */ charge_codes := new net_object {{{SINGLE-QUOTE}}}List{{{SINGLE-QUOTE}}}; ///Do the loop to make the per min charges If ct_ch_co > 0 then//exists dur_m AND // (exists chg_code_proc AND chg_code_proc <> "") then //get_chg_code then //ct_ch_co:= count chg_code_proc ;//dur_m := dur_m as number; ///testing // chg_code_test:= ct_ch_cochg_code_proc; compile:= ""; compile_ct:= ""; For i in 1 seqto ct_ch_co DO // count chg_code_proc DO compile_ct:= compile_ct, i; //chg_code_proc; ret := call charge_codes.Add with chg_code_proc[i] ; //get_chg_code; compile:= compile, chg_code_proc[i]; ENDDO; /*if (circulator_count + scrub_count > 0) then if (circulator_count + scrub_count = 1) then ret := call charge_codes.Add with "00"; elseif (circulator_count = 1 and scrub_count = 1) then ret := call charge_codes.Add with "11"; elseif (circulator_count + scrub_count = 3) then ret := call charge_codes.Add with "12"; else ret := call charge_codes.Add with "33"; endif; endif; */ msg_text:= msg_text||compile ; ENDIF; conclude true; ;; action: return //compile ; // charge_codes; //if exists idest then //write msg_text at idest; //endif; ;; Urgency: 50 ;; end: