maintenance: title: DOC_FUNC_IV_HALDOL_STATUSBOARD;; mlmname: DOC_FUNC_IV_HALDOL_STATUSBOARD;; arden: version 2.5;; version: 5.50;; institution: Allscripts;; author: Shawn T. Head ;; specialist: Dean M;; date: 2016-04-28;; validation: testing;; library: purpose: Update statusboard IV Haldol dosage to remove red flag once ryhthem strip is documented on flowsheet. ;; explanation: 4.29.2016 STH CSR#: 33207 - When the user charts the observation "Rhythm" on the Adult Assessment A/I Flowsheet and there is currently a value in the IV Haldol column on the status board with an * at the end This MLM will update the column to remove the * and replace it with CRLF so the red flag clears off status board. NOTE: There are 2 other MLM{{{SINGLE-QUOTE}}}s that are used in conjuction with this MLM to create the haldol column on charting of IV haldol. SCH_CHARTED_HALDOL_24HRS & DOC_ADULT_ASSESSMENT_CLOSE {Go-Live 6/1/2016} 12.8.2016 STH CSR#: 335130 - Update for issues identified when testing for 16.3 Needed to change the search to look for the current value by searching for the enterprise defined column by name not by the column number. ;; keywords: IV Haldol, alert, flowsheet ;; knowledge: type: data-driven;; data: (this_documentCommunication) := argument; // RS ADD Message box standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; //Called MLMs to set up the CDS and return obs values set_cds_vars := MLM {{{SINGLE-QUOTE}}}CALLED_DOC_FS_DEFINITION_MLM{{{SINGLE-QUOTE}}}; read_obs_value := MLM {{{SINGLE-QUOTE}}}CALLED_DOC_FS_OBS_VALUE_MLM{{{SINGLE-QUOTE}}}; //create_ED_column := MLM {{{SINGLE-QUOTE}}}SCH_FUNC_CREATE_ENTERPRISE_DEFINED_COLUMN{{{SINGLE-QUOTE}}}; /**************Make Changes To Spelling And Flags In This Section**************/ //Set up variables; initialize braden_param := "Rhythm"; msg := ""; mlm_name := "DOC_FUNC_IV_HALDOL_STATUSBOARD"; //Set constants indicating document type and event FLOWSHEET := "Flowsheet"; CHARTOBSERVATION := "ChartObservation"; DOCUMENTCLOSING := "DocumentClosing"; /******************************************************************************/ updatecol := false; CR := 13 formatted with "%c"; LF := 10 formatted with "%c"; TS := 9 formatted with "%c"; CRLF:= CR||LF; //Initialize DocumentCommunication objects (this_documentCommunication, clientGUID, CVGUID, chartGUID, 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) := call set_cds_vars WITH (this_documentCommunication); //Retrieve DocumentType (StructuredNote or Flowsheet) and EventType this_DocumentType := this_documentCommunication.DocumentType; this_EventType := this_documentCommunication.EventType; try client_visit_obj := call {{{SINGLE-QUOTE}}}ClientVisit{{{SINGLE-QUOTE}}}.FindByPrimaryKey with ((CVGUID as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}}) ; EntDefinedColumn_obj := call {{{SINGLE-QUOTE}}}EnterpriseDefinedColumn{{{SINGLE-QUOTE}}}.FindByName with ( client_visit_obj, "Haldol Total"); endtry; catch Exception ex error_occurred := true; error_message := "{{+R}}Common Data:{{-R}}\n" || ex.Message || "\n\n"; if ( client_visit_obj is NOT NULL ) then void:= call client_visit_obj.Dispose; client_visit_obj:= null; endif; if ( EntDefinedColumn_obj is NOT NULL) then void := call EntDefinedColumn_obj.Dispose; EntDefinedColumn_obj := null; endif; endcatch; current_value := EntDefinedColumn_obj.Value; /*read last { " select EnterpriseVisitCol37 from CV3EnterpriseVisitData where clientguid = " || sql(ClientGUID) || " and visitguid = " || sql(CVGUID) }; */ IV_Haldol_Alert_on_statusboard := current_value matches pattern "%*%"; //Process logic on Flowsheets when the document is closing if (IV_Haldol_Alert_on_statusboard and this_DocumentType = FLOWSHEET AND this_EventType = DOCUMENTCLOSING) then //Retrieve Braden Score parameter theParameter := first of (this_parameters WHERE this_parameters.Name = braden_param); if (exists theParameter) then //Retrieve DateTime from current charted column updatecol := true; finda := FIND "*" IN STRING current_value; newvalue := SUBSTRING (finda-1) CHARACTERS FROM current_value; newvalue := newvalue || TS; endif; endif; ;; priority: 50 ;; evoke: ;; logic: if (updatecol=true) then try /* EntDefinedColumn_obj := call {{{SINGLE-QUOTE}}}EnterpriseDefinedColumn{{{SINGLE-QUOTE}}}.FindByName with ( client_visit_obj, "Haldol Total"); */ EntDefinedColumn_obj.Value := newvalue; void := call EntDefinedColumn_obj.Save; void := call EntDefinedColumn_obj.Dispose; EntDefinedColumn_obj := null; endtry; catch Exception ex error_occurred := true; error_message := error_message || "{{+R}}Enterprise Patient List Column{{-R}}\n" || ex.message || "\n\n"; if ex.InnerException is not null net_object then error_message := error_message || "Inner Exception: " || ex.InnerException.Message || "\n\n"; endif; if (EntDefinedColumn_obj is not null) then void := call EntDefinedColumn_obj.Dispose; EntDefinedColumn_obj := null; endif; EDColumn_Dest := null; endcatch; if ( client_visit_obj is not null ) then void := call client_visit_obj.Dispose; client_visit_obj := null; endif; endif; conclude true; ;; action: return this_documentCommunication; ;; Urgency: 50;; end: