436 lines
23 KiB
Plaintext
436 lines
23 KiB
Plaintext
maintenance:
|
|
|
|
title: Retrieve Previous Preferences;;
|
|
mlmname: Form_Diet_Pref_Retreive;;
|
|
arden: version 2;;
|
|
version: 4.50;;
|
|
institution: St Clair Diet Pref MLM;;
|
|
author: Robert Spence, Eclipsys Corp;;
|
|
specialist: ;;
|
|
date: 2006-05-26;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: This MLM sets the fields (3) For Preferences from the latest order
|
|
|
|
;;
|
|
explanation: This MLM takes the data sent to CDS from Diet on open
|
|
Use in On Open ONLY!
|
|
Change History
|
|
--------------------------------------
|
|
26.05.2006 JLM Created MLM By Robert Spence
|
|
17.11.2015 GOS Populating 3 Diet Preferences and Other UDDI{{{SINGLE-QUOTE}}}s for Child Diet Order [Diet - Add to Current Diet].
|
|
|
|
;;
|
|
keywords: Called MLMs, Form fields, Diet, Preferences, On Open Only
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
|
|
// This MLM is passed three arguments, of types
|
|
// communication_type, form_type and client info object respectively.
|
|
|
|
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
|
include standard_libs;
|
|
// 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;
|
|
ClientGuid :=this_communication.clientguid;
|
|
ClientVisitGuid := this_communication.ClientVisitGuid;
|
|
ClientChartGuid := this_communication.ChartGuid;
|
|
CallingField :=this_communication.CallingFieldName;
|
|
CallingEvent := this_communication.CallingEvent;
|
|
|
|
// Start: Added By Shivprasad
|
|
comm_obj := this_communication.primaryobj;
|
|
client_guid := this_communication.ClientGUID;
|
|
visit_guid := this_communication.ClientVisitGUID;
|
|
chart_guid := this_communication.ChartGUID;
|
|
//End : By Shivprasad
|
|
|
|
If CallingEvent ="FormOpen" Then
|
|
// Get the Last Order
|
|
OrderGuid := read last
|
|
{ " Select top 1 guid "
|
|
|| " from cv3order "
|
|
|| " where clientguid = " || SQL(ClientGuid)
|
|
|| " and clientvisitguid = " || SQL(ClientVisitGuid)
|
|
|| " and chartguid = " || SQL(ClientChartGuid)
|
|
|| " and ((Name = " || SQL("Diet") || ") "
|
|
|| " or (Name = " || SQL("Supplements") || ")"
|
|
|| " or (Name = " || SQL("Diet_Special Request") || "))"
|
|
|| " order by createdwhen desc" };
|
|
|
|
|
|
// Get each Preference
|
|
If exists(OrderGuid) then
|
|
PrefData1 := read last
|
|
{ " Select Value"
|
|
|| " from CV3OrderUserData "
|
|
|| " where clientguid = " || SQL(ClientGuid)
|
|
|| " and OrderGUID = " || SQL(OrderGuid)
|
|
|| " and UserDataCode = " || SQL("DIET_DSP_Preference or Restriction") };
|
|
|
|
PrefData2 := read last
|
|
{ " Select Value"
|
|
|| " from CV3OrderUserData "
|
|
|| " where ClientGuid= " || SQL(ClientGuid)
|
|
|| " and OrderGUID = " || SQL(OrderGuid)
|
|
|| " and UserDataCode = " || SQL("DIET_DSP_Additional Pref or Restriction")};
|
|
|
|
PrefData3 := read last
|
|
{ " Select Value"
|
|
|| " from CV3OrderUserData "
|
|
|| " where ClientGuid= " || SQL(ClientGuid)
|
|
|| " and OrderGUID = " || SQL(OrderGuid)
|
|
|| " and UserDataCode = " || SQL("DIET_DSP_More Prefs and Restrictions")};
|
|
|
|
endif;
|
|
|
|
|
|
// If We are a supplement, there is no need for this...
|
|
FormName := this_form.name;
|
|
|
|
If FormName <> "DIET_Supplement"
|
|
then
|
|
OrderGuid := read last
|
|
{ " Select top 1 guid "
|
|
|| " from cv3order "
|
|
|| " where clientguid = " || SQL(ClientGuid)
|
|
|| " and clientvisitguid = " || SQL(ClientVisitGuid)
|
|
|| " and chartguid = " || SQL(ClientChartGuid)
|
|
|| " and ((Name = " || SQL("Diet") || ") "
|
|
|| " or (Name = " || SQL("Diet_Special Request") || "))"
|
|
|| " order by createdwhen desc" };
|
|
|
|
If exists(OrderGuid)
|
|
then
|
|
|
|
PrefDataTemp := read last
|
|
{" Select Value "
|
|
|| " from CV3OrderUserData "
|
|
|| " where ClientGuid= " || SQL(ClientGuid)
|
|
|| " and OrderGUID = " || SQL(OrderGuid)
|
|
|| " and UserDataCode = " || SQL("DIET_MT_LO_Seclusion Tray")};
|
|
|
|
Pref4_Field := last of (field_list
|
|
where field_list.DataItemName = "DIET_MT_LO_Seclusion Tray" );
|
|
|
|
If PrefDataTemp = "1"
|
|
then
|
|
Pref4_Field.Value := True;
|
|
Else
|
|
Pref4_Field.Value := False;
|
|
endif;
|
|
endif;
|
|
endif;
|
|
|
|
|
|
|
|
// This sets the visible control on the field dataitem - CHG_OVERRIDE_WITH
|
|
Pref1_Field := last of (field_list
|
|
where field_list.DataItemName = "DIET_DSP_Preference or Restriction" );
|
|
|
|
Pref2_Field := last of (field_list
|
|
where field_list.DataItemName = "DIET_DSP_Additional Pref or Restriction" );
|
|
|
|
Pref3_Field := last of (field_list
|
|
where field_list.DataItemName = "DIET_DSP_More Prefs and Restrictions" );
|
|
|
|
AtStart_Field := last of (field_list
|
|
where field_list.DataItemName = "DIET_PREF_ATSTART" );
|
|
|
|
// this_communication.DisplayForm := "Yes";
|
|
// this_communication.Message := "PrefData4 Is = " || PrefData4 || "\n" ||
|
|
// "PrefDataTemp is = " || PrefDataTemp || "\n" ||
|
|
// "Client GUID is = " || ClientGUID || "\n" ||
|
|
// "Order GUID is = " || OrderGUID || "\n" ||
|
|
// "Form Name is = " || FormName || "\n" ||
|
|
// "Pre4_Field is = " || Pref4_Field;
|
|
//
|
|
// this_communication.MessageType := "Error";
|
|
|
|
If Exists(PrefData1)
|
|
Then
|
|
Pref1_Field.Value := PrefData1;
|
|
AtStart_Field.Value := True;
|
|
Endif;
|
|
|
|
If Exists(PrefData2)
|
|
Then
|
|
Pref2_Field.Value := PrefData2;
|
|
AtStart_Field.Value :=True;
|
|
Endif;
|
|
|
|
|
|
|
|
If Exists(PrefData3)
|
|
Then
|
|
Pref3_Field.Value := PrefData3;
|
|
AtStart_Field.Value :=True;
|
|
Endif;
|
|
|
|
Endif; // End of form Open Event
|
|
//=====================================Code Added By Shivprasad for Seclusion Tray MLM ===================================
|
|
/* Purpose of Code
|
|
2015-03-14 CSR-32228 : Created MLM
|
|
|
|
1st Senario- When user open the "Diet order" ,then what ever order was present in the [Preference or Restriction (1),
|
|
Preference or Restriction (2),Preference or Restriction (3)]e.g "No Caffeine" should get prepopulate.
|
|
2nd Senario- When the user open the "Diet Order" and all prepopulated information from the "Preference or Restriction "section ,
|
|
user should be able to change the information .
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
1st Senario- When user select "Seclusion Tray " from Diet order then the "No Metal/China should be anavailable (Grayed-Out ) to user for selection.
|
|
|
|
2nd Senario- When user select "No Metal/China" from the Diet order then the "Seclusion Tray" should be Greyed-Out to user for selection .
|
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
1st Senario- When user select "Seclusion Tray " from Diet order then "Finger Foods" from Other Diets should get auto selected.
|
|
|
|
2nd Senario - When user uncheck the "Seclusion Tray" then "Finger Food " should also get uncheck.
|
|
|
|
3rd Senario-When user select "Finger Foods" from Other Diets order,then "Seclusion Tray" should not get autoselect. "Finger Foods" can be select single.
|
|
|
|
4th Senario- If "Finger Foods" has selected previously (Single selected) and "Seclusion Tray" is not selected ,and
|
|
if user select "No Metal/China" then "Finger Foods" should not get uncheck. */
|
|
|
|
|
|
F_FingerDiet := last of ( field_list WHERE field_list.DataItemName ="DIET_DSD_Finger Foods" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Diet1 := last of ( field_list WHERE field_list.DataItemName = "DIET_DSP_Preference or Restriction" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Diet2 := last of ( field_list WHERE field_list.DataItemName = "DIET_DSP_Additional Pref or Restriction" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Diet3 := last of ( field_list WHERE field_list.DataItemName = "DIET_DSP_More Prefs and Restrictions" and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
F_Seclusion := last of ( field_list WHERE field_list.DataItemName = "DIET_MT_LO_Seclusion Tray" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_MetalChina := last of ( field_list WHERE field_list.DataItemName = "DIET_MT_LO_No Metal/China" and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
F_Seclusion_Val := F_Seclusion.Value ;
|
|
F_MetalChina_Value := F_MetalChina.Value ;
|
|
|
|
// To look for Any Active order
|
|
DietOrderGuid := Read first{" Select Top 1 o1.guid from cv3ClientVisit cv with (nolock) Join Cv3Order o1 With (Nolock) "
|
|
|| " on cv.guid=o1.ClientVisitGUID And cv.ClientGUID=o1.ClientGUID And cv.ChartGUID=o1.ChartGUID And o1.name = {{{SINGLE-QUOTE}}}Diet{{{SINGLE-QUOTE}}} "
|
|
|| " And o1.OrderStatusLevelNum = 50 And o1.InitialSessionTypeCode <> {{{SINGLE-QUOTE}}}Discharge{{{SINGLE-QUOTE}}} And cv.guid = "|| visit_guid || " Order By O1.CreatedWhen Desc "} ;
|
|
|
|
If exist DietOrderGuid Then ActiveOrderAlert := False ; Endif;
|
|
// If {{{SINGLE-QUOTE}}}Active{{{SINGLE-QUOTE}}} order is not Present then we are looking any other order to Pull the Data
|
|
If Not Exist DietOrderGuid Then
|
|
ActiveOrderAlert := True ;
|
|
DietOrderGuid := Read first{" Select Top 1 o1.guid from cv3ClientVisit cv with (nolock) Join Cv3Order o1 With (Nolock) "
|
|
|| " on cv.guid=o1.ClientVisitGUID And cv.ClientGUID=o1.ClientGUID And cv.ChartGUID=o1.ChartGUID And o1.name = {{{SINGLE-QUOTE}}}Diet{{{SINGLE-QUOTE}}} "
|
|
|| " And o1.InitialSessionTypeCode <> {{{SINGLE-QUOTE}}}Discharge{{{SINGLE-QUOTE}}} And cv.guid = "|| visit_guid || " Order By O1.CreatedWhen Desc "} ;
|
|
Endif;
|
|
|
|
|
|
Ord_data := OBJECT[Obs_name, Value];
|
|
Ord_vals := READ AS Ord_data {" Select ud.UserDataCode , ud.Value "
|
|
|| " from cv3ClientVisit cv (nolock) Join cv3Order o (nolock)"
|
|
|| " On cv.guid =o.ClientVisitGUID And cv.ClientGUID=o.ClientGUID And cv.VisitStatus = {{{SINGLE-QUOTE}}}ADM{{{SINGLE-QUOTE}}} "
|
|
|| " Join cv3OrderUserData ud On ud.OrderGUID=o.GUID And ud.ClientGUID=cv.ClientGUID "
|
|
|| " And ud.UserDataCode in ({{{SINGLE-QUOTE}}}DIET_DSP_Preference or Restriction{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSP_Additional Pref or Restriction{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSP_More Prefs and Restrictions{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_MT_LO_No Metal/China{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_MT_LO_Seclusion Tray{{{SINGLE-QUOTE}}}) "
|
|
|| " And o.guid = " || DietOrderGuid || " "} ;
|
|
|
|
Ord_data1 := OBJECT[Obs_name, Value];
|
|
Ord_vals1 := READ AS Ord_data1 {" Select ud.UserDataCode , ud.Value "
|
|
|| " from cv3ClientVisit cv (nolock) Join cv3Order o (nolock)"
|
|
|| " On cv.guid =o.ClientVisitGUID And cv.ClientGUID=o.ClientGUID And cv.VisitStatus = {{{SINGLE-QUOTE}}}ADM{{{SINGLE-QUOTE}}} "
|
|
|| " Join cv3OrderUserData ud On ud.OrderGUID=o.GUID And ud.ClientGUID=cv.ClientGUID "
|
|
|| " And ud.UserDataCode in ({{{SINGLE-QUOTE}}}DIET_DSD_Common{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_Special{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_ADA or Calorie{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_Consistency{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_Liquid{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_GI{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_Other{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD__Sodium{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_MT_LO_No Metal/China{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_MT_LO_Seclusion Tray{{{SINGLE-QUOTE}}}, "
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_Potassium{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}DIET_DSD_Finger Foods{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_DSD_Thickened{{{SINGLE-QUOTE}}},"
|
|
|| " {{{SINGLE-QUOTE}}}DIET_DSD_Protein{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_DSD_Fluid Restrictions{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}DIET_Summary Line Verbiage{{{SINGLE-QUOTE}}}) "
|
|
|| " And o.guid = " || DietOrderGuid || " "} ; //And o.OrderStatusCode = {{{SINGLE-QUOTE}}}AUA1{{{SINGLE-QUOTE}}}
|
|
|
|
Sp_Inst := Read first {"select SpecialInstructions from CV3OrderAddnlInfo oa With (Nolock) Join CV3Order o With (Nolock) On oa.guid=o.guid
|
|
And oa.ClientGUID = o.ClientGUID And o.Guid = " || DietOrderGuid || " "} ;
|
|
|
|
If CallingEvent ="FormOpen" Then
|
|
|
|
//Generic_MLM := MLM {{{SINGLE-QUOTE}}}FORM_DIET_PREF_RETREIVE{{{SINGLE-QUOTE}}};
|
|
//this_communication,this_form := Call Generic_MLM With this_communication,this_form, client_info_obj ;
|
|
|
|
If Not exist Ord_vals Then // To Clear the Diet1, Diet2, Diet3 if No active parent {{{SINGLE-QUOTE}}}Diet{{{SINGLE-QUOTE}}} Order present on Patient
|
|
F_Diet1.Value := Null ;
|
|
F_Diet2.Value := Null ;
|
|
F_Diet3.Value := Null ;
|
|
Endif;
|
|
|
|
// Visually Impaired
|
|
Diet1 := first of(Ord_vals.Value where Ord_vals.Obs_name = "DIET_DSP_Preference or Restriction" And Ord_vals.Value Is Not Null );
|
|
Diet2 := first of (Ord_vals.Value where Ord_vals.Obs_name = "DIET_DSP_Additional Pref or Restriction" And Ord_vals.Value Is Not Null );
|
|
Diet3 := first of(Ord_vals.Value where Ord_vals.Obs_name = "DIET_DSP_More Prefs and Restrictions" And Ord_vals.Value Is Not Null );
|
|
MetalChina := first of(Ord_vals.Value where Ord_vals.Obs_name = "DIET_MT_LO_No Metal/China" And Ord_vals.Value Is Not Null );
|
|
Seclusion := first of(Ord_vals.Value where Ord_vals.Obs_name = "DIET_MT_LO_Seclusion Tray" And Ord_vals.Value Is Not Null );
|
|
|
|
If Diet1 Is Not Null Then
|
|
F_Diet1.Value := Diet1 ; Endif;
|
|
If Diet2 Is Not Null Then
|
|
F_Diet2.Value := Diet2 ; Endif;
|
|
If Diet1 Is Not Null Then
|
|
F_Diet3.Value := Diet3 ; Endif;
|
|
|
|
If F_Seclusion.Value = true Then
|
|
F_FingerDiet.Value := "Finger Foods" ;
|
|
Elseif F_Seclusion.Value = false And F_MetalChina.Control_Read_Only = True And F_MetalChina.Value = False Then
|
|
if F_FingerDiet.Value = "Finger Foods" Then
|
|
F_FingerDiet.Value := Null ;
|
|
Endif;
|
|
Endif;
|
|
|
|
If MetalChina = "1" Then
|
|
F_MetalChina.Value := True ;
|
|
F_Seclusion.Value := False ;
|
|
F_FingerDiet.Value := "" ;
|
|
//F_Seclusion.Control_Read_Only := True ;
|
|
Elseif Seclusion = "1" Then
|
|
F_Seclusion.Value := true ;
|
|
F_FingerDiet.Value := "Finger Foods" ;
|
|
F_MetalChina.Value := False;
|
|
Endif;
|
|
|
|
If comm_obj.Modifier= "(Add to current diet)" Then
|
|
|
|
// To show the Message to User when he open Child Diet Order i.e.[Diet-Add to current diet]
|
|
If ActiveOrderAlert = True Then // To Pass the Message if No active parent {{{SINGLE-QUOTE}}}Diet{{{SINGLE-QUOTE}}} Order present on Patient
|
|
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Patient does NOT have an active diet order ", "Important Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
|
Ord_vals1.Value := "";
|
|
Endif;
|
|
|
|
// To Show the Previous Active diet orders Data on new child-Diet Order
|
|
F_Common := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Common" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Special := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Special" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Cal := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_ADA or Calorie" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Consi := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Consistency" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Liquid := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Liquid" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_ThickLiquid := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Thickened" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_GI := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_GI" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Other := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Other" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Finger := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Finger Foods" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Sodium := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD__Sodium" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Pota := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Potassium" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Protein := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Protein" and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
F_Fluid := last of ( field_list WHERE field_list.DataItemName = "DIET_DSD_Fluid Restrictions" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_Summary := last of ( field_list WHERE field_list.DataItemName = "DIET_Summary Line Verbiage" and field_list.Control_MultiFieldOccNum = 1);
|
|
F_SpecialInst := last of ( field_list WHERE field_list.DataItemName = "SpecialInstructions" and field_list.Control_MultiFieldOccNum = 1);
|
|
|
|
Common := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Common" And Ord_vals1.Value Is Not Null );
|
|
Special := first of (Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Special" And Ord_vals1.Value Is Not Null );
|
|
Cal := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_ADA or Calorie" And Ord_vals1.Value Is Not Null );
|
|
Consi := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Consistency" And Ord_vals1.Value Is Not Null );
|
|
Liquid := first of (Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Liquid" And Ord_vals1.Value Is Not Null );
|
|
ThickLiquid := first of (Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Thickened" And Ord_vals1.Value Is Not Null );
|
|
GI := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_GI" And Ord_vals1.Value Is Not Null );
|
|
Other := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Other" And Ord_vals1.Value Is Not Null );
|
|
Finger := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Finger Foods" And Ord_vals1.Value Is Not Null );
|
|
Sodium := first of (Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD__Sodium" And Ord_vals1.Value Is Not Null );
|
|
Pota := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Potassium" And Ord_vals1.Value Is Not Null );
|
|
Protein := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Protein" And Ord_vals1.Value Is Not Null );
|
|
MetalChina := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_MT_LO_No Metal/China" And Ord_vals1.Value Is Not Null );
|
|
Seclusion := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_MT_LO_Seclusion Tray" And Ord_vals1.Value Is Not Null );
|
|
|
|
Fluid := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_DSD_Fluid Restrictions" And Ord_vals1.Value Is Not Null );
|
|
Summary := first of(Ord_vals1.Value where Ord_vals1.Obs_name = "DIET_Summary Line Verbiage" And Ord_vals1.Value Is Not Null );
|
|
|
|
|
|
If Common is Not Null Then F_Common.Value := Common ; Else F_Common.Value :="" ; Endif;
|
|
If Special is Not Null Then F_Special.Value := Special ; Else F_Special.Value :="" ; Endif;
|
|
If Cal is Not Null Then F_Cal.Value := Cal ; Else F_Cal.Value :="" ; Endif;
|
|
If Consi is Not Null Then F_Consi.Value := Consi ; Else F_Consi.Value :="" ; Endif;
|
|
If Liquid is Not Null Then F_Liquid.Value := Liquid ; Else F_Liquid.Value :="" ; Endif;
|
|
If ThickLiquid is Not Null Then F_ThickLiquid.Value := ThickLiquid ; Else F_ThickLiquid.Value :="" ; Endif;
|
|
If GI is Not Null Then F_GI.Value := GI ; Else F_GI.Value :="" ; Endif;
|
|
If Other is Not Null Then F_Other.Value := Other ; Else F_Other.Value :="" ; Endif;
|
|
If Finger is Not Null Then F_Finger.Value := Finger ; Elseif F_FingerDiet.Value = "Finger Foods" Then Void:=Void ; Else F_Finger.Value :="" ; Endif; // for Finger Section
|
|
If Sodium is Not Null Then F_Sodium.Value := Sodium ; Else F_Sodium.Value :="" ; Endif;
|
|
If Pota is Not Null Then F_Pota.Value := Pota ; Else F_Pota.Value :="" ; Endif;
|
|
If Protein is Not Null Then F_Protein.Value := Protein ; Else F_Protein.Value :="" ; Endif;
|
|
|
|
If Fluid is Not Null Then F_Fluid.Value := Fluid ; Else F_Fluid.Value :="" ; Endif;
|
|
If Summary is Not Null Then F_Summary.Value := Summary ; Else F_Summary.Value :="" ; Endif;
|
|
If Sp_Inst is Not Null Then F_SpecialInst.Value := Sp_Inst ; Else F_SpecialInst.Value :="" ; Endif;
|
|
If MetalChina = "1" Then
|
|
F_MetalChina.Value := True ;
|
|
F_Seclusion.Value := False ;
|
|
Elseif Seclusion = "1" Then
|
|
F_Seclusion.Value := true ;
|
|
F_MetalChina.Value := False ;
|
|
Endif;
|
|
if F_Seclusion.Value = True Then F_FingerDiet.Value := "Finger Foods" ; Else F_FingerDiet.Value :=""; Endif;
|
|
|
|
Endif;
|
|
|
|
Endif;
|
|
|
|
//---------------------------- Change in field Change Event -----------------------------------------------
|
|
|
|
If CallingEvent ="FieldChange" Then
|
|
|
|
|
|
If this_communication.CallingFieldLabel = "Seclusion Tray" Then
|
|
If F_Seclusion.Value = true Then
|
|
F_MetalChina.Value := False;
|
|
F_FingerDiet.Value := "Finger Foods" ;
|
|
ElseIF F_Seclusion.Value = False Then
|
|
|
|
//F_MetalChina.Value := True;
|
|
F_FingerDiet.Value:= Null ;
|
|
EndIf ;
|
|
Elseif this_communication.CallingFieldLabel = "No Metal/China" Then
|
|
if F_MetalChina.Value = true Then
|
|
F_Seclusion.Value := False;
|
|
F_FingerDiet.Value:= Null ;
|
|
Elseif F_MetalChina.Value = False And F_Seclusion.Value = True Then
|
|
F_Seclusion.Value := True;
|
|
F_FingerDiet.Value := "Finger Foods" ;
|
|
Endif;
|
|
Endif ;
|
|
|
|
// Code for [Seclusion Tray Check Box ] and [Finger food] Value Selection
|
|
If F_Seclusion.Value = true Then
|
|
F_FingerDiet.Value := "Finger Foods" ;
|
|
Elseif F_Seclusion.Value = false
|
|
//And F_MetalChina.Control_Read_Only = False
|
|
And F_MetalChina.Value = False Then
|
|
If F_FingerDiet.Value = "Finger Foods" Then
|
|
F_FingerDiet.Value:= Null ;
|
|
Endif;
|
|
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:
|