I recently attended a couple of MUSE webcasts put on by IPeople and have been trying the techniques presented but I have a followup question. How do you properly use the Z.link to get both .data and .dic linked up properly.
I am trying to get positive culture results using the following macro to build an array of organisms. I can see in the debugger that I get the organism ID but I don't get the name (/ORG in the example). Can someone tell me what I'm doing wrong?
Marcia Locke
MIC
C(*S,:S),
@Chg.prefix(LAB.M.SPEC,:,*),
@Chg.prefix(LAB.M.SPEC,?,*),
%Z.link("*","LAB","%.LAB.data","LAB.SHS"),
/PAT^LAB.M.SPEC.patient,
""^LAB.M.SPEC.collection.date^LAB.M.SPEC.collection.time,
""^LAB.M.SPEC.number.part^/SRC^/FNL^/ID^/ORG^/COL,
DO{@Next(LAB.M.SPEC.collection.date,LAB.M.SPEC.patient.x) 1,
@LAB.M.SPEC.collection.date^/CDT,
DO{@Next(LAB.M.SPEC.collection.time,LAB.M.SPEC.patient.x) 1,
@LAB.M.SPEC.collection.time^/CTM,
"MB"^LAB.M.SPEC.prefix,
DO{@Next(LAB.M.SPEC.number.part,LAB.M.SPEC.patient.x) 1,
LAB.M.SPEC.patient.x^LAB.M.SPEC.urn^/URN,
@SPEC}}},
C(*U,:U)
SPEC
@LAB.M.SPEC.source^/SRC,
""^LAB.M.SPEC.proc,
DO{@Next(LAB.M.SPEC.proc) ""^LAB.M.SPEC.res.q,
DO{@Next(LAB.M.SPEC.res.q) 1,
@LAB.M.SPEC.prelim.or.final^/FNL,
IF{/SRC="SPT"&(/FNL="F") @GET.ORGS}}}
GET.ORGS
@Chg.prefix(LAB.M.ORG,?,:),
%Z.link(":","LAB","%.LAB.dic","LAB.SHS"),
""^LAB.M.SPEC.result.org.q,
DO{@Next(LAB.M.SPEC.result.org.q) 1,
@LAB.M.SPEC.result.org.id^LAB.M.ORG.mnemonic^/ID,
;@LAB.M.ORG.name[/ID]^/ORG, <--tried both ways here
@LAB.M.ORG.name^/ORG, <--tried both ways here
IF{/CDT&CTM %Z.date.out(/CDT)^/CDT,
/CDT_" "_/CTM^/COL},
%Z.ddc("ORGS")X, <-----From here I can see that /ID is populated but there is nothing in /ORG
IF{/COL&/ORG&(/ID'="NOF") 1^/ORGS[/PAT,/COL,/ORG]}}