Welcome to The MAP

(Meditech Attribute Page)
Debbie Bate-Travis

Welcome to my collection of  Meditech attributes. A note of thanks to all who have
 contributed their attributes to the Meditech-l list. 

I have recently taken out some of the complex attributes as they contained attributes
that no longer worked in 4.9 and 5.4.

·   Order Entry Rules
·  Tips for Building Attributes

·  Additional links for avid attribute collectors


new=New or modified attributes since March 2005

 

Attributes based on query reponses or criteria (OE/NUR)

1a. Answering a question based on specifying age criteria

1b. Answering a question based on a query response and ADM criteria

1c. Answering a question based on the response to a previous question eg Yes/No

1d .Answering a question based on the response to a previous question AND 
      making the question required.

1f.ball  Answering a question based on no response to a previous question

1m.  Not answering a question based on a yes or no response

1g. Getting  the user to enter "valid" data in a free text attribute (as opposed to the
      dreaded  dot)

1n . Entering Valid Answer With a Warning Message

1h.  Having the cursor stop depending on select responses from a multiple choice lookup.

1k.  Double condition attributes

 1l   How to adapt attributes for multiple queries

1o.  Answering a question if the admission date is between certain months

1p. ballRestricting query to only select users

 

Pulling in Fields or Responses

2a. Pulling in primary diagnosis

2b Pulling in a  standard field from ADM to OE using the default attribute

2d. Defaulting the answer from one query into another in the same screen 

2f. Defaulting in a predetermined response based on the response to a previous query.

2g. View only attribute

 2h View only queries

 
Order Entry Screen Attributes

3a. Defaulting in physicians phone number into the consult procedure

3b. Defaulting  Campus

3d.  Pulling in the mothers name into an infants order entry procedure screen.

3e. Attribute to show the age based on the birthdate entered in another customer defined query

3f. Attribute for a procedure CDS on an OE order screen that  defaults the "order dr".

3g Defaulting in the clinical information at the procedure level  (from info entered in another  procedure in the same category)

3h Order  Entry Attributes for Physician Consult Screen

3i. Defaulting current time into an order screen 

 

Displaying Messages Based on Responses

4a. Displaying a Message Based on a entered response

4b. Displaying a message for a range of responses

4c. Generating an error message if no response is entered

4d. Generating a warning message rather than an error message 


4j. newHow to write a lengthy pop up message

4e. Combining default responses and a line check .

4f. Error message when doctor is selected who is not on staff .

4g  Attribute to prevent user from pressing enter to continue (creates an error message)

4h. Generating an error message based on ADM criteria

4i . Having a  warning appear if either a too low temp or a too high temp is entered in a temp query


 

Attributes for use in  the NUR Module

General NUR Attributes

5a. Default responses from Admin Data screen into an Assessment

5b. Question can only be answered by certain nurse types

5e. Attribute that returns a numeric score based on an entered value.

5f . Skipping Queries based on patients age 

5g  Preventing Users From Entering a Future Date for a query

5j. Disabling recall 

5k. Length of stay attribute

Pop Up Screens:

a). Link to Double T

b) Tips from Daniel Davis

5m. Switching to other routines (e.g to Patient Notes,OE)

5o. Defaulting Physician Information (eg phone number) in NUR

5p.Defaulting user mnemonic on the screen

 

Convertion Attributes

6a. Converting a temperature from Farenheit to Celsius 

6c Converting pounds and ounces to kg

6e.Converting  Feet and Inches to Centimeters

6g  Converting age to days

6h, Calculating BMI

6l  Age related attributes

 

 

7a. Calculation attributes

 

 

Miscellaneous Complex Attributes

8a  Calling  a macro  from a CDS query 

8b   Sending an Email from a Customer Defined Screen (link to Double T)

8c  Warning Attributes for Vital Signs Queries

Working with Multiples

 9a. Defaulting responses into multiples (link to double T web site)

9b  #How to adapt attributes for multiple queries

 

 

*1a . Specifying age criteria *
The cursor will only stop at this question if the patients age is greater than 64 and less than 80 
Attribute: IFE=(@p.ADM.PAT.age>"64")&(@p.ADM.PAT.age<"80") 

Single age criteria: IFE=IF{@p.ADM.PAT.age>65 1;""}

*1b .Specifying criteria based on a query response and ADM criteria
Answer this question if the answer to NURBLOOD is Y and the patient is female 
Attribute:IFE=([ANS,"NURBLOOD1"]|0="Y")&(@p.ADM.PAT.sex="F") 

1c. Answering a question based on the response to a previous question (eg yes/no)
If the answer to question NURAD was yes then have the cursor stop at this query 
Attribute:IFE=([ANS,"NURAD"]|0="Y")

1d. Answer required only if the response to the previous question is yes
Attribute: IFE=IF{[ANS,"OEO2"]|0="Y"}
REQ=[ANS,"OEO2"]|0="Y" 

1f. Cursor stops at query based on no response to a previous query
 
IFE=IF{[ANS,"ND.MOSAT2"]|0 "";1}

1g. This is an  attribute for the many times staff input a period
to skip the field. The question asked was how do get the user to enter 
"valid" data in a free text attribute. 
FCL1=(@.response#0^RES<"A")!(RES>"Z") 
FCL1A=@W.err("For Clinical Purposes, please enter a meaningful response 
FCL1A=this field") 

1n. Attribute to Ensure a Valid Response with message  (targeted for the NUR module)

Substitute your query mnemonic for QUERY.MNEMONIC

 REQI=IF{/S.LAST.QUERY'="QUERY.MNEMONIC" "";
REQI='/S.A @W.err("Enter the most recent order date, or the date,
REQI= or the date initiated if protocol in effect");""}
 

1h.Having the cursor stop depending on select responses from a multiple choice lookup 

IFE=([ANS,"NURADMA222"]|0="L")!([ANS,"NURADMA222"]|0="R")! 
IFE=([ANS,"NURADMA222"]|0="S2")!([ANS,"NURADMA222"]|0="S3"! 
IFE=([ANS,"NURADMA222"]|0="S4") 

1m. Not answering a query based on a yes or no response to a previous query 
IFE=IF{[ANS,"ADM.LATEX"]|0 "";1}

Not answering a query based on other than a yes/no response (eg are other answer options)
IFE=IF{([ANS,"ADM.LATEX"]|0="Y")!([ANS,"ADM.LATEX"]|0="N") "";1}
 

1k . Dual condition attributes 
IFE=([ANS,"CD1"]|0'="Y")&([ANS,"CD2"]|0'="Y") 

The key is the parenthesis.  The expression in each set of parenthesis will 
be evaluated first, then Added (&) with each other. 
Note that each query is named. 
John jcurtiss@hahc-hmc.com 

OR 
IFE=ANS["ADM1"]|0="Y"&(ANS["ADM2"]|0="Y")    

 1o Answering a question if the admission date is between certain months
frank.cyr@HCAHealthcare.com <frank.cyr@HCAHealthcare.com>

(remove the REQI lines if you do not want the query conditionally
required). 

IFE=IF{(@p.ADM.PAT.admit.date%3)$2="01" 1;
IFE=(@p.ADM.PAT.admit.date%3)$1="1" 1;""}
REQI=IF{(@p.ADM.PAT.admit.date%3)$2="01" 1;
REQI=(@p.ADM.PAT.admit.date%3)$1="1" 1;""}

OR
Joe Cocuzzo <JoeC@iatricsys.com>
To exclude April thru August:

IFE=IF{@.today%3$2+0>3<9 "";1}

OR
Brian Golden <bgolden@sehosp.org>
This one looks for the admission month of October thru January.
IFE=IF{@p.ADM.PAT.admit.date%3$2^MO="01"!(MO>"09") 1;""}
 

                        1p. Restricting query to being answered only select users
                        IFE=(@.user="USER1")!(@.user="USER2")

                      This atribute will only allow USER1 and USER2 to access the query.

,                       Source Brian Schmit -March 2005








 

2a.Pulling in a field from ADM. Pulling in the "reason for visit" field into the primary diagnosis query (OEMDIAG1)
Contact: Pam Nelson ,Sudbury General Hospital 
Attribute: To pull in diagnosis and NOT allow the diagnosis response to be edited 
IFE=IF{@p.ADM.PAT.reason.for.visit^N N^@t.OE.PAT.response IFE=["OEMDIAG1"],P(R,S,N)^#,1}

To pull in diagnosis and TO allow the response to be edited (but the edit will be over written if the query is refiled) 
IFE=IF{@p.ADM.PAT.reason.for.visit^N N^@t.OE.PAT.response 
IFE=["OEMDIAG1"],P(R,S,N)^#},1 

To pull in diagnosis and  allow the response to be edited and the edit will NOT be over written if the query is refiled. (Contact Joel Bergman) 
IFE=IF{@t.OE.PAT.response["OEDIAG1"];
IFE=P(R,S,@p.ADM.PAT.reason.for.visit^/[ANS,"OEMDIAG1"]|0)^#},1 

To pull in diagnosis and  allow the response to be edited and the edit will NOT be over written (and no query flickers when the attribute is read). 
(Contact Karen McDonald) Karen MacDonald <kmacdono@healthtech.on.ca> 
IFE=P(R,S)^#, 
IFE=IF{/[ANS%0,"OEMDIAG1"]|0;@p.ADM.PAT.reason.for.visit^/[ANS%0, IFE="OEMDIAG1"]|0}^#,"" 

Or (last but not least) DFT=@p.ADM.PAT.reason.for.visit 

Source: Meditech 
 

2b. Pulling in a field from ADM using DFT
To find the field name in admissions press shift F8 and the F9
Attribute: 
e.g person to notify
DFT=@p.ADM.PAT.notify.name
e.g Registration date:
DFT=@p.ADM.PAT.service.date

2cDefaulting the answer from one query into another query on the same screen.
Source: Meditech
   DFT=[ANS,"OE.D.TEX"]|0

2d . Defaulting an  answer into a query 
Simple default DFT="Y" 

jcurtiss@hahc-hmc.com 
Conditional default (2 methods) 
DFT=(IF{[ANS,"QUERY1"]|0="Y" "Y"}) 
This defaults "Y" is QUERY1="Y" 

DFT="Y" 
IFE=[ANS,"QUERY1"]|0="Y" 
This defaults "Y".  If QUERY1 is not "Y", QUERY2 is skipped. 
 

2e. Making a Field View Only 
 IFE="" 

 The IFE="" will make the field VIEW ONLY for that particular screen. 

 Frank J. Fortner  Email: FrankF@iatricsys.com 

2h . The View type query in Meditech
Although the view type query is not an attribute it can be of value, especially in OE when you want to default admissions information on to a screen. Once a query is set up as a view query the information will  default for all instances of that query (no attributes required) , displays instantly and as the name indicates is view only. The view query will also print on any outputs. View queries DO NOT pass across to radiology and lab. This can be a good or bad feature depending on how the information is to be used.

 

3a.Attribute to default in doctors phone number into the OE consult procedure

Note:double check the exact field names in the doctor/provider dictionary as depending on the version, the field is named differently . 

IFE=IF{@p.MIS.DOC.DICT.phone[@t.OE.INP.response 
IFE=["OECONS"]]^DOC^@t.OE.INP.response["OEDRPHONE"],P(R,S,DOC:15TL)^#,1;""} 

3b Attribute to default in the campus name into an order entry procedure

Note this attribute only works if you use different/distinct naming conventions for each 
site. In the example below each location in a campus begins with a set letter (eg all the locations at the Church site begin with "C" ,at the Finch site "F") 
Contact: dbatetravis@home.com

IFE=IF{@p.ADM.PAT.location^LOC,LOC#0="C" "CHURCH";LOC#0="F""FINCH";LOC#0= 
IFE="K" "KEELE"}^CAMP^@t.OE.INP.response["OECAMPUS"],P(R,S,CAMP)^#,1 

Defaulting Campus in and the cursor will not stop at the query. 
IFE=IF{""^CAMP,@p.ADM.PAT.location^LOC,IF{LOC#0="C" "CHURCH"^CAMP;LOC#0=
IFE="F" "FINCH"^CAMP;LOC#0="K" "KEELE"^CAMP},
IFE=IF{CAMP P(R,S,(CAMP^/[ANS%0,"OECAMPUS"]|0))^#,"";1}}
 

3d. 
Pulling in the mothers name into an infants order entry procedure screen.
IFE=IF{@p.ADM.PAT.mothers.first.name^N N^@t.OE.INP.response["OEBBMOM"], 
IFE=P(R,S,N)^#},1 

Hi, Deb! 
I lifted one of your attributes, to default the mom's name in on newborn lab orders.  The OB staff loved it, and for awhile, life was good.  Then it came to lab's attention that the mother's name wasn't just defaulting on newborns - ANY person, if they had been born here, was having their mother pop in.  The system didn't care if they were adopted or not.  It is the first time since we went live with Meditech that I have seen an attribute work too well.  I  finally got a  successful modification that works. 

 IFE=IF{(@p.ADM.PAT.service="NEW")&(@p.ADM.PAT.mothers.first.name^N) N^ 
IFE=@t.OE.INP.response["OEMOM"],P(R,S,N)^#},1

3e .CDS to show the age based on the birthdate entered in 
another customer defined query.  The attribute line that our MIS 
consultant gave me to use in our query called PPSPAGE is: 

DFT=%Z.age([ANS,"PPSPDOB"]|0) 

where PPSPDOB is the CDQ where they are are entering the DOB. 
 

*3f. Attribute for a procedure CDS on an OE order screen that  defaults the "order dr"
This is what works in magic 
DFT=@p.OE.INP.doctor 

*3g Defaulting in the clinical information at the procedure level  (from info entered in another  procedure in the same category)

DFT=/Z.DFT[@OE.PAT.patient,@t.OE.INP.category,"OE.RAD"]
FCL1=IF{@.response^/Z.DFT[@OE.PAT.patient,@t.OE.INP.category,"OE.RAD"] 1;1} 

3h Order  Entry Attributes for Physician Consult Screen

The first 2  attributes pull information from questions in the  MIS provider dictionary.
MIS.VAC     1   1   Dr away:
DFT=@p.MIS.DOC.DICT.cd.response[@t.OE.INP.response["OEMDCON"],"MIS.VAC"

  MIS.VACC    2   1   Covering:
DFT=@p.MIS.DOC.DICT.cd.response[@t.OE.INP.response["OEMDCON"],"MIS.VACC"

Pulls in the physician phone number
  OE.MDCON1   4   1   Physicians phone number:
IFE=IF{@p.MIS.DOC.DICT.dft.phone[@t.OE.INP.response

 OE.CONDR    4   43  Physician notified >
IFE=["OEMDCON"]]^DOC^@t.OE.INP.response["OE.MDCON1"],P(R,S,DOC:15TL)^#,1;""}

Pulls in physicians service dependent on the answer to the consult physician query (OEMDCON)

 OE.MDCON2   5   1   Physicians service:
 IFE=IF{@p.MIS.DOC.DICT.dft.service[@t.OE.INP.response
IFE=["OEMDCON"]]^DOC^@t.OE.INP.response["OE.MDCON2"],P(R,S,DOC:15TL)^#,1;""}
 

3i. Defaulting current time into order screen query
DFT=@.now
 IFE=IF{P(R,S,@.now^/[ANS%0,"GOEWRTIME"]|0)^#,""}

It defaults the current time, and sends it to the "current query" to the
screen and doesn't allow edits (skips over the defaulted time)  

 


4a.Displaying a Message based on a entered response. If the answer to this question is yes, then display a message:
FCL1=IF{@.response="Y" @W.err("IF YES, ACTIVATE PROBLEM: INJURY YET DONE");""} 

Or 
FCL1=(@.response="Y") 
FCL1A=@W.err("Patient Has Pacemaker, Cannot Order MRI") 
 

4b. Error messages for a range of responses. 

FCL1=(@.response<1) 
FCL1A=@W.err("Pupil size range is from 1mm to 8mm")
FCL2=(@.response>8) 
FCL2A=@W.err("Pupil size range is from 1mm to 8mm")

4c. Generating an error message if no response is entered.

PRE1=@Not(@.response) 
PRE1A=@W.err("This field must be completed!"). 
REQ=Y 

     PRE1=@Not(@.response) PRE1A=@W.err("This field   must be completed!"). 
   If the field is left blank, the FCL conditions are 
    never checked. PRE just gives the message but doesn't require them to fill 
    in the field. REQI=Y will require them to fill in the field before going 
    to the next field. REQ=Y will require them to fill in the field before 
    filing. 
 

4d.  Attribute gives a warning message but allows the user to press return to continue. 

 FCL1=IF{@.response="Y" @W.err("IF YES, ACTIVATE PROBLEM: INJURY-FALLS IF NOT
FCL1=YET DONE");""}
or 
IFE=IF{RESP="Y"@W.return("the message"),1;1} 
FCL1=IF{@.response="Y"@W.return("the message"),""} 

 4e.Combining default responses and a line check . 
DFT="N" 
FCL1=IF{@.response="Y" @W.err("Patient needs a wristband!!")} 


                           
                            4. J How to write a lengthy pop up message

                             FCL1=IF{@.response="NA" .^/.WO,
                             FCL1="No rings or jewelry can be taped or left"^/.WO[1],
                             FCL1="Rings or jewelry must be removed!"^/.WO[2],
                             FCL1="This is a patient safety issue."^/.WO[3],
                             FCL1=%Z.wm.macro(0,1)}

Source : Brian Schmidt March 2005

4f . Error message when doctor is selected who is not on staff .

FCL1="N"'=@p.MIS.DOC.DICT.dft.on.staff[@.response]
FCL1A=@W.err("PHYSICIAN IS NOT ON STAFF AT THISTIME")

4g Attribute that does not allow the user to press enter and move on.  I use it
to require the use of look up and there for not allow the
use of recall.The only disadvantage is that it also does not allow the
user to type in the mnemonic and press enter!

FCL1=@Z.lastkey=13
FCL1A=@W.err("You must use the lookup to document this query")
 

4h. Attribute to use  to give the user a message if the pt is anything but a ADM IN or DIS IN. 

IFE=IF{@p.ADM.PAT.status.w.obsv^/OP,
IFE=IF{/OP’=”ADM IN”)!(/OP’=”DIS IN”) 1,
IFE=@W.err(“ Outpatient, Please enter charges. “)},””} 

4i Having a warning appear if either a too low temp or a too high temp is entered in a temp query

Gives the same message whether high or low.
FCL1=IF{(@.response^/TEMP>106)!(/TEMP<95) @W.err
FCL1=(" Temperature out of normal range (95-106 F) ")}

Gives the same yes/no message whether high or low and requires a comment if
response is out of range.
FCL1=IF{""^/RT,(@.response^/TEMP>106)!(/TEMP<95) IF{@W.yes.no
FCL1=(" Temperature out of normal range (95-106 F), comment required - OK:
")
FCL1=^/RT="Y" "";1}}
FCL1A=1
Place this attribute on the comment line for vital signs
REQI=/RT="Y"

Gives the different yes/no message for high and low.
FCL1=IF{(@.response>106) IF
FCL1={@W.yes.no(" Abnormally High Temp, are you sure: ")="Y" "";1}}
FCL1A=1
FCL2=IF{(@.response<95) IF
FCL2={@W.yes.no(" Abnormally Low Temp, are you sure: ")="Y" "";1}}
FCL2A=1

 

 
Misc NUR Attributes

5A. 
Defaulting responses from the Admin data screen into an Assessment
DFT=@p.ADM.PAT.ccdqr.response["NURADMA067"]

Warning message:
FCL1=IF{@.response="Y" @W.err("Do MRSA swabs if client has been hospitalized
FCL1=within last 12 months");""}

5b To allow only certain Nurse Types access to a query, you can add the 
following attribute to the query: 

IFE=&NN[@.user]|1="RN" 

This will only allow RN Nurse Types to document that query. 
IFE=(&NN[@.user]|1="RN")!(&NN[@.user]|1="NM") 

This will allow the Nurse Types of RN or NM to document the query. 
Restricting Queries by Nurse Type 

 

5f Skipping Queries Based on Patient Age

This is useful especially on Pediatric Developmental Assessments to skip over sections that are not applicable.  For patients over the age of 3 years, the system records the age in only years.  For patients under the age of 3, the system records age in years and months.  Under the age of 1 year, the age is recorded in months and days.  In order to accommodate for patients under the age of 3, we must use a special attribute.  A caveat to this attribute is that it uses 30 days = 1 Month.  This rounding could cause a patient to fall into a higher age bracket in certain months.  The difference is only 1 or 2 days and should not pose any big problems, but you are urged to clarify this with the Pediatric staff.

IFE=IF{%Z.date.sub(@.today,@p.ADM.PAT.birthdate)^/AGE,
IFE=/AGE'<90&(/AGE'>180)}

OR
This example is for 3-6 months (based on 30 days/month).  This attribute uses a Z program to calculate the number of days between today’s date and the patient’s birthdate.  To use this attribute for other age ranges, just multiply the number of months by 30 and fill in.
IFE=%Z.age.in.years(@p.ADM.PAT.computed.birthdate,@.today)<1

Stop here if patient is less than 1 year.  We use this on our head and
abdominal circumferences on the admit assessment.  If you want to refer to
admit age, you could use a simpler variation.

IFE=@p.ADM.PAT.age>7
Of course, this will stop if the patient if over 7 years.
 

5g Preventing Users from Entering a Future Date for a Date Query
You can attach this attribute to a Date Query to prevent the user from accidentally entering a date in the future:

FCL1=(%Z.date.in(@.response)>@.today)
FCL1A=@W.err("Cannot be in the future!!  Please re-enter.")

 

*5j Disabling the Recall Key 
Attribute:
IFE=gxx^CDS,"N"^/F5[/S.LAST.QUERY,/CDS],
IFE=%MIS.zcus.hr.ab.lib.M.disable.exit.and.recall(""),1

Macro:
"MIS.zcus.hr.ab.lib.M.disable.exit.and.recall"^/S.READ.PGM,
IF{@Z.lastkey=146 IF{/F11[/S.LAST.QUERY,/CDS] @MSG1,13^/Z;
                     %NUR.PC.WORK.recall.queries(A,B,C,D)};
   @Z.lastkey=145 IF{/F5[/S.LAST.QUERY,/CDS] @MSG2;
                     %NUR.PC.WORK.recall.queries(A,B,C,D)}};
MSG1
@W.err("ATTENTION: The 'Exit Key' cannot be used at this time.")

MSG2
@W.err("ATTENTION: The 'Recall Key' cannot be used at this time.")
 

5k.Pulling Length of Stay into a query
The following attribute can be used to pull in the Patient's Current Length of Stay on a query:

IFE=IF{(%Z.date.sub(IF{@p.ADM.PAT.discharge.date;@.today},
IFE=@p.ADM.PAT.admit.date)!1)^/[ANS%0,"NURCMPRLO2"]|0^ZLOS,
IFE=P(R,S,ZLOS)^#,""}

Replace NURCMPRLO2 with whatever Query mnemonic you are using for the LOS.

 

5m Switching  to other Routines
Attribute from Daniel Davis (meditech-l)

*Switch to Patient Notes without stopping at the Patient Notes Menu
FCL1=IF{@.response="Y" %NUR.NOTE.note.ee("")X,@Cursor.on("")^#}
Switch to Patient Notes stopping at the Patient Notes Menu

FCL1=IF{@.response="Y" %NUR.NOTE.menu("")X,@Cursor.on("")^#}
Switch to Plan of Care
IFE=IF{[ANS,"my-query"]|0="Y" 1,
IFE=IF{%Z.switch.appl("NUR")X (" ** OE Unavailable ** ")^/.WO,%Z.w.macro(1,1);
IFE=%NUR.PC.ee.S("")X,%Z.switch.appl("")},1}

Switch to Order Entry
IFE=IF{[ANS,"my-query"]|0="Y" 1,
IFE=IF{%Z.switch.appl("OE")X (" ** OE Unavailable ** ")^/.WO,%Z.w.macro(1,1);
IFE=%OE.INP.ee.care.area.S("")X,%Zswitch.appl("")},1}

Switch to Review Orders by Order Date
IFE=IF{[ANS,"my-query"]|0="Y" 1,
IFE=IF{%Z.switch.appl("OE")X (" ** OE Unavailable ** ")^/.WO,%Z.w.macro(1,1);
IFE=%OE.ORD.review.od.S("")X,%Z.switch.appl("")},1}
 
 

 

5oDefaulting physician phone and address in NUR
DFT=@p.MIS.DOC.DICT.name[@p.ADM.PAT.attend.doctor]
 
 

5pDefaulting user mnemonic on the screen 
The following attribute will default in a the User's Name into a query:

IFE=IF{P(R,S,IF{@p.MIS.USER.name[@.user]}^/[ANS%0,
IFE="NAME"]|0)^#,""}
 
 

 

 

Convertion Attributes

6a 
Converting a temperature from Farenheit to celsius 
Contact: Jim Zautner Riverview Hospital, Wisconsin jzautner@wctc.net,
IF{([ANS,"NURT"]|0^FR) =If there is an answer to the query "NURT", 
then store it in the temporary field "FR"> ((FR-32)*.55556):1D^CL =calculation that converts 
the temporary field "FR"> from fahrenheit to celsius and stores the result 
in temporary field "CL" CL^/[ANS%0,"NURTEMPC"]|0 = this sends the result stored in "CL" and places it in the query "NURTEMPC"> P(R,S,CL)^#,"" = prints the response to the query
"NURTEMPC" so it can be seen on the customer defined screen right away 
Contact: Jim Zautner Riverview Hospital, Wisconsin jzautner@wctc.net 

Attribute: 
IFE=IF{([ANS,"NURT"]|0^FR) ((FR-32)*.55556):1D^CL,CL^/[ANS%0,"NURTEMPC"]|0, 
IFE=P(R,S,CL)^#,""} 

 6b.  ATTRIBUTE TO CONVERT CELSIUS TO FARENHEIT 

6c  Converting pounds and ounces to kg (source doubleT)
Conversion Attributes 
Convert Lbs and Ozs to Kgs
Formula - LB*16+OZ/35.274
In the second method the cursor will stop at the query if both the Lbs and Ozs query are blank but skip it otherwise. IFE=P(R,S,IF{[ANS,"LB_QRY"]|0^LB!([ANS,"OZ_QRY"]|0^OZ)
IFE= LB*16+OZ:5D/35.274:2D}^/[ANS%0,"KG_QRY"]|0)^#

or

IFE=IF{[ANS,"LB_QRY"]|0^LB!([ANS,"OZ_QRY"]|0^OZ)
IFE= P(R,S,LB*16+OZ:5D/35.274:2D^/[ANS%0,"KG_QRY"]|0)^#,
IFE="";1} 
Convert Ft and In to Cm
Formula - FT*12+IN*2.54 IFE=P(R,S,IF{[ANS,"FT_QRY"]|0^FT!([ANS,"IN_QRY"]|0^IN)
IFE= FT*12+IN*2.54}^/[ANS%0,"CM_QRY"]|0)^# 
 

6e Converting Feet & Inches to Centimeters (source DoubleT)
IFE=P(R,S,IF{[ANS,"FT_QRY"]|0^FT!([ANS,"IN_QRY"]|0^IN)
IFE= FT*12+IN*2.54}^/[ANS%0,"CM_QRY"]|0)^#

6g .Converting age to days .Since children under 5 or whatever age it is are years
and months in meditech this is the attribute I use to convert the age
to days: 

IFE=IF{%Z.date.sub(@.today,@p.ADM.PAT.birthdate)^/AGE,
IFE=/AGE<360}  was as 360 is the days years old so for 3years old use 360 x
3 = 1080 days (I cannot remember why 360 for a year but that works and
nothing else does.)
 

6h  Calculating BMI 
ATTRIBUTES: Body Mass Index Calculation (BMI) for the OE Administrative Data Screen

The following attributes can be used in order to calculate the patient's Body Mass Index.  The BMI is calculated by taking the patients weight (in kgs) and dividing the weight by the patients height (in meters) squared. 

The following attribute will allow this attribute to work off of the standard height and weight fields in the OE Administrative Data Screen routine.

The attributes should be attached to the Body Mass Index (BMI) query:

IFE=IF{P(R,S)^#,IF{(@OE.PAT.ht.in.cm^/CM)&(@OE.PAT.wt.in.kg^/KG) (/CM+0.000^
IFE=/CM),/CM/100^/MT,(/MT*/MT^/MT),/KG:9D//MT^/BMI},/BMI:3D^#^/
IFE=[ANS%0,"BMI"]|0}

*NOTE:  Where "BMI" (on line 3 of the attribute) is the name of my BMI query.

  

6l. Age calculation attributes
INFANT (0-12)
IFE=%Z.age.in.years(@p.ADM.PAT.computed.birthdate,@.today)<1

TODDLER (13mo-2.5yrs)
IFE=%Z.date.sub(@.today,@p.ADM.PAT.computed.birthdate)/30>11<31

SCHOOL AGE (5yrs-11YRS)
IFE=%Z.age.in.years(@p.ADM.PAT.computed.birthdate,
@.today)>5
IFE=&(@p.ADM.PAT.computed.birthdate,@.today)<11

For each of these attributes, place the age appropriate
attribute on each query under the age section or heding.

So if the patient is 11 months old, the cursor will stop at the infant
growth and development section and will not stop at the other age
sections.

Additional age in years calculation attributes 

Just use the %Z.age.in.years utility as follows: 
IFE=%Z.age.in.years(@birthdate,@.today)<5 

Another method would be to calculate the days old: 
IFE=%Z.date.sub(@.today,@birthdate)<1825 
 
 

 

Calculation Attributes

7aAttribute:
IFE=IF{0^OS,IF{/.GUI 1^OS},
IFE=0^NP,IF{+/NPCWF[""] 1^NP} ""},
IFE=IF{ANS^/ANS,%MIS.zcus.library.M.n.as.braden(/ANS,OS,NP),1}
IFE=P(R,S,IF{[ANS,"N.BRAD030"]|0>14 "1";[ANS,"N.BRAD030"]|0<13 "3";"2"
IFE=0,"N.BRAD035A"]|0)^#,""

Attach this attribute to each query that you are planning to add
IFE=IF{ANS^/ANS,%MIS.zcus.library.M.n.as.braden(/ANS,OS,NP),1}

 MIS.zcus.library.M.n.as.braden 

Braden Macro (thanks to Brian Golden)

;SKIN ASSESSMENT-BRADEN SCALE

;

;DETERMINE POSITION

;B: 1=GUI, 0=3.1

;C: 1=VH,  0=DI

;

;                    ENTER

IF{(B=0)&(C=0) 9^/ROW,21^/COL},

;                    VIEW HISTORY - EDIT

IF{(B=0)&(C=1) 12^/ROW,21^/COL},

;                    GUI - ENTER

IF{(B=1)&(C=0) 8^/ROW,21^/COL},

;                    GUI - VIEW HISTORY - EDIT

IF{(B=1)&(C=1) 10^/ROW,21^/COL},

;

@TOTAL,

/ADD^/[/ANS%0,"N.BRAD030"]|0,

@CK.SCRN,

IF{/SC P((/ROW),(/COL),"  ")^#,

       P((/ROW),(/COL),/ADD)^#};

 

TOTAL

""^/ADD^CNT,

/[A%0,"N.BRAD005"]|0$1^/RSP1,

/[A%0,"N.BRAD010"]|0$1^/RSP2,

/[A%0,"N.BRAD015"]|0$1^/RSP3,

/[A%0,"N.BRAD020"]|0$1^/RSP4,

/[A%0,"N.BRAD025"]|0$1^/RSP5,

/[A%0,"N.BRAD027"]|0$1^/RSP6,

(0+/RSP1+/RSP2+/RSP3+/RSP4+/RSP5+/RSP6)^/ADD

 

CK.SCRN

""^/SC,

IF{/S.LAST.QUERY="N.BRAD005" 1^/SC},

IF{/S.LAST.QUERY="N.BRAD010" 1^/SC},

IF{/S.LAST.QUERY="N.BRAD015" 1^/SC},

IF{/S.LAST.QUERY="N.BRAD020" 1^/SC},

IF{/S.LAST.QUERY="N.BRAD025" 1^/SC},

IF{/S.LAST.QUERY="N.BRAD027" 1^/SC},

IF{/S.LAST.QUERY="N.BRAD030" 1^/SC}

 

 

   8. Calling a, macro from a query. 
The following logic works very well for us to display a message based on 
the response to a query. 
FCL1=IF{@.response="Y" %MIS.USER.zcus.sch.lib.M.diabetic("")X},"" 

Customer Defined Screen sends email 

I used the IFE statement.  This could just as easily be done with a FCL1 or 
from within a macro.  The macro would probably be best as the CDS length 
limit wouldn't apply. 

Here are two ways: 
%MIS.OA.MSG.auto(MESSAGE,Q("",USR,USR,USR)) is a way to generate an OA 
message from the MIS OA MESSAGE dictionary to specific user(s) where: 
     MESSAGE is the mnemonic of the message from the MIS OA MESSAGE dict 
              USR is/are user initials (you can have more than 1) 

%MIS.OA.MSG.auto("",Q(^/FILE.MSG,USR,USR)) is a way to generate an OA 
message that contains custom text for a specific user where: 
     FILE.MSG is the name of the slash file in which you have stored 
your message 
       USR is/are the user initials of the message recipient 
I have never tried these from a CDS, but they should work. I have used 
the second version. Thinking about it now, the first version would be 
the one to use from a CDS because you could have the patient data 
automatically plugged into the text. 

IFE=IF{0=0 "A"^A, 
IFE="==== INFECTION CONTROL ALERT ===="^/JC[1], 
IFE="PATIENT HISTORY OF TUBERCILOSIS WAS ANSWERED YES ON"^/JC[2], 
IFE="FORM.  PLEASE REVIEW THIS ASAP"^/JC[3], 
IFE=" "^/JC[4], 
IFE="PATIENT ID: "^/JC[5], 
IFE=%MIS.OA.MSG.auto("",Q(^/JC,"user.mnemonic1","user.mnemonic2")), 
IFE=1} 

   <>

         Notes

  • Attributes may work in more than one module (e.g. the attribute is under the OE list but may also work in NUR). As a general rule of thumb attributes do not work across modules when they need to include a temporary index (e.g./RESP for NUR)
  • Sometimes when you cut and paste from this page invisible codes/spacing are included. If an attribute doesn't initially work try copy typing it in instead.
  • Please let me know if an attribute does not work! I can edit or remove the attribute to save someone else frustration

 

 Additional Attribute Links 

<>                      

                                                  emailContact me                         Sign Guestbook View Guestbook

                                                                                                   

                      

                       Counter

 

                         by Debbie Bate-Travis -May 28/98  Last update: March 2005