maintenance: title: DOC_FUNC_GENERIC_MULTI_SELECT;; mlmname: DOC_FUNC_GENERIC_MULTI_SELECT;; arden: version 5.0;; version: 2.00;; institution: St.Clair Hospital;; author: Janet Nordin;; specialist: Don Warnick;; date: 2016-04-08;; validation: testing;; library: purpose: ;; explanation: This generic MLM will select the checkboxes in an observation when the "All" checkbox is selected. This MLM should be used instead of "DOC_ACS_Reciprocal_Multi_Select" when the observation list utilizes a suggested dictionary. That MLM will place a "null" in the freetextbox. This one will not. Change history 04.08.2016 DW CSR# 33486 - Created for the Post Hospital Care Orders SN but may be used for any SN ;; keywords: generic, multi-select ;; knowledge: type: data-driven;; data: // RS ADD Message box standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; using "ObjectsPlusXA.SCM.Forms"; using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms"; // Recieve arguments from the structured note (thisDocumentCommunication) := argument; // Extract interesting parts of the object model (thisStructuredNoteDoc) := thisDocumentCommunication.DocumentConfigurationObj; (thisParameters) := thisStructuredNoteDoc.ParametersList; (thisObservations) := thisStructuredNoteDoc.ChartedObservationsList; // Create prototypes for the object types we{{{SINGLE-QUOTE}}}ll need to instantiate ObservationType := OBJECT [ObservationGUID, ClientDocumentGUID, ParameterGUID, DataType, ValueObj]; FreeTextValueType := OBJECT [Value]; DateValueType := OBJECT [Value]; ListValueType := OBJECT [ListGuid,ListItemsList, SuggestedTextValue]; ListValueListItemType := OBJECT [ListItemGUID, Value, IsSelected]; // Get the client and visit GUIDs clientGuid := thisDocumentCommunication.ClientGUID; visitGuid := thisDocumentCommunication.ClientVisitGUID; chartGuid := thisDocumentCommunication.ChartGUID; userGuid := thisDocumentCommunication.UserGUID; // Find the Observation Name that was selected this_currentObj := thisdocumentCommunication.CurrentObservationObj; current_parameter := FIRST OF (thisParameters WHERE thisparameters.ParameterGUID = this_CurrentObj.ParameterGUID); selected_observation_name := current_parameter.name ; IF thisdocumentCommunication.EventType = "ChartObservation" then // Determine if the "All" checkbox is set to "true" (since the "All" checkox is reset to false later in the MLM, this means that someone has selected it to trigger the MLM) theParameter := first of (thisparameters where thisparameters.Name = selected_observation_name); theObservation := first of (thisobservations where thisobservations.ParameterGUID = theParameter.ParameterGUID); if true in (theObservation.ValueObj.ListItemsList.IsSelected where theObservation.ValueObj.ListItemsList.Value = "All") then AllWasSelected := "true"; else AllWasSelected := "false"; endif; // If the All checkbox is set to true, then select all checkboxes and de-select the "All" checkbox to initialize it for future selection If AllWasSelected = "true" then this_parametername := first of (thisParameters where thisParameters.Name = selected_observation_name); this_currentObj := NEW ObservationType; this_currentObj.ClientDocumentGUID:= thisStructuredNoteDoc.ClientDocumentGUID; this_currentObj.ParameterGUID := this_parametername.ParameterGUID; this_currentObj.DataType := "ListValue"; this_currentObj.ValueObj := New ListValueType; this_currentObj.ValueObj.ListGUID:= this_parametername.ConfigurationObj.ListGUID; listItems := (); FOR item IN this_parametername.ConfigurationObj.ListItemsList DO selectedItem := NEW ListValueListItemType; selectedItem.ListItemGUID := item.ListItemGUID; selectedItem.Value := item.Value; if selectedItem.Value = "All" then selectedItem.IsSelected := false; else selectedItem.IsSelected := true; endif; listItems := (listItems, selectedItem); ENDDO; this_currentobj.ValueObj.ListItemsList := listItems; thisStructuredNoteDoc.ChartedObservationsList := (thisstructuredNoteDoc.ChartedObservationsList, this_currentObj); endif; endif; // End of Observation Event section ;; evoke: ;; logic: conclude true; ;; action: return thisDocumentCommunication; ;; Urgency: 50;; end: