From 81dc035c523fe0e9f5b811192157ab4290ffa466 Mon Sep 17 00:00:00 2001 From: george Date: Tue, 13 Oct 2009 23:58:45 +0000 Subject: [PATCH] some fixes to the MXML wrapper --- p/C0CMXML.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/p/C0CMXML.m b/p/C0CMXML.m index e623876..8036e79 100644 --- a/p/C0CMXML.m +++ b/p/C0CMXML.m @@ -20,7 +20,9 @@ C0CMXML ; ERX/GPL - MXML based XPath utilities; 10/11/09 Q ; TEST ; - S DOCID=$$PARSE("^GPL") + S C0CXMLIN=$NA(^TMP("C0CMXML",$J)) + W $$FTG^%ZISH("/home/vademo2/EHR/p/","mxml-test.xml",$NA(@C0CXMLIN@(1)),3) + S C0CDOCID=$$PARSE(C0CXMLIN) S REDUX="//ContinuityOfCareRecord/Body" D XPATH(1,"/","GIDX","GARY",,REDUX) Q @@ -47,7 +49,7 @@ XPATH(ZOID,ZPATH,ZXIDX,ZXPARY,ZNUM,ZREDUX) ; RECURSIVE ROUTINE TO POPULATE . I GT'="" S NEWPATH=GT S @ZXIDX@(NEWPATH)=ZOID ; ADD THE XPATH FOR THIS NODE TO THE XPATH INDEX N GD S GD=$$DATA(ZOID) ; SEE IF THERE IS DATA FOR THIS NODE - I GD'=0 S @ZXPARY@(NEWPATH)=GD ; IF YES, ADD IT TO THE XPATH ARRAY + I GD'="" S @ZXPARY@(NEWPATH)=GD ; IF YES, ADD IT TO THE XPATH ARRAY N ZFRST S ZFRST=$$FIRST(ZOID) ; SET FIRST CHILD I ZFRST'=0 D ; THERE IS A CHILD . N ZMULT S ZMULT=$$ISMULT(ZFRST) ; IS FIRST CHILD A MULTIPLE @@ -70,17 +72,19 @@ ISMULT(ZOID) ; RETURN TRUE IF ZOID IS ONE OF A MULTIPLE Q 0 ; FIRST(ZOID) ;RETURNS THE OID OF THE FIRST CHILD OF ZOID - Q $$CHILD^MXMLDOM(DOCID,ZOID) + Q $$CHILD^MXMLDOM(C0CDOCID,ZOID) ; TAG(ZOID) ; RETURNS THE XML TAG FOR THE NODE - Q $$NAME^MXMLDOM(DOCID,ZOID) + Q $$NAME^MXMLDOM(C0CDOCID,ZOID) ; NXTSIB(ZOID) ; RETURNS THE NEXT SIBLING - Q $$SIBLING^MXMLDOM(DOCID,ZOID) + Q $$SIBLING^MXMLDOM(C0CDOCID,ZOID) ; DATA(ZOID) ; RETURNS DATA FOR THE NODE N ZT,ZN S ZT="" - S ZN=$$TEXT^MXMLDOM(DOCID,ZOID,"ZT") + S C0CDOM=$NA(^TMP("MXMLDOM",$J,C0CDOCID)) + Q $G(@C0CDOM@(ZOID,"T",1)) + S ZN=$$TEXT^MXMLDOM(C0CDOCID,ZOID,"ZT") I $G(ZT) ZWR ZT Q $G(ZT) ;