Initial Checking with all 820 MLMs
This commit is contained in:
251
MLMStripper/bin/Debug/SCH/SCH_CREATE_GENERAL_ORDER.mlm
Normal file
251
MLMStripper/bin/Debug/SCH/SCH_CREATE_GENERAL_ORDER.mlm
Normal file
@@ -0,0 +1,251 @@
|
||||
maintenance:
|
||||
|
||||
title: SCH_Create_General_Order ;;
|
||||
mlmname: SCH_Create_General_Order ;;
|
||||
arden: version 2.5;;
|
||||
version: 5.50;;
|
||||
institution: SCH ;;
|
||||
author: Saurabh patel;;
|
||||
specialist: ;;
|
||||
date: 2012-09-12;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose:
|
||||
;;
|
||||
explanation:
|
||||
Change History
|
||||
--------------
|
||||
01.13.2014 JML CSR 31748: Modify to allow Requested Date and Time values to be passed in
|
||||
01.06.2015 DW CSR# 31899 Infusion Center Consult MLM Change
|
||||
;;
|
||||
keywords:
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
|
||||
// Specify which .NET assemblies need to be loaded for ObjectsPlus
|
||||
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
||||
include standard_libs;
|
||||
|
||||
(
|
||||
order_type,
|
||||
client_visit_obj, // ClientVisit ObjectsPlus object
|
||||
Order_catalog_item, // CatalogMasterItem ObjectsPlus object
|
||||
order_Creation_Reason, // string CreateReason
|
||||
WSRequestedBy_obj, // RequestingProvider ObjectsPlus object
|
||||
WSRequestedBySource, // string requestingSource(must be in dict)
|
||||
WSSessionType, // string SessionType
|
||||
WSSessionReason, // string SessionReason
|
||||
WSLocation_obj,
|
||||
RequestedDate, //Requested Date (CSR 31748 change)
|
||||
RequestedTime //Requested Time (CSR 31748 change)
|
||||
|
||||
) := argument;
|
||||
|
||||
|
||||
//break;
|
||||
|
||||
mlm_name := "SCH_Create_General_Order";
|
||||
|
||||
local_session := CDS_SESSION.local;
|
||||
|
||||
error_occurred := false;
|
||||
error_message := "";
|
||||
|
||||
GeneralOrder_dest := destination { ObjectsPlus } with
|
||||
[ alert_type := "Warning",
|
||||
short_message := "Object created by MLM",
|
||||
priority := "low",
|
||||
scope := "chart",
|
||||
rule_group := "Order Object",
|
||||
rule_number := 2010 ];
|
||||
|
||||
DiagnosticOrder_dest := destination { ObjectsPlus } with
|
||||
[ alert_type := "Warning",
|
||||
short_message := "Object created by MLM",
|
||||
priority := "low",
|
||||
scope := "chart",
|
||||
rule_group := "Order Object",
|
||||
rule_number := 2010 ];
|
||||
|
||||
|
||||
error_destination := destination { Alert } with [
|
||||
alert_type := "Warning",
|
||||
short_message := "ObjectsPlus Error from MLM",
|
||||
priority := "low",
|
||||
scope := "chart",
|
||||
Rule_group := "ObjectsPlus Error from MLM",
|
||||
Rule_number := 1003,
|
||||
Rule_subgroup := "",
|
||||
Send_with_order := "",
|
||||
Alert_dialog_settings := "",
|
||||
Display_alert := true ];
|
||||
|
||||
try
|
||||
|
||||
if Order_type = "Diagnostic" then
|
||||
DiagnosticOrder_obj := call {{{SINGLE-QUOTE}}}DiagnosticOrder{{{SINGLE-QUOTE}}}.CreateDiagnosticOrder
|
||||
with
|
||||
client_visit_obj, // ClientVisit ObjectsPlus object
|
||||
Order_catalog_item, // OrderCatalogMasterItem ObjectsPlus object
|
||||
order_Creation_Reason, // Create Reason
|
||||
WSRequestedBy_obj, // RequestedBy ObjectsPlus object
|
||||
WSRequestedBySource, // Requesting Source
|
||||
WSSessionType, // Session type
|
||||
WSSessionReason, // Session reason
|
||||
WSlocation_obj, // Location ReleaseLocGrpID
|
||||
"Never" as {{{SINGLE-QUOTE}}}AvailabilityOverride{{{SINGLE-QUOTE}}}; // AvailabilityOverride eAvailabilityOverride
|
||||
|
||||
DiagnosticOrder_Obj.RequestedDate := RequestedDate; //CSR 31748
|
||||
DiagnosticOrder_Obj.RequestedTime := RequestedTime; //CSR 31748
|
||||
|
||||
DiagnosticOrder_dest.ObjectsPlus := DiagnosticOrder_obj;
|
||||
|
||||
elseif Order_type = "other" then
|
||||
// Create the prefilled General order
|
||||
GeneralOrder_obj := call {{{SINGLE-QUOTE}}}GeneralOrder{{{SINGLE-QUOTE}}}.CreateGeneralOrder
|
||||
with
|
||||
client_visit_obj, // ClientVisit ObjectsPlus object
|
||||
Order_catalog_item, // OrderCatalogMasterItem ObjectsPlus object
|
||||
order_Creation_Reason, // Create Reason
|
||||
WSRequestedBy_obj, // RequestedBy ObjectsPlus object
|
||||
WSRequestedBySource, // Requesting Source
|
||||
WSSessionType, // Session type
|
||||
WSSessionReason, // Session reason
|
||||
WSlocation_obj, // Location ReleaseLocGrpID
|
||||
"Always" as {{{SINGLE-QUOTE}}}AvailabilityOverride{{{SINGLE-QUOTE}}}; // AvailabilityOverride eAvailabilityOverride
|
||||
|
||||
if (Order_catalog_item.Name = "Catheter: Foley") then
|
||||
val := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"NUR_Catheter Medical Necessity","Device present on admission, EDand OR" ;
|
||||
GeneralOrder_obj.SpecialInstructions := "Device(s) present on admission, ED, and OR";
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Catheter: Port") then
|
||||
GeneralOrder_obj.SpecialInstructions := "Device(s) present on admission, ED, and OR";
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Catheter: IV") then
|
||||
GeneralOrder_obj.SpecialInstructions := "Device(s) present on admission, ED, and OR";
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Catheter: Central Line") then
|
||||
GeneralOrder_obj.SpecialInstructions := "Device(s) present on admission, ED, and OR";
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Catheter: PICC Line") then
|
||||
GeneralOrder_obj.SpecialInstructions := "Device(s) present on admission, ED, and OR";
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Dietitian Consult") then
|
||||
val1 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"NUTR_Consult Reasons","New Onset Diabetes" ;
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Infusion Center Consult") then
|
||||
val2 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"INF_Consult Reason","Device(s) present on admission, ED, OR" ;
|
||||
|
||||
// Changes by Shivprasad Jadhav On 06 Jan 2015
|
||||
|
||||
val9 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"INF_Reason","Device(s) present on admission, ED, OR" ;
|
||||
Val9.Control_Mandatory := true;
|
||||
|
||||
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Daily Orders:") then
|
||||
|
||||
val3 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"NUR_DailyOrder","Prealbumin" ;
|
||||
|
||||
val4 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"NUR_DailySchedule","Every Monday and Thursday" ;
|
||||
|
||||
FromDate := now as {{{SINGLE-QUOTE}}}System.DateTime{{{SINGLE-QUOTE}}};
|
||||
val5 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Nullable<DateTime>>{{{SINGLE-QUOTE}}} with
|
||||
"NUR_DateField",FromDate ;
|
||||
|
||||
ToDate := (now + 1 days) as {{{SINGLE-QUOTE}}}System.DateTime{{{SINGLE-QUOTE}}};
|
||||
val6 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<Nullable<DateTime>>{{{SINGLE-QUOTE}}} with
|
||||
"NUR_ToDate",ToDate ;
|
||||
|
||||
GeneralOrder_obj.SpecialInstructions := "if results are less than 19.";
|
||||
|
||||
endif;
|
||||
|
||||
if (Order_catalog_item.Name = "Pulmonary Health Education Consult") then
|
||||
|
||||
if ( local_session.SessionReadmissionOrder = "Patient uses Tobacco" ) then
|
||||
val7 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"RESP Pulmonary Health Education","Smoking Cessation" ;
|
||||
elseif ( local_session.SessionReadmissionOrder = "Quit Tobacco Use in the Last 12 months" ) then
|
||||
val8 := call GeneralOrder_obj.{{{SINGLE-QUOTE}}}SetEnterpriseDefinedDataItemValue<String>{{{SINGLE-QUOTE}}} with
|
||||
"RESP Pulmonary Health Education","Quit Smoking in Last 12 Months" ;
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
GeneralOrder_dest.ObjectsPlus := GeneralOrder_obj;
|
||||
//VOID := GeneralOrder_obj.Save ;
|
||||
endif;
|
||||
endtry;
|
||||
|
||||
catch Exception ex
|
||||
error_occurred := true;
|
||||
error_message := error_message || "{{+R}}New" || order_type || " order:{{-R}}\n" ||
|
||||
ex.Message || "\n\n";
|
||||
|
||||
if ( Order_catalog_item is NOT NULL ) then
|
||||
void:= call Order_catalog_item.Dispose;
|
||||
Order_catalog_item:= null;
|
||||
endif;
|
||||
|
||||
if ( DiagnosticOrder_obj is NOT NULL ) then
|
||||
void:= call DiagnosticOrder_obj.Dispose;
|
||||
DiagnosticOrder_obj:= null;
|
||||
endif;
|
||||
|
||||
if ( GeneralOrder_obj is NOT NULL ) then
|
||||
void:= call GeneralOrder_obj.Dispose;
|
||||
GeneralOrder_obj:= null;
|
||||
endif;
|
||||
|
||||
GeneralOrder_dest := null;
|
||||
DiagnosticOrder_dest := null;
|
||||
|
||||
endcatch;
|
||||
|
||||
;;
|
||||
priority: 50
|
||||
;;
|
||||
evoke:
|
||||
;;
|
||||
logic:
|
||||
Conclude true;
|
||||
;;
|
||||
action:
|
||||
if Error_occurred
|
||||
then
|
||||
|
||||
write "An error has occured in the MLM {{+B}}SCH_Create_General_Order{{-B}} " ||
|
||||
"Please notify your System Administrators that an error message has " ||
|
||||
"occurred for this patient. They will review the following error " ||
|
||||
"message: \n" at error_destination;
|
||||
write error_message at error_destination;
|
||||
|
||||
endif;
|
||||
|
||||
if EXISTS GeneralOrder_dest then
|
||||
write true at GeneralOrder_dest;
|
||||
endif;
|
||||
|
||||
if EXISTS DiagnosticOrder_dest then
|
||||
write true at DiagnosticOrder_dest;
|
||||
endif;
|
||||
;;
|
||||
Urgency: 50;;
|
||||
end:
|
||||
Reference in New Issue
Block a user