[MT-L] Defaulting a Value into a Multiple query Magic.

35 views
Skip to first unread message

Goode, Derrick

unread,
Mar 16, 2016, 1:54:29 PM3/16/16
to medit...@mtusers.com

Magic sites

Has anyone been able to actually default a value into a multiple Query ?

DFT=IF{@p.ADM.PAT.location="MAT" "Y";"N”}  This works on a non multiple  Query

 

Article ID: 21617
Date: 6/1/2005
Published: 7/1/2005

Application: NUR
Subject: Rules and Attributes
Platform: MAGIC

FAQ: Multiple Queries and DFT attributes

Question:
Can we apply a DFT attribute to a multiple type query?

Answer:
We cannot default a response into a multiple type query.  The default will continue to occur for each line of the multiple.  In order to default information to a multiple type field you would need to create a DO loop, which should not be done within CDS attributes. 

 

 

Derrick Goode

Clinical Informatics

Penn Highlands Elk

763  Johnsonburg Rd.

St. Marys, PA 15857

814-788-8661 Telephone

814-788-8076 Fax

DIG...@phhealthcare.org

www.phhealthcare.org

PHH ESig Logo 150dpi

 

This email and any attached files are sensitive in nature and intended solely for the intended recipient(s). If you are not the named recipient you should not read, distribute, copy or alter this email. Any views or opinions expressed in this email are those of the author and do not represent those of Penn Highlands Healthcare or its affiliates.. Warning: Although precautions have been taken to make sure no viruses are present in this email, the company cannot accept responsibility for any loss or damage that arise from the use of this email or attachments.

Pinkerton, Katie

unread,
Mar 16, 2016, 2:09:12 PM3/16/16
to Goode, Derrick, medit...@mtusers.com

Defaulting Responses In a Multiple Type Query

DFT attributes are not designed to handle multiple responses. Maybe in a future release there will be a DFTL attribute which defaults a list of responses. Until then you will need to do it the hard way - with lots of code. As in other attributes that default a response you need to store the responses in /[ANS%0... and also display them on screen. You do not want to display more responses than the lines that the multiple is set to display. If you have a long list of responses to default you can store them in a group response dictionary to save room in the attribute.

Defaulting a short list - 3 responses, query set to display 4 lines. The "1" at the end of line 1 and line 4 allows the user to add more responses.

IFE=IF{/[ANS%0,/S.LAST.QUERY,"M",1]|0 1;
IFE=P(R,S,"RESPONSE1"^/[ANS%0,"QUERY","M",1]|0)^#,
IFE=P(R+1,S,"RESPONSE3"^/[ANS%0,"QUERY","M",2]|0)^#,
IFE=P(R+2,S,"RESPONSE3"^/[ANS%0,"QUERY","M",3]|0)^#,1}

 

Defaulting a short list - 3 responses with query attribute set to display 2 lines. Note the 3rd response gets stored in /[ANS but is not written to the screen.

IFE=IF{/[ANS%0,/S.LAST.QUERY,"M",1]|0 1;
IFE=P(R,S,"RESPONSE1"^/[ANS%0,"QUERY","M",1]|0)^#,
IFE=P(R+1,S,"RESPONSE3"^/[ANS%0,"QUERY","M",2]|0)^#,
IFE="RESPONSE3"^/[ANS%0,"QUERY","M",3]|0,1} 

 

Defaulting a longer list stored in a group response dictionary called "MULT.RESP" in a multiple query. Here the object is to loop thru the group response dictionary elements and store the element names as a response using the element as the multiple subscript. The group response dictionary should be set up like this

Element     Element Name
1              RESPONSE1
2              RESPONSE2
3              RESPONSE3
etc           etc

The elements should start with 1 and not skip any numbers.

IFE=IF{/[ANS%0,"QUERY"^LQ,"M",1]|0 1;
IFE=\GGV[LQ]|20^QL,""^XX,
IFE=DO{+\GGL["MULT.RESP,"E",XX]^XX
IFE= \GGL["MULT.RESP,"E",XX]|0^YY,
IFE=IF{XX'>QL P(R+XX-1,S,YY^/[ANS%0,LQ,"M",XX]|0)^#;
IFE=YY^/[ANS%0,LQ,"M",XX]|0}},1} 

Defaulting canned text in a multiple query can also be done. You will need to vary the attribute based on the application where the canned text is stored but the format should be the same. Keep in mind that the canned text dictionaries vary in the line length. Both OE and NUR allow text lines greater than 75 characters and so may have lines longer than allowed in a query response. I have made use of several variables and referenced the physical data structure to save space. In the first line "QUERY" is stored in LQ and LQ is used from that point on. \GGV[LQ]|20 is the field in the MIS Query dictionary that holds the number of lines to display. These attributes just pull in the text. The tab stops are pulled in as plain text and will appear as [] in the query response. If you need the attribute to allow processing of the tab stops see my Pulling NUR Canned Text web page. Do not try to pull OE canned text into an NUR CDS or NUR canned text into an OE CDS.

The first version pulls the NUR canned text CANNED into an NUR CDS. &NCT is the physical structure of the NUR canned text dictionary.

IFE=IF{/[ANS%0,"QUERY"^LQ,"M",1]|0 1;
IFE=""^XX,
IFE=DO{+&NCT["CANNED,"T",XX]^XX &NCT["CANNED,"T",XX]^YY,
IFE=IF{XX'>\GGV[LQ]|20 P(R+XX-1,S,YY^/[ANS%0,LQ,"M",XX]|0)^#;
IFE=YY^/[ANS%0,LQ,"M",XX]|0}},1}

Similar code is used for pulling in OE canned text into an OE CDS. The canned text dictionary structure is &PCT instead of& NCT and there is an extra subscript for department. This attribute pulls in the canned text CANNED for department EKG into an OE CDS.

IFE=IF{/[ANS%0,"QUERY"^LQ,"M",1]|0 1;
IFE=""^XX,
IFE=DO{+&PCT["EKG","CANNED,"T",XX]^XX
IFE= &PCT["EKG","CANNED,"T",XX]^YY,
IFE=IF{XX'>\GGV[LQ]|20 P(R+XX-1,S,YY^/[ANS%0,LQ,"M",XX]|0)^#;
IFE=YY^/[ANS%0,LQ,"M",XX]|0}},1}

 

 

Katie Pinkerton

Clinical Informatics Analyst

Clinical Transformation Department

Mercy Medical Center

Office: 330-489-1382

Katie.P...@cantonmercy.org


The enclosed information is STRICTLY CONFIDENTIAL and is intended for the use of addressee only. Mercy Medical Center Inc. and its affiliates disclaim any responsibility for unauthorized disclosure of this information other than the addressee. Federal and Ohio law protects patient medical information disclosed in this email, including psychiatric disorders, (HIV) test results, AIDs-related conditions, alcohol, and/or drug dependence or abuse. Federal regulation (42 CFR Part 2) and Ohio Revised Code section 5122.31 and 3701.243 prohibit disclosure of this information without the specific written consent of the person to whom it pertains, or as otherwise permitted by law.
If you are not the intended recipient of the email or any of its attachments, please be advised that you have received this email in error and that any use, dissemination, distribution, forwarding, printing, or copying of this email or any attached files is strictly prohibited. If you have received this email in error, please immediately purge it and all attachments and notify the sender by reply email or contact the sender at the number listed.
Reply all
Reply to author
Forward
0 new messages