Files
St.Clair/MLMStripper/bin/Debug/STD/STD_DUPLICATE_ORDER_SET.mlm

222 lines
7.5 KiB
Plaintext

maintenance:
title: Duplicate Order Set Checking;;
mlmname: STD_DUPLICATE_ORDER_SET;;
arden: version 2.5;;
version: 18.4;;
institution: Allscripts, Standard MLM;;
author: Allscripts Healthcare Solutions, Inc.;;
specialist: ;;
date: 2018-10-26;;
validation: testing;;
/* P r o p r i e t a r y N o t i c e */
/* Unpublished (c) 2013 - 2018 Allscripts Healthcare, LLC. and/or its affiliates. All Rights Reserved.
P r o p r i e t a r y N o t i c e: This software has been provided pursuant to a License Agreement, with
Allscripts Healthcare, LLC. and/or its affiliates, containing restrictions on its use. This software contains
valuable trade secrets and proprietary information of Allscripts Healthcare, LLC. and/or its affiliates and is
protected by trade secret and copyright law. This software may not be copied or distributed in any form or medium,
disclosed to any third parties, or used in any manner not provided for in said License Agreement except with prior
written authorization from Allscripts Healthcare, LLC. and/or its affiliates. Notice to U.S. Government Users:
This software is {{{SINGLE-QUOTE}}}Commercial Computer Software{{{SINGLE-QUOTE}}}.
All product names are the trademarks or registered trademarks of Allscripts Healthcare, LLC. and/or its affiliates.
*/
/* P r o p r i e t a r y N o t i c e */
library:
purpose: Provide Duplicate Order Set Checking.
The checking will include:
1. Order sets of the same name or type within a pre-defined date range,
which will be varied by patient location.
2. Active order sets of the same type
;;
explanation: An Evoking-Order-Set is considered a duplicate of Other-Order-Sets when all of
the criteria listed below are met:
a. The evoking-order-set is a NEW order set
b. The evoking-order-set is not excluded from duplicate checking
(over-all or by patient location).
c. The order sets have identical Item Names (i.e.Catalog GUIDs),
or the other-order-set matches the Sets
listed in the evoking-order-set{{{SINGLE-QUOTE}}}s catalog duplicate-checking panel.
d. The other-order-sets are within the scoping rules for the patient location listed
in the evoking-order-set{{{SINGLE-QUOTE}}}s Duplicate Policy. The patient{{{SINGLE-QUOTE}}}s location is based on
the location-business-rules established by the facility for other parts of
Sunrise Clinical Manager.
Once a duplicate order set has been identified, selection of the appropriate message
is based on the defined MESSAGE TYPE in the catalog.
;;
keywords: Duplicate Order Set;
;;
citations:
{{+B}}Development{{-B}}: Allscripts Healthcare Solutions, Inc. Clinical Information can be customized and configured by local facility.
{{+B}}Funding{{-B}}: None specific to the development of this alert
{{+B}}Release{{-B}}: None
{{+B}}Revision Date{{-B}}: 2012-11-07
{{+B}}Citations{{-B}}: None
;;
knowledge:
type: data-driven;;
data:
/***************Make Changes To Spelling And Flags In This Section***************/
/* Set to true if logging is needed.*/
log_execution_info := false;
/* Change the message within the quotes if a different short-message is needed.*/
duplicate_order_set_alert:= destination { Alert: warning,
"Duplicate Order Set", low, chart,
"HVC Duplicate", 2005 };
/* Event statement does not require a change in this MLM.*/
any_new_order_set:= event {OrderSetEnter User OrderSet : where StartDtm is not null};
/********************************************************************************/
/* Executes only when this MLM is called by the editor */
if called_by_editor then
/* Get current selected client visit in MLM Editor. */
(client_visit_guid,
current_visit) := read last
{ClientVisit: GUID, This };
/* Search for example order set in the current visit. */
EvokingObject:= read last
{OrderSet: This
WHERE OrderSetName = "Joyce Linked Parent (w STD & linked)" AND ClientVisitGUID = client_visit_guid
};
endif;
/* Declares MLMs which can be called */
func_dup_message:= MLM {{{SINGLE-QUOTE}}}std_func_order_set_dup_messages{{{SINGLE-QUOTE}}};
func_check_for_duplicates:= MLM {{{SINGLE-QUOTE}}}std_func_order_set_dup_rules{{{SINGLE-QUOTE}}};
/* Gets the Client GUID */
client_guid := read last {ClientInfo: GUID};
/* Gets information from the evoking order set */
(order_set_name,
evoking_object_guid,
order_set_catalog_guid,
chart_guid,
client_visit_guid,
order_set_start_date ) := read last
{OrderSet: OrderSetName, GUID, OrderCatalogSetGUID,
ChartGUID, ClientVisitGUID, StartDtm
REFERENCING EvokingObject};
/* Gets the patient{{{SINGLE-QUOTE}}}s location group */
If called_by_editor
Then
/* Get visit information from the current selected visit in MLM Editor. */
patient_loc_group:= read last
{ ClientVisit: BusinessRuleLocationGUID
REFERENCING current_visit};
Else
patient_loc_group:= read last
{ ClientVisit: BusinessRuleLocationGUID };
Endif;
;;
evoke: any_new_order_set
;;
logic:
//----------------------------------------------------------------
// If there is no evoking object then do nothing, this can
// only be true for the MLM Editor
//----------------------------------------------------------------
If EvokingObject is NULL
then conclude false;
endif;
If NOT continue_checking_order_set
then conclude false;
endif;
/* Initialize variables */
indent:= " ";
dash_line:= "-----";
printable_alert_msg:= "";
/* Process the order_sets for duplicates */
(exact_msg,
performed_msg,
scheduled_msg,
exact_type,
subset_type,
superset_type,
same_set_type,
partial_match_type,
no_std_message_type,
matching_name_list,
matching_order_set_guid_list,
matching_start_date_list,
matching_msg_type_list,
matching_msg_text_list,
matching_time_msg_list,
matching_order_set_type_code_list ) := call func_check_for_duplicates with
(order_set_name,
evoking_object_guid,
order_set_catalog_guid,
chart_guid,
client_visit_guid,
order_set_start_date,
patient_loc_group);
/*--------------------------------------------------------------*/
/* Calls an MLM to select the appropriate message and format it */
/*--------------------------------------------------------------*/
If exist matching_name_list
then
(alert_msg,
matching_short_message_list):= call func_dup_message with
(order_set_name,
exact_msg,
performed_msg,
scheduled_msg,
exact_type,
subset_type,
superset_type,
same_set_type,
partial_match_type,
no_std_message_type,
matching_name_list,
matching_start_date_list,
matching_msg_type_list,
matching_msg_text_list,
matching_time_msg_list,
matching_order_set_type_code_list);
/* Format date, removing milliseconds */
order_set_start_date_formatted := order_set_start_date formatted with "%.4t";
/* Create one long message to print */
printable_alert_msg:= printable_alert_msg || alert_msg;
endif; /* If exist matching_name_list */
/*---------------*/
/* Clinical Rule */
/*---------------*/
If exist alert_msg
then conclude true;
endif;
;;
action:
write "The current Order Set: \n"
|| indent || order_set_name || "\n"
|| indent || "Date: " || order_set_start_date_formatted ||"\n"
|| "\n"
|| "May be duplicate with: \n\n"
|| printable_alert_msg
at duplicate_order_set_alert;
;;
Urgency: 50;;
end: