175 lines
5.5 KiB
Plaintext
175 lines
5.5 KiB
Plaintext
maintenance:
|
|
|
|
title: SCH_CODE_STATUS_DEFAULT_COMMENT;;
|
|
filename: SCH_CODE_STATUS_DEFAULT_COMMENT;;
|
|
arden: version 2.50;;
|
|
version: 16.3;;
|
|
institution: St. Clair Hospital;;
|
|
author: Juliet Law;;
|
|
specialist: Peggy Leschak;;
|
|
date: 2017-11-22;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: This MLM will modify the Code Status comment IF "Ethically Unable to Determine" order exists on patient.
|
|
|
|
;;
|
|
explanation: When a code status order is placed on a patient, the interface boomerangs a comment back into SCM so the CPR and Code Status
|
|
verbiage is visible in the patient header. If "Ethically Unable to Determine" order is included in the code status orders
|
|
for the patient, the patient header needs to display "(Default)" next to the code status verbiage so physicians have an
|
|
indicator that this order exists.
|
|
|
|
This MLM will trigger when the interface enters the Code Status comment and update the verbiage if the "Ethically Unable to Determine"
|
|
order exists.
|
|
|
|
Change History
|
|
|
|
11.22.2017 JML CSR 26413: Created
|
|
|
|
;;
|
|
keywords: Code Status, Patient Comment
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
|
|
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
|
include standard_libs;
|
|
|
|
log_execution_info:= false;
|
|
continueProcessing := false;
|
|
|
|
order_enter_event := EVENT { OrderEnter User Order : WHERE Name = "Code Status: Ethically unable to determine" };
|
|
order_dc_event := EVENT { OrderDiscontinue User Order : WHERE Name = "Code Status: Ethically unable to determine" };
|
|
|
|
( ClientVisitGUID, ChartGUID, ClientGUID ):= read last { Order : ClientVisitGUID, ChartGUID, ClientGUID REFERENCING EvokingObject };
|
|
|
|
error_destination := destination { Alert } with [
|
|
alert_type := "Warning",
|
|
short_message := "ObjectsPlus Error from MLM",
|
|
priority := "low",
|
|
scope := "chart",
|
|
Rule_group := "ObjectsPlus Error from MLM",
|
|
Rule_number := 1003,
|
|
Rule_subgroup := "",
|
|
Send_with_order := "",
|
|
Alert_dialog_settings := "",
|
|
Display_alert := true ];
|
|
|
|
if ( EvokingEvent = order_dc_event ) then
|
|
|
|
//Retrieve GUID for patient header comment
|
|
discontinueCommentTypeCode := "Code Status Default";
|
|
discontinue_Comment_GUID := read last { "select GUID from CV3CommentDeclaration "
|
|
|| "where TypeCode = " || SQL(discontinueCommentTypeCode)
|
|
|| " AND Status = {{{SINGLE-QUOTE}}}Active{{{SINGLE-QUOTE}}} AND ClientGUID = " || SQL(ClientGUID) } ;
|
|
endif;
|
|
;;
|
|
evoke:
|
|
order_enter_event;
|
|
order_dc_event;
|
|
;;
|
|
logic:
|
|
|
|
try
|
|
if ( EvokingEvent = order_enter_event ) then
|
|
|
|
ClientVisit_obj := call {{{SINGLE-QUOTE}}}ClientVisit{{{SINGLE-QUOTE}}}.FindByPrimaryKey with ( ( ClientVisitGUID as number ) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}} );
|
|
|
|
CodeStatus_Comment_obj := call {{{SINGLE-QUOTE}}}PatientComment{{{SINGLE-QUOTE}}}.CreatePatientComment WITH ( ClientVisit_obj, "Code Status Default" );
|
|
|
|
CodeStatus_Comment_obj.Text := "(Default)";
|
|
|
|
void := call CodeStatus_Comment_obj.Save;
|
|
endif;
|
|
|
|
//Destroy object
|
|
if ( CodeStatus_Comment_obj is NOT NULL ) then
|
|
void := call CodeStatus_Comment_obj.Dispose;
|
|
CodeStatus_Comment_obj := null;
|
|
endif;
|
|
|
|
if ( ClientVisit_obj IS NOT NULL ) then
|
|
void := call ClientVisit_obj.Dispose;
|
|
ClientVisit_obj := null;
|
|
endif;
|
|
|
|
endtry;
|
|
|
|
catch exception ex
|
|
|
|
error_occurred := true;
|
|
error_message := "{{+R}}New Comment:{{-R}}\n" || ex.Message || "\n\n";
|
|
if ex.InnerException is not null net_object then
|
|
error_message := error_message ||
|
|
"Inner Exception: " || ex.InnerException.Message || "\n\n";
|
|
endif;
|
|
|
|
if (CodeStatus_Comment_obj is NOT NULL ) then
|
|
void:= call CodeStatus_Comment_obj.Dispose;
|
|
CodeStatus_Comment_obj:= null;
|
|
endif;
|
|
|
|
if ( ClientVisit_obj IS NOT NULL ) then
|
|
void := call ClientVisit_obj.Dispose;
|
|
ClientVisit_obj := null;
|
|
endif;
|
|
|
|
endcatch;
|
|
|
|
try
|
|
if ( EvokingEvent = order_dc_event AND exists discontinue_Comment_GUID ) then
|
|
|
|
CodeStatus_DiscontinueComment_obj := call {{{SINGLE-QUOTE}}}PatientComment{{{SINGLE-QUOTE}}}.FindByPrimaryKey WITH ( ( discontinue_Comment_GUID as number ) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}} );
|
|
|
|
void := call CodeStatus_DiscontinueComment_obj.Discontinue;
|
|
|
|
void := call CodeStatus_DiscontinueComment_obj.Save;
|
|
|
|
endif;
|
|
|
|
//Destroy object
|
|
if ( CodeStatus_DiscontinueComment_obj IS NOT NULL ) then
|
|
void := call CodeStatus_DiscontinueComment_obj.Dispose;
|
|
CodeStatus_DiscontinueComment_obj := null;
|
|
endif;
|
|
|
|
endtry;
|
|
|
|
catch exception ex
|
|
|
|
error_occurred := true;
|
|
|
|
error_message := "{{+R}}New Comment:{{-R}}\n" || ex.Message || "\n\n";
|
|
if ex.InnerException is not null net_object then
|
|
error_message := error_message ||
|
|
"Inner Exception: " || ex.InnerException.Message || "\n\n";
|
|
endif;
|
|
|
|
if ( CodeStatus_DiscontinueComment_obj IS NOT NULL ) then
|
|
void := call CodeStatus_DiscontinueComment_obj.Dispose;
|
|
CodeStatus_DiscontinueComment_obj := null;
|
|
endif;
|
|
|
|
endcatch;
|
|
|
|
conclude true;
|
|
;;
|
|
action:
|
|
|
|
// write " Messages version 1.2 " at alert_dest;
|
|
|
|
if Error_occurred then
|
|
|
|
write "An error has occured in the MLM {{+B}}SCH_CODE_STATUS_DEFAULT_COMMENT{{-B}} " ||
|
|
"Please notify your System Administrators that an error message has " ||
|
|
"occurred for this patient. They will review the following error " ||
|
|
"message: \n" at error_destination;
|
|
|
|
write error_message at error_destination;
|
|
|
|
endif;
|
|
|
|
;;
|
|
end:
|