Upload
brendon-samples
View
241
Download
11
Tags:
Embed Size (px)
Citation preview
M.U.S.E. 2007Tuesday Training
Introduction to CDS Attributes
Presented by:Jason Medeiros
Iatric Systems
Attribute Introduction
What are attributes? What types of attributes are there? When do they work? What do they do? Things to remember… Where do you put them?
Attribute Definition
Attributes allow hospitals to make Customer Defined Screens more interactive.
Skip Queries Default Responses Evaluate Data entered in Queries
Attributes require a basic knowledge of Magic programming
Attributes are statements that:
Decide when to answer the question
Determine valid responses to the question
Display messages to the user based on variable criteria
Default responses Provide Quality
Control
What types of attributes are there?
DFT - Default FCL – Field Check IFE – Before you get to a field REQ (and REQI) - Required
Where do you put the attribute?
In the MIS Enter/Edit Customer Defined Screen
Attributes are assigned to the query detail of the CDS.
The same query can have different attributes on different CDSs.
To enter/edit an attribute, move the cursor to the Edit A/D column for the query and type in “A”.
When do attributes work?
DFT and IFE statements work before the user has an opportunity to answer the question. IFE statements are invoked before DFT. As a result, DFT statements may not function if used in combination with IFE statements.
FCL and REQ statements work after the user has answered the query .
IFE Attribute – What does it do?
Intended: Determine whether or not the user can answer the query. If the expression is false, the cursor will bypass this field so that it cannot be edited. If expression is true, cursor will stop.
Optional: Can perform calculations, call NPR reports/macros, manipulate data, send messages, call other CDS’s, etc.
IFE attribute - Evaluates At
Evaluated just prior to the cursor arriving at a field.
IFE is the first attribute to be evaluated on the screen.
The result of an IFE attribute may prevent other attributes from being evaluated on a particular query.
IFE – How it works
IFE="" IFE = FALSE will cause the query to be
skipped
IFE=1 IFE = TRUE will allow the user to answer
the question. If IFE equals ANY ANSWER, it is TRUE!
IFE attribute - Example
Example:[email protected]=”M”
If the patient sex is equal to “M”, then the cursor will stop here. If the sex is equal to any other value, this query is skipped
IFE attribute - Example
This reads: “If there is a response to @t.OE.PAT.ht.in.cm, then IFE = True”
The result: If there isn’t a response to the OE.PAT field, the current query will be skipped.
Combination IFE examples:
IFE=(@p.ADM.PAT.sex=“F”)&IFE=([ANS,"NA12.25.10"]|0="N”)
Stop if sex is female AND answer to query is N, else skip
Note the standard syntax for checking a response to a query on the screen: [ANS,”QUERY”]|0
IFE=(@p.ADM.PAT.sex=“F”)&IFE=(%Z.age(@p.ADM.PAT.birthdate)>9)&IFE=(%Z.age(@p.ADM.PAT.birthdate)<51)
Stop if sex is F and patient age is greater than 9 and less than 51, else skip
Note the call to %Z.age
REQ/REQI Attribute- what does it do?
Intended: Make a query required either at time of entry or when screen is filed.
Optional: Call a program or perform some operation when the user presses the file key – at the end of the screen!
REQ/REQI Attributes
There are two ways to make a query required.
1. NO attributes: Answer the question in the CDS dictionary for each query. Answering this question with “Y” makes the query required all of the time.
How to make a query response required #2
2. Use REQ or REQI attribute. It is often used in conjunction with a matching IFE attribute.
REQI – Response required immediately
REQ/REQI attribute - Evaluates At
REQI - Evaluated IMMEDIATELY as the user exits the query. If a response is not entered, a warning message is displayed.
REQ - Evaluated when the user presses the <file>
key or reaches the end of the screen, causing the Meditech “file dialogue”.
Example:[email protected]>64 A response will be required if the REQ or
REQI attribute evaluates to true
DFT Attribute – What does DFT do?
Intended: Automatically default a response into the current query from a standard or customer defined field
DFT Attribute – How does it work?
It works before the user gets to respond to the query
It only works if there isn’t a response to the query
The response can be edited by the user
DFT Attribute –Several types of responses
System fields [email protected]
Text DFT=“Y”
Response from previous query DFT=[ANS,”query mnemonic”]|0
DFT Attribute – issues
The DFT is often difficult to use in practice. If there is an IFE attribute on the query, the cursor may not stop at the query and consequently the DFT attribute is not executed and the value is not defaulted into the query.
Resolution: Use the IFE attribute to default the value. We’ll discuss that a bit later.
DFT- Examples of Data already in the system
[email protected] [email protected] [email protected]
[email protected]_" - "[email protected]
[email protected][@p.ADM.PAT.attend.doctor]
[email protected][“OE.RESUC”]
DFT - Default Text into the Response
DFT="1. Impaired mobility requiring use of walker/crutches”
DFT="Y”
DFT=“No overt oral-pharyngeal dysphagia symptoms observed.”
DFT- Default response from a prev query
DFT=[ANS,"query mnemonic"]|0
DFT – Summary
The benefit of the DFT format is that it is short and easy to set up. It works well unless you want to prohibit the user from editing the response.
If you want to prohibit the user from editing the response, you will need to use an IFE statement instead (described later).
FCL1/FCL1A attribute – What does it do?
Intended: To check the user’s response and restrict them from responding with inappropriate values.
Optional: Can check the response and display a message to the user (and still allow that response). Can also perform functions after the user responds such as send a MOX message.
FCL (Field Check Line) Attributes
When the user exits the field Only if the user edited the response To inform the user that an invalid response
was entered. To inform the user of consequences of the
response they entered. Reject a user response
FCLn and FCLnA - Description
FCLn and FCLnA work in conjunction with one another.
Allow you to do error checking on a user’s response to a query.
If the expression to the right of FCLn is true, the code in FCLnA will be executed.
If the FCLnA attribute is executed, the input will be rejected. It is not required to have a FCLnA for each FCL.
In the attribute name, n = an integer
FCLn and FCLnA – Evaluates at
FCL attributes are evaluated in sequential order based on the integer as a user leaves the field, after the REQI attribute
Example – Notify user that the response is invalid:
[email protected]=”.”[email protected](“Please do not use a .<return>”)
The FCL1 evaluates the user’s response and if equal to a
“.”, will execute the FCL1A, which will display an error message to the user and reject the response.
FCL- Share Information
You may want to communicate information to the user based on the response to the query. For example:
FCL1=IF{@.response="Y" @W.errFCL1=("THIS FAX WILL PRINT IN MEDICAL RECORDS")}
Note how the FCL code breaks on the first line and continues on the second line.
FCL - Ask the user if they are sure
FCL1=IF{@.response>100 @W.yes.no.y("Are you
FCL1= sure?")}
Note: the "y" at the end of the @W.yes.no.y defaults a "Y" into the query "Are you sure?". You can use @W.yes.no.n to default a "N".
Let’s DO something with FCL
The FCL can be used to actually DO something as well. For instance, the following attribute will take the user to the Nurses’ Notes section for this patient if the user answers the query with a “Y”.
FCL1=IF{@.response="Y“ %NUR.NOTE.note.ee("")X,@Cursor.on("")^#}
Note there is a <space> between the “Y” and %.
More good stuff with FCL
You can also use the FCL to change the response to another query.
FCL1=IF{(@.response="N") ""^/[ANS%0,"NA12.25.20"]|0}
FCL2=IF{(@.response="N") P(4,30,” “:50)^#} Note: “ “:50 will paint 50 blank spaces on
the screen
Attributes – System Fields
Response to current query @.responseOld Response to current query
@.response.oldCurrent User Mnemonic @.userCurrent Date @.todayCurrent Time @.nowFacility @.facilityCurrent Database @.dbCurrent Directory @.dirCurrent MIS Mnemonic @.mis
Permanent vs Temporary fields
When creating attributes, @t. or @p. is often used in front of a field name to refer to either the temporary file (@t.) or the permanent file (@p.).
Permanent fields
Field has previously been filed into the Meditech database.
Example - If you are in NUR and refer to an ADM field:[email protected]’=”M”
“@p.” signifies permanent field
Temporary fields
Entered on the screen the user is currently processing and has not yet been filed into the Meditech database.
These types of fields should be referenced using “@t.” and then the field name.
Example: Attribute on the OE Order screen to refer to the
Category that the user entered while placing the order:
[email protected]=”LAB”
Multiple Type Queries
The query is designated as a Multiple in Query Dictionary
At least 2 lines of responses are visible on CDS
User may enter an UNLIMITED number of responses
Multiple query values are stored differently than standard queries
Multiple Type Queries
Multiple Responses are stored by QUEUE
To refer to temporary query responses on the current screen:[ANS,”QUERY”,”M”,1]|0[ANS,”QUERY”,”M”,2]|0
Multiple Type Queries (ctd)
To refer to a clinical customer defined query:@p.ADM.PAT.ccdqr.mult.response[“QUERY”,1
]@p.ADM.PAT.ccdqr.mult.response[“QUERY”,2
]
To refer to a multiple type ADM [email protected][“QUERY”,1]@p.ADM.PAT.cdm.response[“QUERY”,2]
Basic Attribute Syntax
Name of the attribute must appear on each line
Break the attribute at any point except a space when going to next line
Use up to 255 characters Use proper MAGIC syntax
Example - Where to break an attribute
IFE=IF{@ADM.PAT.urn^/R.FRAG.ARG.URNIFE= %Z.rw.fragment(“PHA.PAT.zcus.iat.frag.R,”PHA.TEST”),P(R,S,(IFE=/R.FRAG.VAL[“ALL”]^/[ANS%0,”QUERY”]|0))^#,1}
Local Variables
Used for the temporary storage of information during the processing of the current screen
Most important local variable is ANS
ANS (short for answer) is the location where Meditech stores query responses prior to filing
Example: [ANS,”EVERPREG”]|0Represents the user’s response to the query called
EVERPREG
Local Variables – Naming Conventions
Use Capital-Alpha-Numeric characters XXX, A12, NAME, and NAME1 are all valid
Use at least 3 characters Use variable names that are meaningful Keep variable names relatively short and
descriptive
Local Variables – what NOT to use
Meditech uses its own local variables while the screen is functioning. You should take care not to overwrite the following local variables in your code: X XX XXX ANS R S A B C
Can you think of others?
The Assignment Operator ()
Shift-6 on your keyboard Used to:
1. Assign a value to a variable 2. Display a value on the screen 3. Erase a value
Example: IFE=IF{[ANS,”EVERPREG”]|0=“Y”
“N/A”^PREG}We read this as “N/A goes to Local Variable
PREG.”
Relational Operators
Relational Operators are used to compare values to determine a true/false relationship
Magic Relational Operators
Operator Explanation Example
= [email protected]=“ICU”
‘= Not equals @p.ADM.PAT.insurance’=”MCR”
> Greater than @p.length.of.stay>3
< Less than @t.age<18
‘< Not Less than(Greater than or equal to)
@.now'<0700
‘> Not Greater Than(Less than or equal to)
@t.age’>18
Relational Operators – Nil vs. Non-nil
Each operation will maintain a value
If the evaluation is true, the value on the LEFT side becomes the value of the operation
If the evaluation is false, nil becomes the value of the operation
Nil = Nothing = False
Non-nil = Something = True
Relational Operators - Examples
Operation Evaluation Value
5>2 True 5
3’>1 False “”
STATUS=“ADM IN” ? ?
“”=“” Initially – TrueUltimately - False
“”When creating operations, you should always be careful to not set something = to nil. Even if the value is nil, the final value of the operation will become nil and will ultimately be evaluated as false.
IF/THEN/ELSE
Used to determine appropriate responses based on conditions
Example:
• IF a response to a query is “Y”, then display a large pop-up screen.
• IF the response to a query is too high, then reject the answer.
• IF patient LAB RESULTS exist, then display results and skip the query, ELSE just skip the query.
Note: Various attributes have inherent IF/THEN properties. In fact, when translated, they are built into an IF/THEN statement.
IF/THEN (cont)
IF/THEN:
ATT=IF{condition response}
Example:
FCL1=IF{@.response=”Y” @W.return(“Notification sent to Dietary.”)}
Note: There is a space between the condition and response. The space represents the "then" portion of the IF/THEN statement.
With the simple IF/THEN, if the condition is true, the response is performed. If the condition is false, the response will be ignored.
IF/THEN/ELSE
IF/THEN/ELSE
IFE=IF{condition response1;response2}
Example: IFE=IF{@t.ADM.PAT.age<18 1;””}
The cursor will stop only if patient is under 18 years of age.
Note: The semi-colon represents the separation between the first condition/response pair. The semi-colon is the "else" portion of the IF/THEN/ELSE statement.
Display Macros – Easy!
Single line messages are the easiest Use “W macros”
@W.return - display a message in a yellow box and wait for user to press <enter>
Example:FCL1=([ANS,”NUR25.1”]|0>25)&(@.response=”Y”)
[email protected](“Please verify response!”)
Display Macros - @W.err
Displays error message to user Ring bell Wait for user to press <enter>
Example:[email protected]>[email protected](“Invalid value for Pulse. Please confirm.”)
*Note the use of the FCL1A This rejects the user response
Positioning the Cursor
Allows you to position the cursor at any location on the screen Syntax:
P(R,S,”VALUE”)^#
The arguments of this command are:R = RowS = Column“VALUE”= the text or value that you wish to display
Comments: Local variables R and S represent the current row/column Do not need to use R,S. You may use actual field location if
you choose The C argument can be a text string, a field or a query value
The # Prefix
The pound (#) Prefix is open to the MT Screen
This syntax is used for displaying a value on the screen and is read “goes to screen”.
Example: P(R,S,”N/A”)^# This code will display the text “N/A” on the
screen at row R and column S.
Default using IFE attribute
Used if there are IFE attributes on a query 3 things we must do
1. Calculate the value to display 2. Store the value into the temp file so Meditech will
file it 3. Use the position command to display the value in
the proper spot on the screen
Example: DFT using IFE attribute
Example:IFE=IF{[ANS,”EVERPREG”]|0=”N” “N/A”^/[ANS%0,”LAST_PREG”]|0,IFE=P(R,S,”N/A”)^#,””;1}
Comments:1. [ANS,”EVERPREG”]|0 refers to the user’s response to the EVERPREG
query on the screen. If the response equals “N”, then we will proceed with the default process.
2. “N/A”^/[ANS%0,”PREGDATE”]|0 is how we store “N/A” in the temporary
structure so it will be filed into the database.
3. P(R,S,”N/A”)^# does the positioning and displays value on screen. 4. The end value of the IFE attribute is nil. Cursor will SKIP this field if the
condition is true and the value defaults. If condition is not true, end in a 1 and allow cursor to stop.
Calling Macros
You may call an NPR report macro from a Customer Defined Attribute
Allows you to:1. Create a large display window2. Perform totaling or other calculations 3. Call a fragment report to obtain a result from a patient’s
lab tests.
Syntax – Calling Macros
Syntax:IFE=%MIS.USER.zcus.iat.att.M.total(ANS,R,S)
Comments: ANS, R and S are called arguments – values that are passed
into the program to be used by the program ANS – structure where the query responses are stored R - current row S – current column
Note: When you call a macro from an attribute, the final value of the program is returned to the attribute. Typically, users set the value returned to be nil, so that the screen may continue functioning as it was prior to the program call.
Displaying a multi-line window
Example:FCL1=IF{@.response=”Y” %MIS.USER.zcus.iat.att.M.win(0)}
Macro code:@Window.centered(11,60,8)^#,
"Warning!!":60C^#,
N(D(4,0))^#,
N("This test has been known to cause complications")^#,
N("with pregnant women.")^#,
NN("Please confirm the following:")^#,
N(" 1. Physician has documented knowledge of pregnancy.")^#,
N(" 2. Patient has been educated about possible risks.")^#,
N(" 3. Patient has signed release form.")^#,
NN("Press <Enter> to Continue.")^#,
#0,
@Window.close("")^#;
Multi–line window comments
Comments: This macro uses @Window commands to open and
close the display window Each “^#” is used to send something to the
screen The syntax “N(“ is used to create a new line “#0” causes the cursor to wait for user input The code used above may be copied into a macro
and easily modified for other uses
Send MOX Message
MOX Messaging from attributes may be done two ways
1. Use a message built in the OA Message Dictionary Recipients are taken from the message dictionary Permanent data only May end up with blank fields
2. Build your own message in an NPR Macro and send from the macro
Print information from the temporary file
Message in OA Message Dictionary
Simplest method - just build the message and send
The single argument to the MIS.OA.MSG.auto program is the mnemonic of the message you are sending
Example:FCL1=IF{@.response=”Y” %MIS.OA.MSG.auto(“OECONSULT”)}
Build your own message in an NPR Macro
Build the message and the recipient list yourself
Allows more detailed patient/order information
See www.iatric.com for macro code examples.
Using NPR Fragments with Attributes
Retrieve data from other applications while working in ADM, OE, NUR
No restriction to “open” modules Requires Knowledge of NPR Report
Writer Return values in /R.FRAG.VAL
Fragments: Pull results from LAB
Using Fragments - Example
IFE=IF{@ADM.PAT.urn^/R.FRAG.ARG.PT
IFE= %Z.rw.fragment("LAB.L.SPEC.zcus.iat.frag.R","LAB.HHS"),
IFE=P(R,S,(/R.FRAG.VAL["RES"]^/[ANS%0,"IAT.LAB"]|0))^#,"";""}
Comments: Assign the ADM.PAT.urn to /R.FRAG.ARG.PT – required by
report Call the fragment report with the LAB database Position the cursor and default the value End value is “” – user will not stop at query – NO EDITS! You may pass back several values from the fragment to the
screen. Ie: Result, Collection Date/Time
Frag report page 1 – Use index file
Frag report page 2 – note Selection
Frag report - Macro call in Footnote
Frag report – Macro detail
Quotations in Query Response?
Quotations can be problematic in query responses for interfaces, scripts, etc.
You can prevent users from including quotes
Example:FCL1=L(@.response,D(34))<L(@.response)[email protected](“Please remove the quotes from response!")FCL2=L(@.response,D(39))<L(@.response)[email protected]("Please remove the quotes from response!")
Note: Use the Locate/Length functions D(34) equals“ and D(39) equals ‘
Calling Meditech programs in attributes
Attribute to calculate BSA
IFE=%Z.square.root(KG*CM*1000/3600)^BSA,
IFE=P(R,S,BSA^/[ANS%0,"OE.COMMENT"]|0)^#
Note the call to %Z.square.root
Calling Meditech programs in attributes
Format a date
IFE=IF{%Z.date.out(@.today)^/[ANS%0,”OE.PROC.DT”]|0^/DATE
IFE= P(R,S,/DATE)^#,””}
Call %Z.date.out with @.today as argument Assign value to the temp file Display on screen End in “” so user may not edit
Calling other Meditech Routines
You may use attributes to call other Meditech programs from your CDS
FCL1=IF{"NUR.NOTE.menu"^PR,1^/ARG1,
[email protected]="Y" %MIS.USER.zcus.lib.M.call.rtn(PR,/ARG1)X},1
Pass program to call into PR Pass 1 into /ARG1 Call program using macro
Pop-Up Screens
Meditech provides a new program to do this in 5.4+ Z.zcus.cds – You can request this from your
NUR consultant This solution is STRICTLY FOR NUR
For other Applications, you can use a custom version of this program. There are various working versions available on the Web.
For more information…..
Our I-Online Learning courses are a great way to present this
material to your entire staff simultaneously – for a fraction of
the cost of On-site training.
See our website for our Fall/Winter Course Schedule!
Iatric Systemswww.iatric.com978 805 4100