All messages should be posted in plain text. HTML will be converted to attachments. The meditech-l web site is MTUsers.com ======================================
Hi Rhonda, One thing I spotted is that your code ZZ%O(:,OLD.QM) should be ZZ%O(&,OLD.QM) because the prefix you are using is &, not :. If I spot anything else I will let you know. Have you tried using the debugger program %Z.ddc to debug the macro? Thanks, Brian Schmit Sr. Programmer, Picis Direct: 781 557 3315 Fax: 781 557 3140 100 Quannapowitt Parkway Suite 405 Wakefield, MA 01880 [EMAIL PROTECTED] www.picis.com Please visit www.picis.com/meditech for additional information about our NPR Report Writing Trainings. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access or use by any other person to this internet email is not authorized and may be unlawful. If you are not the intended recipient, please delete or destroy this email. If you do not wish to receive future emails from the sender, please reply directly to this email requesting you be removed from any mailing list. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rhonda Feldbauer Sent: Friday, June 16, 2006 3:54 PM To: [email protected] Subject: [MEDITECH-L] MAGIC using Z.link to bring back an MV array full ofdata from another module All messages should be posted in plain text. HTML will be converted to attachments. The meditech-l web site is MTUsers.com ====================================== I have successfully used Z.link to speed up some of my reports by eliminating fragments. But in each case, and in the examples I've seen from Picis and Iatrics, I've only brought back one or two values - like a cpt code, etc. What if I want to bring back an MV array full of data? Is this possible? For example, I am working in NUR.PC.WORK. I want to pull in the allergies from PHA. I don't want to use a fragment. Has anyone ever done something like this? I've got some code - but it's pretty long, so I'll paste it at the bottom... (MAGIC 5.4.1) Any thoughts are greatly appreciated! Rhonda Feldbauer Applications Analyst Newnan Hospital 770.304.4304 Detail DPM NUR.PC.WORK Detail Segment nur.int.documented.activity Index DPM NUR.PC.WORK Index File nur.date.doc.x HP * DRUG ALLERGIES(PHARMACY) x xx.pha.allergies____________________________ HP xx.pha.allergies____________________________ Line Attribute: MV=AL Data Field | Field Marker xx.pha.allergies xx.pha.allergies DAT=FREE FNC=LST JFY=L LEN=79 VAL=1 xx.pha.allg.trigger x DAT=FREE JFY=L LEN=1 VAL=%NUR.PC.WORK.zcus.prt.med.rec.admission.fast.M.get.pha.allg(patient) get.pha.allg Macro ;----------------------------------------------------------------- ;Macro links to PHA and brings back data ;----------------------------------------------------------------- A^patient, [EMAIL PROTECTED](PHA.PAT,:,&), "The above line of code modifies the prefix", %Z.link("&","PHA","%.PHA.data","PHA.NEN.N")^OLD.QM, IF{A;/patient}^PHA.PAT.pha.patient, IF{B;92}-1^LEN, @ALLERGIES, @ADRS, ZZ%O(:,OLD.QM), ""}; ;--------------------- ALLERGIES IF{C;"AL"}^MV, D^LN, ""^Q^S, ""^PHA.PAT.generic.allergy, [EMAIL PROTECTED](PHA.PAT.generic.allergy,PHA.PAT.generic.allergies) ., @PHA.GENERIC.name[PHA.PAT.generic.allergy]^ALL, [EMAIL PROTECTED] " ("_TEXT_")";""}^NAME, @ADD.IT}, ""^PHA.PAT.class.allergy, [EMAIL PROTECTED](PHA.PAT.class.allergy,PHA.PAT.class.allergies) ., @PHA.CLASS.name[PHA.PAT.class.allergy]^ALL, [EMAIL PROTECTED] " ("_TEXT_")";""}^NAME, @ADD.IT}, ""^PHA.PAT.allergy.code, [EMAIL PROTECTED](PHA.PAT.allergy.code,PHA.PAT.allergy.codes) ., @PHA.ALLERGY.desc[PHA.PAT.allergy.code]^ALL, [EMAIL PROTECTED] " ("_TEXT_")";""}^NAME, @ADD.IT}, @LAST.LINE.ALLERGIES, ""^NAME^TEXT^ALL ADD.IT IF{L(S_NAME)>LEN @NEW.LINE}, S_", "_NAME^S NEW.LINE IF{LN S%1_","^/MV[MV,Q+1^Q,LN]; S%1_","^/MV[MV,Q+1^Q]}, ""^S LAST.LINE.ALLERGIES IF{LN IF{S S%1;'Q "Allergies not entered."}^/MV[MV,Q+1^Q,LN]; IF{S S%1;'Q "Allergies not entered."}^/MV[MV,Q+1^Q]} ADRS IF{E;"AD"}^MV, F^LN, ""^Q^S, ""^PHA.PAT.generic.adr, [EMAIL PROTECTED](PHA.PAT.generic.adr,PHA.PAT.generic.adrs) ., @PHA.GENERIC.name[PHA.PAT.generic.adr]^ADR, [EMAIL PROTECTED] " ("_TEXT_")";""}^NAME, @ADD.IT}, ""^PHA.PAT.class.adr, [EMAIL PROTECTED](PHA.PAT.class.adr,PHA.PAT.class.adrs) ., @PHA.CLASS.name[PHA.PAT.class.adr]^ADR, [EMAIL PROTECTED] " ("_TEXT_")";""}^NAME, @ADD.IT}, ""^PHA.PAT.ingredient.adr, [EMAIL PROTECTED](PHA.PAT.ingredient.adr,PHA.PAT.ingredient.adrs) ., @PHA.ALLERGY.desc[PHA.PAT.ingredient.adr]^ADR, [EMAIL PROTECTED] " ("_TEXT_")";""}^NAME, @ADD.IT}, @LAST.LINE.ADRS, ""^ADR^NAME^TEXT LAST.LINE.ADRS IF{LN IF{S S%1;'Q "ADR not entered"}^/MV[MV,Q+1^Q,LN]; IF{S S%1;'Q "ADR not entered"}^/MV[MV,Q+1^Q]} _______________________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l _______________________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l
