377 lines
15 KiB
Plaintext
377 lines
15 KiB
Plaintext
maintenance:
|
|
|
|
title: FORM_SET_PARACENTESIS_CCM_LABS;;
|
|
mlmname: FORM_SET_PARACENTESIS_CCM_LABS;;
|
|
arden: version 2.5;;
|
|
version: 5.50;;
|
|
institution: St Clair Hospital;;
|
|
author: Juliet M. Law, Allscripts ;;
|
|
specialist: Maria Pest, Allscripts;;
|
|
date: 2012-12-03;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Lab orders entered on Thoracentesis and Paracentesis Order Sets need to display on MI and Cytology requisitions
|
|
;;
|
|
|
|
explanation: This MLM is called from ...
|
|
|
|
Change history
|
|
2012.12.03 JML CSR 30985: Created
|
|
2014.09.15 STH CSR 31956: Changed name from "FORM_SET_THORACENTESIS_PARACENTESIS_LABS" to "FORM_SET_PARACENTESIS_CCM_LABS" as this MLM will be for para and CCM. Thoracentesis OS was updated for new layout and logic.
|
|
|
|
|
|
;;
|
|
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_item_control := mlm {{{SINGLE-QUOTE}}}FORM_SET_GENERIC_ITEM_CONTROL{{{SINGLE-QUOTE}}};
|
|
ccm_thoracentesis := mlm {{{SINGLE-QUOTE}}}FORM_SET_CCM_THORACENTESIS{{{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";
|
|
|
|
//Retrieve fields
|
|
Labs_fld := last of (field_list WHERE field_list.DataItemName = "MultiOrderCheckbox"
|
|
and field_list.Control_MultiFieldOccNum = 1);
|
|
Labs_fld_List := Labs_fld.Value;
|
|
|
|
US_Thor_fld := last of (field_list WHERE field_list.DataItemName = "MultiOrderGrid"
|
|
and field_list.Control_MultiFieldOccNum = 2);
|
|
US_Thor_fld_List := US_Thor_fld.Value;
|
|
|
|
CCM_Left_Thor_fld := last of (field_list WHERE field_list.DataItemName = "CCM Left Thoracentesis"
|
|
and field_list.Control_MultiFieldOccNum = 1);
|
|
CCM_Left_Thor_fld_List := CCM_Left_Thor_fld.Value;
|
|
|
|
CCM_Right_Thor_fld := last of (field_list WHERE field_list.DataItemName = "CCM Right Thoracentesis"
|
|
and field_list.Control_MultiFieldOccNum = 1);
|
|
CCM_Right_Thor_fld_List := CCM_Right_Thor_fld.Value;
|
|
|
|
CCM_LR_Thor_fld := last of (field_list WHERE field_List.DataItemName = "CCM L/R Thoracentesis"
|
|
and field_list.Control_MultiFieldOccNum = 1);
|
|
CCM_LR_Thor_fld_List := CCM_LR_Thor_fld.Value;
|
|
|
|
CCM_Left_Thor_Labs_fld := last of (field_list WHERE field_list.DataItemName = "MultiOrderCheckbox"
|
|
and field_list.Control_MultiFieldOccNum = 2);
|
|
CCM_Left_Labs_List := CCM_Left_Thor_Labs_fld.Value;
|
|
|
|
CCM_Right_Thor_Labs_fld := last of (field_list WHERE field_list.DataItemName = "MultiOrderCheckbox"
|
|
and field_list.Control_MultiFieldOccNum = 3);
|
|
CCM_Right_Labs_List := CCM_Right_Thor_Labs_fld.Value;
|
|
|
|
Labs_Right_Left_fld := last of (field_list WHERE field_list.DataItemName = "LAB_VO_Right or Left");
|
|
//and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
Labs_Right_Left2_fld := last of (field_list WHERE field_list.DataItemName = "LAB_SREQ_VO_DI_Left or Right");
|
|
//and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
Labs_List_fld := last of (field_list WHERE field_list.DataItemName = "Labs on Centesis"
|
|
and field_list.Control_MultiFieldOccNum = 1);
|
|
Cytology_List_fld := last of (field_list WHERE field_list.DataItemName = "Cytology on Centesis"
|
|
and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
if (CallingEvent = "FieldChange") then
|
|
//Applies to Order Set(s) US Thoracentesis and US Paracentesis
|
|
if (CallingField = "MultiOrderGrid|2") then
|
|
(this_communication, this_form) := call generic_item_control WITH (this_communication, this_form, client_info_obj);
|
|
|
|
if (US_Thor_fld_List.IsSelected[1] = true) then
|
|
|
|
//Above MLM call checks all of the labs; populate text boxes
|
|
for i in 1 seqto (count Labs_fld_List.Name) do
|
|
if (not (Labs_fld_List.Name[i] matches pattern "%Cytology%")) then
|
|
if (Labs_List_fld.Value IS NULL) then
|
|
Labs_List_fld.Value := Labs_fld_List.Name[i];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || Labs_fld_List.Name[i];
|
|
endif;
|
|
else
|
|
if (Cytology_List_fld.Value IS NULL) then
|
|
Cytology_List_fld.Value := Labs_fld_List.Name[i];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || Labs_fld_List.Name[i];
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
else
|
|
Labs_List_fld.Value := null;
|
|
Cytology_List_fld.Value := null;
|
|
|
|
endif;
|
|
//Applies to Order Set(s) US Thoracentesis, SP Thoracentesis, CT Thoracentesis,
|
|
// US Paracentesis, SP Paracentesis, CT Paracentesis
|
|
elseif (CallingField = "MultiOrderCheckbox|1") then
|
|
|
|
if (Labs_Right_Left_fld.Value IS NOT NULL) then
|
|
if (Labs_Right_Left_fld.Value matches pattern "%Left%") then
|
|
Labs_List_fld.Value := "Left: ";
|
|
Cytology_List_fld.Value := "Left: ";
|
|
elseif (Labs_Right_Left_fld.Value matches pattern "%Right%") then
|
|
Labs_List_fld.Value := "Right: ";
|
|
Cytology_List_fld.Value := "Right: ";
|
|
else
|
|
Labs_List_fld.Value := "";
|
|
Cytology_List_fld.Value := "";
|
|
endif;
|
|
else
|
|
Labs_List_fld.Value := "";
|
|
Cytology_List_fld.Value := "";
|
|
endif;
|
|
|
|
for i in 1 seqto (count Labs_fld_List.Name) do
|
|
if (not (Labs_fld_List.Name[i] matches pattern "%Cytology%")) then
|
|
if (Labs_fld_List.IsSelected[i]) then
|
|
if (Labs_List_fld.Value = "") then
|
|
Labs_List_fld.Value := Labs_fld_List.Name[i];
|
|
elseif (Labs_List_fld.Value = "Left: " OR Labs_List_fld.Value = "Right: ") then
|
|
Labs_List_fld.Value := Labs_List_fld.Value || Labs_fld_List.Name[i];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || Labs_fld_List.Name[i];
|
|
endif;
|
|
endif;
|
|
else
|
|
if (Labs_fld_List.IsSelected[i]) then
|
|
if (Cytology_List_fld.Value = "") then
|
|
Cytology_List_fld.Value := Labs_fld_List.Name[i];
|
|
elseif (Cytology_List_fld.Value = "Left: " OR Cytology_List_fld.Value = "Right: ") then
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || Labs_fld_List.Name[i];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || Labs_fld_List.Name[i];
|
|
endif;
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
elseif (CallingField = "LAB_VO_Right or Left|1") then
|
|
new_string := Labs_List_fld.Value;
|
|
new_string2 := Cytology_List_fld.Value;
|
|
|
|
//Need to test if preceeding {{{SINGLE-QUOTE}}}right{{{SINGLE-QUOTE}}} or {{{SINGLE-QUOTE}}}left{{{SINGLE-QUOTE}}} already exists
|
|
rt_side_loc := FIND "Right:" IN STRING Labs_List_fld.Value;
|
|
if (rt_side_loc = 0) then
|
|
lt_side_loc := FIND "Left: " IN STRING Labs_List_fld.Value;
|
|
if (lt_side_loc > 0) then
|
|
new_string := SUBSTRING ((Length Labs_List_fld.Value) - (Length "Left: ")) CHARACTERS STARTING AT 7 FROM Labs_List_fld.Value;
|
|
endif;
|
|
elseif (rt_side_loc > 0) then
|
|
new_string := SUBSTRING ((Length Labs_List_fld.Value) - (Length "Right: ")) CHARACTERS STARTING AT 8 FROM Labs_List_fld.Value;
|
|
endif;
|
|
|
|
Labs_List_fld.Value := new_string;
|
|
|
|
rt_side_loc2 := FIND "Right: " IN STRING Cytology_List_fld.Value;
|
|
if (rt_side_loc2 = 0) then
|
|
lt_side_loc2 := FIND "Left: " IN STRING Cytology_List_fld.Value;
|
|
if (lt_side_loc2 > 0) then
|
|
new_string2 := SUBSTRING ((LENGTH Cytology_List_fld.Value) - (LENGTH "Left: ")) CHARACTERS STARTING AT 7 FROM Cytology_List_fld.Value;
|
|
endif;
|
|
else
|
|
new_string2 := SUBSTRING ((LENGTH Cytology_List_fld.Value) - (LENGTH "Right: ")) CHARACTERS STARTING AT 8 FROM Cytology_List_fld.Value;
|
|
endif;
|
|
|
|
Cytology_List_fld.Value := new_string2;
|
|
|
|
if (Labs_Right_Left_fld.Value matches pattern "%Left%") then
|
|
Labs_Right_Left2_fld.Value := "Fluid Collected Left Side (LEFT)";
|
|
lab_side := "Left: ";
|
|
elseif (Labs_Right_Left_fld.Value matches pattern "%Right%") then
|
|
Labs_Right_Left2_fld.Value := "Fluid Collected Right Side (RI)";
|
|
lab_side := "Right: ";
|
|
endif;
|
|
|
|
if (Labs_List_fld.Value is not null) then
|
|
Labs_List_fld.Value := lab_side || Labs_List_fld.Value;
|
|
endif;
|
|
if (Cytology_List_fld.Value is not null) then
|
|
Cytology_List_fld.Value := lab_side || Cytology_List_fld.Value;
|
|
endif;
|
|
//Applies to Order Set Thoracentesis Specimen Handling for CCM (Dr. Fino)
|
|
elseif (CallingField = "CCM Left Thoracentesis|1" OR CallingField = "CCM Right Thoracentesis|1"
|
|
OR CallingField = "CCM L/R Thoracentesis|1") then
|
|
|
|
(this_communication, this_form) := call ccm_thoracentesis with (this_communication, this_form, client_info_obj);
|
|
|
|
//Populate with all right, left, or both labs
|
|
if (CallingField = "CCM Left Thoracentesis|1") then
|
|
if (CCM_Left_Thor_fld_List = true) then
|
|
for i in 1 seqto (Count CCM_Left_Labs_List.Name) do
|
|
if (not (CCM_Left_Labs_List.Name[i] matches pattern "%Cytology%")) then
|
|
if (Labs_List_fld.Value IS NULL) then
|
|
Labs_List_fld.Value := "Left side: " || CCM_Left_Labs_List.Name[i];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || CCM_Left_Labs_List.Name[i];
|
|
endif;
|
|
else
|
|
if (Cytology_List_fld.Value IS NULL) then
|
|
Cytology_List_fld.Value := "Left side: " || CCM_Left_Labs_List.Name[i];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || CCM_Left_Labs_List.Name[i];
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
else
|
|
Labs_List_fld.Value := null;
|
|
Cytology_List_fld.Value := null;
|
|
endif;
|
|
elseif (CallingField = "CCM Right Thoracentesis|1") then
|
|
if (CCM_Right_Thor_fld_List = true) then
|
|
|
|
for i in 1 seqto (count CCM_Right_Labs_List.Name) do
|
|
if (not (CCM_Right_Labs_List.Name[i] matches pattern "%Cytology%")) then
|
|
if (Labs_List_fld.Value IS NULL) then
|
|
Labs_List_fld.Value := "Right side: " || CCM_Right_Labs_List.Name[i];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || CCM_Right_Labs_List.Name[i];
|
|
endif;
|
|
else
|
|
if (Cytology_List_fld.Value IS NULL) then
|
|
Cytology_List_fld.Value := "Right side: " || CCM_Right_Labs_List.Name[i];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || CCM_Right_Labs_List.Name[i];
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
else
|
|
Labs_List_fld.Value := null;
|
|
Cytology_List_fld.Value := null;
|
|
endif;
|
|
elseif (CallingField = "CCM L/R Thoracentesis|1") then
|
|
if (CCM_LR_Thor_fld_List = true) then
|
|
for i in 1 seqto (count CCM_Left_Labs_List.Name) do
|
|
if (not (CCM_Left_Labs_List.Name[i] matches pattern "%Cytology%")) then
|
|
if (Labs_List_fld.Value IS NULL) then
|
|
Labs_List_fld.Value := "Left side: " || CCM_Left_Labs_List.Name[i];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || CCM_Left_Labs_List.Name[i];
|
|
endif;
|
|
else
|
|
if (Cytology_List_fld.Value IS NULL) then
|
|
Cytology_List_fld.Value := "Left side: " || CCm_Left_Labs_List.Name[i];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || CCM_Left_Labs_List.Name[i];
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
for j in 1 seqto (count CCM_Right_Labs_List.Name) do
|
|
if (not (CCM_Right_Labs_List.Name[j] matches pattern "%Cytology%")) then
|
|
if (not (Labs_List_fld.Value matches pattern "%Right side:%")) then
|
|
Labs_List_fld.Value := Labs_List_fld.Value || CR || LF || "Right side: " || CCM_Right_Labs_List.Name[j];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || CCM_Right_Labs_List.Name[j];
|
|
endif;
|
|
else
|
|
if (not (Cytology_List_fld.Value matches pattern "%Right side:%")) then
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || CR || LF || "Right side: " || CCM_Right_Labs_List.Name[j];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || CCM_Right_Labs_List.Name[j];
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
else
|
|
Labs_List_fld.Value := null;
|
|
Cytology_List_fld.Value := Null;
|
|
endif;
|
|
endif;
|
|
//Applies to Order Set Thoracentesis Specimen Handling for CCM (Dr. Fino)
|
|
elseif (CallingField = "MultiOrderCheckbox|2" OR CallingField = "MultiOrderCheckbox|3") then
|
|
Labs_List_fld.Value := "";
|
|
Cytology_List_fld.Value := "";
|
|
for i in 1 seqto (count CCM_Left_Labs_List.Name) do
|
|
if (not (CCM_Left_Labs_List.Name[i] matches pattern "%Cytology%")) then
|
|
if (CCM_Left_Labs_List.IsSelected[i]) then
|
|
if (Labs_List_fld.Value = "") then
|
|
Labs_List_fld.Value := "Left side: " || CCM_Left_Labs_List.Name[i];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || CCM_Left_Labs_List.Name[i];
|
|
endif;
|
|
endif;
|
|
else
|
|
if (CCM_Left_Labs_List.IsSelected[i]) then
|
|
if (Cytology_List_fld.Value = "") then
|
|
Cytology_List_fld.Value := "Left side: " || CCM_Left_Labs_List.Name[i];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || CCM_Left_Labs_List.Name[i];
|
|
endif;
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
for j in 1 seqto (count CCM_Right_Labs_List.Name) do
|
|
if (not (CCM_Right_Labs_List.Name[j] matches pattern "%Cytology%")) then
|
|
if (CCM_Right_Labs_List.IsSelected[j]) then
|
|
if (not (Labs_List_fld.Value matches pattern "%Right side:%")) then
|
|
Labs_List_fld.Value := Labs_List_fld.Value || CR || LF || "Right side: " || CCM_Right_Labs_List.Name[j];
|
|
else
|
|
Labs_List_fld.Value := Labs_List_fld.Value || ", " || CCM_Right_Labs_List.Name[j];
|
|
endif;
|
|
endif;
|
|
else
|
|
if (CCM_Right_Labs_List.IsSelected[j]) then
|
|
if (not (Cytology_List_fld.Value matches pattern "%Right side:%")) then
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || CR || LF || "Right side: " || CCM_Right_Labs_List.Name[j];
|
|
else
|
|
Cytology_List_fld.Value := Cytology_List_fld.Value || ", " || CCM_Right_Labs_List.Name[j];
|
|
endif;
|
|
endif;
|
|
endif;
|
|
enddo;
|
|
endif;
|
|
elseif (CallingEvent = "FormClose") then
|
|
if (Labs_List_fld.Value = "Left:" OR Labs_List_fld.Value = "Right:") then
|
|
Labs_List_fld.Value := "";
|
|
endif;
|
|
if (Cytology_List_fld.Value = "Left:" OR Cytology_List_fld.Value = "Right:") then
|
|
Cytology_List_fld.Value := "";
|
|
endif;
|
|
endif;
|
|
|
|
|
|
;;
|
|
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:
|