Initial Checking with all 820 MLMs
This commit is contained in:
441
MLMStripper/bin/Debug/SCH/SCH_PROBIOTIC_PROTOCOL.mlm
Normal file
441
MLMStripper/bin/Debug/SCH/SCH_PROBIOTIC_PROTOCOL.mlm
Normal file
@@ -0,0 +1,441 @@
|
||||
maintenance:
|
||||
|
||||
title: Probiotic Protocol for Antibiotic Ordering;;
|
||||
mlmname: SCH_Probiotic_Protocol;;
|
||||
arden: version 2;;
|
||||
version: 5.50;;
|
||||
institution: St Clair;;
|
||||
author: Bryan Berkeybile;;
|
||||
specialist: Don Warnick;;
|
||||
date: 2013-09-22;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: Probiotic Ordering
|
||||
;;
|
||||
|
||||
explanation: The MLM will create an order for a Probiotic if a patient is prescribed and antibiotic
|
||||
|
||||
Change history
|
||||
09.22.2013 DW CSR# 31693 Created
|
||||
10.24.2013 DW CSR# 31693 - Now the MLM supplies the session type (of the evoking antibiotic) to the Order Create MLM
|
||||
Also, active orders has been redifined as >=15 (includes held orders)
|
||||
10.31.2013 DW CSR# 31693 - Converted the lab result to a number
|
||||
11.13.2013 DW CSR# 31693 - Pass Order Source Value to Order Creation Functional MLM
|
||||
01.14.2014 DW HD# 163173 - Exclude orders from the "Family Birth Center Admission" Order Set
|
||||
08.03.2015 GOS CSR :33324 -Exclusion for All Inflammatory Bowel Disease with inflixamab and adalimumab medication orders
|
||||
Pop-up Message for User if Patient Already ordered with [inflixamab or adalimumab] orders.
|
||||
12.20.2017 TMS CSR# 35886 - Add logic for 1)when patient ordered an antifungal to auto discontinue the Florastor;
|
||||
2) to not order Florastor when an appropriate antibiotic is ordered if the patient is
|
||||
already on an antifungal;
|
||||
3) Warn the user if an antifungal and florastor are being ordered in the same session.
|
||||
10.29.2018 TMS CSR# 37374 - Remove auto order entry of Florastor for patients ordered antibiotics. Maintain alerting for patients on
|
||||
Florastor who are receiving Adalimumab or Infliximab, patients on florastor who are being order an antifungal
|
||||
and a hard stop for patients with Absolute Neutrophil Count (ANC) less than 1 K/UL.
|
||||
;;
|
||||
keywords: Probiotic Ordering
|
||||
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
|
||||
data:
|
||||
|
||||
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
||||
include standard_libs;
|
||||
|
||||
error_occurred := false;
|
||||
error_message := "";
|
||||
log_execution_info := false;
|
||||
|
||||
send_alert := "DoNotSend";
|
||||
hard_stop := false;
|
||||
CR := 13 formatted with "%c";
|
||||
LF := 10 formatted with "%c";
|
||||
CRLF:= CR||LF;
|
||||
|
||||
if called_by_editor
|
||||
then EvokingObject := read last {Order: THIS where Name="Loratadine 10mg Tab" };
|
||||
endif;
|
||||
|
||||
order_enter_event := event { OrderEnter User Order: where TypeCode = "Medication"
|
||||
and (OrderSetName <> "Family Birth Center Admission" or OrderSetName is null) // changed 1/14/14
|
||||
and InitialSessionTypeCode <> "Discharge"
|
||||
and not (Name matches pattern "%flush%")
|
||||
and not (Name matches pattern "%lock%")
|
||||
and not (Name matches pattern "%zz%")
|
||||
and not (Name matches pattern "%Neomycin%Enema%")
|
||||
and Name <> "Vancomycin Soln"
|
||||
and Name <> "Sulfasalazine 500mg Tab"
|
||||
and Name <> "Saccharomyces Boulardi 250mg Cap"
|
||||
};
|
||||
order_init_event := event { OrderInit User Order: where TypeCode = "Medication"
|
||||
and Name = "Saccharomyces Boulardi 250mg Cap"
|
||||
};
|
||||
(unsubmitted_florastor) := READ {UnsubmittedOrders: Name WHERE Name = "Saccharomyces Boulardi 250mg Cap"};
|
||||
|
||||
number_unsub_florastor := count (unsubmitted_florastor);
|
||||
|
||||
(unsubmitted_antifungal) := READ {UnsubmittedOrders: Name WHERE (Name MATCHES PATTERN "Fluconazole%")
|
||||
or (Name MATCHES PATTERN "Micafungin%")
|
||||
or (Name MATCHES PATTERN "Voriconazole%")
|
||||
or (Name MATCHES PATTERN "Ketoconazole 200%")
|
||||
or (Name = "Amphotericin B Liposome:")
|
||||
or (Name = "Amphotericin B:")} ;
|
||||
|
||||
number_unsub_antifungal := count (unsubmitted_antifungal);
|
||||
|
||||
|
||||
|
||||
userguid :=read last {UserInfo: guid};
|
||||
|
||||
(OrderAdditionalInfoObj, SessionType) := read last { Order: OrderAdditionalInfo, InitialSessionTypeCode REFERENCING EvokingObject };
|
||||
|
||||
(CatalogItemObj, FrequencyValue) := read last {Order: OrderCatalogMasterItem, FrequencyCode REFERENCING EvokingObject};
|
||||
|
||||
(ClientVisitGuid, ChartGuid, ClientGuid, VisitType) := read last {ClientVisit: GUID, ChartGUID, ClientGUID, TypeCode};
|
||||
(birthdate, birth_year ) := read last { ClientInfo: birthdate, BirthYearNum };
|
||||
|
||||
|
||||
// Determine if the patient is over 18 // not needed tms
|
||||
/*
|
||||
if exist birthdate and birth_year > 0 and birthdate is time
|
||||
then
|
||||
patient_age:= (NOW - birthdate) / (1 year);
|
||||
// NOW_DateOnly:= (NOW formatted with "%.2t") as time;
|
||||
// patient_age2 := (NOW_DateOnly - birthdate) / (1 year);
|
||||
endif;
|
||||
*/
|
||||
//=====
|
||||
|
||||
(ActiveOrderPresent, OrderGuid) := read last
|
||||
{ " select o.name, o.guid "
|
||||
|| " from cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " join cv3order as o with (nolock)on o.ordercatalogmasteritemguid = ocmi.guid "
|
||||
|| " and o.ClientGUID = " || ClientGuid || " and o.ChartGUID = " || ChartGuid || " and o.ClientVisitGUID= " || ClientVisitGuid || " "
|
||||
|| " and (o.name = {{{SINGLE-QUOTE}}}Saccharomyces Boulardi 250mg Cap{{{SINGLE-QUOTE}}}) "
|
||||
|| " and o.OrderStatusLevelNum >= 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
};
|
||||
|
||||
|
||||
(AntifungalGuidList) := read
|
||||
{ " select Guid from cv3ordercatalogmasteritem where TherapeuticCategory = {{{SINGLE-QUOTE}}}anti-infectives | antifungals{{{SINGLE-QUOTE}}} "
|
||||
|| " and (name not like {{{SINGLE-QUOTE}}}%irrigation%{{{SINGLE-QUOTE}}} and name not like {{{SINGLE-QUOTE}}}%_IPRO{{{SINGLE-QUOTE}}})"
|
||||
|| " and ExpiryDate is null"
|
||||
};
|
||||
|
||||
(ActiveAntifungal) := read
|
||||
{ " select o.name "
|
||||
|| " from cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " join cv3order as o with (nolock)on o.ordercatalogmasteritemguid = ocmi.guid "
|
||||
|| " and o.ClientGUID = " || ClientGuid || " and o.ChartGUID = " || ChartGuid || " and o.ClientVisitGUID= " || ClientVisitGuid || " "
|
||||
|| " and o.OrderCatalogMasterItemGUID in (" || AntifungalGuidList || ")"
|
||||
|| " and o.OrderStatusLevelNum >= 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
};
|
||||
|
||||
|
||||
LabResult := read last
|
||||
{ " Select top 1 bo.value from cv3BasicObservation bo where "
|
||||
|| " (bo.itemname = {{{SINGLE-QUOTE}}}Absolute Neutrophil Count (ANC){{{SINGLE-QUOTE}}} or bo.itemname = {{{SINGLE-QUOTE}}}Absolute Neutrophils{{{SINGLE-QUOTE}}}) and bo.value is not NULL and bo.IsHistory = {{{SINGLE-QUOTE}}}0{{{SINGLE-QUOTE}}} "
|
||||
|| " and bo.clientguid = " || SQL(ClientGuid) || " and bo.chartguid = " || SQL(ChartGuid) || " and bo.ClientVisitGUID = " || SQL(ClientVisitGuid) || " "
|
||||
|| " order by bo.TouchedWhen desc "
|
||||
};
|
||||
|
||||
// Added By Shivprasad Jadhav for CSR :33324- Florastor Protocol
|
||||
Ord_OBJECT := OBJECT [Obs_Name, Obs_EnteredDtm , Obs_StatusCode] ;
|
||||
Medi_OrderPresent := read as Ord_OBJECT { " select o.name ,o.Entered, o.OrderStatusCode "
|
||||
|| " from CV3Order o With (Nolock) Join Cv3ClientVisit cv With (Nolock) On o.ClientVisitGUID=cv.Guid And o.ClientGUID =cv.ClientGUID "
|
||||
|| " where o.ClientVisitGUID = " || SQL(ClientVisitGuid)
|
||||
|| " And o.clientguid = " || SQL(ClientGuid)
|
||||
|| " and o.ChartGUID = " || SQL(ChartGuid)
|
||||
|| " AND o.name in ({{{SINGLE-QUOTE}}}Infliximab:{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Adalimumab Inj{{{SINGLE-QUOTE}}}) "
|
||||
|| " Order By o.Entered Desc " };
|
||||
|
||||
If (EVOKINGOBJECT.Name = "Saccharomyces Boulardi 250mg Cap") And exists ActiveAntiFungal Then
|
||||
|
||||
info_message := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient is already on an antifungal " || ActiveAntiFungal || ", which will diminish the effectiveness of Florastor. "
|
||||
|| "\n\n Recommend avoiding the use of Florastor with systemic antifungals. "
|
||||
,"Patient Receiving AntiFungal Medication", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Information" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
Endif;
|
||||
|
||||
If (EVOKINGOBJECT.Name = "Saccharomyces Boulardi 250mg Cap") And number_unsub_antifungal = 1 Then
|
||||
|
||||
unsub_info_message := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient has an unsubmitted order for an antifungal which will diminish the effectiveness of Florastor: "
|
||||
|| "\n " || unsubmitted_antifungal [1]
|
||||
|| "\n\n Recommend avoiding the use of Florastor with systemic antifungals. "
|
||||
,"Unsubmitted AntiFungal Order", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Information" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
Endif;
|
||||
|
||||
If (EVOKINGOBJECT.Name = "Saccharomyces Boulardi 250mg Cap") And number_unsub_antifungal > 1 Then
|
||||
|
||||
unsub_info_message := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient has " || number_unsub_antifungal ||" unsubmitted orders for antifungals which will diminish the effectiveness of Florastor: "
|
||||
|| "\n " || unsubmitted_antifungal
|
||||
|| "\n\n Recommend avoiding the use of Florastor with systemic antifungals. "
|
||||
,"Unsubmitted AntiFungal Orders", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Information" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
Endif;
|
||||
|
||||
If (EVOKINGOBJECT.Name = "Saccharomyces Boulardi 250mg Cap") And ((LabResult as number) < 1 ) Then
|
||||
|
||||
// alert destination
|
||||
|
||||
order_alert_dest := destination {alert} with
|
||||
[alert_type := warning,
|
||||
short_message := "Florastor Order Conflict",
|
||||
priority := "High",
|
||||
scope := Chart,
|
||||
rule_group := "Florastor Order Conflict",
|
||||
rule_number := 4020,
|
||||
send_with_order := "DoNotSend",
|
||||
alert_dialog_settings := "No Override Allowed",
|
||||
display_alert := true];
|
||||
|
||||
// alert message
|
||||
|
||||
alert_message := "{{+B}}You are attempting to order " || EVOKINGOBJECT.Name || "." || CRLF ||"This patient has an Absolute Neutrophil Count (ANC) of {{+R}}" || LabResult|| " K/UL. {{-R}}"
|
||||
|
||||
||CRLF || "Saccharomyces boulardii is CONTRAINDICATED in patients with neutropenia due to increased risk of infection."
|
||||
|| CRLF || CRLF || "{{+R}}You MAY NOT PROCEED with this order. {{-R}} {{-B}} ";
|
||||
|
||||
hard_stop := true;
|
||||
|
||||
Endif;
|
||||
|
||||
If (EVOKINGOBJECT.Name in ("Infliximab:","Adalimumab Inj")) And exists ActiveOrderPresent Then
|
||||
|
||||
Ordername := Read Last {"select replace ({{{SINGLE-QUOTE}}}" || EVOKINGOBJECT.Name || "{{{SINGLE-QUOTE}}} ,{{{SINGLE-QUOTE}}}:{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}}) " };
|
||||
|
||||
dlg_result_Florastor := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient is receiving Florastor. If " || Ordername || " is being used for Inflammatory Bowel Disease, "
|
||||
|| " please discontinue the Florastor. Patients with acute flares of IBD may be at higher risk of developing Saccharomyces infections."
|
||||
,"Medication Order to be Entered", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Warning" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
|
||||
Endif;
|
||||
|
||||
//==========================================
|
||||
/*
|
||||
// Proceed if this is an inpatient/observation patient 18 or over and the drug is not of certain classes
|
||||
|
||||
If (VisitType = "inpatient" or VisitType = "observation" or VisitType = "emergency")
|
||||
and patient_age >= 18
|
||||
and CatalogItemObj.TherapeuticCategory matches pattern "anti-infective%"
|
||||
and CatalogItemObj.TherapeuticCategory <> "anti-infectives | antiviral agents"
|
||||
and CatalogItemObj.TherapeuticCategory <> "anti-infectives | antifungals"
|
||||
and CatalogItemObj.TherapeuticCategory <> "anti-infectives | antimalarial agents"
|
||||
and CatalogItemObj.TherapeuticCategory <> "anti-infectives | antituberculosis agents"
|
||||
and CatalogItemObj.TherapeuticCategory <> "anti-infectives | anthelmintics"
|
||||
then
|
||||
|
||||
// Convert the Frequency Code to Doses Per Day
|
||||
|
||||
DosesPerDay := read last
|
||||
{ " select count (fsd.ScheduledTime) from CV3CodedFreqTranslation cft "
|
||||
|| " join CV3FixedScheduleDefinition fsd on fsd.ParentGUID = cft.guid "
|
||||
|| " where cft.FrequencyCode = " || SQL(FrequencyValue) || " "
|
||||
|| " and FrequencyClass = {{{SINGLE-QUOTE}}}<Default>{{{SINGLE-QUOTE}}} and cft.active = 1 "
|
||||
};
|
||||
|
||||
// Determine the "time from value" for Frequency Codes < 1 per day (i.e. Q48H, Weekly etc)
|
||||
|
||||
TimeFromValue := read last
|
||||
{ " select cft.TimeFromValue from CV3CodedFreqTranslation cft "
|
||||
|| " join CV3FixedScheduleDefinition fsd on fsd.ParentGUID = cft.guid "
|
||||
|| " where cft.FrequencyCode = " || SQL(FrequencyValue) || " "
|
||||
|| " and FrequencyClass = {{{SINGLE-QUOTE}}}<Default>{{{SINGLE-QUOTE}}} and cft.active = 1 "
|
||||
};
|
||||
|
||||
|
||||
// Gather data from the stop fields
|
||||
|
||||
if OrderAdditionalInfoObj.StopAfterOption = 1 then StopAfterOption := "Days";
|
||||
elseif OrderAdditionalInfoObj.StopAfterOption = 2 then StopAfterOption := "Hours";
|
||||
elseif OrderAdditionalInfoObj.StopAfterOption = 3 then StopAfterOption := "Minutes";
|
||||
elseif OrderAdditionalInfoObj.StopAfterOption = 4 then StopAfterOption := "Times";
|
||||
endif;
|
||||
|
||||
StopAfterNumber := OrderAdditionalInfoObj.StopAfterValue;
|
||||
|
||||
|
||||
if StopAfterOption is null and DosesPerDay > 0 then DurationOver72 := "true";
|
||||
elseif StopAfterOption = "Days" and StopAfterNumber > 3 then DurationOver72 := "true";
|
||||
elseif StopAfterOption = "Hours" and StopAfterNumber > 72 then DurationOver72 := "true";
|
||||
elseif StopAfterOption = "Minutes" and StopAfterNumber > 4320 then DurationOver72 := "true";
|
||||
|
||||
elseif StopAfterOption = "Times" and TimeFromValue = 1
|
||||
and StopAfterNumber > (3 * DosesPerDay) then DurationOver72 := "true";
|
||||
|
||||
elseif StopAfterOption = "Times" and TimeFromValue > 1
|
||||
and (TimeFromValue * StopAfterNumber) > 3 then DurationOver72 := "true";
|
||||
|
||||
elseIf FrequencyValue = "<User Schedule>" then DurationOver72 := "true";
|
||||
else DurationOver72 := "false";
|
||||
endif;
|
||||
|
||||
// Determine if the patient has a Lab ANC value over 1000
|
||||
|
||||
LabResult := read last
|
||||
{ " Select top 1 bo.value from cv3BasicObservation bo where "
|
||||
|| " (bo.itemname = {{{SINGLE-QUOTE}}}Absolute Neutrophil Count (ANC){{{SINGLE-QUOTE}}} or bo.itemname = {{{SINGLE-QUOTE}}}Absolute Neutrophils{{{SINGLE-QUOTE}}}) and bo.value is not NULL and bo.IsHistory = {{{SINGLE-QUOTE}}}0{{{SINGLE-QUOTE}}} "
|
||||
|| " and bo.clientguid = " || SQL(ClientGuid) || " and bo.chartguid = " || SQL(ChartGuid) || " and bo.ClientVisitGUID = " || SQL(ClientVisitGuid) || " "
|
||||
|| " order by bo.TouchedWhen desc "
|
||||
};
|
||||
|
||||
// Check for an active Saccharomyces Order on the account
|
||||
//=================================================================================================================================================================
|
||||
// This portion of MLM is moved on upper side of MLM
|
||||
/*(ActiveOrderPresent) := read last
|
||||
{ " select o.name "
|
||||
|| " from cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " join cv3order as o with (nolock)on o.ordercatalogmasteritemguid = ocmi.guid "
|
||||
|| " and o.ClientGUID = " || ClientGuid || " and o.ChartGUID = " || ChartGuid || " and o.ClientVisitGUID= " || ClientVisitGuid || " "
|
||||
|| " and (o.name = {{{SINGLE-QUOTE}}}Saccharomyces Boulardi 250mg Cap{{{SINGLE-QUOTE}}}) "
|
||||
|| " and o.OrderStatusLevelNum >= 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
};
|
||||
|
||||
// Added By Shivprasad Jadhav for CSR :33324- Florastor Protocol
|
||||
Ord_OBJECT := OBJECT [Obs_Name, Obs_EnteredDtm , Obs_StatusCode] ;
|
||||
Medi_OrderPresent := read as Ord_OBJECT { " select o.name ,o.Entered, o.OrderStatusCode "
|
||||
|| " from CV3Order o With (Nolock) Join Cv3ClientVisit cv With (Nolock) On o.ClientVisitGUID=cv.Guid And o.ClientGUID =cv.ClientGUID "
|
||||
|| " where o.ClientVisitGUID = " || SQL(ClientVisitGuid)
|
||||
|| " And o.clientguid = " || SQL(ClientGuid)
|
||||
|| " and o.ChartGUID = " || SQL(ChartGuid)
|
||||
|| " AND o.name in ({{{SINGLE-QUOTE}}}Infliximab:{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Adalimumab Inj{{{SINGLE-QUOTE}}}) "
|
||||
|| " Order By o.Entered Desc " };
|
||||
|
||||
|
||||
//Medi_OrderPresent := "ABC";
|
||||
If (exists Medi_OrderPresent or (EVOKINGOBJECT.Name in ("Infliximab:","Adalimumab Inj")) ) And exists ActiveOrderPresent Then
|
||||
Ordername := Last of(Medi_OrderPresent.Obs_Name where Medi_OrderPresent.Obs_EnteredDtm Is Not Null And Medi_OrderPresent.Obs_StatusCode Is Not Null );
|
||||
//Ordername :="XYZ";
|
||||
|
||||
dlg_result_Florastor := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient is receiving Florastor. If " || Ordername|| " is being used for Inflammatory Bowel Disease, "
|
||||
|| "\n\n please discontinue the Florastor. Patients with acute flares of IBD may be at higher risk of developing Saccharomyces infections."
|
||||
,"Medication Order to be Entered", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Warning" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
|
||||
Endif; */
|
||||
/*
|
||||
//Start :Added By Shivprasad Jadhav for CSR :33324- Florastor Protocol =============================================
|
||||
|
||||
(Healthissue) := read { " select distinct hid.shortname, chi.code, chi.typecode, hid.typecode "
|
||||
||" from cv3healthissuedeclaration hid with (nolock) "
|
||||
||" join cv3codedhealthissue chi on chi.Guid = hid.codedhealthissueguid "
|
||||
||" where hid.clientguid = " || ClientGuid
|
||||
||" and hid.active = 1 and hid.status = {{{SINGLE-QUOTE}}}Active{{{SINGLE-QUOTE}}} "
|
||||
||" and chi.typecode in ({{{SINGLE-QUOTE}}}ICD9{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Pt-Stated Hx{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Pt Stated HX{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}AMB Med History{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}Problem-Chronic{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}Problem-Visit{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}Vaccine History{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Skin Tests{{{SINGLE-QUOTE}}}) "
|
||||
||" And Hid.ShortName in({{{SINGLE-QUOTE}}}Crohn{{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}}s disease{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Inflammatory bowel disease (Crohn{{{SINGLE-QUOTE}}}{{{SINGLE-QUOTE}}}s disease){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Inflammatory bowel disease (ulcerative colitis){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}Ulcerative Colitis{{{SINGLE-QUOTE}}}, "
|
||||
||" {{{SINGLE-QUOTE}}}Inflammatory bowel disease in pediatric patient{{{SINGLE-QUOTE}}} , {{{SINGLE-QUOTE}}}Inflammatory bowel disease{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}Chronic inflammatory small bowel disease{{{SINGLE-QUOTE}}}, "
|
||||
||" {{{SINGLE-QUOTE}}}Personal history of inflammatory bowel disease{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}H/O inflammatory bowel Disease{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}idiopathic chronic inflammatory Bowel Disease{{{SINGLE-QUOTE}}}) "
|
||||
||" and chi.code in ({{{SINGLE-QUOTE}}}558.9{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}555.9{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}556.9{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}V12.79{{{SINGLE-QUOTE}}}) " };
|
||||
|
||||
|
||||
//End :Added By Shivprasad Jadhav for CSR :33324- Florastor Protocol ===========================================
|
||||
|
||||
// Is the patient a candidate for a Probiotic Order?
|
||||
|
||||
if DurationOver72 = "true"
|
||||
and ((LabResult as number) >= 1 or not exist LabResult)
|
||||
and ( not exists ActiveOrderPresent )
|
||||
and ( not exists ActiveAntifungal )
|
||||
And ( Not exists Healthissue )
|
||||
And ( Not exists Medi_OrderPresent )
|
||||
and ( Not exists unsubmitted_antifungal)
|
||||
then
|
||||
|
||||
// Inform the user of the order to be created
|
||||
|
||||
dlg_result := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient has met the criteria for the Probiotic Protocol. "
|
||||
|| "\n\n An order for Florastor 500 mg PO BID will be automatically created. "
|
||||
,"Probiotic Protocol Order to be Entered", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Information" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
|
||||
// Ceate the order
|
||||
// If the user selects another careprovider (Nurse or US entry), pass the requestors user ID
|
||||
|
||||
if userguid <> EVOKINGOBJECT.CareProviderGUID then
|
||||
userguid := EVOKINGOBJECT.CareProviderGUID;
|
||||
endif;
|
||||
|
||||
create_CHF_order := mlm {{{SINGLE-QUOTE}}}SCH_FUNC_CREATE_ORDER{{{SINGLE-QUOTE}}};
|
||||
var := call create_CHF_order WITH (ClientVisitGuid, userguid, ClientGuid, SessionType,"Protocol Order", "Saccharomyces Boulardi 250mg Cap" , "Probiotic Protocol", "Medication");
|
||||
|
||||
endif; // Is the patient a candidate for a Probiotic Order?
|
||||
|
||||
endif; // Visit Type is Inpatient or Observation Patient 18 years or older
|
||||
*/
|
||||
If (VisitType = "inpatient" or VisitType = "observation" or VisitType = "emergency")
|
||||
and CatalogItemObj.TherapeuticCategory = "anti-infectives | antifungals"
|
||||
and ActiveOrderPresent is not null and CatalogItemObj.GUID in AntifungalGuidList
|
||||
then
|
||||
|
||||
dc_message := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient has an active order for Florastor 500 mg. Antifungals diminish the benefit of Florastor. "
|
||||
|| "\n\n Do you wish to discontinue the Florastor?"
|
||||
|| "\n\n Select YES to discontinue the Florastor order."
|
||||
|| "\n\n Select NO to keep the Florastor order and continue."
|
||||
,"Probiotic Protocol Order to be Discontinued", "YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Information" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
|
||||
|
||||
if((dc_message as string) = "Yes") then
|
||||
|
||||
if userguid <> EVOKINGOBJECT.CareProviderGUID then
|
||||
userguid := EVOKINGOBJECT.CareProviderGUID;
|
||||
endif;
|
||||
|
||||
Reason := "Patient Ordered Antifungal Medication";
|
||||
Source := "Protocol Order";
|
||||
DC_Probiotic_order := mlm {{{SINGLE-QUOTE}}}SCH_Func_Discontinue_By_OrderGuid{{{SINGLE-QUOTE}}};
|
||||
dcord := call DC_Probiotic_order WITH (OrderGuid, userguid, ClientVisitGuid, Reason, Source);
|
||||
endif;
|
||||
endif;
|
||||
|
||||
If (VisitType = "inpatient" or VisitType = "observation" or VisitType = "emergency")
|
||||
and CatalogItemObj.TherapeuticCategory = "anti-infectives | antifungals"
|
||||
and number_unsub_florastor >= 1 and CatalogItemObj.GUID in AntifungalGuidList
|
||||
then
|
||||
|
||||
|
||||
delete_message := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with
|
||||
"\n This patient has an unsubmitted order for Florastor 500 mg. Please delete the order from the worksheet before submitting. "
|
||||
|| "\n\n Antifungals diminish the benefit of Florastor. "
|
||||
,"Unsubmitted Probiotic Order", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Information" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}};
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
;;
|
||||
priority: 50
|
||||
;;
|
||||
evoke: order_enter_event;
|
||||
order_init_event;
|
||||
|
||||
|
||||
;;
|
||||
logic:
|
||||
|
||||
if called_by_editor
|
||||
then
|
||||
conclude false;
|
||||
endif;
|
||||
|
||||
if EvokingObject is null
|
||||
then
|
||||
conclude false;
|
||||
else
|
||||
|
||||
conclude hard_stop;
|
||||
endif;
|
||||
|
||||
;;
|
||||
action:
|
||||
|
||||
write alert_message at order_alert_dest;
|
||||
;;
|
||||
Urgency: 50;;
|
||||
end:
|
||||
Reference in New Issue
Block a user