maintenance: title: SCH_Surgery_StatusChange_Anesthesia;; mlmname: SCH_Surgery_StatusChange_Anesthesia;; arden: version 2.5;; version: 16.3;; // institution: Allscripts, ;; author: Allscripts Healthcare Solutions, Inc.;; specialist: ;; date: 2017-04-11;; validation: Testing;; library: purpose: Maintains an Alert when SUrgCase status change is done to "Procedure Complete" with missing Anesthesia data ;; explanation: This MLM is a sample of alert on SUrgCase status change with missing data - and hard stop alert 01/07/15 - Allscripts - change trigger and status to regard to "Procedure Complete" and update alert message 04/05/17 - Allscripts - initiate readiness and deploy at SCH Dev 05/01/17 - updated for enhanced anesthesia checking upon close with iPro 07/19/17 - demoted out of PRod uction status as CU 8 has cared for iPro to write into closed cases 10/09/17 - revert back to 04/05/17 version for hardstop if no Anesth Type ;; keywords: ObjectsPlus, Advanced Visit List Data, Health Issues ;; knowledge: type: data-driven;; data: //****************Make Changes To Spelling And Flags In This Section**************** // list of CPT{{{SINGLE-QUOTE}}}s to check for - to see if COnsult /// for case statuses that to be considered the logic in_prog_status:= "Procedure Complete", "Transfer to In-patient"; //"In OR", "Ready for Recovery Room", "Closing Started" ; //------------------------------------------------------------------- // Triggers //------------------------------------------------------------------- // Case status event CaseStatusInternalType /// 07/18/15 - update to look at Internal Type for status case_status_event := EVENT {SRGCaseStatusChange User SRGCase: Where (CaseStatusInternalType in ("Complete") ) }; // Where (CaseStatusName in ("Procedure Complete") ) }; // "In OR", "Ready for Recovery Room", "Closing Started" )) }; //--------------------------------------------------------------- // Email and ObjectsPlus destinations //--------------------------------------------------------------- /// flags test_a:= "&"; a:= 0; ct_get_con:= 0; //******************Do Not Make Changes Below This Section******************* // Specify which .NET assemblies need to be loaded for ObjectsPlus standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; if called_by_editor then EvokingObject := read last {SRGCase: THIS }; evokingevent:= case_status_event; endif; //break; /// for STV Surg Procedures // Get the case events object from the evoking case object // find the surg case events bu_case_obj:= evokingObject.backup; get_status:= EVOKINGOBJECT.CaseStatusName; get_status_type:= EVOKINGOBJECT.CaseStatusInternalType; get_anesth:= EVOKINGOBJECT.AnesthesiaTypeName; get_anesth_id:= EVOKINGOBJECT.AnesthesiaTypeID ; proc_end := evokingobject.ActualEndDateTimeUTC; /// testing if called_by_editor then proc_end:= NOW - 8 days; endif; /// //break; /// logic for anesthesia needed /// 07/18/16 - update to look at internal status type if ( get_status in in_prog_status OR get_status_type in ("Complete") ) and not(bu_case_obj.CaseStatusName in in_prog_status) then if not (exists get_anesth) then a:=1; endif; endif; // break; ////////////////////////////////////////////////////////////////////////////// /// test for logic If a > 0 then //break; alert_text:=// "Procedure Status Update to: "||get_status||" \n{{+B}} IS NOT permitted on a Procedure without {{{SINGLE-QUOTE}}}Anesthesia Type{{{SINGLE-QUOTE}}} documented. {{-B}}" //|| proc_f // for a {{+B}}{{+C}}Consult Code{{-C}} {{-B}}" "\nPlease document {{+B}} {{+R}}Anesthesia Type {{-R}}{{-B}} on the {{+B}}Case Header{{-B}} tab for this Case." ||"\n\n Then you may proceed to Close the Case."; // below if you need to enter the NDC Codes."; //||"It is being deleted.\n\nYou Must Re-Value to get a Score"; dest_var:= destination{alert: warning, "Anesthesia Type is Required", low, chart, "my rule group", 1001, "", "No Override Allowed" }; endif; // a >0 an //break; ;; priority: 50 ;; evoke: case_status_event ;; logic: if a = 0 //( EvokingObject is null or ///continue_processing = false ) then conclude false; elseif a > 0 then conclude true; endif; //break; ;; action: if exists dest_var //and a >0 then write alert_text at dest_var; endif; ;; urgency: 50;; end: