143 lines
5.5 KiB
Plaintext
143 lines
5.5 KiB
Plaintext
maintenance:
|
|
|
|
title: Ordering: Auto-populate heparin status on aptt order with appropriate selection;;
|
|
mlmname: FORM_Lab_APTT_Heparin_Status;;
|
|
arden: version 2;;
|
|
version: 4.50;;
|
|
institution: St Clair Hospital;;
|
|
author: Dean Miklavic Eclipsys Corp;;
|
|
specialist: Don Warnick Eclipsys Corp ;;
|
|
date: 2009-07-13;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Display a message outlining a Lab Protocol when specific drugs are entered
|
|
|
|
;;
|
|
|
|
explanation: This MLM is called from forms where APTT is ordered. It uses two session objects (one for SQ orders and one for IV orders)
|
|
passed from SCH_Unsubmitted_Heparin_Order to populate the Heparin Status field.
|
|
|
|
|
|
Change history
|
|
|
|
07.13.2009 DW Initial build
|
|
04.03.2012 TMS Modified to only send label field with continuous heparin. CSR 24257
|
|
|
|
;;
|
|
keywords: Called MLMs, Form open, heparin
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
|
|
// This MLM is passed three arguments, of types
|
|
// communication_type, form_type and client info object respectively.
|
|
|
|
(this_communication, // Communication object
|
|
this_form, // Form object
|
|
client_info_obj //Arden ClientInfo object
|
|
) := argument;
|
|
|
|
// Specify which .NET assemblies need to be loaded for ObjectsPlus
|
|
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
|
include standard_libs;
|
|
|
|
/*******************Make Changes To Spelling And Flags In This Section*******************/
|
|
|
|
// heparin_order := "%Heparin%";
|
|
heparin_order_iv := "%Heparin 25,000%";
|
|
|
|
/***************************************************************************************/
|
|
|
|
// Initialize error message
|
|
error_message:="";
|
|
|
|
// Assigns fields passed in the Form object to the Field object
|
|
field_list:= this_form.fields;
|
|
CallingField :=this_communication.CallingFieldName;
|
|
CallingEvent := this_communication.CallingEvent;
|
|
Visit_Guid := this_communication.ClientVisitGuid;
|
|
Chart_Guid := this_communication.ChartGuid;
|
|
Client_Guid := this_communication.ClientGuid;
|
|
//order_name := this_communication.primaryobj.name;
|
|
|
|
|
|
local_session := cds_session.local;
|
|
|
|
omitcheckstatus := last of (field_list where field_list.DataItemName = "MLM Generic Checkbox" );
|
|
heparinlabinfo := last of (field_list where field_list.DataItemName = "LAB_VO_DI_Coag_Heparin Status" );
|
|
|
|
heparinstatus := last of (field_list where field_list.DataItemName = "Lab_ContHep_Question" );
|
|
LabHoldOrderReqDtm := mlm {{{SINGLE-QUOTE}}}FORM_LAB_HOLDORDER_REQUESTEDTIME{{{SINGLE-QUOTE}}};
|
|
LabRepeatOrders := mlm {{{SINGLE-QUOTE}}}FORM_ID_REPEATORDERS{{{SINGLE-QUOTE}}};
|
|
omitcheckstatus_value := omitcheckstatus.value;
|
|
retain_heparin_Status := heparinstatus.value;
|
|
heparinstatus_value := heparinstatus.value;
|
|
|
|
// Search patient record for existing Heparin IV order
|
|
|
|
heparin_order_iv_found := read last {"select name from cv3order where name like " || SQL(heparin_order_iv)
|
|
|| " and ClientGUID = " || SQL(client_guid)
|
|
|| " and ChartGUID = " || SQL(chart_guid)
|
|
|| " and ClientVisitGUID= " || SQL(visit_guid)
|
|
|| " and OrderStatusLevelNum > 15 "
|
|
|| " and OrderStatusLevelNum not in (69, 70) "
|
|
};
|
|
|
|
if heparin_order_IV_found is not null then heparin_iv_found := true; else heparin_iv_found := false; endif;
|
|
|
|
|
|
// Search unsubmitted orders for Heparin IV order (use count function to determine if the session object is populated)
|
|
unsubmitted_heparin_iv:= local_session.SessionUnsubmittedHeparinIV;
|
|
unsubmitted_heparin_iv_count:= count(unsubmitted_heparin_iv) As Number;
|
|
|
|
if unsubmitted_heparin_iv_count = 0 then unsubmitted_heparin_iv_found := false; else unsubmitted_heparin_iv_found := true; endif;
|
|
|
|
if ((unsubmitted_heparin_iv_found = true) or (heparin_iv_found = true )) then found_orders:= "true"; else found_orders := "false"; endif;
|
|
|
|
// If order preconfigured with heparin status retain configured value regardless of existing or unsubmitted orders
|
|
If CallingEvent = "FormOpen" then
|
|
if omitcheckstatus_value = true then heparinstatus.value := retain_heparin_Status ; endif;
|
|
endif;
|
|
|
|
|
|
// If order preconfigured with heparin status retain configured value regardless of existing or unsubmitted orders
|
|
If CallingEvent = "FormClose" or callingEvent = "FormOpen" then
|
|
if found_orders = "true" and omitcheckstatus_value = false then heparinstatus.value := "Yes"; heparinlabinfo.value := "Continuous Heparin";
|
|
endif;
|
|
|
|
if found_orders = "false" and omitcheckstatus_value = false then heparinstatus.value := "No"; heparinlabinfo.value := "";
|
|
endif;
|
|
endif;
|
|
|
|
If CallingEvent = "FormClose" or CallingField = "Lab_ContHep_Question" then
|
|
if heparinstatus_value = "Yes" then heparinlabinfo.value := "Continuous Heparin";
|
|
else heparinlabinfo.value := "";
|
|
endif;
|
|
endif;
|
|
|
|
// Call for other MLM{{{SINGLE-QUOTE}}}s on Form Open and Close
|
|
If CallingEvent = "FormOpen" then
|
|
(this_communication,this_form) := Call LabHoldOrderReqDtm with this_communication, this_form, client_info_obj;
|
|
endif;
|
|
|
|
If CallingEvent = "FormClose" then
|
|
(this_communication,this_form) := Call LabRepeatOrders with this_communication, this_form, client_info_obj;
|
|
endif;
|
|
|
|
;;
|
|
evoke: // No evoke statement
|
|
;;
|
|
logic:
|
|
|
|
conclude true;
|
|
;;
|
|
action:
|
|
// This MLM returns two parameters, of types communication_type and form_type respectively.
|
|
return this_communication, this_form;
|
|
|
|
|
|
;;
|
|
end:
|