Files
St.Clair/MLMStripper/bin/Debug/SCH/SCH_SURGERY_DOB_COLUMN_UPDATE.mlm

113 lines
3.4 KiB
Plaintext

maintenance:
title: SCH_SURGERY_DOB_COLUMN_UPDATE;;
mlmname: SCH_SURGERY_DOB_COLUMN_UPDATE;;
arden: version 2.5;;
version: 16.3;;
institution: St. Clair Hospital;;
author: Courtney Carr;;
specialist: Don Warnick ;;
date: 2018-08-28;;
validation: testing;;
library:
purpose: This will uptdate columns on the Case List when a DOB is corrected.
;;
explanation: This MLM is triggered on DOB correction.
Change history
08.28.2018 DW HD# 3393937 DOB correction made after case creation does not update the column with the new DOB - Created
;;
keywords: Surgery
;;
knowledge:
type: data-driven;;
data:
log_execution_info := false;
error_occurred:= false;
error_message := "";
// Destinations and Evokes
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 := 1001,Rule_subgroup := "",Send_with_order := "",Alert_dialog_settings := "",Display_alert := true ];
alert_destination := destination { Alert } with [alert_type := "FUNCTIONAL_MLM_EVOKE", short_message:="Column Update", Priority:="high",scope:="chart",rule_group:="Call MLM Group",rule_number:=9050,send_with_order:= "DoNotSend",alert_abstract:= "",alert_dialog_settings:= ""];
client_modify_event:= event{ClientModify Any ClientInfo};
ClientGuid := read last{ClientInfo:GUID};
// Birthdate column processing
birthdate := read last { ClientInfo: BirthDate};
birthyear := SUBSTRING 4 CHARACTERS STARTING AT 7 from (birthdate as string);
birthmonth := SUBSTRING 2 CHARACTERS STARTING AT 1 from (birthdate as string);
birthday := SUBSTRING 2 CHARACTERS STARTING AT 4 from (birthdate as string);
columnvalue:= birthyear || "-" || birthmonth || "-" || birthday;
// Find the patient{{{SINGLE-QUOTE}}}s surgery cases and create a "column update" message for each case
// Find patient cases
(case_id_string) := read
{
"
select sc.caseid
from SXASRGCase sc with (nolock)
where sc.ClientGUID = " || ClientGuid || // " and sc.ClientVisitGUID = " || ClientVisitGUID ||
" order by ScheduledStartDateTimeUTC desc "
};
// Create a string of column update messages
if exists case_id_string
then
casestring := "";
for i in 1 seqto count case_id_string do
case_id := case_id_string[i];
casestring := casestring || "CL^"|| case_id || "^Birthdate^" || columnvalue || "|";
enddo;
endif;
;;
priority: 50
;;
evoke:
client_modify_event;
;;
logic:
conclude true;
;;
action:
if error_occurred
then
write "An error has occured in the MLM {{+B}}SCH_SURGERY_DOB_COLUMN_UPDATE{{-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;
// Write column message string to the destination. Creates a row in CV3AlertDeclaration which will be processed by
if exists case_id_string
then
write casestring at alert_destination;
endif;
;;
Urgency: 50;;
end: