maintenance: title: Pediatric Profile Admission Order Set;; mlmname: FORM_Set_Pediatric_Profile_Admission;; arden: version 2;; version: 4.50;; institution: St Clair Admissions;; author: Robert Spence, Eclipsys Corp Ext 7461;; specialist: Peggy Karish, Eclipsys Corp ext 7441;; date: 2008-04-10;; validation: testing;; library: purpose: Used for grids that perform all true or no risk ;; explanation: This MLM is called from the Patient Profile- Adult Admission Orders ;; keywords: Called MLMs, Respiratory ORder Set, Adult Admission ;; knowledge: type: data-driven;; data: // This MLM is passed three arguments, of types // communication_type, form_type and client info object respectively. (this_communication, // Communication object this_form, // Form object client_info_obj //Arden ClientInfo object ) := argument; /*******************Make Changes To Spelling And Flags In This Section*******************/ /* Set to true if a decision.log is needed.*/ log_execution_info := FALSE; /***************************************************************************************/ // Initialize error message error_message:=""; // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; If CallingField = "MultiOrderCheckBox|1" then NoRisk := "No Diagnosis Risk Criteria"; OccNumber := 1; Elseif CallingField = "MultiOrderCheckBox|2" then NoRisk := "No Discharge Risk Criteria"; OccNumber := 2; Elseif CallingField = "MultiOrderCheckBox|3" then NoRisk := "No Functional Risk Criteria"; OccNumber :=3; Elseif CallingField = "MultiOrderCheckBox|7" then NoRisk := "No Smoking Risk"; OccNumber := 7; Elseif CallingField = "MultiOrderCheckBox|9" then NoRisk := "No Pediatric Nutritional Risk"; OccNumber := 9; Elseif CallingField = "MultiOrderCheckBox|10" then NoRisk := "No Parent Smoking Risk"; OccNumber := 10; endif; // Now do True and false logic for EVERY grid on this form //Get the multi order grid check box value Grid_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = OccNumber); Grid_list :=Grid_fld.Value; Grid_SelList := Grid_List.IsSelected; Found_NoRisk:= First of (Grid_list where Grid_list.Name = NoRisk ); ListMembs:= count Grid_SelList; AllButNo:= (); FalseList := (); TrueList := (); for k in (1 seqto (ListMembs-1)) do AllButNo:= AllButNo, Grid_SelList[k]; FalseList := FalseList,False; TrueList := TrueList ,True; enddo; OneOfRest := true in AllButNo; If Found_NoRisk.IsSelected = True then Grid_List.IsSelected:= FalseList , True; Grid_List.IsReadOnly:= TrueList , False; endif; If (Found_NoRisk.IsSelected = False) and (OneOfRest = False) then // deselected No Risk Grid_List.IsSelected := FalseList , False; Grid_List.IsReadOnly := FalseList , False; Endif; If (OneOfRest = True) and (Found_NoRisk.IsSelected = False) then Found_NoRisk.IsSelected := False; Found_NoRisk.IsReadOnly := True; endif; ///////////////////////////////////////////////////////////////////////////////////////////////////// // Now for the extras per grid // //////////////////////////////////////////////////////////////////////////////////////////////////// If CallingField = "MultiOrderCheckBox|1" then // Set the Order Set fields, comment and mapped to Dietitian Consult Reason Set_Comment := last of (field_list where field_list.DataItemName = "NUR_ Comment 1 line"); Set_ConReason := last of (field_list where field_list.DataItemName = "NUTR_Consult Reasons"); If Found_NoRisk.IsSelected = True then Set_Comment.Value := ""; Endif; //Get the order set value PrevCon_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox"); PrevCon_Value := PrevCon_Fld.Value; Grid_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = OccNumber); Grid_list :=Grid_fld.Value; Found_NODOrder:= first of (Grid_list where Grid_list.Name = "New Onset Diabetes"); NOD_Selected:= Found_NODOrder.IsSelected; //If they are the same, this grid check box did not change, hence do nothing If PrevCon_Value = NOD_Selected then Tester:="Dont Do anything"; else // Set the fields we are about to change as the New Onset Diabeters Box Changed // First get the entire field components for the MultiOrdercheckBox Consult_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 5); Consult_list :=Consult_fld.Value; // Pull out the Dietitian Data from the MultiOrder Found_DietConOrder:= first of (Consult_list where Consult_list.Name = "Dietitian Consult"); // Peform logic based on the value of the New Order Diabetes If NOD_Selected = True then Found_DietConOrder.IsSelected := True; Found_DietConOrder.IsReadOnly := True; Set_Comment.Value := "By Selecting New Onset Diabetes- an order for a Dietitian Consult (New Onset Diabetes) has automatically been created"; Set_ConReason.Value := "New Onset Diabetes"; else Found_DietConOrder.IsSelected := False; Found_DietConOrder.IsReadOnly := False; Set_Comment.Value := "By Deselecting New Onset Diabetes- the order for Dietitian Consult (New Onset Diabetes) has automatically been removed"; Set_ConReason.Value := ""; endif; // Set set from field to record the new value of New Order Diabetes (can tell if it changes again) PrevCon_Fld.Value:= NOD_Selected; endif; ElseIf CallingField = "MultiOrderCheckBox|7" then SmokeCon_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 5); SmokeCon_list :=SmokeCon_fld.Value; Found_SmokeConOrder:= first of (SmokeCon_list where SmokeCon_list.Name = "Pulmonary Health Education Consult"); ParentSmok_fld :=last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 10); ParentSmok_list :=ParentSmok_fld.Value; ParentSmok_SelList := ParentSmok_list.IsSelected; ParMembs:= count ParentSmok_SelList; ParAllButNo:= (); for k in (1 seqto (ParMembs-1)) do ParAllButNo:= ParAllButNo, ParentSmok_SelList[k]; enddo; ParOneTrue := True in (ParAllButNo); Smoke_Comment := last of (field_list where field_list.DataItemName = "NUR_Comment 3"); Smoke_ConReason1 := last of (field_list where field_list.DataItemName = "RESP Pulmonary Health Education"); Smoke_ConReason2 := last of (field_list where field_list.DataItemName = "RESP Pulmonary Health Consult 2"); Found_UTBOrder:= first of (Grid_list where Grid_list .Name = "Patient Uses Tobacco"); UTB_Selected:= Found_UTBOrder.IsSelected; Found_Less12Order := first of (Grid_list where Grid_list .Name = "Quit tobacco use in the last 12 months"); Less12_Selected := Found_Less12Order.IsSelected; PrevUseToB_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox 2"); PrevUseToB_Value := PrevUseToB_Fld.Value; PrevLess12_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox 3"); PrevLess12_Value:= PrevLess12_Fld.Value; If (Found_NoRisk.IsSelected = True) then If ParOneTrue = False then Smoke_Comment.Value := ""; endif; Smoke_ConReason1.Value := ""; endif; If Less12_Selected = PrevLess12_Value then Robert:="KEWL"; Else If Less12_Selected = True then Found_UTBOrder.IsReadOnly := True; Found_SmokeConOrder.IsSelected := True; Found_SmokeConOrder.IsReadOnly := True; If ParOneTrue =False then Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(Quit Smoking in Last 12 Months) has automatically been created"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(Quit Smoking in Last 12 Months, " || Smoke_ConReason2.Value || ") has automatically been created"; endif; Smoke_ConReason1.Value := "Quit Smoking in Last 12 Months"; Else Found_UTBOrder.IsReadOnly := False; If ParOneTrue =False then Found_SmokeConOrder.IsSelected := False; Found_SmokeConOrder.IsReadOnly := False; Smoke_Comment.Value := "By DeSelecting Smoking Risk Orders- an order for a Pulmonary Health Consult has automatically been removed"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult (" || Smoke_ConReason2.Value || ") has automatically been created"; endif; Smoke_ConReason1.Value := ""; Endif; PrevLess12_Fld.Value:= Less12_Selected; endif; If UTB_Selected = PrevUseToB_Value then Robert := "Still KEWL"; Else If UTB_Selected = True then Found_Less12Order.IsReadOnly := True; Found_SmokeConOrder.IsSelected := True; Found_SmokeConOrder.IsReadOnly := True; If ParOneTrue =False then Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(Smoking Cessation) has automatically been created"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(Smoking Cessation, " || Smoke_ConReason2.Value || ") has automatically been created"; endif; Smoke_ConReason1.Value := "Smoking Cessation"; Else Found_Less12Order.IsReadonly := False; Found_UTBOrder.IsReadOnly := False; If ParOneTrue =False then Found_SmokeConOrder.IsSelected := False; Found_SmokeConOrder.IsReadOnly := False; Smoke_Comment.Value := "By DeSelecting Smoking Risk Orders- an order for a Pulmonary Health Consult has automatically been removed"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult (" || Smoke_ConReason2.Value || ") has automatically been created"; endif; Smoke_ConReason1.Value := ""; Endif; PrevUseToB_Fld.Value := UTB_Selected; endif; ElseIf CallingField = "MultiOrderCheckBox|10" then SmokeCon_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 5); SmokeCon_list :=SmokeCon_fld.Value; Found_SmokeConOrder:= first of (SmokeCon_list where SmokeCon_list.Name = "Pulmonary Health Education Consult"); ParentSmok_fld :=last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 7); ParentSmok_list :=ParentSmok_fld.Value; ParentSmok_SelList := ParentSmok_list.IsSelected; ParMembs:= count ParentSmok_SelList; ParAllButNo:= (); for k in (1 seqto (ParMembs-1)) do ParAllButNo:= ParAllButNo, ParentSmok_SelList[k]; enddo; ParOneTrue := True in (ParAllButNo); Smoke_Comment := last of (field_list where field_list.DataItemName = "NUR_Comment 3"); Smoke_ConReason1 := last of (field_list where field_list.DataItemName = "RESP Pulmonary Health Education"); Smoke_ConReason2 := last of (field_list where field_list.DataItemName = "RESP Pulmonary Health Consult 2"); Found_UTBOrder:= first of (Grid_list where Grid_list .Name = "Parent Uses Tobacco"); UTB_Selected:= Found_UTBOrder.IsSelected; Found_Less12Order := first of (Grid_list where Grid_list .Name = "Parent Quit Tobacco- Last 12 months"); Less12_Selected := Found_Less12Order.IsSelected; PrevUseToB_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox 4"); PrevUseToB_Value := PrevUseToB_Fld.Value; PrevLess12_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox 5"); PrevLess12_Value:= PrevLess12_Fld.Value; If (Found_NoRisk.IsSelected = True) then If ParOneTrue = False then Smoke_Comment.Value := ""; endif; Smoke_ConReason2.Value := ""; endif; If Less12_Selected = PrevLess12_Value then Robert:="KEWL"; Else If Less12_Selected = True then Found_UTBOrder.IsReadOnly := True; Found_SmokeConOrder.IsSelected := True; Found_SmokeConOrder.IsReadOnly := True; If ParOneTrue =False then Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(Parent Quit Tobacco-Last 12 Months) has automatically been created"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(" || Smoke_ConReason1.Value || ", Parent Quit Tobacco-Last 12 Months) has automatically been created"; endif; Smoke_ConReason2.Value := "Parent Quit Tobacco-Last 12 Months"; Else Found_UTBOrder.IsReadOnly := False; If ParOneTrue =False then Found_SmokeConOrder.IsSelected := False; Found_SmokeConOrder.IsReadOnly := False; Smoke_Comment.Value := "By DeSelecting Smoking Risk Orders- an order for a Pulmonary Health Consult has automatically been removed"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult (" || Smoke_ConReason1.Value || ") has automatically been created"; endif; Smoke_ConReason2.Value := ""; Endif; PrevLess12_Fld.Value:= Less12_Selected; endif; If UTB_Selected = PrevUseToB_Value then Robert := "Still KEWL"; Else If UTB_Selected = True then Found_Less12Order.IsReadOnly := True; Found_SmokeConOrder.IsSelected := True; Found_SmokeConOrder.IsReadOnly := True; If ParOneTrue =False then Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(Parent Uses Tobacco) has automatically been created"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult " || "(" || Smoke_ConReason1.Value || ", Parent Uses Tobacco) has automatically been created"; endif; Smoke_ConReason2.Value := "Parent Uses Tobacco"; Else Found_Less12Order.IsReadonly := False; Found_UTBOrder.IsReadOnly := False; If ParOneTrue =False then Found_SmokeConOrder.IsSelected := False; Found_SmokeConOrder.IsReadOnly := False; Smoke_Comment.Value := "By DeSelecting Smoking Risk Orders- an order for a Pulmonary Health Consult has automatically been removed"; else Smoke_Comment.Value := "By Selecting Smoking Risk Order(s)- an order for a Pulmonary Health Consult (" || Smoke_ConReason1.Value || ") has automatically been created"; endif; Smoke_ConReason2.Value := ""; Endif; PrevUseToB_Fld.Value := UTB_Selected; endif; endif; /* this_communication.DisplayForm := "Yes"; this_communication.Message := "One Of Rest Selection is " || OneOfRest|| "\n\n" || "NoRisk Select" || Found_NoRisk.IsSelected || "\n\n" || "NoRisk Value " || Found_NoRisk.Value; this_communication.MessageType := "Informational"; */ ;; 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: