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,140 @@
maintenance:
title: CALLED_DOC_FS_DEFINITION_MLM;;
mlmname: CALLED_DOC_FS_DEFINITION_MLM;;
arden: version 2.5;;
version: 5.50;;
institution: St. Clair Hospital;;
author: Juliet M. Law;;
specialist: ;;
date: 2011-09-22;;
validation: testing;;
library:
purpose: Standardize the document mlm responsible for variable assignment and debugging.
Specific to flowsheets.
;;
explanation:
;;
keywords: RTF, Document Called MLM , list, debug, displayMessageFlag
;;
knowledge:
type: data-driven;;
data:
(this_documentCommunication) := argument;
log_execution_info := false;
(displayMessageFlag) := false;
(client_guid) := this_documentCommunication.ClientGUID;
(client_visit_guid) := this_documentCommunication.ClientVisitGUID;
(chart_guid) := this_documentCommunication.ChartGUID;
(user_guid) := this_documentCommunication.UserGUID;
(document_type) := this_documentCommunication.DocumentType;
(document_name) := this_documentCommunication.DocumentName;
(event_type) := this_documentCommunication.EventType;
(configuration_guid) := this_documentCommunication.ConfigurationGUID;
(this_currentObs) := this_documentCommunication.CurrentObservationObj;
(CancelEventFlag) := this_documentCommunication.CancelEvent;
(this_fs_doc) := this_documentCommunication.DocumentConfigurationObj;
(authored_by_guid) := this_fs_doc.AuthoredByGUID;
(isIOFlowsheetFlag) := this_fs_doc.IsIOFlowsheet;
(client_document_guid) := this_fs_doc.CurrentColumn.ClientDocumentGUID;
(this_parameters) := this_fs_doc.ParametersList;
(this_columnList) := this_fs_doc.ColumnsList;
(this_currentColumn) := this_fs_doc.CurrentColumn;
(this_chartedObservationsList) := this_fs_doc.CurrentColumn.ChartedObservationsList;
(this_parameters_displayName) := this_parameters.DisplayName;
if (event_type = "DocumentClosing") then
current_parameter := first of (this_parameters WHERE
this_parameters.ParameterGUID = this_currentObs.ParameterGUID);
current_parameter_name := current_parameter.Name;
current_parameter_guid := current_parameter.ParameterGUID;
current_parameter_datatype := current_parameter.DataType;
if (current_parameter_datatype IS IN ("FreeTextValue", "NumericValue", "DateValue")) then
current_value := this_currentObs.ValueObj.Value;
elseif (current_parameter_datatype = "ListValue") then
selectedItems := (this_currentObs.ValueObj.ListItemsList
WHERE this_currentObs.ValueObj.ListItemsList.IsSelected = true);
selectedItems_Value := selectedItems.Value;
countOf_selectedItems := count of selectedItems_Value;
current_value := first of selectedItems_Value;
endif;
if (current_parameter_name = "debug_message" AND exists current_value) then
displayMessageFlag := true;
endif;
endif;
diagnostic_message := ("CALLED_DOC_FS_DEFINITION_MLM \n"
|| "\n client guid: " || client_guid
|| "\n client visit guid: " || client_visit_guid
|| "\n chart guid: " || chart_guid
|| "\n user guid: " || user_guid
|| "\n document type: " || document_type
|| "\n document name: " || document_name
|| "\n event type: " || event_type
|| "\n configuration guid: " || configuration_guid
|| "\n current obs: " || this_currentObs
|| "\n cancel event flag: " || CancelEventFlag
|| "\n this flowsheet doc: " || this_fs_doc
|| "\n authored by guid: " || authored_by_guid
|| "\n IO flowsheet flag: " || isIOFlowsheetFlag
|| "\n client document guid: " || client_document_guid
|| "\n current parameter: " || current_parameter
|| "\n current parameter name: " || current_parameter_name
|| "\n current parameter guid: " || current_parameter_guid
|| "\n current parameter datatype: " || current_parameter_datatype
|| "\n current value: " || current_value
|| "\n selected items: " || selectedItems
|| "\n selected items value: " || selectedItems_Value
|| "\n count of selected items value: " || countOf_selectedItems
|| "\n"
);
;;
priority: 50
;;
evoke:
;;
logic:
conclude true;
;;
action:
return (this_documentCommunication,
client_guid,
client_visit_guid,
chart_guid,
user_guid,
document_type,
document_name,
event_type,
configuration_guid,
this_currentObs,
CancelEventFlag,
this_fs_doc,
authored_by_guid,
isIOFlowsheetFlag,
client_document_guid,
this_parameters,
this_columnList,
this_currentColumn,
this_chartedObservationsList,
this_parameters_displayName,
current_parameter,
current_parameter_name,
current_parameter_guid,
current_parameter_datatype,
selectedItems,
selectedItems_Value,
current_value,
diagnostic_message,
displayMessageFlag
);
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,73 @@
maintenance:
title: CALLED_DOC_FS_OBS_VALUE_MLM;;
mlmname: CALLED_DOC_FS_OBS_VALUE_MLM;;
arden: version 2.5;;
version: 5.50;;
institution: St. Clair Hospital;;
author: Juliet M. Law;;
specialist: ;;
date: 2011-09-22;;
validation: testing;;
library:
purpose: Identify the current observation in a flowsheet and return the value.
;;
explanation:
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
(this_documentCommunication, parameter_name, UpdateType) := argument;
// .Net assemblies need to be loaded for ObjectsPlus
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
include standard_libs;
log_execution_info := false;
(this_fs_doc) := this_documentCommunication.DocumentConfigurationObj;
(this_parameters) := this_fs_doc.ParametersList;
(this_columnList) := this_fs_doc.ColumnsList;
(this_currentColumn) := this_fs_doc.CurrentColumn;
(this_currentObs) := this_documentCommunication.CurrentObservationObj;
(this_chartedObservationsList) := this_fs_doc.CurrentColumn.ChartedObservationsList;
if (not exists UpdateType OR UpdateType NOT IN ("Update","Read")) then
UpdateType := "Read";
endif;
if (this_documentCommunication.EventType = "DocumentClosing") then
theParameter := first of (this_parameters WHERE this_parameters.Name = parameter_name);
(theCurrentColumn) := first of (this_columnList
WHERE this_columnList.ClientDocumentGUID = this_currentObs.ClientDocumentGUID);
(theObservation) := first of (theCurrentColumn.ChartedObservationsList
WHERE theCurrentColumn.ChartedObservationsList.ParameterGUID = theParameter.ParameterGUID);
if (exists theParameter AND exists theObservation) then
if (theParameter.DataType = "ListValue") then
selectedValue := (theObservation.ValueObj.ListItemsList.Value
WHERE theObservation.ValueObj.ListItemsList.IsSelected = true);
else
currentValue := theObservation.ValueObj.Value;
endif;
endif;
endif;
;;
priority: 50
;;
evoke:
;;
logic:
conclude true;
;;
action:
return (this_documentCommunication, selectedValue, currentValue);
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,259 @@
maintenance:
title: CALLED_DOM_CCC;;
mlmname: CALLED_DOM_CCC;;
arden: VERSION 2.5;;
version: 7.02;;
institution: Allscripts;;
author: Allscripts;;
specialist: Allscripts;;
date: 2014-09-22;;
validation: TESTING;;
/* P r o p r i e t a r y N o t i c e */
/* Unpublished (c) 2013 - 2014 Allscripts Healthcare, LLC. and/or its affiliates. All Rights Reserved.
*
* P r o p r i e t a r y N o t i c e: This software has been provided pursuant to a License Agreement, with
Allscripts Healthcare, LLC. and/or its affiliates, containing restrictions on its use. This software contains
valuable trade secrets and proprietary information of Allscripts Healthcare, LLC. and/or its affiliates and is
protected by trade secret and copyright law. This software may not be copied or distributed in any form or medium,
disclosed to any third parties, or used in any manner not provided for in said License Agreement except with prior
written authorization from Allscripts Healthcare, LLC. and/or its affiliates. Notice to U.S. Government Users:
This software is "Commercial Computer Software".
All product names are the trademarks or registered trademarks of Allscripts Healthcare, LLC. and/or its affiliates.
*
**/
/* P r o p r i e t a r y N o t i c e */
library:
purpose:
;;
explanation:
/*### SCM Release Version: 6.1, 14.3, 15.1 ###*/
VERSION DATE AUTHOR REVISION
---------------------------------------------------------------------------------------------------------
V6.10 2011-05-01 Initial Inclusion.
V7.00 2014-04-16 SMS Incremented version.
V7.01 2014-04-21 SMS Added IF block to allow charting to FS in addition to SN.
V7.02 2014-09-22 SMS Added IF block to check if .ValueObj EXISTS and if it doesn{{{SINGLE-QUOTE}}}t, create it.
This is a helper MLM that you can use to chart an observation by passing in the required parameters.
;;
keywords: RTF, Document Called MLM , list, multi-select
;;
knowledge:
type: data-driven
;;
data:
(this_documentCommunication, parameter_name, newValue, sugg_txt_value, UpdateType, pListGUID) := ARGUMENT;
/*******************Make Changes To Spelling And Flags In This Section******************/
//*** Variable and Constant Declaration ***//
// Document Types
FLOWSHEET := "Flowsheet";
STRUCTUREDNOTE := "StructuredNote";
(this_structuredNoteDoc) := this_documentCommunication.DocumentConfigurationObj;
(this_parameters) := this_structuredNoteDoc.ParametersList;
(this_chartedObservationsList) := this_structuredNoteDoc.ChartedObservationsList;
IF this_documentCommunication.DocumentType = FLOWSHEET THEN
(this_columnsList) := this_structuredNoteDoc.ColumnsList;
(this_currentColumn) := this_structuredNoteDoc.CurrentColumn;
(this_ClientDocumentGUID) := this_currentColumn.ClientDocumentGUID;
(this_chartedObservationsList) := this_structuredNoteDoc.CurrentColumn.ChartedObservationsList;
ELSEIF this_documentCommunication.DocumentType = STRUCTUREDNOTE THEN
(this_ClientDocumentGUID) := this_structuredNoteDoc.ClientDocumentGUID;
(this_chartedObservationsList) := this_structuredNoteDoc.ChartedObservationsList;
ENDIF;
this_DocumentType := this_documentCommunication.DocumentType;
//if the parameter type is a text and the observation already exist the new data may be a
//Replace of Append to current valueObj.Value
IF NOT EXISTS UpdateType OR UpdateType NOT IN("Append","Replace") THEN
UpdateType := "Replace";
ENDIF;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//*** Data Structures ***//
//The following data structures can be used to create new objects within the MLM itself.
//Not all data structures are represented here, only ones that can be created in the MLM.
// Parameter Types
NUMERICVALUE := "NumericValue";
FREETEXTVALUE := "FreeTextValue";
LISTVALUE := "ListValue";
LISTSETVALUE := "ListSetValue";
DATEVALUE := "DateValue";
IOVALUE := "IOValue";
GENERICDRIPVALUE := "GenericDripValue";
DRIPVALUE := "DripValue";
ObservationType := OBJECT [ObservationGUID, ClientDocumentGUID, ParameterGUID, DataType, ValueObj];
ListValueType := OBJECT [ListGUID, ListItemsList, SuggestedTextValue];
ListValueListItemType := OBJECT [ListItemGUID, Value, IsSelected];
DateValueType := OBJECT [Value];
FreeTextValueType := OBJECT [Value];
NumericValueType := OBJECT [Value];
ListSetValueType := OBJECT [ListValuesList];
//
// This section of code will demonstrate how to write to FreeTextValue, DateValue,NumericValue and ListValue
parameter := FIRST OF (this_Parameters WHERE this_Parameters.Name = parameter_name);
IF EXISTS parameter THEN
//******************************************************************************************************
// Check for existing object
//*******************************************************************************************************
obs := FIRST OF(this_ChartedObservationsList WHERE this_ChartedObservationsList.parameterGUID = parameter.parameterGUID);
IF NOT EXISTS obs THEN
//Create a new Observation for the list
obs := NEW ObservationType;
//obs.ClientDocumentGUID := this_documentCommunication.DocumentConfigurationObj.ClientDocumentGUID; //2014-04-21 SMS
obs.ClientDocumentGUID := this_ClientDocumentGUID;
obs.ParameterGUID := parameter.ParameterGUID;
obs.DataType := parameter.DataType;
ENDIF; //2014-09-22 SMS
IF NOT EXISTS obs.ValueObj THEN //2014-09-22 SMS
// Based on the parameter.DataType create the ValueObj Type and set the valueObj.value for (FREETEXTVALUETYPE,DATEVALUETYPE,NUMERICVALUETYPE)
// If the DataType is LISTVALUE then creat the valueObj of LISTVALUETYPE ABD ASSIGN THE paramter.configurationObj.ListGUID
IF parameter.DataType = FREETEXTVALUE THEN
obs.ValueObj := NEW FreeTextValueType;
ELSEIF parameter.DataType = DATEVALUE THEN
obs.ValueObj := NEW DateValueType;
ELSEIF parameter.DataType = NUMERICVALUE THEN
obs.ValueObj := NEW NumericValueType;
ELSEIF parameter.DataType = LISTVALUE THEN
obs.ValueObj := NEW ListValueType;
obs.ValueObj.ListGUID := parameter.ConfigurationObj.ListGUID;
ELSEIF parameter.DataType = LISTSETVALUE THEN
obs.ValueObj := NEW ListSetValueType;
ENDIF; // if parameter.DataType = FREETEXTVALUE then
//APPEND obs to the ChartedObservationsList
ENDIF;
IF parameter.DataType = FREETEXTVALUE AND UpdateType = "Append" THEN
IF LENGTH OF obs.ValueObj.Value > 0 THEN
obs.ValueObj.Value := obs.ValueObj.Value || "\n" || newValue;
ELSE
obs.ValueObj.Value := newValue;
ENDIF;
//break;
ELSEIF parameter.DataType = FREETEXTVALUE AND UpdateType = "Replace" THEN
IF EXISTS newValue THEN
//break;
obs.ValueObj.Value := newValue;
ELSE
obs.ValueObj := null;
ENDIF;
//break;
ELSEIF parameter.DataType IN(DATEVALUE,NUMERICVALUE) THEN
IF EXISTS newValue THEN // new code added by Stve Abel from Roswell Park
obs.ValueObj.Value := newValue;
//break;
ELSE
obs.ValueObj := null;
ENDIF;
// obs.ValueObj.Value := newValue; This was the code before Steve Abel addition
ELSEIF parameter.DataType = LISTVALUE THEN
//Populate the ListItemsList in the new observation object (obs)
// loop through each item in the parameter.ConfugurationObj.ListItemsList using "item"and append the item to the newly created object ListValueListItemType
//assign the item.listItemGUID to the selectedItem.ListItemGUID, the Item.value to the selectedItem.Value and set the SelectedItem.IsSelected := true
listItems := ();
IF newValue = "" THEN
newValue := NULL;
ENDIF;
IF sugg_txt_value = "" THEN
sugg_txt_value := NULL;
ENDIF;
IF (NOT EXISTS newValue) AND (NOT EXISTS sugg_txt_value) THEN
obs.ValueObj := null;
ELSE
IF EXISTS newValue THEN
FOR k IN 1 SEQTO COUNT OF parameter.ConfigurationObj.ListItemsList DO
item := parameter.ConfigurationObj.ListItemsList[k];
parm := FIRST OF(newValue WHERE newValue.ListValue = item.Value);
IF EXISTS parm THEN
//Create a list item object for the selected list item
selectedItem := NEW ListValueListItemType;
selectedItem.ListItemGUID := item.ListItemGUID;
selectedItem.Value := parm.ListValue;
selectedItem.IsSelected := parm.IsSelected;
// Arden list append statement appending the new object to the listItems object of the ListValueListItemType Object
listItems := (listItems, selectedItem);
// set the obs.valueObj.ListItemsList := listItems list object
Obs.ValueObj.ListItemsList := listItems;
ENDIF;
ENDDO;
ENDIF;
IF EXISTS sugg_txt_value THEN
obs.ValueObj.SuggestedTextValue := sugg_txt_value;
ENDIF;
ENDIF;
ELSEIF parameter.DataType = LISTSETVALUE THEN
newListValue := NEW ListValueType;
newListValue.ListGUID := pListGUID;
k := 0;
listItems := ();
ii := 0;
FOR i IN 1 SEQTO COUNT OF parameter.ConfigurationObj.ListConfigurationList DO
IF parameter.ConfigurationObj.ListConfigurationList[i].ListGUID = pListGUID THEN
ii := i;
ENDIF;
ENDDO;
FOR pItem IN parameter.ConfigurationObj.ListConfigurationList[ii].ListItemsList DO
k := k + 1;
parm := FIRST OF(newValue WHERE newValue.ListValue = pItem.Value);
IF EXISTS parm THEN
newItem := NEW ListValueListItemType;
newItem.ListItemGUID := pItem.ListItemGUID;
newItem.Value := parm.ListValue;
newItem.IsSelected := parm.IsSelected;
listItems := (listItems, newItem);
ENDIF;
ENDDO;
newListValue.ListItemsList := (newListValue.ListItemsList, listItems);
Obs.ValueObj.ListValuesList := (Obs.ValueObj.ListValuesList, newListValue);
IF EXISTS sugg_txt_value THEN
newListValue.SuggestedTextValue := sugg_txt_value;
ENDIF;
ENDIF;
IF EXISTS obs THEN //2014-04-21 SMS
IF this_DocumentType = FLOWSHEET THEN
this_documentCommunication.DocumentConfigurationObj.CurrentColumn.ChartedObservationsList := this_documentCommunication.DocumentConfigurationObj.CurrentColumn.ChartedObservationsList, obs;
ELSEIF this_DocumentType = STRUCTUREDNOTE THEN
this_documentCommunication.DocumentConfigurationObj.ChartedObservationsList := (this_documentCommunication.DocumentConfigurationObj.ChartedObservationsList, obs);
ENDIF;
ENDIF;
ENDIF; //IF EXISTS parameter THEN
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
;;
evoke:
;;
logic:
CONCLUDE TRUE;
;;
action:
RETURN this_documentCommunication;
;;
Urgency: 50
end:

View File

@@ -0,0 +1,288 @@
maintenance:
title: CALLED_LAUNCH_LISTBOX_MULTI_SELECT_ACS;;
mlmname: CALLED_LAUNCH_LISTBOX_MULTI_SELECT_ACS;;
arden: VERSION 2.5;;
version: 7.00;;
institution: Allscripts;;
author: Allscripts;;
specialist: Allscripts;;
date: 2014-03-27;;
validation: TESTING;;
/* P r o p r i e t a r y N o t i c e */
/* Unpublished (c) 2013 - 2014 Allscripts Healthcare, LLC. and/or its affiliates. All Rights Reserved.
*
* P r o p r i e t a r y N o t i c e: This software has been provided pursuant to a License Agreement, with
Allscripts Healthcare, LLC. and/or its affiliates, containing restrictions on its use. This software contains
valuable trade secrets and proprietary information of Allscripts Healthcare, LLC. and/or its affiliates and is
protected by trade secret and copyright law. This software may not be copied or distributed in any form or medium,
disclosed to any third parties, or used in any manner not provided for in said License Agreement except with prior
written authorization from Allscripts Healthcare, LLC. and/or its affiliates. Notice to U.S. Government Users:
This software is "Commercial Computer Software".
All product names are the trademarks or registered trademarks of Allscripts Healthcare, LLC. and/or its affiliates.
*
**/
/* P r o p r i e t a r y N o t i c e */
library:
purpose:
Create a dynamic, multiselect List Window without a dll.
;;
explanation:
DEPENDENCIES:
-------------
.NET 4 +
This MLM takes an Arden List 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 values selected by the user as an Arden List.
;;
keywords:
.NET 4, UDDD, Dynamic
;;
knowledge:
type: data-driven;;
data:
(listItems, SelectionMode, WindowTitle) := ARGUMENT;
if called_by_editor and not exists listItems then
listItems := ("one","two","three","four","five","six","$even","Eight","n!n3");
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 := 40; // Defines how wide the ListBox is
//window.Height := 38; // Defines how tall the ListBox is
window.MinWidth := 200; // Defines how wide the ListBox is
window.MinHeight := 100; // Defines how tall the ListBox is
window.MaxWidth := 600; // Defines how wide the ListBox is
window.MaxHeight := 580; // Defines how tall the ListBox is
window.SizeToContent := "WidthAndHeight";
window.WindowStartupLocation := "CenterScreen";
if(exists(WindowTitle) and WindowTitle <> "")then
window.Title := WindowTitle;
endif;
//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 ListBox
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;
if(SelectionMode = "Multiple")then
ListBox.SelectionMode := "Multiple";
endif;
ListBox.MaxHeight := 375;
//Set Up the Buttons
//OK
ButtonOk := NEW NET_OBJECT {{{SINGLE-QUOTE}}}Button{{{SINGLE-QUOTE}}};
ButtonOk.Content := "OK" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}};
ButtonOk.Margin := 5;
//Cancel
ButtonCancel := NEW NET_OBJECT {{{SINGLE-QUOTE}}}Button{{{SINGLE-QUOTE}}};
ButtonCancel.Content := "Cancel" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}};
ButtonCancel.Margin := 5;
//container
StackPanel_Buttons := NEW NET_OBJECT {{{SINGLE-QUOTE}}}StackPanel{{{SINGLE-QUOTE}}};
StackPanel_Buttons.Orientation := {{{SINGLE-QUOTE}}}Orientation{{{SINGLE-QUOTE}}}.Horizontal;
StackPanel_Buttons.HorizontalAlignment := {{{SINGLE-QUOTE}}}HorizontalAlignment{{{SINGLE-QUOTE}}}.Right;
void := call StackPanel_Buttons.Children.Add with ButtonOk;
void := call StackPanel_Buttons.Children.Add with ButtonCancel;
//create a container
StackPanel := NEW NET_OBJECT {{{SINGLE-QUOTE}}}StackPanel{{{SINGLE-QUOTE}}};
void := call StackPanel.Children.Add with ListBox;
void := call StackPanel.Children.Add with StackPanel_Buttons;
window.Content := StackPanel;
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";
ClickEventArgsType := CALL {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}}.GetType WITH "System.Windows.RoutedEventArgs, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", true, false;
ClickEventHandlerType := CALL {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}}.GetType WITH "System.Windows.RoutedEventHandler, PresentationCore, 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;
ButtonType := CALL ButtonOk.GetType;
StackPanelType := {{{SINGLE-QUOTE}}}System.Windows.Controls.StackPanel{{{SINGLE-QUOTE}}};
ListBoxType := CALL ListBox.GetType;
ItemCollectionType := {{{SINGLE-QUOTE}}}System.Windows.Controls.ItemCollection{{{SINGLE-QUOTE}}};
void := CALL parameters.Add WITH ClickEventArgsType AS {{{SINGLE-QUOTE}}}Type{{{SINGLE-QUOTE}}};
paramArray := CALL parameters.ToArray;
eventHandler := NEW NET_OBJECT {{{SINGLE-QUOTE}}}DynamicMethod{{{SINGLE-QUOTE}}} WITH "Button_Click", {{{SINGLE-QUOTE}}}Void{{{SINGLE-QUOTE}}}, paramArray;
method1 := CALL FrameworkElementType.GetMethod WITH "get_Parent";
method2 := CALL WindowType.GetMethod WITH "Close";
method6Property := CALL ButtonType.GetProperty WITH "Content";
method6 := CALL method6Property.GetSetMethod;
stringValue := "Clicked" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}};
generator := CALL eventHandler.GetILGenerator;
//Change the selected buttons Text, so we can tell which button was clicked
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, ButtonType;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ldstr, stringValue;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Call, method6;
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, ButtonType;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method1;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, StackPanelType;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method1;
void := CALL generator.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, StackPanelType;
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;
buttonEvent := {{{SINGLE-QUOTE}}}Button{{{SINGLE-QUOTE}}}.ClickEvent;
delegate := CALL eventHandler.CreateDelegate WITH ClickEventHandlerType;
void := CALL ButtonOk.AddHandler WITH buttonEvent, delegate;
//close Button
eventHandler2 := NEW NET_OBJECT {{{SINGLE-QUOTE}}}DynamicMethod{{{SINGLE-QUOTE}}} WITH "ButtonClear_Click", {{{SINGLE-QUOTE}}}Void{{{SINGLE-QUOTE}}}, paramArray;
generator2 := CALL eventHandler2.GetILGenerator;
//Change the selected buttons Text, so we can tell which button was clicked
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Nop;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ldarg_0;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, ButtonType;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ldstr, stringValue;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Call, method6;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Nop;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ldarg_0;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, ButtonType;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method1;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, StackPanelType;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method1;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, StackPanelType;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method1;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Castclass, WindowType;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Callvirt, method2;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Nop;
void := CALL generator2.Emit WITH {{{SINGLE-QUOTE}}}OpCodes{{{SINGLE-QUOTE}}}.Ret;
delegate := CALL eventHandler2.CreateDelegate WITH ClickEventHandlerType;
void := CALL ButtonCancel.AddHandler WITH buttonEvent, delegate;
itemList := NEW NET_OBJECT {{{SINGLE-QUOTE}}}List<String>{{{SINGLE-QUOTE}}};
for item in ListItems do
void := CALL itemList.Add WITH item as string;
enddo;
value := ();
IF itemList.Count > 0 THEN
ListBox.ItemsSource := itemList;
try
void := CALL window.ShowDialog;
buttonClicked := "";
if(ButtonCancel.Content = "Clicked")then
buttonClicked := "Cancel";
endif;
if(ButtonOk.Content = "Clicked")then
buttonClicked := "Ok";
endif;
if(buttonClicked = "Ok")then
for i in (1 seqto ListBox.SelectedItems.Count)do
value := (value,ListBox.SelectedItems[i]);
enddo;
endif;
endtry;
catch exception ex
void := CALL {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with ex as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}};
endcatch;
ENDIF;
;;
priority: 50
;;
evoke: //MLM is called not evoked
;;
logic:
CONCLUDE TRUE;
;;
action:
RETURN value AS STRING;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,230 @@
maintenance:
title: Called_RPM_DOM_Get_Definition_MLM ;;
mlmname: Called_RPM_DOM_Get_Definition_MLM ;;
arden: version 2.5;;
version: 5.20;;
institution: RPM, Sample Document Called MLM;;
author: Rick Mansour ;;
specialist: ;;
date: 2010-11-08;;
validation: testing;;
library:
purpose: Standardize the document mlm responsible for variable assignment and debugging.
The 5.2 version adds in the CoSigner1, CoSigner2 and the DocumentTopic
;;
explanation:
;;
keywords: RTF, Document Called MLM , list, debug, displayMessageFlag,
;;
knowledge:
type: data-driven;;
data:
(this_documentCommunication) := argument;
/*******************Make Changes To Spelling And Flags In This Section******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := false;
/***************************************************************************************/
// This disarticulation of the this_DocumentCommunication is needed for most document mlms
//*** Variable and Constant Declaration ***//
(displayMessageFlag) := FALSE ;
(client_guid) := this_documentCommunication.ClientGUID;
(client_visit_guid) := this_documentCommunication.ClientVisitGUID;
(client_chart_guid) := this_documentCommunication.ChartGUID;
(user_guid) := this_documentCommunication.UserGUID;
(document_type) := this_documentCommunication.DocumentType;
(document_name) := this_documentCommunication.DocumentName;
(event_type) := this_documentCommunication.EventType;
(configuration_guid) := this_documentCommunication.ConfigurationGUID ;
(this_currentObj) := this_documentCommunication.CurrentObservationObj;
(CancelEventFlag) := this_documentCommunication.CancelEvent;
(this_structuredNoteDoc) := this_documentCommunication.DocumentConfigurationObj;
(authored_date_time) := this_structuredNoteDoc.AuthoredDateTime;
(authored_by_guid) := this_structuredNoteDoc.AuthoredByGuid;
(client_document_guid) := this_structuredNoteDoc.ClientDocumentGUID;
(document_date_time) := this_structuredNoteDoc.DateTime;
(isNewFlag) := this_structuredNoteDoc.IsNew;
(isIncompleteFlag) := this_structuredNoteDoc.IsIncomplete;
(isResultsPendingFlag) := this_structuredNoteDoc.IsResultsPending;
(isPriorityFlag) := this_structuredNoteDoc.IsPriority;
(this_parameters) := this_structuredNoteDoc.ParametersList;
(this_chartedObservationsList) := this_structuredNoteDoc.ChartedObservationsList;
(CoSigner1) := this_structuredNoteDoc.CoSigner1; // (Read Only)
(CoSigner2) := this_structuredNoteDoc.CoSigner2; // (Read Only)
(DocumentTopic) := this_structuredNoteDoc.DocumentTopic; // (Read/Write)
(this_parameters_display_name) := this_parameters.DisplayName;
// The "ChartObservation" EventType is associated with the charted information
// and the parameter_name. This code dissects the information.
IF event_type = "ChartObservation" THEN
// could be "DocumentOpening", "ChartObservation", OR "DocumentClosing"
current_parameter := FIRST OF (this_Parameters
WHERE this_parameters.ParameterGUID = this_CurrentObj.ParameterGUID);
current_parameter_name := current_parameter.name;
current_parameter_guid := current_parameter.ParameterGuid;
current_parameter_DataType := current_parameter.DataType;
IF current_parameter_DataType IS IN("FreeTextValue","NumericValue","DateValue") THEN
current_value := this_currentObj.ValueObj.value;
ELSEIF current_parameter_DataType = "ListValue" THEN
selectedItems := (this_currentObj.ValueObj.ListItemsList
WHERE this_currentObj.ValueObj.ListItemsList.IsSelected =
true);
selectedItems_value := selectedItems.value;
countOf_selectedItems := count of selectedItems_value;
current_value := FIRST OF selectedItems_value;
ENDIF;
// This code looks for a specific charted observation used for debugging
// By setting the displayMessageFlag := True the entire contents of the
// document will show up as a message
if current_parameter_name = "debug_message" and exist current_value then
displayMessageFlag := TRUE;
endif;
ENDIF;
// A structured note has parameters that are assinged to the mlm function and some
// are charted. This code loops through all of the mlm assigned parameters and
// creates a list of those which have charted values and those without charted values.
// This will help detect parameter name spelling errors in the mlm
// The message will show when the displayMessageFlag = TRUE
param_info_charted:=""; param_info_empty:="";
ictr_charted:=0; ictr_empty := 0 ;
obs_value:="";
obs_value_list:=();
this_Parameters_Sorted := sort(this_Parameters.name);
for param_Obj_Name IN this_Parameters_Sorted DO
param_Obj := first of (this_Parameters
WHERE this_Parameters.name = param_Obj_Name);
param_Obs_Obj := first of (this_ChartedObservationsList
WHERE this_ChartedObservationsList.ParameterGUID = param_Obj.ParameterGUID);
if exist param_Obs_Obj then
if param_Obj.DataType = "ListValue" then
obs_value_list := param_Obs_Obj.valueObj.ListItemsList.value
WHERE param_Obs_Obj.valueObj.ListItemsList.IsSelected = TRUE ;
if NOT EXIST obs_value_list then obs_value := "not charted";
else obs_value := obs_value_list;
endif;
else
obs_value := param_Obs_Obj.valueObj.value ;
endif;
else
obs_value := "not charted" ;
endif;//if exist param_Obs_Obj then
if obs_value = "not charted" then
ictr_empty := ictr_empty + 1;
param_info_empty := param_info_empty || ictr_empty || ". " || param_Obj.Name
|| " " || param_Obj.DataType || "\n";
param_info_empty := param_info_empty || ictr_empty || "a. "
|| param_Obj.DisplayName || " " || obs_value || "\n\n";
else
ictr_charted := ictr_charted + 1;
param_info_charted := param_info_charted || ictr_charted || ". "
|| param_Obj.Name || " " || param_Obj.DataType || "\n";
param_info_charted := param_info_charted || ictr_charted || "a. "
|| param_Obj.DisplayName || " " || obs_value || "\n\n";
endif;
enddo;
diagnosticMessage:= ("Called_RPM_DOM_GetDefinition_MLM \n"
|| "\n client_guid: " || client_guid
|| "\n client_visit_guid: " || client_Visit_guid
|| "\n client_chart_guid: " || client_chart_guid
|| "\n user_guid: " || user_guid //
|| "\n document_type: " || document_type //
|| "\n document_name: " || document_name
|| "\n event_type: " || event_type
|| "\n configuration_guid: " || configuration_guid
|| "\n this_currentObj: " || this_currentObj
|| "\n this_CancelEvent: " || CancelEventFlag
|| "\n this_structuredNoteDoc: " || this_structuredNoteDoc
|| "\n authored_date_time: " || authored_date_time
|| "\n authored_by_guid: " || authored_by_guid
|| "\n client_document_guid: " || client_document_guid
|| "\n document_date_time: " || document_date_time
|| "\n isNewFlag: " || isNewFlag
|| "\n isIncompleteFlag: " || isIncompleteFlag
|| "\n isResultsPendingFlag: " || isResultsPendingFlag
|| "\n isPriorityFlag: " || isPriorityFlag
|| "\n current_parameter: " || current_parameter
|| "\n current_parameter_name: " || current_parameter_name
|| "\n current_parameter_guid: " || current_parameter_guid
|| "\n current_parameter_DataType: " || current_parameter_DataType
|| "\n current_value: " || current_value
|| "\n selectedItems: " || selectedItems
|| "\n selectedItems_value: " || selectedItems_value
|| "\n countOf_selectedItems: " || countOf_selectedItems
|| "\n current_value: " || current_value
// || "\n this_Parameters.name: " || this_Parameters_Sorted
|| "\n"
|| "\n The information below returns all of the "
|| "\n parameters assigned to document mlm function "
|| "\n in the structured note editor."
|| "\n The this_ChartedObservationsList return is limited to "
|| "\n the parameter assigned in the Structured Note editor "
|| "\n"
|| "\n Parameter Information CHARTED: \n\n" || param_info_charted
|| "\n"
|| "\n Parameter Information NOT CHARTED: \n\n" || param_info_empty
);
// this_documentCommunication.DisplayMessage := FALSE ;
// this_documentCommunication.Message :=
// "Called_RPM_DOM_GetDefinition_MLM \n" || diagnosticMessage ;
;;
evoke:
;;
logic:
conclude true;
;;
action:
// All of these variable are returned to the
// calling mlm including the diagnosticMessage used for debuging.
return (this_documentCommunication,
client_guid,
client_visit_guid,
client_chart_guid,
user_guid,
document_type,
document_name,
event_type,
configuration_guid,
this_currentObj,
CancelEventFlag,
this_structuredNoteDoc,
authored_date_time,
authored_by_guid,
client_document_guid,
document_date_time,
isNewFlag,
isIncompleteFlag,
isResultsPendingFlag,
isPriorityFlag,
this_parameters,
this_chartedObservationsList,
this_parameters_display_name,
current_parameter,
current_parameter_name,
current_parameter_guid,
current_parameter_DataType,
selectedItems,
selectedItems_value,
current_value,
diagnosticMessage,
displayMessageFlag,
CoSigner1,
CoSigner2,
DocumentTopic) ;
;;
Urgency: 50;;
end:

View File

@@ -0,0 +1,165 @@
maintenance:
title: CALLED_RPM_DOM_MLM ;;
mlmname: CALLED_RPM_DOM_MLM ;;
arden: version 2.5;;
version: 6.00;;
institution: RPM, Sample Document Called MLM;;
author: Rick Mansour with addition from Steve Abel;;
specialist: ;;
date: 2010-11-03;;
validation: testing;;
library:
purpose: Demonstrate the ability to identify the current Observation in a structured
document and instantiate the parameter.
;;
explanation: This is your basic starter mlms for all standard document mlms.
;;
keywords: RTF, Document Called MLM , list, multi-select
;;
knowledge:
type: data-driven;;
data:
(this_documentCommunication,
parameter_name,newValue,
sugg_txt_value,UpdateType) := argument;
/*******************Make Changes To Spelling And Flags In This Section******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := false;
/* Create variable for tab*/
// TAB := 9 formatted with "%c" ;
/***************************************************************************************/
//*** Variable and Constant Declaration ***//
(this_structuredNoteDoc) := this_documentCommunication.DocumentConfigurationObj;
(this_parameters) := this_structuredNoteDoc.ParametersList;
(this_chartedObservationsList) := this_structuredNoteDoc.ChartedObservationsList;
// if the parameter type is a text and the observation already exist the new data may be a
// Replace of Append to current valueObj.Value
if not exists UpdateType OR UpdateType NOT IN("Append","Replace") then
UpdateType := "Replace";
endif;
/////////////////////////////////////////////////////////////////////////////////////////////////
//*** Data Structures ***//
//The following data structures can be used to create new objects within the MLM itself.
//Not all data structures are represented here, only ones that can be created in the MLM.
// Parameter Types
NUMERICVALUE := "NumericValue";
FREETEXTVALUE := "FreeTextValue";
LISTVALUE := "ListValue";
LISTSETVALUE := "ListSetValue";
DATEVALUE := "DateValue";
IOVALUE := "IOValue" ;
GENERICDRIPVALUE := "GenericDripValue" ;
DRIPVALUE := "DripValue" ;
ObservationType := OBJECT [ObservationGUID, ClientDocumentGUID,
ParameterGUID, DataType, ValueObj];
ListValueType := OBJECT [ListGUID,ListItemsList, SuggestedTextValue];
ListValueListItemType := OBJECT [ListItemGUID, Value, IsSelected];
DateValueType := OBJECT [Value];
FreeTextValueType := OBJECT [Value];
NumericValueType := OBJECT [Value];
//
// This section of code will demonstrate how to write to FreeTextValue, DateValue,NumericValue
// and ListValue
parameter := FIRST OF (this_Parameters WHERE this_Parameters.Name = parameter_name );
IF EXISTS parameter THEN
//***************************************************************************************
// Check for existing object
//***************************************************************************************
obs := first of(this_ChartedObservationsList
WHERE this_ChartedObservationsList.parameterGUID = parameter.parameterGUID) ;
if not exist obs then
//Create a new Observation for the list
obs := NEW ObservationType;
obs.ClientDocumentGUID :=
this_documentCommunication.DocumentConfigurationObj.ClientDocumentGUID;
obs.ParameterGUID := parameter.ParameterGUID;
obs.DataType := parameter.DataType;
// Based on the parameter.DataType create the ValueObj Type and set the
// valueObj.value for (FREETEXTVALUETYPE,DATEVALUETYPE,NUMERICVALUETYPE)
// If the DataType is LISTVALUE then creat the valueObj of LISTVALUETYPE
// ABD ASSIGN THE paramter.configurationObj.ListGUID
if parameter.DataType = FREETEXTVALUE then
obs.ValueObj := NEW FreeTextValueType ;
elseif parameter.DataType = DATEVALUE then
obs.ValueObj := NEW DateValueType ;
elseif parameter.DataType = NUMERICVALUE then
obs.ValueObj := NEW NumericValueType ;
elseif parameter.DataType = LISTVALUE then
obs.ValueObj := NEW ListValueType;
obs.ValueObj.ListGUID := parameter.ConfigurationObj.ListGUID;
endif; // if parameter.DataType = FREETEXTVALUE then
// APPEND obs to the ChartedObservationsList
this_documentCommunication.DocumentConfigurationObj.ChartedObservationsList
:= (this_documentCommunication.DocumentConfigurationObj.ChartedObservationsList,
obs);
endif;
if parameter.DataType = FREETEXTVALUE AND UpdateType = "Append" then
if length of obs.ValueObj.Value > 0 then
obs.ValueObj.Value := obs.ValueObj.Value || "\n" || newValue ;
else
obs.ValueObj.Value := newValue ;
endif;
elseif parameter.DataType = FREETEXTVALUE AND UpdateType = "Replace" then
obs.ValueObj.Value := newValue ;
elseif parameter.DataType IN(DATEVALUE,NUMERICVALUE) then
if exists newValue then // new code added by Stve Abel from Roswell Park
obs.ValueObj.Value := newValue ;
else
obs.ValueObj := null;
endif;
// obs.ValueObj.Value := newValue; This was the code before Steve Abel addition
elseif parameter.DataType = LISTVALUE then
//Populate the ListItemsList in the new observation object (obs)
// loop through each item in the parameter.ConfugurationObj.ListItemsList using
// "item"and append the item to the newly created object ListValueListItemType
// assign the item.listItemGUID to the selectedItem.ListItemGUID, the Item.value
// to the selectedItem.Value and set the SelectedItem.IsSelected := true
listItems := ();
FOR item IN parameter.ConfigurationObj.ListItemsList DO
IF item.Value IN newValue THEN
//Create a list item object for the selected list item
selectedItem := NEW ListValueListItemType;
selectedItem.ListItemGUID := item.ListItemGUID;
selectedItem.Value := item.Value;
selectedItem.IsSelected := true;
// Arden list append statement appending the new object to the listItems
// object of the ListValueListItemType Object
listItems := (listItems, selectedItem);
ENDIF;
// set the obs.valueObj.ListItemsList := listItems list object
Obs.ValueObj.ListItemsList := listItems;
if exists sugg_txt_value then
obs.ValueObj.SuggestedTextValue := sugg_txt_value ;
endif ;
ENDDO;
endif; //if parameter.DataType = LISTVALUE then
ENDIF; //IF EXISTS parameter THEN
/////////////////////////////////////////////////////////////////////////////////////////////////
;;
evoke:
;;
logic:
conclude true;
;;
action:
return this_documentCommunication;
;;
Urgency: 50;;
end: