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 | Application: NUR |
FAQ: Multiple Queries and DFT attributes
Question: Answer: |
Derrick Goode
Clinical Informatics
Penn Highlands Elk
763 Johnsonburg Rd.
St. Marys, PA 15857
814-788-8661 Telephone
814-788-8076 Fax

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.
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