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

114 lines
4.0 KiB
Plaintext

maintenance:
title: FORM_OPIATE_WITHDRAWAL_OS;;
mlmname: FORM_OPIATE_WITHDRAWAL_OS;;
arden: version 2.5;;
version: 6.10;;
institution: St. Clair Hospital;;
author: Shivprasad Jadhav;;
specialist: Shivprasad Jadhav Allscripts Corporation;;
date: 2015-03-11;;
validation: testing;;
library:
purpose:
;;
explanation:
Change History
-----------------
12.10.2014 JML CSR# 33059: Created
Look back the current visit on a patient in Emergeny room for the lab orders with the Status as "Specimen Recieved by performing Department"
and if order is not there then preselect the same.
1)CBC (Includes Diff)
2)Comprehensive Basic Metabolic Panel
3)RPR-Rapid Plasma Reagin Serum
4)Rotine/Microscopic Urinalysis
;;
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;
/***************************************************************************************/
// 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;
CallingEvent := this_communication.CallingEvent;
CallingField := this_communication.CallingFieldName;
//Retrieve relevant form fields
Labs_NotDoneED := last of ( field_list WHERE field_list.DataItemName = "MultiOrderCheckbox"
and field_list.Control_MultiFieldOccNum = 3);
Labs_NotDoneED_Val := Labs_NotDoneED.Value;
/*****************************Call to Base form MLM******************************************/
Mdecical_Imaging_MLM:= MLM {{{SINGLE-QUOTE}}}FORM_Medical_Imaging_Indications_for_OS{{{SINGLE-QUOTE}}};
this_communication,this_form := call Mdecical_Imaging_MLM with this_communication,this_form,client_info_obj ;
/*****************************Call to Base form MLM******************************************/
//Check to see if patient had these labs drawn in current visit till date
( lab_name ) := read {"SELECT o.Name "
|| " 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}}}Comprehensive Metabolic Panel{{{SINGLE-QUOTE}}},"
|| " {{{SINGLE-QUOTE}}}CBC (Includes Diff){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Routine/Microscopic Urinalysis{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}RPR-Rapid Plasma Reagin Serum{{{SINGLE-QUOTE}}}) "
|| " 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_NotDoneED_Val ) do
if ( Labs_NotDoneED_Val[lab].Name Not IN lab_name ) then
Labs_NotDoneED_Val[lab].IsSelected := true;
else
Labs_NotDoneED_Val[lab].IsSelected := false;
endif;
enddo;
else
//No labs exist for this patient, select all labs
Labs_NotDoneED_Val.IsSelected := ( true, true, 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: