maintenance: title: CLINSUM_STATUS_BOARD_STATUS_TIMES ;; mlmname: CLINSUM_STATUS_BOARD_STATUS_TIMES ;; arden: version 2.5;; version: 1.00;; institution: ;; author: Amanda Kirsopp ;; specialist: Don Warnick ;; date: 2013-06-07;; validation: testing;; library: purpose: Populate a Clinical Summary Tile for ED Status Board Status times. To be used by the MR Coders ;; explanation: Change history 11.28.2012 DW CSR# 31622 Created for Quality Blue requirement 04.02.2014 DW CSR# 32326 Remove TBADM from the Medical Records Clinical Summary Tab 05.03.2018 JML CSR# 36699 Added column "Updated By Provider" to display user who updated status on board. 06.06.2018 DW CSR# 36857 Add PEIP to the Medical Records Clinical Summary Tab (go forward name of TIP) 07.02.2018 DW CSR# 36891 Add credentials to the name of the physician displayed in the tile ;; keywords: ;; knowledge: type: data-driven;; data: (session_id, user_GUID, client_GUID, chart_GUID, visit_GUID, from_date, to_date) := argument; if called_by_editor then client_GUID:= read last{ClientInfo:GUID}; visit_GUID:= read last{ClientVisit:GUID}; chart_GUID:= read last{ClientVisit:ChartGUID}; endif; // Column definition. More column properties may be added. Any changes to the defintion must be reflected in MLM STD_FUNC_CLINSUM_TRANSLATE. colDefinition_def := object [ FieldName, // The name of the field in the data row that contains the column{{{SINGLE-QUOTE}}}s value ColumnHeader, // The text for the column header DisplaySeqNum, // left-to-right sequence number in which to display the column DataType, // The .net type name of the value DisplayFormat, // format string to apply to the column WidthDefaultPixel, // default width of the column, in pixels WidthMinPixel, // Min width of the column, in pixels WidthMaxPixel, // Max width of the column, in pixels IsVisible, // Is the column visible IsSortable // Is the column sortable ]; // Use column definition to define a row. Used by C# code to create the grid rowDefinition_obj:= (new colDefinition_def with "ScheduledDtm", "Time",0, "DateTime", "", 120, 120, 120, true, true ), (new colDefinition_def with "OrderName", "Status", 1, "String", "", 180, 180, 180, true, true ), (new colDefinition_def with "TouchedBy", "Updated By Provider", 2, "String", "", 200, 200, 200, true, true ) ; rowValue_def := OBJECT [ScheduledDtm,OrderName,TouchedBy]; // Populate the row with data. rows_obj :=(); singleRow_obj:= read as rowValue_def { " SET CONCAT_NULL_YIELDS_NULL off select a.touchedwhen, " || " case when a.columnnewvalue = {{{SINGLE-QUOTE}}}tip{{{SINGLE-QUOTE}}} then {{{SINGLE-QUOTE}}}Provider Exam in Progress{{{SINGLE-QUOTE}}} " || " when a.columnnewvalue = {{{SINGLE-QUOTE}}}peip{{{SINGLE-QUOTE}}} then {{{SINGLE-QUOTE}}}Provider Exam in Progress{{{SINGLE-QUOTE}}} " || " when a.columnnewvalue = {{{SINGLE-QUOTE}}}tbaor{{{SINGLE-QUOTE}}} then {{{SINGLE-QUOTE}}}To be Admitted Orders Received{{{SINGLE-QUOTE}}} end " || " , (SELECT u.DisplayName + {{{SINGLE-QUOTE}}} {{{SINGLE-QUOTE}}} + u.occupationcode FROM CV3USER u WHERE u.IDCode = RIGHT( a.TouchedBy, ( LEN(a.TOUCHEDBY) - CHARINDEX({{{SINGLE-QUOTE}}}_{{{SINGLE-QUOTE}}}, a.TouchedBy) ) ) ) " || " from sxaedlocationaudit a (nolock) " || " join cv3location l on l.guid = a.locationguid " || " where a.clientvisitguid = " || sql(visit_GUID) || " and a.columnnewvalue in ({{{SINGLE-QUOTE}}}tip{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}peip{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}tbaor{{{SINGLE-QUOTE}}}) " || " and l.code like {{{SINGLE-QUOTE}}}%|ED %{{{SINGLE-QUOTE}}} order by a.touchedwhen " }; rows_obj := singleRow_obj; // Once the rows have been defined & populated this MLM Function will tranlate the OBJECT(s) // into CDSDataObjects which can be read by the C# code that called this MLM. translator := MLM {{{SINGLE-QUOTE}}}STD_FUNC_CLINSUM_TRANSLATE{{{SINGLE-QUOTE}}}; (rowDefintion_dataObj, rows_dataObj) := call translator with rowDefinition_obj, rows_obj ;; priority: 50 ;; evoke: ;; logic: conclude true; ;; action: return rowDefintion_dataObj, rows_dataObj; ;; Urgency: 50;; end: