maintenance: title: SCIP Surgical Antibiotic Prophylaxis Orders;; mlmname: FORM_Set_SCIP;; arden: version 2.5;; version: 5.50;; institution: St Clair Hospital;; author: Teresa Spicuzza, Allscripts ;; specialist: Teresa Spicuzza, Allscripts;; date: 2011-04-01;; validation: testing;; library: purpose: Used for Surgical Antibiotic Prophylaxis Weight Based Dosing ;; explanation: This MLM is called from Surgical Antibiotic Prophylaxis Order Set Change history 03.12.2013 TMS Created for SCIP Antibiotic Orders in order sets 04.08.2013 TMS Moved to production as part of the Mini-Syringe to Mini-Bag project to reduce item changes needing completed in order sets and to standarize the look of SCIP orders in the post op order sets. CSR 31359 06.02.2013 TMS Added SCIP Antibiotics: Pre-op Open Heart Surgery to same MRSA routine used by SCIP Antibiotics: Open Heart Surgery CSR 32467 08.17.2016 TMS Added Penicillin/Cephalosporin allergy guidelines to all SCIP Order Sets CSR 34749 07.06.2017 TMS Updated to reflect changes to SCIP Antibiotics for heart procedures to use the higher dose of Cefazolin 2 gm < 120 kg and 3 gm for 120 kg or greater. CSR 35793 09.28.2017 TMS CSR #35222 Upadated MLM for allergy info message for Cefoxitin. 09.05.2018 TMS CSR #37176, 37177, 37178, 37062 Added query for Updated Ortho to populate info box with new Cefazolin Dosing for Ortho order sets updated for review. 11.20.2018 TMS CSR{{{SINGLE-QUOTE}}}s 37583 (Abdominoplasty Post Op), 37556 (Post Op Lap Chole) and 37557 (Wound Debridement Post Op Orders): Changed to use new cefazolin dosing. 12.03.2018 TMS CSR{{{SINGLE-QUOTE}}}s 37585 (Gastric Bypass Post Op)and 37533 (Post Op Vascular Surgery): Changed to use new cefazolin dosing. 12.17.2018 TMS CSR 37346 (Fractured Hip Post Op Orders), 37345 (Total Hip Replacement Post Op Orders), 37344 (Total Knee Replacement Post Op Orders) 02.20.2019 TMS 37530 (Post Op Open Chole) Changed to use new cefazolin dosing. 01.15.2020 TMS 38595 (Post Op Foot and Ankle) Changed to use new cefazolin dosing. 01.15.2020 TMS 37873 (Free Flap Post Op) Added to use static dosing for Cefazolin and Clindamycin. ;; keywords: Called MLMs, Antibiotic Prophylaxis, Weight Based Dosing ;; knowledge: type: data-driven;; data: standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; using "ObjectsPlusXA.SCM.Forms"; using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms"; // 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; ClientGuid := this_communication.ClientGUID; ChartGuid := this_communication.ChartGUID; ClientVisitGuid := this_communication.ClientVisitGUID; PrimaryObjdetail:=this_communication.PrimaryObj; OrderSetName := PrimaryObjdetail.OrderSetName; /*******************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; // Identify order sets with old cefazolin dosing (AltSCIPSets) := read {"select GUID from CV3OrderCatalogSet where name in ({{{SINGLE-QUOTE}}}Free Flap Post Op Orders{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}SCIP Antibiotics: Free Flap Surgery{{{SINGLE-QUOTE}}})"}; // Get patient weight comb_ht_wt_field := first of (field_list where field_list.DataItemName = "CombinedMeasurements"); if exists comb_ht_wt_field then comb_ht_wt_val := comb_ht_wt_field.value; wt := comb_ht_wt_val.weight; weightvalue := (wt as number); endif; // Get patient age (patientage) := read last { " select " ||" case when " ||" right({{{SINGLE-QUOTE}}}00{{{SINGLE-QUOTE}}} + cast (datepart (MM,getdate()) as varchar),2) + right({{{SINGLE-QUOTE}}}00{{{SINGLE-QUOTE}}} + cast (datepart (DD,getdate()) as varchar),2) < " ||" right({{{SINGLE-QUOTE}}}00{{{SINGLE-QUOTE}}} + cast (birthmonthnum as varchar),2) + right({{{SINGLE-QUOTE}}}00{{{SINGLE-QUOTE}}} + cast (birthdaynum as varchar),2) " ||" then datediff (yy, cast (birthyearnum as varchar) ,getdate()) -1 " ||" else datediff (yy, cast (birthyearnum as varchar) ,getdate()) " ||" end " ||" from cv3client with (nolock) where guid = " || ClientGuid || " " }; // If patientage < 12 and CallingEvent = "FormOpen" then; dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Patient under 12 years of age." ||"\n Please call physician for dosing. " ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}}; endif; // // Define other fields StartNow := last of (field_list where field_list.DataItemName = "PRX_Dosing Start Now" ); Dose := first of (field_list where field_list.DataItemName = "DosageLow"); SP := " "; CR := 13 formatted with "%c"; LF := 10 formatted with "%c"; CRLF:= CR||LF; TAB := 9 formatted with "%c"; Cefazolin := last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 1); Cefoxitin := last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 2); Clindamycin := last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 3); Vancomycin := last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 4); Gentamicin := last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 5); CefazolinDose := Cefazolin.Value; CefoxitinDose := Cefoxitin.Value; ClindamycinDose := Clindamycin.Value; VancomycinDose := Vancomycin.Value; GentamicinDose := Gentamicin.Value; CefazolinID := last of (field_list where field_list.DataItemName = "PRX_DrugIDCode" and field_List.Control_MultiFieldOccNum = 1); CefoxitinID := last of (field_list where field_list.DataItemName = "PRX_DrugIDCode" and field_List.Control_MultiFieldOccNum = 3); ClindamycinID := last of (field_list where field_list.DataItemName = "PRX_DrugIDCode" and field_List.Control_MultiFieldOccNum = 2); VancomycinID := last of (field_list where field_list.DataItemName = "PRX_DrugIDCode" and field_List.Control_MultiFieldOccNum = 4); GentamicinID := last of (field_list where field_list.DataItemName = "PRX_DrugIDCode" and field_List.Control_MultiFieldOccNum = 5); CefazolinCode := CefazolinID.Value; CefoxitinCode := CefoxitinID.Value; ClindamycinCode := ClindamycinID.Value; VancomycinCode := VancomycinID.Value; GentamicinCode := GentamicinID.Value; RequestedTime1 := last of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 1); RequestedTime2 := last of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 2); RequestedTime3 := last of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 3); RequestedTime4 := last of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 4); RequestedTime5 := last of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 5); RequestedDate1 := last of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 1); RequestedDate2 := last of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 2); RequestedDate3 := last of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 3); RequestedDate4 := last of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 4); RequestedDate5 := last of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 5); Grid1Orders := last of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 1); Grid1Orders_List := Grid1Orders.Value; Grid2Orders := last of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 2); Grid2Orders_List := Grid2Orders.Value; SCIPMedInfo := last of (field_list where field_list.DataItemName = "NUR_GenAdditionalTxt" and field_List.Control_MultiFieldOccNum = 1); SCIPPCNMedInfo := last of (field_list where field_list.DataItemName = "NUR_GenAdditionalTxt" and field_List.Control_MultiFieldOccNum = 2); SCIPSetInfo := last of (field_list where field_list.DataItemName = "NUR_GenAdditionalTxt" and field_List.Control_MultiFieldOccNum = 3); AltCefazolinInfo := CRLF || TAB ||"Cefazolin 1 gm" ; CefazolinInfo := CRLF || TAB ||"Cefazolin 2 gm" ||TAB || "(Weight less than 120 kg)" || CRLF || TAB || "Cefazolin 3 gm"|| TAB || "( Weight 120 kg or greater)" ; CefoxitinInfo := CRLF || TAB ||"Cefoxitin 1 gm" || TAB || "(Weight less than 80 kg)" || CRLF || TAB || "Cefoxitin 2 gm" || TAB || "(Weight 80 kg or greater)"; ClindamycinInfo := CRLF || TAB || "Clindamycin 600mg" || TAB || TAB || "(Weight less than 80 kg)" || CRLF || TAB || "Clindamycin 900mg" || TAB || TAB || "(Weight 80 kg or greater)"; AltClindamycinInfo := CRLF || TAB || "Clindamycin 600mg" ; VancomycinInfo := CRLF || TAB || "Vancomycin 1 gm" || TAB || TAB || "(Weight between 50kg and less than 80 kg)" || CRLF || TAB || "Vancomycin 15mg/kg" || TAB || "(Weight less than 50kg or 80kg and greater)"; ClindaGentInfo := CRLF || TAB || TAB || TAB || " AND"|| CRLF || TAB || "Gentamicin" || TAB || TAB || "(1.5mg/kg)" ; OpenHeartInfo := "Cefazolin" || TAB || TAB || TAB || "- Patient MRSA negative and NOT allergic to cephalosporins or penicillins" || CRLF || "Vancomycin or Clindamycin"|| TAB || "- Patient MRSA negative AND allergic to cephalosporins or penicillins" || CRLF || "Cefazolin and Vancomycin"|| TAB || "- Patient MRSA positive and NOT allergic to cephalosporins or penicillins" || CRLF || "Vancomycin" || TAB || TAB || "- Patient MRSA positive AND allergic to cephalosporins or penicillins" || CRLF || "Note: " ||TAB || "Simple rash, nausea, or vomiting does not exclude the use of Cephalosporins. Avoid cephalosporins " || "only if immediate hypersensitivity (i.e., hives, anaphylaxis, pharyngeal edema, neutropenia, fever)" ; OrthoInfo := "Cefazolin" || TAB || TAB || TAB || "- Patient MRSA negative and NOT allergic to cephalosporins or penicillins" || CRLF || "Clindamycin or Vancomycin"|| TAB || "- Patient MRSA negative AND allergic to cephalosporins or penicillins" || CRLF || "Cefazolin and Vancomycin"|| TAB || "- Patient MRSA positive and NOT allergic to cephalosporins or penicillins" || CRLF || "Vancomycin" || TAB || TAB || "- Patient MRSA positive AND allergic to cephalosporins or penicillins" || CRLF || "Note: " ||TAB || "For Penicillin allergy, simple rash, nausea, or vomiting does not exclude the use of Cephalosporins. Avoid cephalosporins " || "only if immediate " || TAB || TAB || "hypersensitivity (i.e., hives, anaphylaxis, pharyngeal edema, neutropenia, fever)" ; AllergyInfo := CRLF || TAB || "Note: " ||TAB || "Simple rash, nausea, or vomiting does not exclude the use of Cephalosporins. Avoid cephalosporins" ||CRLF || TAB || TAB || "only if immediate hypersensitivity (i.e., hives, anaphylaxis, pharyngeal edema, neutropenia, fever)" ; AllergyInfoCefoxitin := CRLF || TAB || "Note: " ||TAB || "Simple rash, nausea, or vomiting does not exclude the use of (cefoxitin) Cephalosporins. Avoid cephalosporins" ||CRLF || TAB || TAB || "only if immediate hypersensitivity (i.e., hives, anaphylaxis, pharyngeal edema, neutropenia, fever)" ; Found_Cefazolin := first of (Grid1Orders_List where Grid1Orders_List.Name = "Cefazolin:"); Found_Cefoxitin := first of (Grid1Orders_List where Grid1Orders_List.Name = "Cefoxitin:"); Found_Vancomycin := first of (Grid2Orders_List where Grid2Orders_List.Name = "Vancomycin:"); Found_Clindamycin := first of (Grid2Orders_List where Grid2Orders_List.Name = "Clindamycin:"); Found_Gentamicin := first of (Grid2Orders_List where Grid2Orders_List.Name = "Gentamicin:"); CefazolinBox := last of (field_list where field_list.DataItemName = "PRX_Checkbox1" and field_List.Control_MultiFieldOccNum = 1); CefazolinBoxValue := CefazolinBox.Value; VancomycinBox := last of (field_list where field_list.DataItemName = "PRX_Checkbox1" and field_List.Control_MultiFieldOccNum = 4); VancomycinBoxValue := VancomycinBox.Value; ClindamycinBox := last of (field_list where field_list.DataItemName = "PRX_Checkbox1" and field_List.Control_MultiFieldOccNum = 3); ClindamycinBoxValue := ClindamycinBox.Value; ClindaGentBox := last of (field_list where field_list.DataItemName = "PRX_Checkbox1" and field_List.Control_MultiFieldOccNum = 5); ClindaGentBoxValue := ClindaGentBox.Value; CefoxitinBox := last of (field_list where field_list.DataItemName = "PRX_Checkbox1" and field_List.Control_MultiFieldOccNum = 2); CefoxitinBoxValue := CefoxitinBox.Value; If OrderSetName = "SCIP Antibiotics: Open Heart Surgery" or OrderSetName = "SCIP Antibiotics: Pre-op Open Heart Surgery" then SCIPSetInfo.value := OpenHeartInfo; OS_with_MRSA := "True"; elseif OrderSetName = "SCIP Antibiotics: Cefazolin-Clindamycin-Vancomycin" then SCIPSetInfo.value := OrthoInfo; OS_with_MRSA := "True"; elseif OrderSetName = "SCIP Antibiotics: Cefoxitin-Clindamycin w/ Gentamicin" then SCIPSetInfo.value := AllergyInfoCefoxitin; else SCIPSetInfo.value := AllergyInfo; endif; // Obtain Coded Allergen Guids (AllergenGuids) := read { " select guid from cv3allergen where code like {{{SINGLE-QUOTE}}}Penicill%{{{SINGLE-QUOTE}}}or code like {{{SINGLE-QUOTE}}}Cef%{{{SINGLE-QUOTE}}} or code like {{{SINGLE-QUOTE}}}%cillin{{{SINGLE-QUOTE}}} or code like {{{SINGLE-QUOTE}}}Cephalex%{{{SINGLE-QUOTE}}}"}; // Retrieve coded and possible typed in allergies to penicillin (PCNAllergy) := read last { " Select Status from CV3AllergyDeclaration " || " where ClientGUID = " || SQL(clientguid) || " and " || " ((Text like {{{SINGLE-QUOTE}}}penicil%{{{SINGLE-QUOTE}}} or text like {{{SINGLE-QUOTE}}}%pcn%{{{SINGLE-QUOTE}}} or text like {{{SINGLE-QUOTE}}}%cephalexin%{{{SINGLE-QUOTE}}} or " || " text like {{{SINGLE-QUOTE}}}%cillin%{{{SINGLE-QUOTE}}} or text like {{{SINGLE-QUOTE}}}cef%{{{SINGLE-QUOTE}}}) and Status = {{{SINGLE-QUOTE}}}active{{{SINGLE-QUOTE}}} and TypeCodeForOther = {{{SINGLE-QUOTE}}}drug{{{SINGLE-QUOTE}}}) " || " or (ClientGUID = " || SQL(clientguid) || " and AllergenGUID in (" || SQL(allergenguids) || ") and Status = {{{SINGLE-QUOTE}}}active{{{SINGLE-QUOTE}}} ) " }; // Check for MRSA Result (ResultValue) := read last {"SELECT tol.text " || " from cv3ordercatalogmasteritem ocmi with (nolock) " || " join cv3order o with (nolock) on o.ordercatalogmasteritemguid = ocmi.guid and o.clientguid = " || SQL(clientguid) || " and o.chartguid = " || SQL(chartguid) || " and o.clientvisitguid = " || SQL(clientvisitguid) || " and o.orderstatuscode In ({{{SINGLE-QUOTE}}}RESF{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}RESC{{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}}RESI{{{SINGLE-QUOTE}}}) " || " and o.name = {{{SINGLE-QUOTE}}}Nasal Screen for MRSA (Infection Control){{{SINGLE-QUOTE}}} " || " left join cv3BasicObservation bo with (nolock) on bo.OrderGuid = o.guid and bo.clientguid = " || SQL(clientguid) || " and bo.chartguid = " || SQL(chartguid) || " and bo.clientvisitguid = " || SQL(clientvisitguid) || " and bo.itemname = {{{SINGLE-QUOTE}}}culture{{{SINGLE-QUOTE}}} " || " left join cv3textualobservationline tol with (nolock) on tol.observationguid = bo.guid and tol.clientguid = " || SQL(clientguid) || " order by o.significantdtm " }; if ResultValue = "METHICILLIN RESISTANT STAPHYLOCOCCUS AUREUS" then MRSAPositive := "Yes"; else MRSAPositive := "No"; endif; // Check for MRSA Flag (MRSAHist) := read last { " select case when EnterpriseClientcol8 in ({{{SINGLE-QUOTE}}}MRSA{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Both{{{SINGLE-QUOTE}}}) then {{{SINGLE-QUOTE}}}Yes{{{SINGLE-QUOTE}}} else {{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}} end " || " from cv3enterpriseclientdata where clientguid = " || SQL(clientguid) || " " }; if exist MRSAHist then MRSAHistory := "Yes"; else MRSAHistory := "No"; endif; If (VancomycinBoxValue = True or CefazolinBoxValue = True or ClindamycinBoxValue = True or ClindaGentBoxValue = True or CefoxitinBoxValue = True) and weightvalue = 0 then dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Please enter a weight to calculate dosing.","Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}}; endif; CurrentLocation := read last {"Select CurrentLocation " ||" From cv3Clientvisit " ||" Where Guid = " || SQL(ClientVisitGuid) ||" and VisitStatus = {{{SINGLE-QUOTE}}}ADM{{{SINGLE-QUOTE}}}" }; If CallingEvent = "FormOpen" then sciporders := ""; grid1true := (); grid1false := (); index_list := 1 seqto (count Grid1Orders_List ) ; for J in index_list do sciporders := sciporders || Grid1Orders_List.Name ; enddo; index_list2 := 1 seqto (count Grid2Orders_List ) ;grid2true := (); grid2false := (); for K in index_list2 do sciporders := sciporders || Grid2Orders_List.Name ; enddo; if sciporders matches pattern "%cefazolin%" then RequestedTime1.control_visible := true; RequestedDate1.control_visible := true; CefazolinBox.control_visible := true; If this_communication.CatalogParentOrderSetGUID in AltSCIPSets or this_communication.CatalogOrderSetGUID in AltSCIPSets then SCIPMedInfo.value := AltCefazolinInfo; ClindamycinInfo := AltClindamycinInfo; else SCIPMedInfo.value := CefazolinInfo; endif; endif; if sciporders matches pattern "%cefoxitin%" then RequestedTime2.control_visible := true; RequestedDate2.control_visible := true; CefoxitinBox.control_visible := true; SCIPMedInfo.value := CefoxitinInfo; endif; if sciporders matches pattern "%clindamycin%" then if sciporders matches pattern "%Gentamicin%" then RequestedTime5.control_visible := true; RequestedDate5.control_visible := true; RequestedTime3.control_visible := true; RequestedDate3.control_visible := true; ClindaGentBox.control_visible := true; SCIPPcnMedInfo.value := ClindamycinInfo ||ClindaGentInfo; elseif sciporders matches pattern "%vancomycin%" then SCIPPcnMedInfo.value := CLINDAMYCInInfo || VancomycinInfo; RequestedTime3.control_visible := true; RequestedDate3.control_visible := true; ClindamycinBox.control_visible := true; RequestedTime4.control_visible := true; RequestedDate4.control_visible := true; VancomycinBox.control_visible := true; else RequestedTime3.control_visible := true; RequestedDate3.control_visible := true; ClindamycinBox.control_visible := true; SCIPPcnMedInfo.value := CLINDAMYCInInfo; endif; endif; if sciporders matches pattern "%vancomycin%" then if sciporders matches pattern "%Clindamycin%" then SCIPPcnMedInfo.value := CLINDAMYCInInfo || VancomycinInfo; RequestedTime3.control_visible := true; RequestedDate3.control_visible := true; ClindamycinBox.control_visible := true; RequestedTime4.control_visible := true; RequestedDate4.control_visible := true; VancomycinBox.control_visible := true; else RequestedTime4.control_visible := true; RequestedDate4.control_visible := true; VancomycinBox.control_visible := true; SCIPPcnMedInfo.value := VancomycinInfo; endif; endif; /* grid1control := (); grid2control := (); index1_list := 1 seqto (count Grid1Orders_List ) ; index2_list := 1 seqto (count Grid2Orders_List ) ; for a in index1_list do grid1control := grid1control , "true"; enddo; for b in index2_list do grid2control := grid2control , "true"; enddo; Grid1Orders_List.IsReadOnly := grid1control; Grid2Orders_List.IsReadOnly := grid2control; */ endif; If CallingEvent = "FieldChange" then grid1control := (); grid1default := (); grid2control := (); grid2default := (); index1_list := 1 seqto (count Grid1Orders_List ) ; index2_list := 1 seqto (count Grid2Orders_List ) ; // Cefazolin If CallingField = "PRX_Checkbox1|1" then If CefazolinBoxValue = True then Found_Cefazolin.IsSelected := True; CefoxitinBox.control_read_only := True; ClindamycinBox.control_read_only := True; ClindaGentBox.control_read_only := True; for a in index1_list do grid1select := grid1select , grid1orders_list.isselected [a]; if grid1orders_list.isselected [a] = true then grid1default := grid1default , "true"; grid1control := grid1control , "false"; else grid1control := grid1control , "true"; grid1default := grid1default , "true"; endif; enddo; for b in index2_list do grid2select := grid2select , grid2orders_list.isselected [b]; if grid2orders_list.isselected [b] = true then grid2default := grid2default , "true"; grid2control := grid2control , "false"; else grid2default := grid2default , "true"; grid2control := grid2control , "true"; endif; enddo; Grid1Orders_List.IsReadOnly := grid1control; Grid2Orders_List.IsReadOnly := grid2control; If (MRSAPositive = "Yes" or MRSAHistory = "Yes") and (PCNAllergy <> "Active" or PCNAllergy is null) and OS_with_MRSA = "True" then dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Your patient may be flagged as MRSA Positive, consider ordering Vancomycin in addition to Cefazolin.","Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}}; endif; If PCNAllergy = "Active" and MRSAPositive = "No" and MRSAHistory = "No" then dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Your patient may have a documented allergy to Penicillin or Cephalosporins, please review Allergies before continuing. ","Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}}; endif; If (MRSAPositive = "Yes" or MRSAHistory = "Yes") and PCNAllergy = "Active" and OS_with_MRSA = "True" then dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Your patient may be flagged as MRSA Positive and may have a documented allergy to Penicillin or Cephalosporins. " || "\n\n Please review before ordering.","Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}}; endif; elseif CefazolinBoxValue = FALSE then Found_Cefazolin.IsSelected := False; ClindamycinBox.control_read_only := False; ClindaGentBox.control_read_only := False; VancomycinBox.control_read_only := False; CefoxitinBox.control_read_only := False; Grid1Orders_List.IsReadOnly := grid1default; Grid2Orders_List.IsReadOnly := grid2default; endif; endif; // Cefoxitin If CallingField = "PRX_Checkbox1|2" then If CefoxitinBoxValue = True then Found_Cefoxitin.IsSelected := True; CefazolinBox.control_read_only := True; ClindamycinBox.control_read_only := True; VancomycinBox.control_read_only := True; ClindaGentBox.control_read_only := True; for a in index1_list do grid1select := grid1select , grid1orders_list.isselected [a]; if grid1orders_list.isselected [a] = true then grid1default := grid1default , "true"; grid1control := grid1control , "false"; else grid1control := grid1control , "true"; grid1default := grid1default , "true"; endif; enddo; for b in index2_list do grid2select := grid2select , grid2orders_list.isselected [b]; if grid2orders_list.isselected [b] = true then grid2default := grid2default , "true"; grid2control := grid2control , "false"; else grid2default := grid2default , "true"; grid2control := grid2control , "true"; endif; enddo; Grid1Orders_List.IsReadOnly := grid1control; Grid2Orders_List.IsReadOnly := grid2control; elseif CefoxitinBoxValue = FALSE then Found_Cefoxitin.IsSelected := False; ClindamycinBox.control_read_only := False; ClindaGentBox.control_read_only := False; VancomycinBox.control_read_only := False; CefazolinBox.control_read_only := False; Grid1Orders_List.IsReadOnly := grid1default; Grid2Orders_List.IsReadOnly := grid2default; endif; endif; // Clindamycin If CallingField = "PRX_Checkbox1|3" then If ClindamycinBoxValue = True then Found_Clindamycin.IsSelected := True; CefazolinBox.control_read_only := True; CefoxitinBox.control_read_only := True; VancomycinBox.control_read_only := True; ClindaGentBox.control_read_only := True; for a in index1_list do grid1select := grid1select , grid1orders_list.isselected [a]; if grid1orders_list.isselected [a] = true then grid1default := grid1default , "true"; grid1control := grid1control , "false"; else grid1control := grid1control , "true"; grid1default := grid1default , "true"; endif; enddo; for b in index2_list do grid2select := grid2select , grid2orders_list.isselected [b]; if grid2orders_list.isselected [b] = true then grid2default := grid2default , "true"; grid2control := grid2control , "false"; else grid2default := grid2default , "true"; grid2control := grid2control , "true"; endif; enddo; Grid1Orders_List.IsReadOnly := grid1control; Grid2Orders_List.IsReadOnly := grid2control; elseif ClindamycinBoxValue = FALSE then Found_Clindamycin.IsSelected := False; CefazolinBox.control_read_only := False; ClindaGentBox.control_read_only := False; VancomycinBox.control_read_only := False; CefoxitinBox.control_read_only := False; Grid1Orders_List.IsReadOnly := grid1default; Grid2Orders_List.IsReadOnly := grid2default; endif; endif; // If CallingField = "PRX_Checkbox1|4" then If VancomycinBoxValue = True then Found_Vancomycin.IsSelected := True; CefoxitinBox.control_read_only := True; ClindamycinBox.control_read_only := True; ClindaGentBox.control_read_only := True; for a in index1_list do grid1select := grid1select , grid1orders_list.isselected [a]; if grid1orders_list.isselected [a] = true then grid1default := grid1default , "true"; grid1control := grid1control , "false"; else grid1control := grid1control , "true"; grid1default := grid1default , "true"; endif; enddo; for b in index2_list do grid2select := grid2select , grid2orders_list.isselected [b]; if grid2orders_list.isselected [b] = true then grid2default := grid2default , "true"; grid2control := grid2control , "false"; else grid2default := grid2default , "true"; grid2control := grid2control , "true"; endif; enddo; Grid1Orders_List.IsReadOnly := grid1control; Grid2Orders_List.IsReadOnly := grid2control; elseif VancomycinBoxValue = FALSE then Found_Vancomycin.IsSelected := False; CefazolinBox.control_read_only := False; ClindaGentBox.control_read_only := False; ClindamycinBox.control_read_only := False; CefoxitinBox.control_read_only := False; Grid1Orders_List.IsReadOnly := grid1default; Grid2Orders_List.IsReadOnly := grid2default; endif; endif; // If CallingField = "PRX_Checkbox1|5" then If ClindaGentBoxValue = True then Found_Clindamycin.IsSelected := True; Found_Gentamicin.IsSelected := True; VancomycinBox.control_read_only := True; ClindamycinBox.control_read_only := True; CefazolinBox.control_read_only := True; CefoxitinBox.control_read_only := True; for a in index1_list do grid1select := grid1select , grid1orders_list.isselected [a]; if grid1orders_list.isselected [a] = true then grid1default := grid1default , "true"; grid1control := grid1control , "false"; else grid1control := grid1control , "true"; grid1default := grid1default , "true"; endif; enddo; for b in index2_list do grid2select := grid2select , grid2orders_list.isselected [b]; if grid2orders_list.isselected [b] = true then grid2default := grid2default , "true"; grid2control := grid2control , "false"; else grid2default := grid2default , "true"; grid2control := grid2control , "true"; endif; enddo; Grid1Orders_List.IsReadOnly := grid1control; Grid2Orders_List.IsReadOnly := grid2control; elseif ClindaGentBoxValue = FALSE then Found_Clindamycin.IsSelected := False; Found_Gentamicin.IsSelected := False; CefazolinBox.control_read_only := False; VancomycinBox.control_read_only := False; ClindamycinBox.control_read_only := False; CefoxitinBox.control_read_only := False; Grid1Orders_List.IsReadOnly := grid1default; Grid2Orders_List.IsReadOnly := grid2default; endif; 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: