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

Reply via email to