Files
St.Clair/MLMStripper/bin/Debug/DOC/DOC_FUNC_LAUNCH_ADD_CAREPROVIDERS.mlm

161 lines
6.3 KiB
Plaintext

maintenance:
title: Doc_Func_Launch_Add_CareProviders;;
filename: Doc_Func_Launch_Add_CareProviders;;
arden: version 2;;
version: 1.00;;
institution: Eclipsys Corp;;
author: Eclipsys Corp;;
specialist: Shawn Head;;
date: 2015-11-16;;
validation: testing;;
library:
purpose: This mlm launches the AddCareProviders Objects+ custom application from a document
;;
explanation: The Add Care Providers was designed for use by the Physician Progress Note, but could be useful in other areas of SCM
Change history
10.14.2015 STH CSR#: 33715 - Add care providers {Go-Live 12/10/2015}
;;
keywords:
;;
knowledge:
type: data-driven;;
data:
(this_documentCommunication) := argument;
/*******************Make Changes To Spelling And Flags In This Section*******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := FALSE;
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}}; //used to parse string data into a list
include standard_libs;
using "ObjectsPlusXA.SCM.Forms";
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
using "AddCareProviders";
using namespace "AddProviders";
// Extract interesting parts of the object model
(thisStructuredNoteDoc) := this_documentCommunication.DocumentConfigurationObj;
(thisParameters) := thisStructuredNoteDoc.ParametersList;
(thisObservations) := thisStructuredNoteDoc.ChartedObservationsList;
// Create prototypes for the object types we{{{SINGLE-QUOTE}}}ll need to instantiate
ObservationType := OBJECT [ObservationGUID, ClientDocumentGUID, ParameterGUID, DataType, ValueObj];
FreeTextValueType := OBJECT [Value];
DateValueType := OBJECT [Value];
ListValueType := OBJECT [ListGuid,ListItemsList, SuggestedTextValue];
ListValueListItemType := OBJECT [ListItemGUID, Value, IsSelected];
// Reset the launch button
theParameterx := first of (thisparameters where thisparameters.Name = "SCH_Launch CP Window");
theObservation := first of (thisobservations where thisobservations.ParameterGUID = theParameterx.ParameterGUID);
rtbCommentsParam := first of (thisparameters where thisparameters.Name = "SCH_MDPN_CareProviders");
rtbCommentsObs := first of (thisobservations where thisobservations.ParameterGUID = rtbCommentsParam.ParameterGUID);
//first of (thisparameters where thisparameters.Name = "SCH_MDPN_Other Results");
//rtbCommentsObs := first of (thisobservations where thisobservations.ParameterGUID = rtbCommentsParam.ParameterGUID);
if this_documentCommunication.CurrentObservationObj.parameterguid = theParameterx.ParameterGUID then
this_parametername := first of (thisParameters where thisParameters.Name = "SCH_Launch CP Window");
this_currentObj := NEW ObservationType;
this_currentObj.ClientDocumentGUID:= thisStructuredNoteDoc.ClientDocumentGUID;
this_currentObj.ParameterGUID := this_parametername.ParameterGUID;
this_currentObj.DataType := "ListValue";
this_currentObj.ValueObj := New ListValueType;
this_currentObj.ValueObj.ListGUID:= this_parametername.ConfigurationObj.ListGUID;
listItems := ();
FOR item IN this_parametername.ConfigurationObj.ListItemsList DO
selectedItem := NEW ListValueListItemType;
selectedItem.ListItemGUID := item.ListItemGUID;
selectedItem.Value := item.Value;
selectedItem.IsSelected := false;
listItems := (listItems, selectedItem);
ENDDO;
this_currentobj.ValueObj.ListItemsList := listItems;
thisStructuredNoteDoc.ChartedObservationsList := (thisstructuredNoteDoc.ChartedObservationsList, this_currentObj);
endif;
docname := this_documentCommunication.DocumentName as string;
LaunchCP := new net_object {{{SINGLE-QUOTE}}}AddCareProviders.Form1{{{SINGLE-QUOTE}}};
;;
evoke: // No evoke statement
;;
logic:
tstCPLaunch := CALL LaunchCP.ShowDialog;
lstresults := ();
lstitems := ();
lstFromObj := ();
//lstFromObj := LaunchCP.lstProviders4Note;
txtfromobj := LaunchCP.providers4note as string;
lstresults := call str_parse with (txtfromobj,"|");
ctlistitems := count(lstresults);
a := lstresults[0];
b := lstresults[1];
c := lstresults[2];
d := lstresults[3];
finalresults := "";
resultcategory := "";
currentcategory := "";
ccproviders := "";
nonccproviders := "";
sendtonote := "";
for x in (1 seqto count(lstresults)) do
if((trim(lstresults[x]) is not null) and (trim(lstresults[x]) <> "")) then
lstitems := call str_parse with (lstresults[x],"^");
if((trim(lstitems[2]) is not null) and (trim(lstitems[2]) <> "")) then
if((lstitems[1] = "electronic") and (lstitems[4] = "true")) then
sendtonote := " (ELECTRONICALLY SENT TO PHYSICIAN PRACTICE)";
elseif((lstitems[1] = "fax") and (lstitems[4] = "true")) then
sendtonote := " (FAXED DOCUMENT TO " || lstitems[3] || ")";
else
sendtonote := "";
endif;
if(lstitems[4] = "true") then
ccproviders := ccproviders || "\b \li720" || "CC: " || lstitems[2] || "\b0 \i " || sendtonote || "\i0 \n";
else
nonccproviders := nonccproviders || "\b \li720" || lstitems[2] || "\b0 \i " || sendtonote || " \i0 \n";
endif;
endif;
endif;
enddo;
messagefornote := "";
//messagefornote := "\b \ul \li0" || "ADDITIONAL CARE PROVIDERS" || "\b0 \ul0 \n";
if(ccproviders <> "") then
messagefornote := messagefornote || "\n \b \ul \li360 THE FOLLOWING CARE PROVIDERS RECEIVED A COPY OF THIS NOTE \b0 \ul0 \n\n" || ccproviders;
endif;
if(nonccproviders <> "") then
messagefornote := messagefornote || "\n \b \ul \li360 THE FOLLOWING CARE PROVIDERS DID NOT RECEIVE A COPY OF THIS NOTE \b0 \ul0 \n\n" || nonccproviders;
endif;
rtbCommentObj := NEW ObservationType;
rtbCommentObj.ClientdocumentGUID := thisStructuredNoteDoc.ClientDocumentGUID;
rtbCommentObj.ParameterGUID := rtbCommentsParam.ParameterGUID;
rtbCommentObj.DataType := "FreeTextValue";
rtbCommentObj.ValueObj := NEW FreeTextValueType;
rtbCommentObj.ValueObj.Value := messagefornote;
thisStructuredNoteDoc.ChartedObservationsList := (thisstructuredNoteDoc.ChartedObservationsList, rtbCommentObj);
conclude true; // always concludes TRUE
;;
action:
return this_documentCommunication;
;;
end: