maintenance: title: FORM_SET_URINARY_CATHETER;; mlmname: FORM_SET_URINARY_CATHETER;; arden: version 2.5;; version: 5.50;; institution: St Clair Hospital;; author: Juliet M. Law, Allscripts ;; specialist: Janet Nordin, Allscripts;; date: 2016-01-26;; validation: testing;; library: purpose: Select / unselect nursing instruction orders based on Medical Necessity value for catheter order. ;; explanation: This MLM is called from the Urinary Catheter OS Change history 2016.01.26 JML CSR# 33953 Created; copied from FORM_SET_MOVIPREP 2016.06.15 STH CSR#: 34700 Force selection of at least 1 Catheter item before exiting this order set. {Go-Live 6/21/2016} ;; keywords: Called MLMs, catheter ;; knowledge: type: data-driven;; data: // Communication object Form object Arden ClientInfo object (this_communication, this_form, client_info_obj) := argument; standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; using "ObjectsPlusXA.SCM.Forms"; using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms"; log_execution_info := FALSE; error_message:=""; // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; client_guid := this_communication.ClientGUID; visit_guid := this_communication.ClientVisitGUID; chart_guid := this_communication.ChartGuid; CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; med_nec_invalid_values_lst := ("Placed by Urology/Urological Surgery", "Hospice/Comfort Care", "Chronic Urinary Catheter"); //Capture appropriate form fields CatheterOrder := first of ( field_list WHERE field_list.DataItemName = "MultiOrderGrid" AND field_list.Control_MultiFieldOccNum = 5); CatheterMedNecessity := first of ( field_list WHERE field_list.DataItemName = "NUR_Catheter Medical Necessity" AND field_list.Control_MultiFieldOccNum = 1); CathNurseInstr_1 := first of ( field_list WHERE field_list.DataItemName = "MultiOrderGrid" AND field_list.Control_MultiFieldOccNum = 6); CathNurseInstr_1_Value := CathNurseInstr_1.Value; CathNurseInstr_2 := first of ( field_list WHERE field_list.DataItemName = "MultiOrderGrid" AND field_list.Control_MultiFieldOccNum = 7); CathNurseInstr_2_Value := CathNurseInstr_2.Value; if ( CallingEvent = "FieldChange" ) then if ( CallingField = "NUR_Catheter Medical Necessity|1" ) then CatheterMedNecessity_Value := CatheterMedNecessity.Value; if ( CatheterMedNecessity_Value IN med_nec_invalid_values_lst ) then CathNurseInstr_1_Value.IsSelected := ( true, false ); CathNurseInstr_2_Value.IsSelected := ( false, false, false ); else CathNurseInstr_1_Value.IsSelected := ( true, true ); CathNurseInstr_2_Value.IsSelected := ( true, true, true ); endif; endif; endif; IF (CallingEvent = "FormClose") then CatheterField := first (field_list where field_list.Label = "Catheter"); tstval := CatheterField.Value.IsSelected; ActiveCathOrder := read first { " declare @ClientGUID HVCIDDT declare @ChartGUID HVCIDDT declare @VisitGUID HVCIDDT set @ClientGUID = " || sql(client_guid) || " set @VisitGUID = " || sql(visit_guid) || " set @ChartGUID = " || sql(chart_guid) || " select name from cv3order where clientguid = @ClientGUID and ChartGUID = @ChartGUID and ClientVisitGUID = @VisitGUID and name IN ({{{SINGLE-QUOTE}}}Catheter: Foley{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Catheter: Indwelling Double Lumen{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Catheter: Indwelling Triple Lumen{{{SINGLE-QUOTE}}}) and orderstatuscode not in ({{{SINGLE-QUOTE}}}CANC{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CAND{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CANP{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DISC{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DISCD{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}HISDP{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}HOLD{{{SINGLE-QUOTE}}}) "}; if((true not in CatheterField.Value.IsSelected) and (ActiveCathOrder is null)) then this_communication.DisplayForm := "yes"; this_communication.Message := "Please choose Catheter"; this_communication.MessageType := "Error"; endif; endif; ;; evoke: // No evoke statement ;; logic: conclude true; ;; action: // This MLM returns two parameters, of types communication_type and form_type respectively. return this_communication, this_form; ;; end: