Files
St.Clair/MLMStripper/bin/Debug/FORM/FORM_POSTOPEN_HEART_ATRIAL_FIBRILLATION.mlm

126 lines
5.3 KiB
Plaintext

maintenance:
title: FORM_PostOpen_Heart_Atrial_Fibrillation;;
mlmname: FORM_PostOpen_Heart_Atrial_Fibrillation;;
arden: version 2.5;;
version: 6.10;;
institution: St. Clair Hospital;;
author: Shivprasad Jadhav;;
specialist: Shivprasad jadhav, Allscripts Corporation;;
date: 2015-01-14;;
validation: testing;;
library:
purpose: 1) Search the results for " Potassium Plasma/Serum" and "Magnesium Plasma/Serum" on a patient for Past 24 hours
and if no result is found then precheck these lab order items.
;;
explanation:
Change History
-----------------
13.01.2015 JML CSR# 32945: Created
01.21.2016 SSJ Calling base MLM {{{SINGLE-QUOTE}}}FORM_Set_Total_Hip_Post_Op{{{SINGLE-QUOTE}}}. Earlier current MLM was get called from it.
;;
keywords: Called MLMs
;;
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;
/*******************Make Changes To Spelling And Flags In This Section*******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := FALSE;
/***************************************************************************************/
/*-----------------MLM Call By Shivprasad ----*/
PreCardiac_Base_MLM := MLM {{{SINGLE-QUOTE}}}FORM_Set_Total_Hip_Post_Op{{{SINGLE-QUOTE}}};
this_communication,this_form := call PreCardiac_Base_MLM with this_communication,this_form,client_info_obj ;
/* --------------MLM Cal End By Shivprasad--------*/
// Initialize error message
error_message:="";
// Assigns fields passed in the Form object to the Field object
field_list:= this_form.fields;
client_guid := this_communication.ClientGUID;
visit_guid := this_communication.ClientVisitGUID;
chart_guid := this_communication.ChartGUID;
//pObj := this_communication.PrimaryObj;
CallingEvent := this_communication.CallingEvent;
CallingField := this_communication.CallingFieldName;
item_event := this_communication.itemevent;
form_type := this_communication.formtype;
//Retrieve relevant form fields
Labs_96Hr := last of ( field_list WHERE field_list.DataItemName = "MultiOrderCheckBox" and field_list.Label = "Labs-Today" );
Labs_96Hr_Val := Labs_96Hr.Value;
//Check to see if patient had these labs drawn in last 96 hours
( lab_name ) := read {" SELECT Case o.Name When {{{SINGLE-QUOTE}}}Magnesium Plasma/Serum{{{SINGLE-QUOTE}}} Then {{{SINGLE-QUOTE}}}Magnesium Plasma/Serum{{{SINGLE-QUOTE}}} "
|| " Else {{{SINGLE-QUOTE}}}Potassium Plasma/Serum{{{SINGLE-QUOTE}}} End "
|| " FROM CV3ClientVisit cv WITH (NOLOCK) JOIN CV3Order o WITH (NOLOCK)"
|| " ON cv.GUID = o.ClientVisitGUID"
|| " AND cv.ClientGUID = o.ClientGUID"
|| " AND cv.ChartGUID = o.ChartGUID"
|| " WHERE cv.ClientGUID = " || Sql(client_guid)
|| " AND o.NAME IN ({{{SINGLE-QUOTE}}}Potassium Plasma/Serum{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Magnesium Plasma/Serum{{{SINGLE-QUOTE}}} ,{{{SINGLE-QUOTE}}}Basic Metabolic Panel{{{SINGLE-QUOTE}}}, "
|| " {{{SINGLE-QUOTE}}}Basic Metabolic Panel Fasting{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 12{{{SINGLE-QUOTE}}}, "
|| " {{{SINGLE-QUOTE}}}Chem 12 Fasting{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 13{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 13 Fasting{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 14 Fasting{{{SINGLE-QUOTE}}}, "
|| " {{{SINGLE-QUOTE}}}Chem 14.{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 7{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 7 Fasting{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Chem 8 Fasting{{{SINGLE-QUOTE}}}, "
|| " {{{SINGLE-QUOTE}}}Chem 8.{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Comprehensive Metabolic Panel{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Comprehensive Metabolic Panel Fasting{{{SINGLE-QUOTE}}}, "
|| " {{{SINGLE-QUOTE}}}Electrolytes{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Renal Panel{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Renal Panel Fasting{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Renal Profile{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Renal Profile Fasting{{{SINGLE-QUOTE}}} ) "
|| " AND DATEDIFF(HH, o.ARRIVALDTM, GetDate()) <= 24 " //1400"
//|| " AND DATEDIFF(DD, o.ARRIVALDTM, GetDate()) <= 14 " //1400"
|| " AND o.OrderStatusCode IN ({{{SINGLE-QUOTE}}}SPRV{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}RESF{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}RESI{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}RESC{{{SINGLE-QUOTE}}})"};
if ( exists lab_name ) then
for lab in 1 seqto ( count Labs_96Hr_Val ) do
if ( Labs_96Hr_Val[lab].Name NOT IN lab_name ) then
Labs_96Hr_Val[lab].IsSelected := true;
else
Labs_96Hr_Val[lab].IsSelected := false;
endif;
enddo;
else
//No labs exist for this patient, select all labs
Labs_96Hr_Val.IsSelected := ( true, true);
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: