136 lines
4.3 KiB
Plaintext
136 lines
4.3 KiB
Plaintext
maintenance:
|
|
|
|
title: FORM_SET_DISCHARGE_ORDERS_HOME;;
|
|
mlmname: FORM_SET_DISCHARGE_ORDERS_HOME;;
|
|
arden: version 2.5;;
|
|
version: 5.50;;
|
|
institution: St Clair ;;
|
|
author: Juliet M. Law, Allscripts Ext x7461;;
|
|
specialist: Dean Miklavic, Allscripts Ext x7466;;
|
|
date: 2013-05-24;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Used for Discharge-Home Order Set
|
|
;;
|
|
|
|
explanation: Used for Discharge-Home Order Set
|
|
|
|
Change History
|
|
02.25.2014 JML CSR 31744: Added mapped Discharge Diagnosis field to order set; added logic
|
|
to make field NOT MANDATORY for emergency patients
|
|
;;
|
|
keywords: Called MLMs, Order Set, Discharge-Home Order Set
|
|
;;
|
|
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
|
|
value ) := argument;
|
|
|
|
callForm := mlm {{{SINGLE-QUOTE}}}FORM_OBSERVATION_ADT{{{SINGLE-QUOTE}}};
|
|
|
|
/*******************Make Changes To Spelling And Flags In This Section*******************/
|
|
// 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;
|
|
|
|
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
|
include standard_libs;
|
|
using "ObjectsPlusXA.SCM.Forms";
|
|
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
|
|
|
|
/* Set to true if a decision.log is needed.*/
|
|
log_execution_info := false;
|
|
|
|
// Use String parse
|
|
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}};
|
|
|
|
//Local session object
|
|
local_session := cds_session.local;
|
|
|
|
//Retrieve necessary fields
|
|
Labs_list := last of (field_list WHERE field_list.DataItemName = "NUR_NurInstructionFreeText"
|
|
AND field_list.Control_MultiFieldOccNum = 3);
|
|
|
|
Labs_Check := last of (field_list WHERE field_list.DataItemName = "MultiOrderCheckbox"
|
|
AND field_list.Control_MultiFieldOccNum = 2);
|
|
Labs_Check_Value := Labs_Check.Value;
|
|
|
|
Submit_Btn := last of (field_list WHERE field_list.DataItemName = "CPOE Repeat Lab Submit Button"
|
|
AND field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
//**** CSR 31744 Change
|
|
Discharge_grid := last of ( field_list WHERE field_list.DataItemName = "MultiOrderGrid"
|
|
AND field_list.Control_MultiFieldOccNum = 46);
|
|
Discharge_field := Discharge_grid.Value;
|
|
|
|
Discharge_Diagnosis := last of (field_list WHERE field_list.DataItemName = "DISC_Discharge Diagnosis"
|
|
AND field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
linebreakme:= read last
|
|
{" SELECT "
|
|
|| " {{{SINGLE-QUOTE}}} {{{SINGLE-QUOTE}}} +char(13) + char(10) "
|
|
};
|
|
|
|
|
|
//**** CSR 31744 Change Begin ****
|
|
visitType := read last {"SELECT cv.TypeCode"
|
|
|| " FROM CV3Client c WITH (NOLOCK) JOIN CV3ClientVisit cv WITH (NOLOCK)"
|
|
|| " ON c.GUID = cv.ClientGUID"
|
|
|| " WHERE c.GUID = " || Sql(client_guid)
|
|
|| " AND cv.GUID = " || Sql(visit_guid)};
|
|
|
|
|
|
if ( ( visitType = "Emergency" ) OR ( visitType = "Clinc" ) ) then
|
|
Discharge_Diagnosis.Control_Mandatory := false;
|
|
Discharge_Diagnosis.Value := " ";
|
|
endif;
|
|
//**** CSR 31744 Change End ****
|
|
|
|
if ((CallingEvent = "ButtonClick") AND (CallingField = "CPOE Repeat Lab Submit Button|1")) then
|
|
|
|
a := local_session.SessionDischargeLabOrders;
|
|
if ((a <> "") AND (a is not null)) then
|
|
Labs_list.Value := a;
|
|
endif;
|
|
|
|
aa := local_session.SessionDischargeMIOrders;
|
|
if ((aa <> "") AND (aa is not null)) then
|
|
if ((Labs_list.Value is not null) AND (Labs_list.Value <> "")) then
|
|
Labs_list.Value := Labs_list.Value || linebreakme || aa;
|
|
else
|
|
Labs_list.Value := aa;
|
|
endif;
|
|
endif;
|
|
|
|
elseif (CallingEvent = "FormClose") then
|
|
local_session.SessionDischargeLabOrders := "";
|
|
local_session.SessionDischargeMIOrders := "";
|
|
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:
|