Changeset 617 for ccr/trunk


Ignore:
Timestamp:
Nov 30, 2009, 1:33:17 PM (15 years ago)
Author:
George Lilly
Message:

changes for parsing the CCD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CMXML.m

    r608 r617  
    2929        Q
    3030        ;
    31 TEST4 ; TEST OF OUTPUTING AN XML FILE FROM THE DOM .. this one is the CCR
    32  ;
    33  D TEST ; SET UP THE DOM
    34  D START^C0CMXMLB($$TAG(1),,"G")
    35  D NDOUT($$FIRST(1))
    36  D END^C0CMXMLB ;END THE DOCUMENT
    37  M ZCCR=^TMP("MXMLBLD",$J)
    38  ZWR ZCCR
    39  Q
    40  ;
    41 TEST5 ; SAME AS TEST4, BUT THIS TIME THE CCD
    42  S C0CXMLIN=$NA(^TMP("C0CMXML",$J))
    43  K GARY,GTMP,GIDX
    44  K @C0CXMLIN
    45  W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3)
    46  D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS
    47  K @C0CXMLIN
    48  M @C0CXMLIN=GTMP
    49  K GTMP
    50  D STRIPTXT("GTMP",C0CXMLIN)
    51  K @C0CXMLIN
    52  M @C0CXMLIN=GTMP
    53  K GTMP
    54  S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID  ;CALL REGULAR PARSER
    55  ;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 DOCUMENT
    60  ;M ZCCD=^TMP("MXMLBLD",$J)
    61  ZWR ZCCD(1:30)
    62  Q
    63  ;
    6431TEST2   ;
    6532        S REDUX="//soap:Envelope/soap:Body/GetPatientFullMedicationHistory5Response/GetPatientFullMedicationHistory5Result/patientDrugDetail"
     
    9259 Q
    9360 ;
     61TEST4 ; 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 ;
     71TEST5 ; 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 ;
    9494XPATH(ZOID,ZPATH,ZXIDX,ZXPARY,ZNUM,ZREDUX)      ; RECURSIVE ROUTINE TO POPULATE
    9595        ; THE XPATH INDEX ZXIDX, PASSED BY NAME
     
    181181 ;
    182182NDOUT(ZOID) ;CALLBACK ROUTINE - IT IS RECURSIVE
    183  I $$FIRST(ZOID)'=0 D  ; THERE IS A CHILD
    184  . 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
    188188 . ;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
    192192 I $$NXTSIB(ZOID)'=0 D  ; THERE IS A SIBLING
    193193 . D NDOUT($$NXTSIB(ZOID)) ;RECURSE FOR SIBLINGS
     
    332332 . . W ZI," ",TAG," ",ALTTAG," ",NAME,!
    333333 . . 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
    334339 Q
    335340 ;
Note: See TracChangeset for help on using the changeset viewer.