MUSE 2016 Rules for PCS and OM in 6.x Presented by: Joe Cocuzzo Sr. Vice President Report Writing Services
Session Overview Rule Dictionary Overview of sections How to navigate Order Management Order Rules Print Rules Adding a rule to a query on an order Patient Care System Require Rules Message Rules Calculate Rules Suppress Rules Skip Rules
Rule Dictionary Path to the Rule Dictionary: Info Systems, MIS, Dictionaries, Administrative, Rule (M-AT), Rule
Rule Dictionary Main Select New to create. Switch to Edit mode after first file. Categories: Determines the data fields that are available to use in your rule Copy From provides a lookup of rule dictionary
Flowsheet Rule Caching
Override?
Rule Dictionary Variables Variables to be used in the rule: External variables are available outside the scope of the rule Description – Free Text, not required NewQueryResponse defaults in, used in OM rISules (eg. if you need to check user response to invoke logic) Fields: Available fields depends on Category selected on Main screen
Can Pull Queries from Screen
Rule Dictionary Variables Examples of field lookup One thing to note: If you select fields and then try to go back and change your rule Category, you will not be able to until you remove the fields from the Field section
M/AT Design ?features? Design philosophy vs usability Descriptions rather than mnemonics shown on lookups and screens. Input may appear to be possible, but blocked with no reason shown.
Rule Dictionary Rule Editor Start with a blank slate, build rule here The Rule consists of multiple lines of programming commands that are executed in order
Rule Dictionary Rule Editor Use Enter Line to start each new line As you select from one box, the next one pops up to the right with the next set of choices As you continue selecting items, the rule built so far shows up in the current value box
Rule Dictionary Rule Editor Undo – backs you up one menu (one box, from right to left) Back Space – wipes out the last value (example above would remove “DAY” variable) Cancel Line – cancels the current line you are working on, but prompts first to make sure End Line – completes line
Rule Dictionary Rule Editor If you need to edit, insert or remove a line, first select the line by clicking in Line number section Insert will allow you to enter a line above the current one Edit will allow you to change the current line Remove will delete the whole line To continue on, use Enter Line and you will create the next line in the rule Move Up and Down are helpful when you enter a line, and then realize you should have inserted it earlier. They allow you to move full lines of code up or down the list.
Rule Dictionary Rule Editor Expression Compute allows you to create calculations and assign variables Set Program Result establishes the end result of the rule. You might set a program result equal to a value stored in a variable, or simply Ok or NotOk to indicate certain things Create List allows you to make a list of values into a list. Values can be variables, fields, free text, etc. The list can be used for various things, including passing arguments to a built- in function
Rule Dictionary Rule Editor Message/Dialog Box Create pop up message boxes that need to be acknowledged before user can move on Create message boxes that require a Yes or No response. Create message boxes that offer a multiple choice response The last two require an additional query to store the response
Rule Dictionary Rule Editor String Manipulation Format allows you to convert a value to a different format (eg. convert from internal date to external date format) Extract allows you to pull out a certain portion of a string (for example, pulling the first two characters from a time field to get the hour) Join allows you to concatenate values into one value Locate allows you to find a specific value in a string Length returns the number of characters in a field
Rule Dictionary Rule Editor If/Then Allows you to create If/Then/Else logic Can have as many Else If conditions as needed Can execute multiple statements (commands) for each condition Need to End the If statement If Statement Format: If Condition Exists Then Execute This Statement Else If Second Condition Exists Then Execute This Statement End If
Rule Dictionary Rule Editor Notes Can create notes about the rule Notes do not get carried over to a new rule if this one is copied
Order Rule Cannot Order on Weekends Rule to prevent ordering on weekends
Order Rule Cannot Order on Weekends Setup variables and fields: Returns: Mon, Tue, Wed, etc.
Order Rule Cannot Order on Weekends Create the message to display Evaluate the day of week and set variable to Ok or NotOk Create a list containing the two variables {RESULT,MSG} Set program result
What Order Rule Should Return LIST of two items in one variable: {RESULT,MSG} looks like queued string RESULT = OK, allow entry/filing RESULT = NotOk, reject entry/filing MSG = message to display
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends
Order Rule Cannot Order on Weekends Create the message to display Evaluate the day of week and set variable to Ok or NotOk Create a list containing the two variables {RESULT,MSG} Set program result
Add Rule to Associations Tab of Order Dictionary Order Rule Cannot Order on Weekends Scroll down to:
Order Rule Cannot Order on Weekends Message when we try to order on weekend:
Service Date to DOW Can it be done??
Guess Not! Same Hospital (6.07) Report Rules have more format options than “Regular” rules
But.. Maybe it Can
Yes it can - IF{A?8N^D D$4^Y,D%3$2^M,D%5^D, IF{Y<1900!(Y=1900&(M*1<3)) D+1^D}, IF{M<03 Y-1801;Y-1800}^Y, Y\4*365+(Y/4*1461)+(M+9\12^M\5\2*31)+(M\5/2*61)+(M/5*153)+D-1-2\7+1};
Rule Message
Order Rule Only order for women and children Restrict ordering by age and sex
Order Rule Only order for women and children Setup three variables This time add patient age and sex fields
Order Rule Only order for women and children
Order Rule Only order for women and children When evaluating Sex, it is type “Choice”, not “Free Text”
Order Rule Only order for women and children Order Dictionary, Associations Section:
Order Rule Only order for women and children
Order Rule Message based on response Query for Same Day Consult (Y/N) – if Y and Day is Sunday, pop up a message to call Community Dietician.
Order Rule Message based on response Use the NewQueryResponse variable to evaluate what the user just entered
Order Rule Message based on response Two message types: FYI Critical
Order Rule Message based on response
Order Rule Message based on response FYI Critical
Order Print Rules Weekend vs Weekday Printing Printing to Patient Location on weekdays, and a set printer on weekends. Two rules:
Order Print Rules Weekend vs Weekday Printing When first condition is met, the program result is set to Ok and output format will print, otherwise, program result is NotOk and it will not print
Order Print Rules Weekend vs Weekday Printing Add to Printing section of Orders dictionary
Rule on Query Message Box and Determine if it can be ordered Rule that will pop up a message if patient is non-emerg and same day consult is ordered on a weekend or after hours
Rule on Query Message Box and Determine if it can be ordered
Rule on Query Message Box and Determine if it can be ordered
Rule on Query Message Box and Determine if it can be ordered
Rule on Query Message Box and Determine if it can be ordered Add Rule to Query on the Screen
Rule on Query Message Box and Determine if it can be ordered
Rule on Query A Note About Variables Use of variables helps keep the lines shorter so they do not run as far to the right
Rule on Query A Note About Variables It can quickly get too large for the screen and then we need to use the scroll bar to see the rest of the statement
PCS Rules Five Types of PCS Rules: Require – make field required conditionally based on logic Message – create a message box based on certain criteria Suppress – hide a query based on certain logic Skip – skip over a query based on certain logic Calculate – calculate a value such as a score
PCS Rules Require Execute at initial screen load, and state change of referenced queries Message Executed at state change of referenced query Message types of FYI and Critical Neither are hardstops Suppress Executed at initial screen load Skip Execute at initial screen load, and state change of referenced queries Calculate Executed at state change of referenced queries Outputs the value to be stored in the query
Require Rule Based on Y/N and Group Responses Make last query required if previous answer was Yes
Require Rule Based on Y/N Response The answer to the query will be passed from the assessment, so we need to setup an external variable to use it in the rule Use Category Clinical Data for PCS rules
Require Rule Based on Y/N Response We will set this up as a Require Rule: Ok = Make Required NotOk = Do Not Make Required
Require Rule Based on Y/N Response In Rules section of Documentation Section: Setup rule type Require on correct section and query that you would like to make required Setup query to flow to external variable in rule
Require Rule Based on YN Response
Require Rule Based on Group Responses Make last two queries required if there is any response to previous question
Require Rule Based on Group Response External variable needed to collect any response to the group response query
Require Rule Based on Group Response
Require Rule Based on Group Response In Rules section: Setup rule type on correct section and query that you would like to make required Setup query to flow to external variable in rule This will need to be setup on both queries in this section
Require Rule Based on YN and Group Response
Message Rules Based on Y/N and Group Response Queries Message if this query is answered No Message with any response to this query
Message Rules Based on Y/N Query
Message Rules Based on Y/N Query
Message Rules Based on Y/N Query In Rules section: Setup rule type Message on correct section and query that you would like to make required Setup current query to flow to external variable in rule
Message Rules Based on Y/N Query Message pops up as soon as query is answered No (before populating response)
Message Rules Based on Group Response Query
Message Rules Based on Group Response Query
Message Rules Based on Group Response Query
Message Rules Based on Group Response Query Message pops up as soon as an item is selected from Agency Notified query
Message Rules Validating a Date Check date to ensure it’s not in the future, or more than 3 months in the past and pop up error message
Message Rules Validating a Date Variables Needed: External variable to pass the value the user entered Internal variables for converting and comparing dates
Message Rules Validating a Date
Message Rules Validating a Date
Message Rules Validating a Date
Message Rules Validating a Date Setup on Fall Date query Pass date user entered into FALLDATE variable
Message Rules Validating a Date
Message Rules Using Messages to Troubleshoot If unsure of the value of some fields or variables, put them into a Message Box and run the rule to see what you get.
Calculate Rules Totaling Automatic Totalling
Calculate Rules Totaling Setup Group Response to Map Values to Elements
Calculate Rules Totaling Setup the query that will hold the total as Type “Result”
Calculate Rules Totaling Need one external variable for each query being totalled, and variable for Total
Calculate Rules Totaling
Calculate Rules Totaling
Calculate Rules Totaling
Calculate Rules Totaling Rule goes on query that displays the total Map external variables to queries to be totalled
Calculate Rules Totaling Field is not editable
Calculate Rules Totaling Second version of rule includes If statement The difference between the two is that this one checks for the existence of all queries before totalling, while the first one keeps a running total.
Calculate Rules Totaling Running Total Blank until all are answered
Suppress Rules Suppress Query for Inpatients
Suppress Rules Suppress Query for Inpatients Setup field to check for status
Suppress Rules Suppress Query for Inpatients
Suppress Rules Suppress Query for Inpatients
Suppress Rules Suppress Query for Inpatients
Skip Rules Skip Query Based on Y/N Response Only stop on Nutritional Education Needs if previous query answered “N”
Skip Rules Skip Query Based on Y/N Response Setup an external variable to pass user response
Skip Rules Skip Query Based on Y/N Response
Skip Rules Skip Query Based on Y/N Response Attach rule to query to be skipped Map variable to previous query
Skip Rules Skip Query Based on Y/N Response
Calculate BMI Steps: 1.Convert height to inches 2.Square height 3.Convert weight to ounces, round 4.Divide pounds by height squared 5.Multiply by 703
Calculate BMI