Files
St.Clair/MLMStripper/bin/Debug/FORM/FORM_SET_SPINALTAP_LABS.mlm

158 lines
5.5 KiB
Plaintext

maintenance:
title: FORM_SET_SPINALTAP_LABS;;
mlmname: FORM_SET_SPINALTAP_LABS;;
arden: version 2.5;;
version: 5.50;;
institution: St Clair Hospital;;
author: Shawn Head x7468, Allscripts ;;
specialist: Maria Pest, Allscripts;;
date: 2018-04-05;;
validation: testing;;
library:
purpose: coppied from FORM_SET_THORACENTESIS MLM ;;
explanation: This MLM is called from ...
Change history
2018.04.05 STH CSR 36361: Created {GO LIVE 4/17/2018}
;;
keywords: Called MLMs, Thoracentesis, Paracentesis
;;
knowledge:
type: data-driven;;
data:
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
include standard_libs;
using "ObjectsPlusXA.SCM.Forms";
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
generic_mlm := mlm {{{SINGLE-QUOTE}}}FORM_SET_GENERIC_ITEM_CONTROL{{{SINGLE-QUOTE}}};
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}};
// This MLM is passed three arguments, of types
// communication_type, form_type and client info object respectively.
(this_communication, // Communication object
this_form, // Form object
client_info_obj //Arden ClientInfo object
) := argument;
/*******************Make Changes To Spelling And Flags In This Section*******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := FALSE;
/***************************************************************************************/
// Initialize error message
error_message:="";
// Assigns fields passed in the Form object to the Field object
field_list:= this_form.fields;
CallingEvent := this_communication.CallingEvent;
CallingField := this_communication.CallingFieldName;
ClientGuid := this_communication.ClientGUID;
FormName := this_form.Name;
CR := 13 formatted with "%c";
LF := 10 formatted with "%c";
//This field was already available from the Centesis order set. Might want to create a new field?
Labs_List_fld := last of (field_list WHERE field_list.DataItemName = "Labs on Centesis"
and field_list.Control_MultiFieldOccNum = 1);
//This field was already available from the Centesis order set. Might want to create a new field?
Cytology_List_fld := last of (field_list WHERE field_list.DataItemName = "Cytology on Centesis"
and field_list.Control_MultiFieldOccNum = 1);
LabSerumRequired_fld := last of (field_list WHERE field_list.DataItemName = "LAB_SpecType_Protected"
and field_list.Control_MultiFieldOccNum = 1);
LabSerumItems_fld := last of (field_list WHERE field_list.DataItemName = "MultiOrderGrid"
and field_list.Control_MultiFieldOccNum = 3);
if(true in LabSerumItems_fld.Value.IsSelected) then
LabSerumRequired_fld.Value := "Serum Specimen (Red Top) MUST accompany Spinal Fluid for Orders entered";
else
LabSerumRequired_fld.Value := "";
endif;
if (CallingEvent = "FieldChange") then
listings := call str_parse with CAllingField,"|";
CF_DataItemName := listings[1];
CF_MF_OccNum := listings[2];
SelectedItems_Fld := last of (field_list where field_list.DataItemName = CF_DataItemName
and field_list.Control_MultiFieldOccNum = (CF_MF_OccNum as number));
SelectedItems_list := (SelectedItems_Fld.Value.Name where SelectedItems_Fld.Value.IsSelected = true);
DeSelectedItems_list := (SelectedItems_Fld.Value.Name where SelectedItems_Fld.Value.IsSelected = false);
if(DeSelectedItems_list[1] matches pattern "%cytology%") then
Cytology_List_fld.Value := "";
endif;
for i in 1 seqto (count SelectedItems_list) do
if((SelectedItems_list[i] matches pattern "%cytology%"))then
Cytology_List_fld.Value := SelectedItems_list[i];
else
findselected := find SelectedItems_list[i] in string Labs_List_fld.Value;
if((findselected = 0) OR (findselected is null)) then
if (not (SelectedItems_list[i] matches pattern "%Cytology%")) then
if ((Labs_List_fld.Value is null) or (Labs_List_fld.Value = "")) then
Labs_List_fld.Value := SelectedItems_list[i];
else
Labs_List_fld.Value := Labs_List_fld.Value || ", " || SelectedItems_list[i];
endif;
endif;
endif;
endif;
enddo;
AllLabs := Labs_List_fld.Value;
for i in 1 seqto (count deSelectedItems_list) do
findlabs := find deSelectedItems_list[i] in string Labs_List_fld.Value;
if(findlabs > 0) then
replaceitem := deSelectedItems_list[i];
if(findlabs > 0 or findcyto > 0) then
UpdatedSelectedItems := read last {"select replace(replace(" || sql(AllLabs)
|| ",{{{SINGLE-QUOTE}}}, " || replaceitem
|| "{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}})," || sql(replaceitem)
|| ",{{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}})"};
AllLabs := UpdatedSelectedItems;
endif;
endif;
enddo;
findcomma := find ", " in string AllLabs;
if(findcomma = 1) then
AllLabs := substring ((length of AllLabs) -2) characters STARTING AT 3 from AllLabs;
endif;
Labs_List_fld.Value := AllLabs;
endif;
//Execute the generic MLM on form open
execute_generic_mlm := call generic_mlm with this_communication, this_form, client_info_obj;
;;
evoke: // No evoke statement
;;
logic:
conclude true;
;;
action:
// This MLM returns two parameters, of types communication_type and form_type respectively.
return this_communication, this_form;
;;
end: