some parse debugging updates

This commit is contained in:
george 2010-03-01 00:42:07 +00:00
parent a376ee2ddc
commit b70e929bd5
3 changed files with 29 additions and 13 deletions

View File

@ -22,6 +22,7 @@ C0CMXP ; GPL - MXML based XPath utilities;12/04/09 17:05
INITXPF(ARY) ;INITIAL XML/XPATH FILE ARRAY
; DON'T USE THIS ONE ... USE INITFARY^C0CSOAP("FARY") INSTEAD
D INITFARY^C0CSOAP(ARY) ;
Q
S @ARY@("XML FILE NUMBER")=178.101
S @ARY@("XML SOURCE FIELD")=2.1
S @ARY@("XML TEMPLATE FIELD")=3
@ -51,30 +52,42 @@ ADDXP(INARY,TID,FARY) ;ADD XPATH .01 FIELD TO BINDING SUBFILE OF TEMPLATE TID
. D UPDIE ; CREATE THE BINDING SUBFILE FOR THIS XPATH
Q
;
ADDXML(INXML,TEMPID,FARY) ;ADD XML TO A TEMPLATE ID TEMPID
FIXICD9 ; FIX THE ICD9RESULT XML
D GETXML("GPL","ICD9RESULT") ; GET SOME BAD XML OUT OF THE FILE
S ZI=""
S G=""
F S ZI=$O(GPL(ZI)) Q:ZI="" D ; FOR EACH LINE
. S G=G_GPL(ZI) ; MAKE ONE BIG STRING OF XML
D NORMAL^C0CSOAP("G2","G") ;NO NORMALIZE IT BACK INTO AN ARRAY
D ADDXML("G2","ICD9RESULT") ; AND PUT IT BACK
Q
ADDXML(INXML,TEMPID,INFARY) ;ADD XML TO A TEMPLATE ID TEMPID
; INXML IS PASSED BY NAME
I '$D(FARY) D ;
. S FARY="FARY" ; FILE ARRAY
I '$D(INFARY) D ;
. S INFARY="FARY" ; FILE ARRAY
. D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
D SETXPF(FARY) ;SET FILE VARIABLES
I +TEMPID=0 S TEMPID=$$RESTID^C0CSOAP(TEMPID,INFARY) ;RESOLVE TEMPLATE NAME
D SETXPF(INFARY) ;SET FILE VARIABLES
D WP^DIE(C0CXPF,TEMPID_",",C0CXFLD,,INXML)
Q
;
ADDTEMP(INXML,TEMPID,FARY) ;ADD XML TEMPLATE TO TEMPLATE RECORD TEMPID FIELD 3
ADDTEMP(INXML,TEMPID,INFARY) ;ADD XML TEMPLATE TO TEMPLATE RECORD TEMPID
;
I '$D(FARY) D ;
. S FARY="FARY" ; FILE ARRAY
I '$D(INFARY) D ;
. S INFARY="FARY" ; FILE ARRAY
. D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
D SETXPF(FARY) ;SET FILE VARIABLES
I +TEMPID=0 S TEMPID=$$RESTID^C0CSOAP(TEMPID,INFARY) ;RESOLVE TEMPLATE NAME
D SETXPF(INFARY) ;SET FILE VARIABLES
D WP^DIE(C0CXPF,TEMPID_",",C0CXTFLD,,INXML)
Q
;
GETXML(OUTXML,TEMPID,FARY) ;GET THE XML FROM TEMPLATE TEMPID
GETXML(OUTXML,TEMPID,INFARY) ;GET THE XML FROM TEMPLATE TEMPID
;
I '$D(FARY) D ;
. S FARY="FARY" ; FILE ARRAY
I '$D(INFARY) D ;
. S INFARY="FARY" ; FILE ARRAY
. D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
D SETXPF(FARY) ;SET FILE VARIABLES
D SETXPF(INFARY) ;SET FILE VARIABLES
I +TEMPID=0 S TEMPID=$$RESTID^C0CSOAP(TEMPID,INFARY) ;RESOLVE TEMPLATE NAME
I $$GET1^DIQ(C0CXPF,TEMPID_",",C0CXFLD,,OUTXML)'=OUTXML D Q ;
. W "ERROR RETRIEVING TEMPLATE",!
Q

View File

@ -36,7 +36,7 @@ FIELDS(C0CFRTN,C0CF) ; RETURNS AN ARRAY OF THE FIELDS IN FILE C0CF,
. . ;W "N: ",C0CFN,!
. . ;I C0CFN="STR" W C0CFN," ",C0CFJ,!
. . I $D(@C0CFRTN@(C0CFN)) D ; IS THIS A DUPLICATE?
. . . I DEBUG D ;
. . . I $G(DEBUG) D ;
. . . . W "DUPLICATE FOUND! ",C0CFJ," ",C0CFI," ",C0CFN,!,@C0CFRTN@(C0CFN),!
. . . S @C0CFRTN@(C0CFN_"_"_C0CFJ)=C0CFJ_"^"_C0CFI
. . E S @C0CFRTN@(C0CFN)=C0CFJ_"^"_C0CFI

View File

@ -51,6 +51,9 @@ INITFARY(ARY) ;initialize the Fileman Field array for SOAP processing
;
RESTID(INNAM,INFARY) ;EXTRINSIC TO RESOLVE TEMPLATE PASSED BY NAME
; FILE IS IDENTIFIED IN FARY, PASSED BY NAME
I '$D(INFARY) D ; NO FILE ARRAY PASSED
. S INFARY="FARY"
. D INITFARY(INFARY)
N ZN,ZREF,ZR
S ZN=@INFARY@("XML FILE NUMBER")
S ZREF=$$FILEREF^C0CRNF(ZN)