maintenance: title: Form_Save_AdmitToInPatient_PlaceInObs ;; mlmname: Form_Save_AdmitToInPatient_PlaceInObs ;; arden: version 2.5;; version: 6.00;; institution: St. Clair Hospital ;; author: Shivprasad Jadhav;; specialist: Shivprasad Jadhav, Allscripts;; date: 2015-01-16;; validation: testing;; library: purpose: Explanation to Change ----------------------------------------- 14-05-2015 - GMS - Created New 22-01-2019 - JML - CSR 37770 - Modified to create Admission Order Confirmation order when Admit to Inpatient or Place in Observation order is entered that allows the attending physician to sign / co-sign ;; explanation: Create the Request Bed order wwhile populating the information in the free text box, when the Admit to inpatient or Place in observation order item is placed in ED. The order will use the ED physician as the requestor verify if PA or CRNP Will NOT be in a HOLD session Will only be used in the ED location If No ED ohysician is slected then by default it should place the order on the name of "Jasson, Biggs" Information to Display in the Request Bed Comments sections (see screen shot) INP or OBS Bushman(Attending) Resistant Organism=V (Comments) Telemetry CCU or ICU Pneumonia (Diagnosis) Risk Score=4 (score) Isolation ;; keywords: ;; citations: ;; knowledge: type: data-driven;; data: // This MLM is passed three arguments, of types // communication_type, form_type and client info object respectively. // Specify which .NET assemblies need to be loaded for ObjectsPlus standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; using "ObjectsPlusXA.SCM.Forms"; using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms"; (this_communication, // Communication object this_form, // Form object client_info_obj //Arden ClientInfo object ) := argument; log_execution_info := FALSE; error_message:=""; //----------------------------------------------------------------------------------------------------------------- SaveMLM := MLM {{{SINGLE-QUOTE}}}FORM_HEALTH_ISSUE_ENTERED_FROM_ORDER_FORM{{{SINGLE-QUOTE}}}; this_communication,this_form := Call SaveMLM With this_communication,this_form,client_info_obj ; //----------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------- // References the LOCAL SESSION object local_session := cds_session.local; // for local_session.SessionRequestBed //------------------------------------------------------------------------------- // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; clientGuid := this_communication.ClientGUID; visitGuid := this_communication.ClientVisitGUID; chartGuid := this_communication.ChartGUID; UserGuid := this_communication.UserGUID; CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; item_event := this_communication.itemevent; form_type := this_communication.formtype; local_session.SessionRequestedGUID := this_communication.CareProviderGUID ; // Form Order Name If this_form.Name= "CPOE_Admit Obs HI" Then Order_Name := "OBS" ; AdmissionOrderName := "OBS"; Else Order_Name := "Adm" ; AdmissionOrderName := "INPT"; EndIf; StrFinal := StrFinal || Order_Name || ", " ; Attn_Provider := last of ( field_list WHERE field_list.DataItemName = "Obj_Plus_Consult" and field_list.Control_MultiFieldOccNum = 1); HI_Attn_Provider := Attn_Provider.Value; If exists HI_Attn_Provider Then HI_Attn_Provider:= HI_Attn_Provider ; Endif ; StrFinal := StrFinal || HI_Attn_Provider || ", " ; Admit_Diagnosis := last of ( field_list WHERE field_list.DataItemName = "OBJ_PLUS_ADM_Health Issue" ); Eff_Date := last of ( field_list WHERE field_list.DataItemName = "CM_Patient_Change_Date" ); Eff_Date_Month := SUBSTRING 2 CHARACTERS From ( Eff_Date.Value as string ); Eff_Date_Day := Substring 2 Characters starting at 4 from ( Eff_Date.Value as string ); Eff_Date_Year := substring 4 characters starting at 7 from ( Eff_Date.Value as string ); Eff_Date_Converted := Eff_Date_Year || "-" || Eff_Date_Month || "-" || Eff_Date_Day; Eff_Time := last of ( field_list WHERE field_list.DataItemName = "RequestedTime" ); Eff_Time_Val := Eff_Time.Value; Eff_Time_Value := Eff_Time_Val.ReqTimeValue; /*Qualify := last of ( field_list WHERE field_list.DataItemName = "CPOE_Adm_TwoMidnight" and field_list.Control_MultiFieldOccNum = 1); HI_Qualify := Qualify.Value; If exists HI_Qualify And HI_Qualify= True Then HI_Qualify := "Qualifies for Two Midnight "; Endif ; StrFinal := StrFinal || HI_Qualify || ", " ; */ HealthIssue := last of ( field_list WHERE field_list.DataItemName = "HealthIssues" and field_list.Control_MultiFieldOccNum = 1); HI_HealthIssue := HealthIssue.Value; If exists HI_HealthIssue And HI_HealthIssue = True Then HI_HealthIssue := "Launch Health issues :"; Endif ; StrFinal := StrFinal || HI_HealthIssue || ", " ; HI_General := last of ( field_list WHERE field_list.DataItemName = "HI Check 1" and field_list.Control_MultiFieldOccNum = 1); HHI_General := HI_General.Value; HI_Cardio := last of ( field_list WHERE field_list.DataItemName = "HI Check 2" and field_list.Control_MultiFieldOccNum = 1); HHI_Cardio := HI_Cardio.Value; HI_Resp := last of ( field_list WHERE field_list.DataItemName = "HI Check 3" and field_list.Control_MultiFieldOccNum = 1); HHI_Resp := HI_Resp.Value; HI_Infection := last of ( field_list WHERE field_list.DataItemName = "HI Check 4" and field_list.Control_MultiFieldOccNum = 1); HHI_Infection := HI_Infection.Value; HI_Genito := last of ( field_list WHERE field_list.DataItemName = "HI Check 5" and field_list.Control_MultiFieldOccNum = 1); HHI_Genito := HI_Genito.Value; HI_Nuero := last of ( field_list WHERE field_list.DataItemName = "HI Check 6" and field_list.Control_MultiFieldOccNum = 1); HHI_Nuero := HI_Nuero.Value; HI_Neoplasm := last of ( field_list WHERE field_list.DataItemName = "HI Check 7" and field_list.Control_MultiFieldOccNum = 1); HHI_Neoplasm := HI_Neoplasm.Value; HI_Ortho := last of ( field_list WHERE field_list.DataItemName = "HI Check 8" and field_list.Control_MultiFieldOccNum = 1); HHI_Ortho := HI_Ortho.Value; HI_Behavior := last of ( field_list WHERE field_list.DataItemName = "HI Check 9" and field_list.Control_MultiFieldOccNum = 1); HHI_Behavior := HI_Behavior.Value; HI_Gastro := last of ( field_list WHERE field_list.DataItemName = "HI Check 10" and field_list.Control_MultiFieldOccNum = 1); HHI_Gastro := HI_Gastro.Value; HI_Pedia := last of ( field_list WHERE field_list.DataItemName = "HI Check 11" and field_list.Control_MultiFieldOccNum = 1); HHI_Pedia := HI_Pedia.Value; LI_General := last of ( field_list WHERE field_list.DataItemName = "HI List 1" and field_list.Control_MultiFieldOccNum = 1); LLI_General := LI_General.Value; LI_Cardio := last of ( field_list WHERE field_list.DataItemName = "HI List 2" and field_list.Control_MultiFieldOccNum = 1); LLI_Cardio := LI_Cardio.Value; LI_Resp := last of ( field_list WHERE field_list.DataItemName = "HI List 3" and field_list.Control_MultiFieldOccNum = 1); LLI_Resp := LI_Resp.Value; LI_Infection := last of ( field_list WHERE field_list.DataItemName = "HI List 4" and field_list.Control_MultiFieldOccNum = 1); LLI_Infection := LI_Infection.Value; LI_Genito := last of ( field_list WHERE field_list.DataItemName = "HI List 5" and field_list.Control_MultiFieldOccNum = 1); LLI_Genito := LI_Genito.Value; LI_Nuero := last of ( field_list WHERE field_list.DataItemName = "HI List 6" and field_list.Control_MultiFieldOccNum = 1); LLI_Nuero := LI_Nuero.Value; LI_Neoplasm := last of ( field_list WHERE field_list.DataItemName = "HI List 7" and field_list.Control_MultiFieldOccNum = 1); LLI_Neoplasm := LI_Neoplasm.Value; LI_Ortho := last of ( field_list WHERE field_list.DataItemName = "HI List 8" and field_list.Control_MultiFieldOccNum = 1); LLI_Ortho := LI_Ortho.Value; LI_Behavior := last of ( field_list WHERE field_list.DataItemName = "HI List 9" and field_list.Control_MultiFieldOccNum = 1); LLI_Behavior := LI_Behavior.Value; Ll_Gastro := last of ( field_list WHERE field_list.DataItemName = "HI List 10" and field_list.Control_MultiFieldOccNum = 1); LLI_Gastro := Ll_Gastro.Value; LI_Pedia := last of ( field_list WHERE field_list.DataItemName = "HI List 11" and field_list.Control_MultiFieldOccNum = 1); LLI_Pedia := LI_Pedia.Value; //Hi_List := last of ( field_list WHERE (field_list.DataItemName MATCHES PATTERN "%HI Check%") ); /* If HHI_General=True Then sel := "General :"; Elseif HHI_Cardio =True Then sel := "CardioVascular :"; Elseif HHI_Resp =True Then sel := "Respiratory :"; Elseif HHI_Infection =True Then sel := "Infrction :"; Elseif HHI_Genito =True Then sel := "Genitourinary :"; Elseif HHI_Nuero =True Then sel := "Neurology :"; Elseif HHI_Neoplasm =True Then sel := "NeoPlasm :"; Elseif HHI_Ortho =True Then sel := "Orthopedic :"; Elseif HHI_Behavior =True Then sel := "Behavioral :"; Elseif HHI_Gastro =True Then sel := "GastroIntestinal :"; Elseif HHI_Pedia =True Then sel := "Pediatric :"; Endif; */ //StrFinal := StrFinal || "Dignosis :" ; //If HHI_General=True or HHI_Cardio =True or HHI_Resp =True or HHI_Infection =True or HHI_Genito =True or HHI_Nuero =True or HHI_Neoplasm =True or HHI_Ortho =True // or HHI_Behavior =True or HHI_Gastro =True or HHI_Pedia =True Then Str1 := LLI_General ||", "|| LLI_Cardio ||", "|| LLI_Resp ||", "|| LLI_Infection ||", "|| LLI_Genito ||", "|| LLI_Nuero ||", "|| LLI_Neoplasm ||", "|| LLI_Ortho ||", "|| LLI_Behavior ||", "|| LLI_Gastro ||", "|| LLI_Pedia ; StrFinal1 := Call (Str1 as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}).Replace with ", null" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}, "" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; // EndIf; StrFinal := StrFinal || StrFinal1 ; C_Diagnosis := last of ( field_list WHERE field_list.DataItemName = "ED_Diagnosis" and field_list.Control_MultiFieldOccNum = 1); CC_Diagnosis := C_Diagnosis.Value; C_HealthIssue := last of ( field_list WHERE field_list.DataItemName = "MLM_Physician_Mandatory_HI" and field_list.Control_MultiFieldOccNum = 1); CC_HealthIssue := C_HealthIssue.Value; If Exists CC_Diagnosis Then StrFinal := StrFinal || ", " || CC_Diagnosis ; Endif; If Exists CC_HealthIssue Then StrFinal := StrFinal || ", " || CC_HealthIssue ; Endif; C_Telemetry := last of ( field_list WHERE field_list.DataItemName = "NUR_ADTTelemetryCBx" and field_list.Control_MultiFieldOccNum = 1); CC_Telemetry := C_Telemetry.Value; C_CCU := last of ( field_list WHERE field_list.DataItemName = "ED_Unit CCU" and field_list.Control_MultiFieldOccNum = 1); CC_CCU := C_CCU.Value; C_Moni_Bed := last of ( field_list WHERE field_list.DataItemName = "NUR_ADTMonitoredBedCBx" and field_list.Control_MultiFieldOccNum = 1); CC_Moni_Bed := C_Moni_Bed.Value; C_ICU := last of ( field_list WHERE field_list.DataItemName = "ED_Unit ICU" and field_list.Control_MultiFieldOccNum = 1); CC_ICU := C_ICU.Value; C_Unit := last of ( field_list WHERE field_list.DataItemName = "NUR_Unit" and field_list.Control_MultiFieldOccNum = 1); CC_Unit := C_Unit.Value; C_Isolation := last of ( field_list WHERE field_list.DataItemName = "Admit_Isolation" and field_list.Control_MultiFieldOccNum = 1); CC_Isolation := C_Isolation.Value; C_Condition := last of ( field_list WHERE field_list.DataItemName = "NUR_ADTCondition" and field_list.Control_MultiFieldOccNum = 1); CC_Condition := C_Condition.Value; C_Sp_Instr := last of ( field_list WHERE field_list.DataItemName = "SpecialInstructions" and field_list.Control_MultiFieldOccNum = 1); CC_Sp_Instr := C_Sp_Instr.Value; C_Notify := last of ( field_list WHERE field_list.DataItemName = "NUR_NotifyType" and field_list.Control_MultiFieldOccNum = 1); CC_Notify := C_Notify.Value; C_NotifyCrit := last of ( field_list WHERE field_list.DataItemName = "NUR_NotifyFreeText" and field_list.Control_MultiFieldOccNum = 1); CC_NotifyCrit := C_NotifyCrit.Value; C_MROHarmRisk := last of ( field_list WHERE field_list.DataItemName = "Admit_free text" and field_list.Control_MultiFieldOccNum = 1); CC_MROHarmRisk := C_MROHarmRisk.Value; If Exists CC_Telemetry And CC_Telemetry = True Then StrFinal := StrFinal || ", Telemetry "; Endif; If Exists CC_CCU And CC_CCU = True Then StrFinal := StrFinal || ", CCU "; Endif; If Exists CC_Moni_Bed And CC_Moni_Bed = True Then StrFinal := StrFinal || ", Monitored Bed "; Endif; If Exists CC_ICU And CC_ICU = True Then StrFinal := StrFinal || ", ICU " ; Endif; If Exists CC_Isolation And CC_Isolation = True Then StrFinal := StrFinal || ", Isolation "; Endif; If Exists CC_Unit Then StrFinal := StrFinal || ", " || CC_Unit ; Endif; If Exists CC_Condition Then StrFinal := StrFinal || ", " || CC_Condition ; Endif; /*If Exists CC_Diagnosis Then StrFinal := StrFinal || ", Diagnosis :" || CC_Diagnosis ; Endif;*/ If Exists CC_Sp_Instr Then StrFinal := StrFinal || ", Special Instructions :" || CC_Sp_Instr ; Endif; /*If Exists CC_Notify Then StrFinal := StrFinal || ", Notify :" || CC_Notify ; Endif; If Exists CC_NotifyCrit Then StrFinal := StrFinal || ", " || CC_NotifyCrit ; Endif; */ //If Exists CC_HealthIssue Then // StrFinal := StrFinal || ", Mandatory Health Issue :" || CC_HealthIssue ; Endif; If Exists CC_MROHarmRisk Then StrFinal := StrFinal || ", " || CC_MROHarmRisk ; Endif; // To Remove all Null Values StrFinal := Call (StrFinal as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}).Replace with "null" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}, "" as {{{SINGLE-QUOTE}}}String{{{SINGLE-QUOTE}}}; local_session.SessionRequestBed := StrFinal ; local_session.SessionAdmissionOrderConfirmation := "Admission Type: " || AdmissionOrderName || " Admit Diagnosis: " || Admit_Diagnosis.Value; local_session.SessionAdmissionOrderAttendingPhysician := HI_Attn_Provider; local_session.SessionAdmissionOrderEffectiveDate := Eff_Date_Converted || " " || Eff_Time_Value; //============================================= //idest:= destination{IntermediateMessage: Warning, "ColValue",high, chart, "RuleGroupHere1", 1001, "", "" }; ;; priority: 50 ;; evoke: ;; logic: conclude true; ;; action: // write "d" at idest; return this_communication, this_form; ;; Urgency: 50;; end: