Initial Checking with all 820 MLMs

This commit is contained in:
2020-02-02 00:54:01 -05:00
parent c59dc6de2e
commit 840d0432f4
828 changed files with 239162 additions and 0 deletions

View File

@@ -0,0 +1,149 @@
maintenance:
title: List Setting MLM ;;
mlmname: UTIL_ITEMS_READONLY;;
arden: version 2;;
version: 5.00;;
institution: Eclipsys Corporation at SCH;;
author: Shawn Head Eclipsys at St Clair Ext 7468;;
specialist: ;;
date: 2012-05-24;;
validation: testing;;
library:
purpose:
Takes a list and the passed in value(s) to set all fields to correct read-only
Returns a list with the correct amount of members all set to the necessary readonly status
;;
explanation:
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
( listallitems,
listselected,
listtriggeritems,
currentreadonly
) := ARGUMENT;
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}};
;;
evoke: /* Call MLM */
;;
logic:
//counts the number of items in the grid AND the number of items that should control the MLM that were passed in
ctallitems := count listallitems;
cttriggeritems := count listtriggeritems;
//builds a couple lists that will be used by the MLM to control the read only status
isitemreadonly := ();
switchro := ();
isitemselected := "no";
//if there are no items configured in the MLMGenericItemControl for specific order items then this section
//will only allow 1 item to be selected and will cause the readonly value to be set to true for all items
//EXCEPT for the item that is currently selected in the grid. If no items are selected then the readonly value
//will be set to the "isitemselected" value of NO allowing for any item to be selected again.
/* original
if listtriggeritems[1] = "" or listtriggeritems[1] is null then
for x in (1 seqto (count listselected)) do
break;
if listselected[x] = true then
switchro := switchro, false;
isitemselected := "yes";
else
switchro := switchro, true;
endif;
enddo;
break;
if isitemselected <> "yes" then
switchro := listselected;
endif;
*/
if listtriggeritems[1] = "" or listtriggeritems[1] is null then
for x in (1 seqto (count listallitems)) do
if listallitems[x] = true then
switchro := switchro, false;
isitemselected := "yes";
else
switchro := switchro, true;
endif;
enddo;
if isitemselected <> "yes" then
switchro := listallitems;
endif;
else
//if there are items configured in MLMGenericItemControl for specific order items to trigger the read-only
//option based on the required configuration then this logic will set all items that are not selected to
//read only. This will be based on the fact that only 1 item at a time should be selectable based on the
//order item list based into the MLM from MLMGenericItemControl (e.x. format would be MOG^7^order1, order2, order3^YES)
updateitempos := ();
selecteditempos := ();
isitemreadonly := currentreadonly;
isitemselected := "no";
//this for loop cycles through the trigger order items that are configured in the MLMGenericItemControl
for x in (1 seqto (count listtriggeritems)) do
//this for loop cycles through ALL items in the grid that called the MLM so it can verify if the item configured
//in the MLMGenericItemControl exists in the grid calling the MLM.
for y in (1 seqto (count listallitems)) do
//this if logic is making sure that the item in the configuration of MLMGenericItemControl matches the grid item
//added to the form. If it matches 1-to-1 then it will check to see if the item is selected.
if trim(listtriggeritems[x]) = trim(listallitems[y]) then
//if the item is selected add the item position in the list to selecteditempos for later use.
if listselected[y] = true then
isitemselected := "yes";
selecteditempos := selecteditempos, y;
//if the item is NOT selected add the item position in the list to updateitempos for later use.
else
updateitempos := updateitempos, y;
endif;
endif;
enddo;
enddo;
//now the MLM will check to see if there is an item selected in the grid. if so then it will update all the
//selected items that are configured in the MLMGenericItemControl to NOT be read only so you can still
//modify/unselect the item. It will also update all the items thAt are not selected to readonly preventing
//those items from being selected until the selected item is "de-selected".
if isitemselected = "yes" then
for x in (1 seqto (count selecteditempos)) do
isitemreadonly[updateitempos[x]] := false;
enddo;
for x in (1 seqto (count updateitempos)) do
isitemreadonly[updateitempos[x]] := true;
enddo;
else
//if there are no items selected as defined by the "isitemselected" variable then the MLM will set all items
//configured in the MLMGenericItemControl to NOT be read only allowing for any item to be selected again.
for x in (1 seqto (count updateitempos)) do
isitemreadonly[updateitempos[x]] := false;
enddo;
endif;
switchro := isitemreadonly;
endif;
conclude true;
;;
action:
return switchro;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,200 @@
maintenance:
title: Launch Dynamic User Defined Dictionary in ListBox;;
mlmname: UTIL_LAUNCH_LISTBOX_DYNAMIC_UDD_SCH;;
arden: version 2.5;;
version: 15.1;;
institution: WWL;;
author: Charles H Andrus;;
specialist: ;;
date: 2013-03-08;;
validation: testing;;
library:
purpose:
Create a dynamic dropdown list precisely where the mouse is currently located without a dll.
;;
explanation:
This MLM takes a string representation of a SQL query (i.e. SELECT Name FROM CV3OrderCatalogMasterItem) and
grabs the first column and puts it into a dropdown list that will overlay over the current form or document.
The dropdown will close when the user successfully chooses an item in the list.
There is a flag in the code (it{{{SINGLE-QUOTE}}}s commented out) if you want to give the user the ability to close the window
with the red x. This MLM only requires .NET 4 be installed.
The MLM returns the value the user picked from the list.
/// for SCH - for Surgery
05/05/17 - deployed in DEV
05/20/19 - JML - Modified HVCLogonObj call to use 18.4 GetSQLConnection method (HVCLogonObj.GetConnectionString method was
deprecated in 18.4)
;;
keywords:
.NET 4, UDDD, Dynamic
;;
knowledge:
type: data-driven;;
data:
(query) := ARGUMENT;
if called_by_editor and not exists query then
(client_guid,client_chart_guid,client_visit_guid) := READ LAST{ClientVisit:ClientGUID,ChartGUID,GUID};
/*
query := "SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL SNAPSHOT; "
|| " SELECT ShortName FROM CV3HealthIssueDeclaration "
|| " WHERE ClientGUID = " || sql(client_guid)
|| " AND Active = 1 "
|| " AND TypeCode IN({{{SINGLE-QUOTE}}}Chronic{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Visit Problem{{{SINGLE-QUOTE}}}) "
|| " AND (ScopeLevel = 3 "
|| " OR (ScopeLevel = 2 "
|| " AND ChartGUID = " || sql(client_chart_guid) || ")) "
|| " ORDER BY ShortName ";
*/
query := "SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL SNAPSHOT; "
|| " SELECT Name FROM CV3Location "
|| " WHERE Name LIKE {{{SINGLE-QUOTE}}}aaa%{{{SINGLE-QUOTE}}} "
|| " AND Active = 1 ";
endif;
using "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
using "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
using "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
using "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
using "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
using "SCMLib";
using namespace "System";
using namespace "System.Reflection";
using namespace "System.Reflection.Emit";
using namespace "System.Collections.Generic";
using namespace "System.Text";
using namespace "System.Windows";
using namespace "System.Windows.Controls";
using namespace "System.Windows.Data";
using namespace "System.Windows.Documents";
using namespace "System.Windows.Input";
using namespace "System.Windows.Media";
using namespace "System.Windows.Media.Imaging";
using namespace "System.Windows.Navigation";
using namespace "System.Windows.Shapes";
using namespace "System.Data.SqlClient";
using namespace "SCMLib.PObj";
using namespace "SCMLib.Context";
// SET UP THE WINDOW AND IT{{{SINGLE-QUOTE}}}s SETTINGS
mouse := {{{SINGLE-QUOTE}}}System.Windows.Forms.Control{{{SINGLE-QUOTE}}}.MousePosition;
window := NEW NET_OBJECT {{{SINGLE-QUOTE}}}Window{{{SINGLE-QUOTE}}};
//window.WindowStyle := {{{SINGLE-QUOTE}}}System.Windows.WindowStyle{{{SINGLE-QUOTE}}}.None; // Comment this out if you want all the buttons in the top right of the window.
window.WindowStyle := {{{SINGLE-QUOTE}}}System.Windows.WindowStyle{{{SINGLE-QUOTE}}}.ToolWindow; // Uncomment this to get a tool window that only has the red x.
// Make sure to change the height
window.Width := 300; // Defines how wide the ListBox is
window.Height := 380; // Defines how tall the ListBox is
window.Left := mouse.X /*- (window.Width/2)*/; // if you uncomment this the window will be horizontally centered to the cursor
window.Top := mouse.Y /* - (window.Height/2)*/; // if you uncomment this the window will be vertically centered to the cursor
uri := NEW NET_OBJECT {{{SINGLE-QUOTE}}}Uri{{{SINGLE-QUOTE}}} WITH "/PresentationFramework.Aero;v4.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml", {{{SINGLE-QUOTE}}}UriKind{{{SINGLE-QUOTE}}}.Relative;
window.Resources.Source := uri;
// SET UP THE ComboBox
ListBox := NEW NET_OBJECT {{{SINGLE-QUOTE}}}ListBox{{{SINGLE-QUOTE}}};
ListBox.HorizontalAlignment := {{{SINGLE-QUOTE}}}System.Windows.HorizontalAlignment{{{SINGLE-QUOTE}}}.Stretch;
ListBox.VerticalAlignment := {{{SINGLE-QUOTE}}}System.Windows.VerticalAlignment{{{SINGLE-QUOTE}}}.Stretch;
window.Content := ListBox;
/********* SET UP THE Selection Event *************/
/* This is the most difficult piece of code because
* you cannot write the function in another MLM because
* it must be .NET code. Therefore, in order to close the
* window when an item is selected from the ComboBox,
* a dynamic event handler function must be created.
* This effectively requires you write the function in
* assembly language.
*/
parameters := NEW NET_OBJECT {{{SINGLE-QUOTE}}}List<Type>{{{SINGLE-QUOTE}}};
obj := new NET_OBJECT {{{SINGLE-QUOTE}}}Object{{{SINGLE-QUOTE}}};
objType := CALL obj.GetType;
void := CALL parameters.Add WITH objType AS {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}};
a1 := CALL {{{SINGLE-QUOTE}}}Assembly{{{SINGLE-QUOTE}}}.Load WITH "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
a2 := CALL {{{SINGLE-QUOTE}}}Assembly{{{SINGLE-QUOTE}}}.Load WITH "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
a3 := CALL {{{SINGLE-QUOTE}}}Assembly{{{SINGLE-QUOTE}}}.Load WITH "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
a4 := CALL {{{SINGLE-QUOTE}}}Assembly{{{SINGLE-QUOTE}}}.Load WITH "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
SelectionChangedEventArgsType := CALL {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}}.GetType WITH "System.Windows.Controls.SelectionChangedEventArgs, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", true, false;
SelectionChangedEventHandlerType := CALL {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}}.GetType WITH "System.Windows.Controls.SelectionChangedEventHandler, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", true, false;
FrameworkElementType := CALL {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}}.GetType WITH "System.Windows.FrameworkElement, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", true, false;
WindowType := CALL window.GetType;
ListBoxType := CALL ListBox.GetType;
void := CALL parameters.Add WITH SelectionChangedEventArgsType AS {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}};
paramArray := CALL parameters.ToArray;
eventHandler := NEW NET_OBJECT {{{SINGLE-QUOTE}}}DynamicMethod{{{SINGLE-QUOTE}}} WITH "ListBox_SelectionChanged", {{{SINGLE-QUOTE}}}Void{{{SINGLE-QUOTE}}}, paramArray;
method1 := CALL FrameworkElementType.GetMethod WITH "get_Parent";
method2 := CALL WindowType.GetMethod WITH "Close";
generator := CALL eventHandler.GetILGenerator;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Nop;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ldarg_0;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, ListBoxType;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method1;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, WindowType;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method2;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Nop;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ret;
listEvent := {{{SINGLE-QUOTE}}}ListBox{{{SINGLE-QUOTE}}}.SelectionChangedEvent;
delegate := CALL eventHandler.CreateDelegate WITH SelectionChangedEventHandlerType;
void := CALL Listbox.AddHandler WITH listEvent, delegate;
/**************************************************/
// QUERY THE DATABASE
itemList := NEW NET_OBJECT {{{SINGLE-QUOTE}}}List<String>{{{SINGLE-QUOTE}}};
conn := NEW NET_OBJECT {{{SINGLE-QUOTE}}}SqlConnection{{{SINGLE-QUOTE}}};
conn := call {{{SINGLE-QUOTE}}}SCMLib.HVCLogon.HVCLogonObj{{{SINGLE-QUOTE}}}.GetSQLConnection;
void := call conn.Open;
command := NEW NET_OBJECT {{{SINGLE-QUOTE}}}SqlCommand{{{SINGLE-QUOTE}}} WITH query AS {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}, conn AS {{{SINGLE-QUOTE}}}SqlConnection{{{SINGLE-QUOTE}}};
reader := call command.ExecuteReader;
continue_reading := call reader.Read;
void := CALL itemList.Add WITH " " as string;
while (continue_reading) do
value := CALL reader.GetValue WITH 0 AS {{{SINGLE-QUOTE}}}Int32{{{SINGLE-QUOTE}}};
void := CALL itemList.Add WITH value as string;
continue_reading := call reader.Read;
enddo;
void := call reader.Dispose;
void := call command.Dispose;
void := call conn.Close;
void := call conn.Dispose;
ListBox.ItemsSource := itemList;
void := CALL window.ShowDialog;
value := ListBox.SelectedItem;
;;
priority: 50
;;
evoke: //MLM is called not evoked
;;
logic:
conclude true;
;;
action:
return value as string;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,52 @@
maintenance:
title: List Setting MLM ;;
mlmname: UTIL_LIST_FALSE_TRUE;;
arden: version 2;;
version: 5.00;;
institution: Eclipsys Corporation at SCH;;
author: Robert Spence Eclipsys at St Clair Ext 7461;;
specialist: ;;
date: 2010-02-11;;
validation: testing;;
library:
purpose:
Takes a list and the passed in value to set all fields to
Returns a list with the correct amount of members, set to the value passed in (true of false)
;;
explanation:
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
( listin,
trueorfalse
) := ARGUMENT;
;;
evoke: /* Call MLM */
;;
logic:
Numin := count listin;
listout:=();
for z in (1 seqto (Numin)) do
listout := listout,trueorfalse;
enddo;
conclude true;
;;
action:
return listout;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,317 @@
maintenance:
title: OBJECT_Customize_DIPA MLM ;;
mlmname: UTIL_OBJECT_Customize_DIPA_MLM;;
arden: version 2.5;;
version: 5.50;;
institution: Allscripts Corporation;;
author: Jignesh Parmar;;
specialist: ;;
date: 2011-01-06;;
validation: testing;;
library:
purpose:
To create an generic object based on the parameters passed and define , initialize , populate and ADD it.
;;
explanation:
This is a Generic MLM which can use to set value to any parameter on any type of document both Flowsheet and StructureNote.
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
//Input parameters
( this_DocumentCommunication , // Document Communication Object
Parameter_Name , // Parameter for which the value needs to be set or assign
Value) // Value to be assigned.
//Clear_Field) // Are we clearing the field? YES/NO.default "NO" , Specifically for Datevaluetype
:= ARGUMENT;
//Get The Structure Note
(this_Doc) := this_documentCommunication.DocumentConfigurationObj;
//Get the Parameter List
(this_parms) := This_Doc.ParametersList;
//Get the Observation
(this_observations) := This_Doc.ChartedObservationsList;
//Checking for the documnet type
IF this_DocumentCommunication.DocumentType = "Flowsheet" THEN
IsFlowsheet := TRUE;
IsStructNote := FALSE;
ELSEIF this_DocumentCommunication.DocumentType = "StructureNote" THEN
IsFlowsheet := FALSE;
IsStructNote := TRUE;
ENDIF;
(this_observations) := this_documentCommunication.CurrentObservationObj;
(doc_config_obj):= this_documentCommunication.DocumentConfigurationObj;
/****************************************************************
Defining the all object types
****************************************************************/
//Declare the Observation
ObservationType := OBJECT [ ObservationGUID,
ClientDocumentGUID,
ParameterGUID,
DataType,
ValueObj ];
//Declare the NumericValue
NumericValueType := OBJECT [ Value ];
//Declare the TextValue
TextValueType := OBJECT [ Value ];
//Declare the DateValue
DateValueType := OBJECT [ Value ];
//Decalare the ListValue
ListValueType :=OBJECT [ ListGUID,
ListItemsList,
SuggestedTextValue ];
//Declare the ListItem
ListItemType := OBJECT[ListItemGuid,
Value,
IsSelected];
ListValueListItemType := OBJECT [ListItemGUID, Value, IsSelected];
//FOLLOWING OBJECTS ARE ONLY FOR FLOWSHEET DOCUMENTS.
IF IsFlowsheet = TRUE THEN
//Declare the Listset Value
ListSetValueType := OBJECT [ ListValuesList ];
//Declare the IO Value
IOValueType := OBJECT [ InValue,
OutValue,
DayRunningValue,
BagNumber,
BagInitialVolume
];
//Declare the Generic Drip Value
GenericDripValueType := OBJECT [DoseValue,
RateValue
];
//Declare the Drip Value
DripValueType := OBJECT [ Value,
BagNumber,
BagInitialVolume
];
ENDIF;
;;
evoke: /* Call MLM */
;;
logic:
/*************************************************************************
Creating object of the observation.
*************************************************************************/
Result_observation := NEW ObservationType;
Result_observation.ClientDocumentGUID := This_Doc.ClientDocumentGUID;
Result_observation.ParameterGUID := Last(Parameter_Name.ParameterGUID);
Result_observation.DataType := Parameter_Name.DataType;
//Checking for the datatype of the parameter.
/*************************************************************************
Initializing and Populating with Value
*************************************************************************/
//NUMERIC VALUE
IF Parameter_Name.DataType = "NUMERICVALUE" THEN
//CHECKING FOR THE RESULT VALUE EXIST
IF value IS NOT NULL THEN
//creates the new NumericValueType object and populates the fields
// - this is the value being supplied to the observation
Result_observation.ValueObj := NEW NumericValueType;
Result_observation.ValueObj.Value := value AS NUMBER;
ENDIF;
//TEXT VALUE
ELSEIF Parameter_Name.DataType = "FreeTextValue" THEN
//creates the new NumericValueType object and populates the fields
// - this is the value being supplied to the observation
Result_observation.ValueObj := NEW TextValueType;
Result_observation.ValueObj.Value := value AS STRING;
//DATE VALUE
ELSEIF Parameter_Name.DataType = "DATEVALUE" THEN
//creates the new NumericValueType object and populates the fields
// - this is the value being supplied to the observation
//We are setting the value object only when Clear field flag is No or NULL.
If Value IS NOT NULL OR Value <> "" Then
Result_observation.ValueObj := NEW DateValueType;
Endif;
Result_observation.ValueObj.Value := value;
//LIST VALUE
ELSEIF Parameter_Name.DataType = "LISTVALUE" THEN
//Get the Parameter details
listItems := ();
items := 1 seqto ( count Value);
//break;
(This_List_param) := this_parms WHERE this_parms.NAME = (Parameter_Name.name as string);
//Get the LitConfiguration of the parameter
(this_List_Config_list) := This_List_param.ConfigurationObj;
//Get the ListItemConfiguration
(this_List_ListItem) := LAST(this_List_Config_list.Listitemslist);
//Create ValueObj as the ListValue
Result_observation.ValueObj := NEW ListValueType;
//Populate the ValueObj ListGUID from the ListGUID of the ListConfiguration
Result_observation.ValueObj.ListGUID := LAST(this_List_Config_list.ListGUID);
//List item array declaration.
listItems := FIRST OF(this_List_ListItem WHERE (this_List_ListItem.IsSelected = TRUE));
for x in items do
item := Value[x];
//Creating the ListItem
//Populating the ListItem
newItems := (this_List_ListItem WHERE (this_List_ListItem.value = item));
for nitems in newItems
do
NewListItem := NEW ListItemType;
NewListItem.ListItemGUID := nitems.ListItemGUID;
NewListItem.Value := nitems.Value;
NewListItem.IsSelected := TRUE;
//Adding ListItem in the List
listItems := listItems, NewListItem;
//break;
enddo;
/*
//Creating the ListItem
NewListItem2 := NEW ListItemType;
//Populating the ListItem
Item2 := FIRST OF(this_List_ListItem WHERE (this_List_ListItem.value = "S2"));
NewListItem2.ListItemGUID := item2.ListItemGUID;
NewListItem2.Value := item2.Value;
NewListItem2.IsSelected := TRUE;
//Adding ListItem in the List
*/
// listItems := listItems, NewListItem ;
// listItems := listItems, NewListItem2 ;
enddo;
//Attaching the ListItem to the ListValue of the created observation
Result_observation.ValueObj.ListItemsList := listItems AS LIST;
//break;
/*
ELSEIF Parameter_Name.DataType = "LISTSETVALUE" THEN
//Get the Parameter details
listItems := ();
listValues := ();
(This_List_param) := this_parms WHERE this_parms.NAME = (Parameter_Name.name as string);
//Get the LitConfiguration of the parameter
(this_List_Config_list) := This_List_param.ConfigurationObj;
//Get the ListItemConfiguration
(this_List_ListItem) := LAST(this_List_Config_list.Listitemslist);
//Create ValueObj as the ListValue
Result_observation.ValueObj := NEW ListValueType;
//Populate the ValueObj ListGUID from the ListGUID of the ListConfiguration
Result_observation.ValueObj.ListGUID := LAST(this_List_Config_list.ListGUID);
//List item array declaration.
listItems := FIRST OF(this_List_ListItem WHERE (this_List_ListItem.IsSelected = TRUE));
Peds_General_List_Set_Param := This_List_param;
obs := NEW ObservationType;
obs.ClientDocumentGUID := this_documentCommunication.DocumentConfigurationObj.ClientDocumentGUID;
obs.ParameterGUID := Peds_General_List_Set_Param.ParameterGUID;
obs.DataType := Peds_General_List_Set_Param.DataType;
obs.ValueObj := NEW ListSetValueType;
items := 1 seqto ( count Value);
for x in items do
item := Value[x];
//Creating the ListItem
NewListSetItem := NEW ListSetValueType;
//Populating the ListItem
Item := FIRST OF(this_List_ListItem WHERE (this_List_ListItem.value = item));
NewListSetItem.ListItemGUID := item.ListItemGUID;
NewListSetItem.Value := item.Value;
NewListSetItem.IsSelected := TRUE;
//Adding ListItem in the List
listItems := listItems, NewListSetItem;
*/
/* */
/*
For Peds_General in Peds_General_List_Set_Param.ConfigurationObj.ListConfigurationList DO
BREAK;
// On the level of ListConfiguration Object
selectedElement := NEW ListValueType;
selectedElement.ListGuid := Peds_General.ListGuid;
FOR item IN Peds_General.ListItemsList DO
// On the level of ListItemConfiguration Object
IF item.Value = "S1" THEN
this_DocumentCommunication.Message := "2";
this_DocumentCommunication.DisplayMessage := true;
//Create a list item object for the selected list item
selectedItem := NEW ListValueListItemType;
selectedItem.ListItemGUID := item.ListItemGUID;
selectedItem.Value := item.Value;
selectedItem.IsSelected := true;
listItems := (listItems, selectedItem);
ENDIF;
ENDDO; // End of ListItem
selectedElement.ListItemsList:= listItems;
ListValues := (ListValues,selectedElement);
ENDDO;// End of ListValue
// End of General
enddo;
//Attaching the ListItem to the ListValue of the created observation
Result_observation.ValueObj.ListItemsList := listItems ;
//break;
*/
ENDIF ;
/*************************************************************************
Add the new value to the document{{{SINGLE-QUOTE}}}s charted observations
*************************************************************************/
//Structure Note
If IsFlowsheet = FALSE AND IsStructNote = TRUE Then
This_Doc.ChartedObservationsList :=(This_Doc.ChartedObservationsList,
Result_observation);
//Flowsheet.
ElseIf IsFlowsheet = TRUE AND IsStructNote = FALSE Then
This_Doc.CurrentColumn.ChartedObservationsList := ( This_Doc.CurrentColumn.ChartedObservationsList,
Result_observation );
EndIf;
//Conclude true
CONCLUDE TRUE;
;;
action:
RETURN Result_observation ;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,191 @@
maintenance:
title: OBJECT_DIPA MLM ;;
mlmname: UTIL_OBJECT_DIPA_MLM;;
arden: version 2;;
version: 5.00;;
institution: Eclipsys Corporation;;
author: Mohammed Mansoor;;
specialist: ;;
date: 2006-10-17;;
validation: testing;;
library:
purpose:
To create an generic object based on the parameters passed and define , initialize , populate and ADD it.
;;
explanation:
This is a Generic MLM which can use to set value to any parameter on any type of document both Flowsheet and StructureNote.
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
//Input parameters
( this_DocumentCommunication , // Document Communication Object
Parameter_Name , // Parameter for which the value needs to be set or assign
Value) // Value to be assigned.
//Clear_Field) // Are we clearing the field? YES/NO.default "NO" , Specifically for Datevaluetype
:= ARGUMENT;
//Get The Structure Note
(this_Doc) := this_documentCommunication.DocumentConfigurationObj;
//Get the Parameter List
(this_parms) := This_Doc.ParametersList;
//Get the Observation
(this_observations) := This_Doc.ChartedObservationsList;
//Checking for the documnet type
IF this_DocumentCommunication.DocumentType = "Flowsheet" THEN
IsFlowsheet := TRUE;
IsStructNote := FALSE;
ELSEIF this_DocumentCommunication.DocumentType = "StructureNote" THEN
IsFlowsheet := FALSE;
IsStructNote := TRUE;
ENDIF;
/****************************************************************
Defining the all object types
****************************************************************/
//Declare the Observation
ObservationType := OBJECT [ ObservationGUID,
ClientDocumentGUID,
ParameterGUID,
DataType,
ValueObj ];
//Declare the NumericValue
NumericValueType := OBJECT [ Value ];
//Declare the TextValue
TextValueType := OBJECT [ Value ];
//Declare the DateValue
DateValueType := OBJECT [ Value ];
//Decalare the ListValue
ListValueType :=OBJECT [ ListGUID,
ListItemsList,
SuggestedTextValue ];
//Declare the ListItem
ListItemType := OBJECT[ListItemGuid,
Value,
IsSelected];
//FOLLOWING OBJECTS ARE ONLY FOR FLOWSHEET DOCUMENTS.
IF IsFlowsheet = TRUE THEN
//Declare the Listset Value
ListSetValueType := OBJECT [ ListValuesList ];
//Declare the IO Value
IOValueType := OBJECT [ InValue,
OutValue,
DayRunningValue,
BagNumber,
BagInitialVolume
];
//Declare the Generic Drip Value
GenericDripValueType := OBJECT [DoseValue,
RateValue
];
//Declare the Drip Value
DripValueType := OBJECT [ Value,
BagNumber,
BagInitialVolume
];
ENDIF;
;;
evoke: /* Call MLM */
;;
logic:
/*************************************************************************
Creating object of the observation.
*************************************************************************/
Result_observation := NEW ObservationType;
Result_observation.ClientDocumentGUID := This_Doc.ClientDocumentGUID;
Result_observation.ParameterGUID := Last(Parameter_Name.ParameterGUID);
Result_observation.DataType := Parameter_Name.DataType;
//Checking for the datatype of the parameter.
/*************************************************************************
Initializing and Populating with Value
*************************************************************************/
//NUMERIC VALUE
IF Parameter_Name.DataType = "NUMERICVALUE" THEN
//CHECKING FOR THE RESULT VALUE EXIST
IF value IS NOT NULL THEN
//creates the new NumericValueType object and populates the fields
// - this is the value being supplied to the observation
Result_observation.ValueObj := NEW NumericValueType;
Result_observation.ValueObj.Value := value AS NUMBER;
ENDIF;
//TEXT VALUE
ELSEIF Parameter_Name.DataType = "FreeTextValue" THEN
//creates the new NumericValueType object and populates the fields
// - this is the value being supplied to the observation
Result_observation.ValueObj := NEW TextValueType;
Result_observation.ValueObj.Value := value AS STRING;
//DATE VALUE
ELSEIF Parameter_Name.DataType = "DATEVALUE" THEN
//creates the new NumericValueType object and populates the fields
// - this is the value being supplied to the observation
//We are setting the value object only when Clear field flag is No or NULL.
If Value IS NOT NULL OR Value <> "" Then
Result_observation.ValueObj := NEW DateValueType;
Endif;
Result_observation.ValueObj.Value := value;
//LIST VALUE
ELSEIF Parameter_Name.DataType = "LISTVALUE" THEN
//Get the Parameter details
(This_List_param) := this_parms WHERE this_parms.NAME = (Parameter_Name.name as string);
//Get the LitConfiguration of the parameter
(this_List_Config_list) := This_List_param.ConfigurationObj;
//Get the ListItemConfiguration
(this_List_ListItem) := LAST(this_List_Config_list.Listitemslist);
//Create ValueObj as the ListValue
Result_observation.ValueObj := NEW ListValueType;
//Populate the ValueObj ListGUID from the ListGUID of the ListConfiguration
Result_observation.ValueObj.ListGUID := LAST(this_List_Config_list.ListGUID);
//List item array declaration.
listItems := ();
//Creating the ListItem
NewListItem := NEW ListItemType;
//Populating the ListItem
Item := FIRST OF(this_List_ListItem WHERE (this_List_ListItem.value = Value));
NewListItem.ListItemGUID := item.ListItemGUID;
NewListItem.Value := item.Value;
NewListItem.IsSelected := TRUE;
//Adding ListItem in the List
listItems := listItems, NewListItem;
//Attaching the ListItem to the ListValue of the created observation
Result_observation.ValueObj.ListItemsList := listItems AS LIST;
ENDIF ;
/*************************************************************************
Add the new value to the document{{{SINGLE-QUOTE}}}s charted observations
*************************************************************************/
//Structure Note
If IsFlowsheet = FALSE AND IsStructNote = TRUE Then
This_Doc.ChartedObservationsList :=(This_Doc.ChartedObservationsList,
Result_observation);
//Flowsheet.
ElseIf IsFlowsheet = TRUE AND IsStructNote = FALSE Then
This_Doc.CurrentColumn.ChartedObservationsList := ( This_Doc.CurrentColumn.ChartedObservationsList,
Result_observation );
EndIf;
//Conclude true
CONCLUDE TRUE;
;;
action:
RETURN Result_observation ;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,86 @@
maintenance:
title: String Parsing MLM ;;
mlmname: UTIL_STRING_BETWEEN;;
arden: version 2;;
version: 1.00;;
institution: Eclipsys Corporation;;
author: ;;
specialist: ;;
date: 2006-04-07;;
validation: testing;;
library:
purpose:
Takes a string and extract out a sub string between a start and end character.
If there is no end character specified it is assumed to be the same as the start character.
If no start or end character then the single quote is assumed.
If the string contains multiple copies of start and end characters then the final string will be a concatenation of all
these strings.
Returns the sub-string.
;;
explanation:
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
( str,
startChar,
endChar
) := ARGUMENT;
;;
evoke: /* Call MLM */
;;
logic:
if str is NOT NULL then
// Default to single quote if start character is missing
if startChar is NULL then
startChar := "{{{SINGLE-QUOTE}}}"; // single quote
endif;
if endChar is NULL then
endChar := startChar; // Same as start
endif;
characterList := extract characters str;
cnt := count (characterList);
indexList := 1 SEQTO cnt;
newList := ();
saveChar := false;
for X in indexList do
ch := characterList[X];
if ch = endChar AND saveChar = true then
saveChar := false;
ch := "";
endif;
if saveChar then
newList := newList, ch;
endif;
if ch = startChar and saveChar = false then
saveChar := true;
endif;
enddo;
newString := string( newList );
endif;
conclude true;
;;
action:
return newString ;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,75 @@
maintenance:
title: String Parsing MLM ;;
mlmname: UTIL_STRING_PARSE;;
arden: version 2;;
version: 1.00;;
institution: Eclipsys Corporation;;
author: ;;
specialist: ;;
date: 2006-04-07;;
validation: testing;;
library:
purpose:
Takes a string and extract out all substrings delimited by a given character.
Returns a list of sub-strings
;;
explanation:
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
( str,
delimiter
) := ARGUMENT;
;;
evoke: /* Call MLM */
;;
logic:
StringList := ();
if str IS NOT NULL then
if delimiter is NULL then
delimiter := ","; // comma
endif;
characterList := extract characters str;
cnt := count (characterList);
indexList := 1 SEQTO cnt;
newList := ();
newString := null;
for X in indexList do
ch := characterList[X];
if ch = delimiter then
newString := string( newList );
StringList := StringList, newString;
newString := null;
newList := ();
else
newList := newList, ch;
endif;
enddo;
newString := string( newList );
StringList := StringList, newString;
endif;
conclude true;
;;
action:
return StringList ;
;;
Urgency: 50;;
end: