maintenance: title: Translation MLM required by the ClinSum Tile MLMs;; mlmname: STD_FUNC_CLINSUM_TRANSLATE;; arden: version 2.5;; version: 18.4;; institution: Allscripts, Standard ClinSum MLMs;; author: Allscripts Healthcare Solutions, Inc.;; specialist: ;; date: 2018-10-26;; validation: testing;; /* P r o p r i e t a r y N o t i c e */ /* Unpublished (c) 2013 - 2018 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 {{{SINGLE-QUOTE}}}Commercial Computer Software{{{SINGLE-QUOTE}}}. 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: This MLM is called by all Clinical Summary MLMs that are used by the Tiles functionality to convert row definitions and values that were created by the parent CLINSUM_ mlm into data structures which can be process by the calling code. ;; explanation: You are required to load this MLM first before attempting to run any sample or custom CLINSUM tile MLMs. Do not make any changes to this MLM unless authorized by Allscripts. ;; keywords: Clinical Summary Tiles ;; knowledge: type: data-driven;; data: (rowDefinition_obj, rows_obj) := argument; log_execution_info := false; standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; using "SCM.CDS.Core"; using namespace "CDS"; using namespace "CDSData"; ;; priority: 50 ;; evoke: ;; logic: // For the MLM Editor if rowDefinition_obj is NULL OR rows_obj is NULL then conclude false; endif; // Define the schema of CDSDataObject that will contain the row definition. // NOTE: This schema must match the fields defined in the parent MLM. colDefinition := new net_object {{{SINGLE-QUOTE}}}DataObjectDefinition{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "FieldName", "CDSString" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "ColumnHeader", "CDSString" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "DisplaySeqNum", "CDSInteger" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "DataType", "CDSString" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "DisplayFormat", "CDSString" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "WidthDefaultPixel", "CDSInteger" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "WidthMinPixel", "CDSInteger" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "WidthMaxPixel", "CDSInteger" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "IsVisible", "CDSInteger" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call colDefinition.AddColumn with "IsSortable", "CDSInteger" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; x := call {{{SINGLE-QUOTE}}}CDSDataObject{{{SINGLE-QUOTE}}}.DeclareObjectSchema with "ColDefinitionType", colDefinition; rowdefinition_dataobj := call {{{SINGLE-QUOTE}}}CDSDataObject{{{SINGLE-QUOTE}}}.CreateObject with "ColDefinitionType"; // Populate the row definition data object from the Arden object colCounter := 1 seqto (count rowDefinition_obj); for CC in colCounter do x := call rowdefinition_dataobj.AppendEmptyRow; x := call rowdefinition_dataobj.SetString with "FieldName", rowDefinition_obj[cc].FieldName as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetString with "ColumnHeader", rowDefinition_obj[cc].ColumnHeader as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetDouble with "DisplaySeqNum", rowDefinition_obj[cc].DisplaySeqNum as {{{SINGLE-QUOTE}}}Int32{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetString with "DataType", rowDefinition_obj[cc].DataType as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetString with "DisplayFormat", rowDefinition_obj[cc].DisplayFormat as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetDouble with "WidthDefaultPixel", rowDefinition_obj[cc].WidthDefaultPixel as {{{SINGLE-QUOTE}}}Int32{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetDouble with "WidthMinPixel", rowDefinition_obj[cc].WidthMinPixel as {{{SINGLE-QUOTE}}}Double{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetDouble with "WidthMaxPixel", rowDefinition_obj[cc].WidthMaxPixel as {{{SINGLE-QUOTE}}}Double{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetBoolean with "IsVisible", rowDefinition_obj[cc].IsVisible as {{{SINGLE-QUOTE}}}Boolean{{{SINGLE-QUOTE}}}; x := call rowdefinition_dataobj.SetBoolean with "IsSortable", rowDefinition_obj[cc].IsSortable as {{{SINGLE-QUOTE}}}Boolean{{{SINGLE-QUOTE}}}; enddo; // Create a row definition schema based on the parent definition rowDefinition := new net_object {{{SINGLE-QUOTE}}}DataObjectDefinition{{{SINGLE-QUOTE}}}; for CC in colCounter do x := call rowDefinition.AddColumn with rowDefinition_obj[cc].FieldName as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}, "CDSString" as {{{SINGLE-QUOTE}}}CDSType{{{SINGLE-QUOTE}}}; enddo; x := call {{{SINGLE-QUOTE}}}CDSDataObject{{{SINGLE-QUOTE}}}.DeclareObjectSchema with "RowDefinitionType", rowDefinition; rows_dataobj := call {{{SINGLE-QUOTE}}}CDSDataObject{{{SINGLE-QUOTE}}}.CreateObject with "RowDefinitionType"; // Take the data in the arden Object and populate the CDSDataObject rowCounter := 1 seqto (count rows_obj); for rr in rowCounter do x := call rows_dataobj.AppendEmptyRow; for cc in colCounter do columnName := rowDefinition_obj[cc].FieldName as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; if rowDefinition_obj[cc].DataType = "DateTime" then columnValue := (attribute rowDefinition_obj[cc].FieldName from rows_obj[rr]) as {{{SINGLE-QUOTE}}}DateTime{{{SINGLE-QUOTE}}}; x := call rows_dataobj.SetDate with ColumnName, ColumnValue; else // Can default string for all other types since it can be cast easily columnValue := (attribute rowDefinition_obj[cc].FieldName from rows_obj[rr]) as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; x := call rows_dataobj.SetString with ColumnName, ColumnValue; endif; enddo; enddo; // Reset to the start of the collection rowdefinition_dataobj.ActiveRowPosition := 1; rows_dataobj.ActiveRowPosition := 1; conclude true; ;; action: return rowdefinition_dataobj, rows_dataobj; ;; Urgency: 50;; end: