Changeset 617
- Timestamp:
- Nov 30, 2009, 1:33:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMXML.m
r608 r617 29 29 Q 30 30 ; 31 TEST4 ; TEST OF OUTPUTING AN XML FILE FROM THE DOM .. this one is the CCR32 ;33 D TEST ; SET UP THE DOM34 D START^C0CMXMLB($$TAG(1),,"G")35 D NDOUT($$FIRST(1))36 D END^C0CMXMLB ;END THE DOCUMENT37 M ZCCR=^TMP("MXMLBLD",$J)38 ZWR ZCCR39 Q40 ;41 TEST5 ; SAME AS TEST4, BUT THIS TIME THE CCD42 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))43 K GARY,GTMP,GIDX44 K @C0CXMLIN45 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3)46 D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS47 K @C0CXMLIN48 M @C0CXMLIN=GTMP49 K GTMP50 D STRIPTXT("GTMP",C0CXMLIN)51 K @C0CXMLIN52 M @C0CXMLIN=GTMP53 K GTMP54 S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER55 ;D XPATH(1,"/","GIDX2","GARY2",,REDUX)56 D OUTXML("ZCCD",C0CDOCID)57 ;D START^C0CMXMLB($$TAG(1),,"G")58 ;D NDOUT($$FIRST(1))59 ;D END^C0CMXMLB ;END THE DOCUMENT60 ;M ZCCD=^TMP("MXMLBLD",$J)61 ZWR ZCCD(1:30)62 Q63 ;64 31 TEST2 ; 65 32 S REDUX="//soap:Envelope/soap:Body/GetPatientFullMedicationHistory5Response/GetPatientFullMedicationHistory5Result/patientDrugDetail" … … 92 59 Q 93 60 ; 61 TEST4 ; TEST OF OUTPUTING AN XML FILE FROM THE DOM .. this one is the CCR 62 ; 63 D TEST ; SET UP THE DOM 64 D START^C0CMXMLB($$TAG(1),,"G") 65 D NDOUT($$FIRST(1)) 66 D END^C0CMXMLB ;END THE DOCUMENT 67 M ZCCR=^TMP("MXMLBLD",$J) 68 ZWR ZCCR 69 Q 70 ; 71 TEST5 ; SAME AS TEST4, BUT THIS TIME THE CCD 72 S C0CXMLIN=$NA(^TMP("C0CMXML",$J)) 73 K GARY,GTMP,GIDX 74 K @C0CXMLIN 75 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3) 76 D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS 77 K @C0CXMLIN 78 M @C0CXMLIN=GTMP 79 K GTMP 80 D STRIPTXT("GTMP",C0CXMLIN) 81 K @C0CXMLIN 82 M @C0CXMLIN=GTMP 83 K GTMP 84 S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER 85 ;D XPATH(1,"/","GIDX2","GARY2",,REDUX) 86 D OUTXML("ZCCD",C0CDOCID) 87 ;D START^C0CMXMLB($$TAG(1),,"G") 88 ;D NDOUT($$FIRST(1)) 89 ;D END^C0CMXMLB ;END THE DOCUMENT 90 ;M ZCCD=^TMP("MXMLBLD",$J) 91 ZWR ZCCD(1:30) 92 Q 93 ; 94 94 XPATH(ZOID,ZPATH,ZXIDX,ZXPARY,ZNUM,ZREDUX) ; RECURSIVE ROUTINE TO POPULATE 95 95 ; THE XPATH INDEX ZXIDX, PASSED BY NAME … … 181 181 ; 182 182 NDOUT(ZOID) ;CALLBACK ROUTINE - IT IS RECURSIVE 183 I $$FIRST(ZOID)'=0 D ; THERE IS A CHILD184 . N ZI S ZI=$$FIRST(ZOID)185 . N ZATT D ATT("ZATT",ZOID) 186 . D MULTI^C0CMXMLB("",$$TAG(ZOID),.ZATT,"NDOUT^C0CMXML(ZI)") 187 E D ; NO CHILD 183 N ZI S ZI=$$FIRST(ZOID) 184 I ZI'=0 D ; THERE IS A CHILD 185 . N ZATT D ATT("ZATT",ZOID) ; THESE ARE THE ATTRIBUTES MOVED TO ZATT 186 . D MULTI^C0CMXMLB("",$$TAG(ZOID),.ZATT,"NDOUT^C0CMXML(ZI)") ;HAVE CHILDREN 187 E D ; NO CHILD - IF NO CHILDREN, A NODE HAS DATA, IS AN ENDPOINT 188 188 . ;W "DOING",ZOID,! 189 . N ZD D DATA("ZD",ZOID) 190 . N ZATT D ATT("ZATT",ZOID) 191 . D ITEM^C0CMXMLB("",$$TAG(ZOID),.ZATT,$G(ZD(1))) 189 . N ZD D DATA("ZD",ZOID) ;NODES WITHOUT CHILDREN HAVE DATA 190 . N ZATT D ATT("ZATT",ZOID) ;ATTRIBUTES 191 . D ITEM^C0CMXMLB("",$$TAG(ZOID),.ZATT,$G(ZD(1))) ;NO CHILDREN 192 192 I $$NXTSIB(ZOID)'=0 D ; THERE IS A SIBLING 193 193 . D NDOUT($$NXTSIB(ZOID)) ;RECURSE FOR SIBLINGS … … 332 332 . . W ZI," ",TAG," ",ALTTAG," ",NAME,! 333 333 . . S C0CTAGS(ZI)=ALTTAG 334 . E D ; NOT A SECTION NODE 335 . . N ZJ 336 . . S ZJ=$O(^C0CXDS(178.101,"D",ZIEN,ZPAR,"") ;IS THERE A WHEREUSED POINTER? 337 . . I ZJ'="" D ; THERE IS A NEW LABEL FOR THIS NODE 338 . . . ;S C0CTAGS(ZI)=$$GET1^DIQ(178.101 334 339 Q 335 340 ;
Note:
See TracChangeset
for help on using the changeset viewer.