Initial Checking with all 820 MLMs
This commit is contained in:
561
MLMStripper/bin/Debug/SRG/SRG_CHG_SCH_ANESTHESIA_POLICY.mlm
Normal file
561
MLMStripper/bin/Debug/SRG/SRG_CHG_SCH_ANESTHESIA_POLICY.mlm
Normal file
@@ -0,0 +1,561 @@
|
||||
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:
|
||||
/// "<charge code>|<Description", "<charge code>|<Description", etc
|
||||
|
||||
anesth_master:= "25012100|MAC to General",
|
||||
// "25011200|MAC to General LMA",
|
||||
// "25011300|MAC to General Mask",
|
||||
"25012100|Spinal to General",
|
||||
// "25011200|Spinal to General LMA",
|
||||
// "25011300|Spinal to General Mask",
|
||||
// "25011000|General ETT",
|
||||
// "25011200|General LMA",
|
||||
// "25011300|General Mask",
|
||||
// "25011400|General Cardiac",
|
||||
"25011500|Spinal",
|
||||
/// 01/09/18 - added for Spinal + Epidural
|
||||
"25011500|Spinal+Epidural",
|
||||
/// 01/05/18 - addedd
|
||||
"25011600|Local+MAC",
|
||||
"25011600|MAC",
|
||||
"25011700|Labor Epidural",
|
||||
"25011701|Epidural",
|
||||
"25011800|Regional (Block)",
|
||||
///01/05/18 - addition of Rgional types
|
||||
"25011800|MAC+Regional",
|
||||
"25011800|Local+Regional",
|
||||
/// 10/09/17 - addition of Anesth Types
|
||||
/// 01/05/18 - addition of General types
|
||||
"25012100|General+Epidural",
|
||||
"25012100|General+Spinal",
|
||||
"25012100|Local+General",
|
||||
"25012100|Regional+General",
|
||||
"25012100|General",
|
||||
"25012200|General Major"
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
/// 07/24/17 - added for processing ECT falt fee anesthesia
|
||||
ECT_master:= "25015100";
|
||||
|
||||
|
||||
/////////////////// end of Master lists /////////////////////////////////////////////
|
||||
|
||||
using "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
using namespace "System";
|
||||
using namespace "System.Collections.Generic";
|
||||
|
||||
log_execution_info := false;
|
||||
|
||||
// The MLM is passed one argument which is the SRGCase object of the case which charges are being generated for.
|
||||
(case_obj) := argument;
|
||||
|
||||
if called_by_editor then
|
||||
case_obj := read last { SRGCase: THIS Where CaseIdentifier = "370" }; // test, debbie = 29 flower, aster = 45 14 = sixteen, courtney
|
||||
// "C00205" = SSC. Bobst c00203 "C00166" = SSC, Append - C00206 "C00163" "C00169" = SSC, HIP / C00204 "C00181" = SSC, GIBLD
|
||||
// "C00259" = Sched, Charli (-6186) "c00243" etopic c00324 = Charges Two
|
||||
|
||||
u_name:= read last {UserInfo: IDCode};
|
||||
evokingobject:= case_obj;
|
||||
//caseF_obj:= read as [object] { SRGCase: Where CaseIdentifier = "114" };
|
||||
//ray_obj:= caseF_obj;
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
// Get the case participants object from the case object
|
||||
( case_participants ) := read { SRGCase: SRGCaseParticipant REFERENCING case_obj };
|
||||
|
||||
// Get the case participants as a list from the case participants object
|
||||
( case_participants_list ) := case_participants.records__;
|
||||
|
||||
/// FOR SCH per minute Level charging investigation
|
||||
/// 01/27/17 - added for determining Location of patient
|
||||
lcode, levcode, lname, DeptGuid := read last { " select lo.code, lo.levelcode, lo.name " //, log.GUID"
|
||||
||" from CV3Location lo"
|
||||
//||" LEFT JOIN CV3LocationFunctionGroup log ON (log.GUID = "
|
||||
//||" ( SELECT x.LocnFuncGroupGUID"
|
||||
//||" FROM CV3LocationFunctionGroupXRef x"
|
||||
//||" INNER JOIN CV3LocationFunctionGroup lfg on (lfg.GUID = x.LocnFuncGroupGUID) "
|
||||
//||" WHERE x.LocnGroupGUID = (CASE WHEN lo.IsLocationGroup = 1 THEN lo.GUID ELSE lo.LocnGrpGUID END) "
|
||||
//||" AND lfg.SysFunctionType = 19)) "
|
||||
||" where lo.GUID = "|| sql(evokingobject.LocationGUID) };
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// u_name := read last {UserInfo: DisplayName};
|
||||
|
||||
EvokingObject:= case_obj;
|
||||
|
||||
// find the case event that match the time type name parameter
|
||||
bu_case_obj:= evokingObject.backup;
|
||||
|
||||
get_status:= EVOKINGOBJECT.CaseStatusName;
|
||||
get_status_type:= EVOKINGOBJECT.CaseStatusInternalType;
|
||||
get_anesth:= EVOKINGOBJECT.AnesthesiaTypeName;
|
||||
get_anesth_id:= EVOKINGOBJECT.AnesthesiaTypeID ;
|
||||
|
||||
|
||||
proc_end := evokingobject.ActualEndDateTimeUTC as time;
|
||||
proc_start:= evokingobject.ActualStartDateTimeUTC as time;
|
||||
|
||||
durat:= proc_end - proc_start;
|
||||
dur_m:= durat/1 minute;
|
||||
dur_m := dur_m as number;
|
||||
|
||||
/// testing -
|
||||
/* if evokingobject.caseidentifier = "C00206" then
|
||||
dur_m := 643;
|
||||
endif;
|
||||
*/
|
||||
///////
|
||||
/// 07/24/17
|
||||
is_ect:= 0 ;
|
||||
|
||||
/// 05/18/15 added for - participant object for ROLE
|
||||
|
||||
srg_part:= evokingobject.SRGCaseParticipant;
|
||||
get_parts:= srg_part.Records__;
|
||||
ct_parts:= count get_parts;
|
||||
|
||||
|
||||
/// 05/20/15 - added for procedure parts to find Charge codes
|
||||
proc_parts:= evokingobject.SRGCaseProcedure;
|
||||
get_procs:= proc_parts.Records__;
|
||||
ct_procs := count get_procs;
|
||||
|
||||
/// 10/13/16 - for query to get charge ID
|
||||
get_proc_id:= proc_parts.CaseProcedureID; //get_procs.Records__;
|
||||
/// Get the Prinmary Performed Procedure
|
||||
//get_proc_idp:= null;
|
||||
For i in 1 seqto ct_procs DO
|
||||
this_proc:= get_procs[i];
|
||||
get_this_proc:= this_proc.records__;
|
||||
if this_proc.IsPrimary = true and this_proc.HasBeenPerformed = true
|
||||
//if get_procs[i].IsPrimary = true and get_procs[i].HasBeenPerformed = true
|
||||
then
|
||||
get_proc_idp:= this_proc.CaseProcedureID;
|
||||
get_proc_desc:= this_proc.Description;
|
||||
|
||||
//break;
|
||||
endif;
|
||||
/// 07/24/17
|
||||
if get_proc_desc matches pattern "ECT%"
|
||||
then
|
||||
is_ect := is_ect + 1;
|
||||
endif;
|
||||
/////////////////////////////////////////////////
|
||||
this_proc:= null;
|
||||
//break;
|
||||
ENDDO ;
|
||||
|
||||
|
||||
/// FOr items and times if needed
|
||||
proc_items:= EVOKINGOBJECT.SRGCaseItem;
|
||||
get_items:= proc_items.Records__;
|
||||
get_surg_items:= proc_items.SRGDepartmentSurgicalItem.Records__;
|
||||
|
||||
///
|
||||
/// 11/11/16 - for PACU and Anesthesia
|
||||
event_items := EVOKINGOBJECT.SRGCaseEvent;
|
||||
get_event:= event_items.Records__;
|
||||
ct_ev:= count get_event;
|
||||
|
||||
get_times:= get_event.SRGCaseEventTime.Records__ ;
|
||||
ct_times:= count get_times;
|
||||
|
||||
FOR i in 1 seqto ct_times DO
|
||||
this_time:= get_times[i];
|
||||
//// now in each event time pair
|
||||
FOR m in 1 seqto count this_time DO
|
||||
this_time_d:= this_time[m];
|
||||
if this_time_d.EventTimeLabel = "PACU Out" then pacu_out:= this_time_d.EventDateTimeUTC ; endif;
|
||||
if this_time_d.EventTimeLabel = "PACU In" then pacu_in:= this_time_d.EventDateTimeUTC ; endif;
|
||||
|
||||
if this_time_d.EventTimeLabel = "Anesthesia Stop" then anes_out:= this_time_d.EventDateTimeUTC ; endif;
|
||||
if this_time_d.EventTimeLabel = "Anesthesia Start" then anes_in:= this_time_d.EventDateTimeUTC ; endif;
|
||||
ENDDO;
|
||||
|
||||
//pac_out:= first of (get_times.EventDateTimeUTC where get_times.EventTimeLabel = "PACU Out" );
|
||||
//pac_in:= first of (get_times.EventDateTimeUTC where get_times.EventTimeLabel = "PACU In" );
|
||||
//break;
|
||||
ENDDO;
|
||||
|
||||
/// do durations from each timing pair:
|
||||
/// PACU
|
||||
if exists pacu_out then
|
||||
pacu_out_t := pacu_out as Time; //endif;
|
||||
pacu_in_t := pacu_in as Time; // endif;
|
||||
|
||||
pacu_d:= (pacu_out_t - pacu_in_t)/ 1 minute;
|
||||
pacu_m := pacu_d as number;
|
||||
|
||||
chg_code_proc2:= ""; // for PACU
|
||||
endif;
|
||||
|
||||
/// Anesthesia
|
||||
|
||||
/// 12/08/16 update for only these Anest
|
||||
///01/05/18 - change to "=" for Local as will need local for doubles
|
||||
IF get_anesth matches pattern "Consult%"
|
||||
OR
|
||||
get_anesth matches pattern "N/A%"
|
||||
OR
|
||||
get_anesth matches pattern "Sedation%"
|
||||
OR
|
||||
get_anesth = "Local"
|
||||
then
|
||||
stop:=1;
|
||||
|
||||
elseif exists anes_out
|
||||
then anes_out_t := anes_out as Time; // endif;
|
||||
anes_in_t := anes_in as Time; //endif;
|
||||
|
||||
anes_d:= (anes_out_t - anes_in_t)/ 1 minute;
|
||||
anes_m := anes_d as number;
|
||||
|
||||
get_anes_0:= (anes_m/15);
|
||||
get_anes_int := int (anes_m/15);
|
||||
if get_anes_0 > 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<String>{{{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:
|
||||
@@ -0,0 +1,528 @@
|
||||
maintenance:
|
||||
|
||||
title: SRG_CHG_SCH_PROCEDURE_PERMINUTE_POLICY - an MLM that is assigned as a policy based on Procedure;;
|
||||
mlmname: SRG_CHG_SCH_PROCEDURE_PERMINUTE_POLICY ;;
|
||||
arden: version 2.5;;
|
||||
version: 15.3;;
|
||||
institution: St Claire ;;
|
||||
author: Allscripts Healthcare Solutions, Inc.;;
|
||||
specialist: R. Johnson;;
|
||||
date: 2017-05-12 ;;
|
||||
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:
|
||||
A sample MLM used to demonstrate an MLM that is assigned as a policy of a charging rule for generating Procedure minutes 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.
|
||||
|
||||
|
||||
|
||||
|
||||
10/14/16 - Get Primary case Procedure CaseProcedureID to use new method to ID charge code for perminute
|
||||
|
||||
05/16/17 - Initial deploy into SCH DEV 16.3 - with masterlists
|
||||
05/17/17 - update talyl of charges and over 30 min charges for ENDO location
|
||||
05/22/17 - update for new Role of "Level" - test ENDO and MLSC
|
||||
|
||||
07/24/17 NO ECT/ESWL charge - do no tprocess level charge
|
||||
|
||||
04/19/18 - remove 3 lines of extraneous unneeded code for ENDO charge tallying
|
||||
|
||||
;;
|
||||
|
||||
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 list for PRocedure Charge Codes *** ///
|
||||
|
||||
/// Ensure entries are as follows for each list:
|
||||
/// "<charge code>|<Description>|<priority sequence>", "<charge code>|<Description>|<priority sequence>", etc
|
||||
|
||||
/// 05/17/17 - update the master list - so that ref_list ican match charge to CHG CHARGE LEVEL Role #
|
||||
|
||||
ref_list_or:=
|
||||
"23021000|OR TIME LEVEL 0|0",
|
||||
"23021001|OR TIME LEVEL 1|1",
|
||||
"23021002|OR TIME LEVEL 2|2",
|
||||
"23021003|OR TIME LEVEL 3|3",
|
||||
"23021004|OR TIME LEVEL 4|4"
|
||||
|
||||
;
|
||||
|
||||
/// here this list vor over 30 minutes is
|
||||
/// "<charge code first 30>|<charge code OVER 30>|<priority sequence>", "<charge code first 30>|<charge code OVER 30>| <priority sequence>"
|
||||
ref_list_endo := "23049159|23049160|1",
|
||||
"23049161|23049162|2",
|
||||
"23049166|23049167|3"
|
||||
;
|
||||
|
||||
endo_over:= "";
|
||||
ref_list_mlsc :=
|
||||
"23081001|OR TIME LEVEL 1|1",
|
||||
"23081002|OR TIME LEVEL 2|2",
|
||||
"23081003|OR TIME LEVEL 3|3",
|
||||
"23081004|OR TIME LEVEL 4|4"
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///flag for GI location
|
||||
get_loc:= "";
|
||||
|
||||
/////////////////// end of Master lists /////////////////////////////////////////////
|
||||
|
||||
using "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
using namespace "System";
|
||||
using namespace "System.Collections.Generic";
|
||||
|
||||
log_execution_info := false;
|
||||
|
||||
// The MLM is passed one argument which is the SRGCase object of the case which charges are being generated for.
|
||||
(case_obj) := argument;
|
||||
/// 500177 ballas, bonnie
|
||||
if called_by_editor then /// test, debbie = 91 test, claudia = 112 test, debbie - 96 & 97 -- fivefive, Bryaned = 90 surgery test3 = 99 test surgery 6 = 102
|
||||
case_obj := read last { SRGCase: THIS Where CaseIdentifier = "500002" }; /// test , surgery = 23 28 = Test, ES 2 = test, registration 7 = test, lance
|
||||
// "C00205" = SSC. Bobst c00203 "C00166" = SSC, Append - C00206 "C00163" "C00169" = SSC, HIP / c00425 C00204 "C00181" = SSC, GIBLD
|
||||
// c00324 = Charges Two c00262 - Sched Abbey
|
||||
|
||||
u_name := read last {UserInfo: IDCOde};
|
||||
endif;
|
||||
|
||||
// Get the case participants object from the case object
|
||||
( case_participants ) := read { SRGCase: SRGCaseParticipant REFERENCING case_obj };
|
||||
|
||||
// Get the case participants as a list from the case participants object
|
||||
( case_participants_list ) := case_participants.records__;
|
||||
|
||||
/// FOR HMC per minute investigation
|
||||
|
||||
// u_name := read last {UserInfo: DisplayName};
|
||||
|
||||
EvokingObject:= case_obj;
|
||||
|
||||
// find the case event that match the time type name parameter
|
||||
bu_case_obj:= evokingObject.backup;
|
||||
|
||||
get_status:= EVOKINGOBJECT.CaseStatusName;
|
||||
get_status_type:= EVOKINGOBJECT.CaseStatusInternalType;
|
||||
get_anesth:= EVOKINGOBJECT.AnesthesiaTypeName;
|
||||
get_anesth_id:= EVOKINGOBJECT.AnesthesiaTypeID ;
|
||||
|
||||
/// 01/27/17 - added for determining Location of patient
|
||||
lcode, levcode, lname, DeptGuid := read last { " select lo.code, lo.levelcode, lo.name " //, log.GUID"
|
||||
||" from CV3Location lo"
|
||||
//||" LEFT JOIN CV3LocationFunctionGroup log ON (log.GUID = "
|
||||
//||" ( SELECT x.LocnFuncGroupGUID"
|
||||
//||" FROM CV3LocationFunctionGroupXRef x"
|
||||
//||" INNER JOIN CV3LocationFunctionGroup lfg on (lfg.GUID = x.LocnFuncGroupGUID) "
|
||||
//||" WHERE x.LocnGroupGUID = (CASE WHEN lo.IsLocationGroup = 1 THEN lo.GUID ELSE lo.LocnGrpGUID END) "
|
||||
//||" AND lfg.SysFunctionType = 19)) "
|
||||
||" where lo.GUID = "|| sql(evokingobject.LocationGUID) };
|
||||
//////////////////////////////
|
||||
/// 01/31/17 - start of GI Lab determinatione
|
||||
IF lname matches pattern "EN%"
|
||||
/// 02/13/17 - addition of PROC for scheduled location to be like GI
|
||||
then
|
||||
get_loc := "ENDO";
|
||||
ref_list:= ref_list_endo ;
|
||||
elseif lname matches pattern "MLSC%"
|
||||
|
||||
then //in ("GI01", "GI02") then
|
||||
get_loc := "MLSC" ;
|
||||
ref_list:= ref_list_mlsc ;
|
||||
else
|
||||
get_loc := "MAIN";
|
||||
ref_list:= ref_list_or ;
|
||||
ENDIF;
|
||||
|
||||
|
||||
/// for HMC - adjudicate if not "Elective"
|
||||
/// Urgent, Emergent, Call Back this is one level up charge
|
||||
|
||||
/// 01/11/17 - new section for EVOKINGOBJECT.CaseTypeName = "Call Back"
|
||||
|
||||
get_case_type:= EVOKINGOBJECT.CaseTypeInternalType;
|
||||
|
||||
If get_case_type in ("Urgent", "Emergency" ) //, "Call Back" )
|
||||
then
|
||||
up_seq:= up_seq + 1;
|
||||
ENDIF;
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
If exists evokingobject.ActualStartDateTimeUTC then
|
||||
|
||||
proc_end := evokingobject.ActualEndDateTimeUTC as time;
|
||||
proc_start:= evokingobject.ActualStartDateTimeUTC as time;
|
||||
|
||||
durat:= proc_end - proc_start;
|
||||
dur_m:= durat/1 minute;
|
||||
dur_m := dur_m as number;
|
||||
|
||||
/*
|
||||
/// 01/11/17 - comment out time of day in deciding Emergent/Call Back situations
|
||||
/// HMC - adjudicate if start time is in Upcharge time
|
||||
get_pmup_st:= (day floor of proc_start) + 20.5 hours;
|
||||
get_amup_st:= (day floor of proc_start) + 6 hours;
|
||||
|
||||
if proc_start >= get_pmup_st
|
||||
OR proc_start < get_amup_st
|
||||
then
|
||||
up_seq := up_seq + 1;
|
||||
endif;
|
||||
*/
|
||||
////////////////////////////////////////////////////////////
|
||||
ENDIF; // exists evokingobject.ActualStartDateTimeUTC
|
||||
|
||||
/// 05/20/17 for SCH - participant object for ROLE
|
||||
srg_part:= evokingobject.SRGCaseParticipant;
|
||||
get_parts:= srg_part.Records__;
|
||||
ct_parts:= count get_parts;
|
||||
|
||||
/// 12/14/16 - find any Additional PArticipants
|
||||
//up_parts:= 0;
|
||||
|
||||
FOR i in 1 seqto ct_parts DO
|
||||
this_part:= get_parts[i];
|
||||
if this_part.SurgeryRoleName matches pattern "Level%" // Charge%"
|
||||
|
||||
then
|
||||
up_parts:= this_part.ExternalParticipantName ;
|
||||
endif;
|
||||
|
||||
ENDDO;
|
||||
if exists up_parts then
|
||||
up_lev := up_parts as number;
|
||||
endif;
|
||||
|
||||
/// 07/24/17 NO ECT charge - do no tprocess level charge
|
||||
no_ect:= 0;
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
/// 05/20/15 - added for procedure parts to find Charge codes
|
||||
proc_parts:= evokingobject.SRGCaseProcedure;
|
||||
get_procs:= proc_parts.Records__;
|
||||
ct_procs := count get_procs;
|
||||
|
||||
/// 07/24/17 NO ECT/ESWL charge - do no tprocess level charge
|
||||
for i in 1 seqto ct_procs DO
|
||||
this_proc := get_procs[i];
|
||||
if this_proc.Description matches pattern "ECT%"
|
||||
or this_proc.Description matches pattern "lithotripsy ESWL%"
|
||||
and this_proc.IsPRimary //= "TRUE"
|
||||
and this_proc.HasBeenPerformed
|
||||
then
|
||||
no_ect := no_ect + 1;
|
||||
endif;
|
||||
enddo;
|
||||
|
||||
if no_ect > 0 then
|
||||
up_lev := null;
|
||||
endif;
|
||||
////////////////////////////////////////////////
|
||||
|
||||
/// 10/13/16 - for query to get charge ID
|
||||
get_proc_id:= proc_parts.CaseProcedureID; //get_procs.Records__;
|
||||
|
||||
/// Get the Prinmary Performed Procedure
|
||||
//get_proc_idp:= null;
|
||||
//for highest
|
||||
collect_id := "" ;
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///
|
||||
event_items := EVOKINGOBJECT.SRGCaseEvent;
|
||||
get_event:= event_items.Records__;
|
||||
ct_ev:= count get_event;
|
||||
|
||||
get_times:= get_event.SRGCaseEventTime.Records__ ;
|
||||
|
||||
|
||||
|
||||
///// testing
|
||||
/* dur_m:= 40;
|
||||
get_proc_idp := "285";
|
||||
collect_id:= "{{{SINGLE-QUOTE}}}285{{{SINGLE-QUOTE}}}";
|
||||
*/
|
||||
|
||||
/// 10/31/16 - replace this SQL with new SQL //////////////////////////////////////////////
|
||||
/// 01/31/17 - change to look for collect_id
|
||||
|
||||
//if collect_id <> "" then //exists get_proc_idp then
|
||||
|
||||
/*( get_chg_code, c_amount, c_desc, p_name):= read //{ "select Code from sxasrgchargecode where Description like " || str_permin};
|
||||
{ "select Code, ChargeAmount, c.Description , p.name " //SXASRGChargeCode where "
|
||||
// ||" Description in (select Replace(c.Description, {{{SINGLE-QUOTE}}}base rate{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}per minute{{{SINGLE-QUOTE}}}) "
|
||||
||" from SXASRGProcedure p"
|
||||
||" join SXASRGCaseProcedure cp on ( cp.ProcedureID= p.ProcedureID " //and cp.IsPrimary = {{{SINGLE-QUOTE}}}TRUE{{{SINGLE-QUOTE}}}"
|
||||
||" and cp.CaseProcedureID in ( "||collect_id||" ) )" //{{{SINGLE-QUOTE}}}329{{{SINGLE-QUOTE}}}) // --258"
|
||||
||" inner join SXASRGProcedureChargeCode pc on (p.ProcedureID = pc.ProcedureID and pc.Active = 1)"
|
||||
||" inner join SXASRGChargeCode c on c.ChargeCodeID = pc.ChargeCodeID "
|
||||
};
|
||||
*/
|
||||
/// testing:
|
||||
/// get_chg_code:= "36000252"; //, "33700502", "33700505"; //"33700100";
|
||||
|
||||
//ct_chg_code:= count (get_chg_code);
|
||||
/*
|
||||
( get_chg_code_b, c_amount_b, c_desc_b):= read last { "select c.Code, c.ChargeAmount, c.Description " //from SXASRGChargeCode where "
|
||||
//||" Description like "|| get_base_desc //in (select Replace(c.Description, {{{SINGLE-QUOTE}}}base rate{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}per minute{{{SINGLE-QUOTE}}}) "
|
||||
||" from SXASRGProcedure p"
|
||||
||" join SXASRGCaseProcedure cp on ( cp.ProcedureID= p.ProcedureID " //and cp.IsPrimary = {{{SINGLE-QUOTE}}}TRUE{{{SINGLE-QUOTE}}}"
|
||||
||" and cp.CaseProcedureID in ( "||collect_id||" ) )" //{{{SINGLE-QUOTE}}}329{{{SINGLE-QUOTE}}}) // --258"
|
||||
||" inner join SXASRGProcedureChargeCode pc on (p.ProcedureID = pc.ProcedureID and pc.Active = 1 ) "
|
||||
//||" and pc.LocationFunctionGroupGUID = " || DeptGUID || ")"
|
||||
||" inner join SXASRGChargeCode c on (c.ChargeCodeID = pc.ChargeCodeID and c.Description like "|| get_base_desc ||") "
|
||||
};
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/// Get appropriate master list of charges
|
||||
/// hold all that have been processed for the event of upcharging
|
||||
list_chg:= "";
|
||||
list_seq:= "";
|
||||
|
||||
/// hold the matching procedures performed to determine highest for charging
|
||||
hold_ref:= "";
|
||||
hold_seq:= "";
|
||||
If exists up_lev then //AND get_chg_code <> "" then //AND ct_chg_code > 0 then
|
||||
ray:= 30;
|
||||
For i in 1 seqto count ref_list DO
|
||||
sep_list:= call parse_mlm with ref_list[i], "|";
|
||||
get_ref_cd:= sep_list[1];
|
||||
get_desc:= sep_list[2];
|
||||
get_seq:= sep_list[3] as number;
|
||||
|
||||
|
||||
if get_seq = up_lev then
|
||||
get_chg_code := get_ref_cd ;//
|
||||
|
||||
//endif; /// if get_ref_cd
|
||||
|
||||
if get_loc = "ENDO" then
|
||||
get_chg_code_b:= get_desc ;
|
||||
for_over := 30;
|
||||
|
||||
endif;
|
||||
|
||||
endif; /// if get_ref_cd
|
||||
|
||||
ENDDO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF;
|
||||
|
||||
///
|
||||
|
||||
|
||||
//chg_code_proc:= "";
|
||||
|
||||
|
||||
// endif; // exists get_proc_idp
|
||||
|
||||
///Do the loop to make the per min charges FOR over the If Endo
|
||||
/// for testing
|
||||
//dur_m := 485;
|
||||
//for_over:= 420;
|
||||
//over_use:= minor_over;
|
||||
If (exists for_over AND dur_m > for_over)
|
||||
AND exists get_chg_code_b
|
||||
then
|
||||
Get_remain:= int(dur_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:= get_chg_code_b;
|
||||
else
|
||||
get_gt_over:= get_gt_over, get_chg_code_b;
|
||||
endif;
|
||||
Enddo;
|
||||
|
||||
|
||||
ENDIF; // for_over and dur_m
|
||||
//break;
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
/// testing
|
||||
//get_gt_over:= null;
|
||||
/////////////////////
|
||||
ct_over:= count get_gt_over;
|
||||
chg_code_proc:= ();
|
||||
///tally charges and if ENDO - get the dur_m > base charge code time
|
||||
if get_loc = "ENDO" then // AND get_gt_over <> "" then
|
||||
/// 04/19/18 - remove 3 lines of extraneous unneeded code for ENDO charge tallying
|
||||
// if get_gt_over <> "" then
|
||||
// chg_code_proc:= get_chg_code, get_gt_over;
|
||||
// else
|
||||
chg_code_proc:= get_chg_code;
|
||||
// endif;
|
||||
elseif exists get_chg_code then
|
||||
chg_code_proc:= get_chg_code;
|
||||
endif;
|
||||
|
||||
/*
|
||||
ct_get_over:= count get_gt_over;
|
||||
if exists get_gt_over then
|
||||
If ct_get_over >=1 //then //exists get_gt_over and
|
||||
//get_gt_over <> ""
|
||||
then
|
||||
chg_code_proc:= chg_code_proc, Get_gt_over;
|
||||
ENDIF;
|
||||
endif;// exist get gt over
|
||||
*/
|
||||
ct_chg_code:= count chg_code_proc;
|
||||
////
|
||||
|
||||
|
||||
|
||||
if u_name matches pattern "services%"
|
||||
then
|
||||
ray:=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:
|
||||
|
||||
|
||||
charge_codes := new net_object {{{SINGLE-QUOTE}}}List<String>{{{SINGLE-QUOTE}}};
|
||||
|
||||
///Do the loop to make the per min charges
|
||||
/// 12/12/16 - update to only run if it is using a per minute list (for charge codes)
|
||||
If get_loc = "ENDO" AND (exists chg_code_proc AND chg_code_proc <> "")
|
||||
then
|
||||
|
||||
For i in 1 seqto ct_chg_code DO
|
||||
ret := call charge_codes.Add with chg_code_proc[i] ; //get_chg_code;
|
||||
compile:= compile, chg_code_proc;
|
||||
ENDDO;
|
||||
|
||||
|
||||
If (exists for_over AND dur_m > for_over) then
|
||||
For i in 1 seqto ct_over DO
|
||||
ret := call charge_codes.Add with get_gt_over[i] ; //get_chg_code;
|
||||
compile:= compile, get_gt_over[i] ;
|
||||
ENDDO;
|
||||
endif;
|
||||
|
||||
|
||||
elseif
|
||||
(exists dur_m AND (exists chg_code_proc AND chg_code_proc <> "") )
|
||||
then
|
||||
|
||||
// If exists dur_m AND (exists chg_code_proc AND chg_code_proc <> "") then
|
||||
//ct_chg_code >= 1 then //(exists chg_code_proc AND chg_code_proc <> "") then //get_chg_code then
|
||||
dur_m := dur_m as number;
|
||||
///testing
|
||||
compile:= "";
|
||||
For i in 1 seqto dur_m DO
|
||||
ret := call charge_codes.Add with chg_code_proc ; //get_chg_code;
|
||||
compile:= compile, chg_code_proc;
|
||||
ENDDO;
|
||||
ENDIF;
|
||||
|
||||
/// 04/26/17 - add for viewing upcharging
|
||||
if exists chg_code_up then
|
||||
ret := call charge_codes.Add with chg_code_up ;
|
||||
compile:= compile, chg_code_up;
|
||||
endif;
|
||||
|
||||
/*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 charge_codes;
|
||||
|
||||
|
||||
//if exists idest then
|
||||
//write msg_text at idest;
|
||||
//endif;
|
||||
|
||||
;;
|
||||
|
||||
Urgency: 50
|
||||
;;
|
||||
end:
|
||||
165
MLMStripper/bin/Debug/SRG/SRG_CHG_SCH_STATISTICS_POLICY.mlm
Normal file
165
MLMStripper/bin/Debug/SRG/SRG_CHG_SCH_STATISTICS_POLICY.mlm
Normal file
@@ -0,0 +1,165 @@
|
||||
maintenance:
|
||||
|
||||
title: SRG_CHG_SCH_STATISTICS_POLICY ;;
|
||||
mlmname: SRG_CHG_SCH_STATISTICS_POLICY ;;
|
||||
arden: version 2.5;;
|
||||
version: 15.3;;
|
||||
institution: St Clair Hospital ;;
|
||||
author: Courtney Carr;;
|
||||
specialist: Don Warnick;;
|
||||
date: 2018-07-18 ;;
|
||||
validation: testing;;
|
||||
|
||||
|
||||
library:
|
||||
purpose:
|
||||
Statistical Surgery Charges
|
||||
;;
|
||||
|
||||
explanation:
|
||||
|
||||
Change history
|
||||
|
||||
07-18-2018 DW CSR# 26563 Statistical Charges - Created
|
||||
|
||||
;;
|
||||
|
||||
keywords:
|
||||
;;
|
||||
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
|
||||
using "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
|
||||
using namespace "System";
|
||||
using namespace "System.Collections.Generic";
|
||||
|
||||
log_execution_info := false;
|
||||
|
||||
(case_obj) := argument;
|
||||
|
||||
if called_by_editor then
|
||||
case_obj := read last { SRGCase: THIS Where CaseIdentifier = "1050" };
|
||||
u_name := read last {UserInfo: IDCOde};
|
||||
endif;
|
||||
|
||||
EvokingObject:= case_obj;
|
||||
|
||||
|
||||
// Attain the facility
|
||||
|
||||
|
||||
LocationName := read last
|
||||
{ "
|
||||
select lo.name
|
||||
from CV3Location lo with (nolock)
|
||||
where lo.GUID = " || sql(evokingobject.LocationGUID) || " "
|
||||
};
|
||||
|
||||
if LocationName matches pattern "EN%" then Facility := "ENDO"; StaisticalFacility := "ENDO";
|
||||
elseif LocationName matches pattern "MLSC%" then Facility := "MLSC" ; StaisticalFacility := "MLSC";
|
||||
elseif LocationName matches pattern "ANES FBC%" then Facility := "MAIN OR"; StaisticalFacility := "FBC";
|
||||
else Facility := "MAIN OR"; StaisticalFacility := "MAIN OR";
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
// FACILITY CHARGE CODE SECTION
|
||||
|
||||
|
||||
|
||||
StasticalFacilityChargeCode:= read last
|
||||
{ "
|
||||
select code from SXASRGChargeCode with (nolock)
|
||||
where description = {{{SINGLE-QUOTE}}}statistical charge {{{SINGLE-QUOTE}}} + {{{SINGLE-QUOTE}}}" || StaisticalFacility || "{{{SINGLE-QUOTE}}} "
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// MD SPECIALITY/FACILITY CHARGE CODE SECTION
|
||||
|
||||
|
||||
|
||||
// Attain the case id and the performed primary procedure id
|
||||
|
||||
CaseID := EVOKINGOBJECT.CaseID;
|
||||
|
||||
proc_parts:= evokingobject.SRGCaseProcedure;
|
||||
get_procs:= proc_parts.Records__;
|
||||
|
||||
// Loop through the procedures to find the primary (planned/primary/secondary procedures are in the object)
|
||||
|
||||
for i in 1 seqto count get_procs DO
|
||||
this_proc := get_procs[i];
|
||||
if this_proc.IsPRimary = true and this_proc.HasBeenPerformed = true
|
||||
then
|
||||
ProcedureID := this_proc.CaseProcedureID;
|
||||
endif;
|
||||
enddo;
|
||||
|
||||
|
||||
// Attain the provider discipline
|
||||
|
||||
|
||||
ProviderDiscipline:= read last
|
||||
{ "
|
||||
select srv.Description
|
||||
from SXASRGCaseProcedure cp with (nolock)
|
||||
join SXASRGSurgeryStaff ss with (nolock) on ss.SurgeryStaffID = cp.SurgeryStaffID
|
||||
join SXASRGService srv with (nolock) on srv.ServiceID = ss.ServiceID
|
||||
where cp.CaseID = " || CaseID || " and cp.CaseProcedureID = " || ProcedureID || " "
|
||||
};
|
||||
|
||||
|
||||
// Attain the charge code assocatied with that facilty and discipline
|
||||
|
||||
|
||||
if exists ProviderDiscipline
|
||||
then
|
||||
StasticalSpecialtyFacilityChargeCode:= read last
|
||||
{ "
|
||||
select code from SXASRGChargeCode with (nolock)
|
||||
where description like {{{SINGLE-QUOTE}}}%division {{{SINGLE-QUOTE}}} + {{{SINGLE-QUOTE}}}" || ProviderDiscipline || "{{{SINGLE-QUOTE}}} and substring (description, 1, CHARINDEX ({{{SINGLE-QUOTE}}} division{{{SINGLE-QUOTE}}}, description) ) = {{{SINGLE-QUOTE}}}" || Facility || "{{{SINGLE-QUOTE}}} "
|
||||
};
|
||||
endif;
|
||||
|
||||
|
||||
;;
|
||||
|
||||
priority: 50
|
||||
;;
|
||||
|
||||
evoke:
|
||||
;;
|
||||
|
||||
logic:
|
||||
|
||||
|
||||
charge_codes := new net_object {{{SINGLE-QUOTE}}}List<String>{{{SINGLE-QUOTE}}};
|
||||
|
||||
|
||||
if StasticalFacilityChargeCode is not null
|
||||
then
|
||||
ret := call charge_codes.Add with StasticalFacilityChargeCode ;
|
||||
endif;
|
||||
|
||||
if StasticalSpecialtyFacilityChargeCode is not null
|
||||
then
|
||||
ret := call charge_codes.Add with StasticalSpecialtyFacilityChargeCode ;
|
||||
endif;
|
||||
|
||||
conclude true;
|
||||
|
||||
;;
|
||||
|
||||
action:
|
||||
|
||||
return charge_codes;
|
||||
|
||||
;;
|
||||
|
||||
Urgency: 50
|
||||
;;
|
||||
end:
|
||||
Reference in New Issue
Block a user