Initial Checking with all 820 MLMs
This commit is contained in:
247
MLMStripper/bin/Debug/SCH/SCH_CALLED_AUTO_ORDER_GENERAL.mlm
Normal file
247
MLMStripper/bin/Debug/SCH/SCH_CALLED_AUTO_ORDER_GENERAL.mlm
Normal file
@@ -0,0 +1,247 @@
|
||||
maintenance:
|
||||
|
||||
title: SCH_Called_Auto_Order_General;;
|
||||
mlmname: SCH_Called_Auto_Order_General;;
|
||||
arden: version 2.5;;
|
||||
version: 6.10;;
|
||||
institution: ;;
|
||||
author: Shubhang Acharya;;
|
||||
specialist: ;;
|
||||
date: 2015-02-18;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: This MLM is being called from other MLMs to automatically place the order based on the input parameters.
|
||||
|
||||
History
|
||||
09.24.2019 TMS CSR # 38444 Add 2 new additional observations.
|
||||
|
||||
;;
|
||||
explanation: This MLM is being called from other MLMs to automatically place the order based on the input parameters.
|
||||
|
||||
;;
|
||||
keywords:
|
||||
;;
|
||||
citations:
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
(
|
||||
ClientVisitGuid,
|
||||
ChartGuid,
|
||||
ClientGuid,
|
||||
UserGuid,
|
||||
LocationGuid,
|
||||
CatalogItemName,
|
||||
OrderDataItem1,
|
||||
OrderDataItemValue1,
|
||||
OrderDataItem2,
|
||||
OrderDataItemValue2,
|
||||
OrderDataItem3,
|
||||
OrderDataItemValue3,
|
||||
OrderDataItem4,
|
||||
OrderDataItemValue4,
|
||||
OrderDataItem5,
|
||||
OrderDataItemValue5,
|
||||
OrderDataItem6,
|
||||
OrderDataItemValue6,
|
||||
OrderDataItem7,
|
||||
OrderDataItemValue7,
|
||||
OrderDataItem8,
|
||||
OrderDataItemValue8,
|
||||
OrderDataItem9,
|
||||
OrderDataItemValue9,
|
||||
OrderDataItem10,
|
||||
OrderDataItemValue10
|
||||
) := argument;
|
||||
|
||||
|
||||
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
||||
include standard_libs;
|
||||
|
||||
error_destination := destination { IntermediateMessage } with [
|
||||
alert_type := "Warning",
|
||||
short_message := "Auto Order MLM",
|
||||
priority := "low",
|
||||
scope := "chart",
|
||||
Rule_group := "Auto Order MLM",
|
||||
Rule_number := 1001,
|
||||
Rule_subgroup := "",
|
||||
Send_alert_with_order := "",
|
||||
Alert_dialog_settings := "",
|
||||
Display_alert := true ];
|
||||
|
||||
|
||||
user_IDType := "PRIMARY";
|
||||
order_Creation_Reason := "Order Created Form MLM";
|
||||
|
||||
User_IdCode := read last{" select cid.IDCode from CV3User u "
|
||||
||" join CV3CareProvider cp on u.GUID =cp.guid "
|
||||
||" join CV3CareProviderID cid on cp.guid = cid.ProviderGuid "
|
||||
||" where u.Guid = "||sql (UserGuid)};
|
||||
// ||" and cid.ProviderIDTypeCode = {{{SINGLE-QUOTE}}}PRIMARY{{{SINGLE-QUOTE}}}"};
|
||||
|
||||
|
||||
try
|
||||
client_visit_obj := call {{{SINGLE-QUOTE}}}ClientVisit{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ((ClientVisitGuid as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}}) ;
|
||||
WSSessionType := "Standard";
|
||||
WSSessionReason := "";
|
||||
WSRequestedBySource := "";
|
||||
WSRequestedBy_obj := call {{{SINGLE-QUOTE}}}CareProvider{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ( (userGUID as Number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}} );
|
||||
//call {{{SINGLE-QUOTE}}}CareProvider{{{SINGLE-QUOTE}}}.FindById
|
||||
// with ( user_IDType, user_IDCode );
|
||||
WSlocation_obj := call {{{SINGLE-QUOTE}}}Location{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ((LocationGuid as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}});
|
||||
endtry;
|
||||
catch Exception ex
|
||||
error_occurred := true;
|
||||
error_message := "{{+R}}Common Data:{{-R}}\n" ||
|
||||
ex.Message || "\n\n";
|
||||
|
||||
if ( client_visit_obj is NOT NULL ) then
|
||||
void:= call client_visit_obj.Dispose;
|
||||
client_visit_obj:= null;
|
||||
endif;
|
||||
|
||||
if ( WSRequestedBy_obj is NOT NULL ) then
|
||||
void:= call WSRequestedBy_obj.Dispose;
|
||||
WSRequestedBy_obj:= null;
|
||||
endif;
|
||||
|
||||
if ( WSlocation_obj is NOT NULL ) then
|
||||
void:= call WSlocation_obj.Dispose;
|
||||
WSlocation_obj:= null;
|
||||
endif;
|
||||
endcatch;
|
||||
|
||||
|
||||
|
||||
|
||||
try
|
||||
// get OrderCatalogMasterItem ObjectsPlus object
|
||||
general_catalog_item := call {{{SINGLE-QUOTE}}}OrderCatalogMasterItem{{{SINGLE-QUOTE}}}.FindByName
|
||||
with CatalogItemName;
|
||||
|
||||
// Create the prefilled General order
|
||||
GeneralOrder2_obj := call {{{SINGLE-QUOTE}}}GeneralOrder{{{SINGLE-QUOTE}}}.CreateGeneralOrder
|
||||
with
|
||||
client_visit_obj, // ClientVisit ObjectsPlus object
|
||||
general_catalog_item, // OrderCatalogMasterItem ObjectsPlus object
|
||||
order_Creation_Reason, // CreateReason
|
||||
wsRequestedBy_obj, // RequestedBy ObjectsPlus object
|
||||
wsRequestedBySource, // string RequestedBySource (must be in dictionary)
|
||||
wsSessionType, // string SessionType
|
||||
wsSessionReason, // string SessionReason
|
||||
wslocation_obj, // Location ReleaseLocGrpID
|
||||
"Always" as {{{SINGLE-QUOTE}}}AvailabilityOverride{{{SINGLE-QUOTE}}}; // AvailabilityOverride
|
||||
|
||||
IF (EXISTS OrderDataItem1 AND OrderDataItem1 IS NOT NULL AND OrderDataItem1 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem1 , OrderDataItemValue1 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem2 AND OrderDataItem2 IS NOT NULL AND OrderDataItem2 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem2 , OrderDataItemValue2 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem3 AND OrderDataItem3 IS NOT NULL AND OrderDataItem3 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem3 , OrderDataItemValue3 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem4 AND OrderDataItem4 IS NOT NULL AND OrderDataItem4 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem4 , OrderDataItemValue4 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem5 AND OrderDataItem5 IS NOT NULL AND OrderDataItem5 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem5 , OrderDataItemValue5 ;
|
||||
ENDIF;
|
||||
|
||||
|
||||
IF (EXISTS OrderDataItem6 AND OrderDataItem6 IS NOT NULL AND OrderDataItem6 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem6 , OrderDataItemValue6 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem7 AND OrderDataItem7 IS NOT NULL AND OrderDataItem7 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem7 , OrderDataItemValue7 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem8 AND OrderDataItem8 IS NOT NULL AND OrderDataItem8 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem8 , OrderDataItemValue8 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem9 AND OrderDataItem9 IS NOT NULL AND OrderDataItem9 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem9 , OrderDataItemValue9 ;
|
||||
ENDIF;
|
||||
|
||||
IF (EXISTS OrderDataItem10 AND OrderDataItem10 IS NOT NULL AND OrderDataItem10 <> "") THEN
|
||||
Value := call GeneralOrder2_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Boolean>{{{SINGLE-QUOTE}}} with
|
||||
OrderDataItem10 , OrderDataItemValue10 ;
|
||||
ENDIF;
|
||||
|
||||
if ( general_catalog_item is NOT NULL ) then
|
||||
void:= call general_catalog_item.Dispose;
|
||||
general_catalog_item:= null;
|
||||
endif;
|
||||
|
||||
//GeneralOrder2_dest.ObjectsPlus := GeneralOrder2_obj;
|
||||
empty := Call GeneralOrder2_obj.save;
|
||||
|
||||
endtry;
|
||||
catch Exception ex
|
||||
error_occurred := true;
|
||||
error_message := error_message || "{{+R}}New general order:{{-R}}\n" ||
|
||||
ex.Message || "\n\n";
|
||||
|
||||
if ( general_catalog_item is NOT NULL ) then
|
||||
void:= call general_catalog_item.Dispose;
|
||||
general_catalog_item:= null;
|
||||
endif;
|
||||
|
||||
if ( GeneralOrder2_obj is NOT NULL ) then
|
||||
void:= call GeneralOrder2_obj.Dispose;
|
||||
GeneralOrder2_obj:= null;
|
||||
endif;
|
||||
|
||||
endcatch;
|
||||
|
||||
if ( client_visit_obj is NOT NULL ) then
|
||||
void:= call client_visit_obj.Dispose;
|
||||
client_visit_obj:= null;
|
||||
endif;
|
||||
if ( WSRequestedBy_obj is NOT NULL ) then
|
||||
void:= call WSRequestedBy_obj.Dispose;
|
||||
WSRequestedBy_obj:= null;
|
||||
endif;
|
||||
if ( WSlocation_obj is NOT NULL ) then
|
||||
void:= call WSlocation_obj.Dispose;
|
||||
WSlocation_obj:= null;
|
||||
endif;
|
||||
|
||||
;;
|
||||
priority: 50
|
||||
;;
|
||||
evoke:
|
||||
;;
|
||||
logic:
|
||||
CONCLUDE true;
|
||||
;;
|
||||
action:
|
||||
if Error_occurred then
|
||||
return ex.Message;
|
||||
else
|
||||
return "1";
|
||||
endif;
|
||||
;;
|
||||
Urgency: 50;;
|
||||
end:
|
||||
Reference in New Issue
Block a user