110 lines
4.2 KiB
Plaintext
110 lines
4.2 KiB
Plaintext
maintenance:
|
|
|
|
title: Formats results to be displayed in alert message;;
|
|
mlmname: STD_FUNC_FORMAT_RESULT;;
|
|
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: Formats result text to return to calling MLM for use in alert messages.
|
|
;;
|
|
explanation: This MLM returns "msg_text" to the calling MLM. The variable "msg_text"
|
|
contains the result name, value, text, unit of measure, and the
|
|
performed date of all tests that were sent in to this MLM.
|
|
|
|
Example: Serum Potassium 3.5 mmol/L on March 15, 2001 10:15 am.
|
|
Serum Potassium 3.8 mmol/L on March 17, 2001 8:30 am.
|
|
|
|
This MLM relys on calling MLM to send
|
|
- a list of result names
|
|
- a list of result values
|
|
- a list of any text sent with values
|
|
- a list of unit of measures sent with values
|
|
- a list of date tests were performed
|
|
|
|
;;
|
|
keywords:
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
|
|
(result_name_list, // List of result names
|
|
result_value_list, // List of result values
|
|
result_text_list, // List of any text sent with values
|
|
result_uom_list, // List of unit of measures sent with values
|
|
result_performed_date_list, // List of date tests were performed
|
|
result_community_source_list, // list of community source
|
|
include_community_source, // flag to indicate if source should be added to aler
|
|
community_results_alert_text // optional
|
|
):= ARGUMENT;
|
|
|
|
;;
|
|
evoke:
|
|
;;
|
|
logic:
|
|
msg_text := "";
|
|
|
|
index_list := 1 seqto (count result_name_list);
|
|
|
|
for I in index_list do
|
|
// Process each item on the lists
|
|
result_name := last (first I from result_name_list);
|
|
result_value := last (first I from result_value_list);
|
|
result_text := last (first I from result_text_list);
|
|
result_uom := last (first I from result_uom_list);
|
|
result_performed_date := last (first I from result_performed_date_list);
|
|
result_community_source := last (first I from result_community_source_list);
|
|
|
|
// Format each item for the message
|
|
if I > 1 then msg_text := msg_text || "\n"; endif;
|
|
if exist result_name then msg_text := msg_text || result_name; endif;
|
|
if exist result_value then msg_text := msg_text || " " || result_value; endif;
|
|
if exist result_text then msg_text := msg_text || " " || result_text; endif;
|
|
if exist result_uom then msg_text := msg_text || " " || result_uom; endif;
|
|
if exist result_performed_date then
|
|
msg_text := (msg_text, " on ", result_performed_date)
|
|
formatted with "%s%s%.4t";
|
|
endif;
|
|
|
|
if exist result_community_source then
|
|
|
|
if exist community_results_alert_text AND
|
|
community_results_alert_text <> "" then
|
|
community_source_suffix := "(" || community_results_alert_text;
|
|
if ( include_community_source ) then
|
|
community_source_suffix := community_source_suffix || " Source: " || result_community_source;
|
|
endif;
|
|
msg_text := msg_text || " {{+B}}" || community_source_suffix || "){{-B}}";
|
|
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
|
|
conclude TRUE;
|
|
;;
|
|
action:
|
|
return msg_text ;
|
|
;;
|
|
end:
|