Changeset 639 for ccr/trunk/p
- Timestamp:
- Dec 6, 2009, 1:16:46 PM (15 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMCCD.m
r630 r639 20 20 Q 21 21 ; 22 TEST ;23 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))24 K GARY25 W $$FTG^%ZISH("/home/vademo2/EHR/p/","mxml-test.xml",$NA(@C0CXMLIN@(1)),3)26 S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DocID: ",C0CDOCID27 S REDUX="//ContinuityOfCareRecord/Body"28 D XPATH(1,"/","GIDX","GARY",,REDUX)29 Q30 ;31 TEST2 ;32 S REDUX="//soap:Envelope/soap:Body/GetPatientFullMedicationHistory5Response/GetPatientFullMedicationHistory5Result/patientDrugDetail"33 D XPATH(1,"/","GIDX","GARY","",REDUX)34 Q35 ;36 TEST337 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))38 K GARY,GTMP,GIDX39 K @C0CXMLIN40 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3)41 D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS42 K @C0CXMLIN43 M @C0CXMLIN=GTMP44 K GTMP45 D STRIPTXT("GTMP",C0CXMLIN)46 K @C0CXMLIN47 M @C0CXMLIN=GTMP48 K GTMP49 S C0CDOCID=$$PARSCCD(C0CXMLIN,"W") W !,"DocID: ",C0CDOCID50 S REDUX="//ClinicalDocument/component/structuredBody"51 D FINDTID ; FIND THE TEMPLATE IDS52 D FINDALT ; FIND ALTERNATE TAGS53 D SETCBK ; SET THE CALLBACK ROUTINE FOR TAGS54 D XPATH(1,"/","GIDX","GARY",,REDUX)55 K C0CCBK("TAG")56 D SEPARATE("GARY2","GARY") ; SEPARATE FOR EASIER BROWSING57 ;S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER58 ;D XPATH(1,"/","GIDX2","GARY2",,REDUX)59 Q60 ;61 TEST4 ; TEST OF OUTPUTING AN XML FILE FROM THE DOM .. this one is the CCR62 ;63 D TEST ; SET UP THE DOM64 D START^C0CMXMLB($$TAG(1),,"G")65 D NDOUT($$FIRST(1))66 D END^C0CMXMLB ;END THE DOCUMENT67 M ZCCR=^TMP("MXMLBLD",$J)68 ZWR ZCCR69 Q70 ;71 TEST5 ; SAME AS TEST4, BUT THIS TIME THE CCD72 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))73 K GARY,GTMP,GIDX74 K @C0CXMLIN75 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3)76 D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS77 K @C0CXMLIN78 M @C0CXMLIN=GTMP79 K GTMP80 D STRIPTXT("GTMP",C0CXMLIN)81 K @C0CXMLIN82 M @C0CXMLIN=GTMP83 K GTMP84 S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER85 ;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 DOCUMENT90 ;M ZCCD=^TMP("MXMLBLD",$J)91 ZWR ZCCD(1:30)92 Q93 ;94 22 PARSCCD(DOC,OPTION) ; THIS WAS COPIED FROM EN^MXMLDOM TO CUSTIMIZE FOR 95 23 ; PROCESSING CCDS … … 100 28 S HANDLE=$O(^TMP("MXMLDOM",$J,""),-1)+1,^(HANDLE)="" 101 29 L -^TMP("MXMLDOM",$J) 102 S CBK("STARTELEMENT")="STARTELE^C0CM XML" ; ONLY THIS ONE IS CHANGED ;GPL30 S CBK("STARTELEMENT")="STARTELE^C0CMCCD" ; ONLY THIS ONE IS CHANGED ;GPL 103 31 S CBK("ENDELEMENT")="ENDELE^MXMLDOM" 104 32 S CBK("COMMENT")="COMMENT^MXMLDOM" … … 130 58 Q 131 59 ; 60 ISMULT(ZOID) ; RETURN TRUE IF ZOID IS ONE OF A MULTIPLE 61 N ZN 62 ;I $$TAG(ZOID)["entry" B 63 S ZN=$$NXTSIB(ZOID) 64 I ZN'="" Q $$TAG(ZOID)=$$TAG(ZN) ; IF TAG IS THE SAME AS NEXT SIB TAG 65 Q 0 66 ; 67 FIRST(ZOID) ;RETURNS THE OID OF THE FIRST CHILD OF ZOID 68 Q $$CHILD^MXMLDOM(C0CDOCID,ZOID) 69 ; 70 PARENT(ZOID) ;RETURNS THE OID OF THE PARENT OF ZOID 71 Q $$PARENT^MXMLDOM(C0CDOCID,ZOID) 72 ; 73 ATT(RTN,NODE) ;GET ATTRIBUTES FOR ZOID 74 S HANDLE=C0CDOCID 75 K @RTN 76 D GETTXT^MXMLDOM("A") 77 Q 78 ; 79 TAG(ZOID) ; RETURNS THE XML TAG FOR THE NODE 80 ;I ZOID=149 B ;GPLTEST 81 N X,Y 82 S Y="" 83 S X=$G(C0CCBK("TAG")) ;IS THERE A CALLBACK FOR THIS ROUTINE 84 I X'="" X X ; EXECUTE THE CALLBACK, SHOULD SET Y 85 I Y="" S Y=$$NAME^MXMLDOM(C0CDOCID,ZOID) 86 Q Y 87 ; 88 NXTSIB(ZOID) ; RETURNS THE NEXT SIBLING 89 Q $$SIBLING^MXMLDOM(C0CDOCID,ZOID) 90 ; 91 DATA(ZT,ZOID) ; RETURNS DATA FOR THE NODE 92 ;N ZT,ZN S ZT="" 93 ;S C0CDOM=$NA(^TMP("MXMLDOM",$J,C0CDOCID)) 94 ;Q $G(@C0CDOM@(ZOID,"T",1)) 95 S ZN=$$TEXT^MXMLDOM(C0CDOCID,ZOID,ZT) 96 Q 97 ; 132 98 CLEANARY(OUTARY,INARY) ; GOES THROUGH AN ARRAY AND CALLS CLEAN ON EACH NODE 133 99 ; INARY AND OUTARY PASSED BY NAME … … 247 213 ; 248 214 SETCBK ; SET THE TAG CALLBACK FOR XPATH PROCESSSING OF THE CCD 249 S C0CCBK("TAG")="D ALTTAG (ZOID)"215 S C0CCBK("TAG")="D ALTTAG^C0CMCCD(ZOID)" 250 216 Q 251 217 ; 252 218 OUTCCD ; OUTPUT THE PARSED CCD TO A TEXT FILE 253 D TEST3 219 D TEST3^C0CMXML 254 220 N ZT S ZT=$NA(^TMP("CCDOUT",$J)) 255 221 N ZI,ZJ -
ccr/trunk/p/C0CMXML.m
r630 r639 43 43 K @C0CXMLIN 44 44 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3) 45 D CLEANARY ("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS46 K @C0CXMLIN 47 M @C0CXMLIN=GTMP 48 K GTMP 49 D STRIPTXT ("GTMP",C0CXMLIN)50 K @C0CXMLIN 51 M @C0CXMLIN=GTMP 52 K GTMP 53 S C0CDOCID=$$PARSCCD (C0CXMLIN,"W") W !,"DocID: ",C0CDOCID45 D CLEANARY^C0CMCCD("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS 46 K @C0CXMLIN 47 M @C0CXMLIN=GTMP 48 K GTMP 49 D STRIPTXT^C0CMCCD("GTMP",C0CXMLIN) 50 K @C0CXMLIN 51 M @C0CXMLIN=GTMP 52 K GTMP 53 S C0CDOCID=$$PARSCCD^C0CMCCD(C0CXMLIN,"W") W !,"DocID: ",C0CDOCID 54 54 S REDUX="//ClinicalDocument/component/structuredBody" 55 D FINDTID ; FIND THE TEMPLATE IDS56 D FINDALT ; FIND ALTERNATE TAGS57 D SETCBK ; SET THE CALLBACK ROUTINE FOR TAGS55 D FINDTID^C0CMCCD ; FIND THE TEMPLATE IDS 56 D FINDALT^C0CMCCD ; FIND ALTERNATE TAGS 57 D SETCBK^C0CMCCD ; SET THE CALLBACK ROUTINE FOR TAGS 58 58 D XPATH(1,"/","GIDX","GARY",,REDUX) 59 59 K C0CCBK("TAG") 60 D SEPARATE ("GARY2","GARY") ; SEPARATE FOR EASIER BROWSING60 D SEPARATE^C0CMCCD("GARY2","GARY") ; SEPARATE FOR EASIER BROWSING 61 61 ;S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER 62 62 ;D XPATH(1,"/","GIDX2","GARY2",,REDUX) … … 78 78 K @C0CXMLIN 79 79 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3) 80 D CLEANARY ("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS81 K @C0CXMLIN 82 M @C0CXMLIN=GTMP 83 K GTMP 84 D STRIPTXT ("GTMP",C0CXMLIN)80 D CLEANARY^C0CMCCD("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS 81 K @C0CXMLIN 82 M @C0CXMLIN=GTMP 83 K GTMP 84 D STRIPTXT^C0CMCCD("GTMP",C0CXMLIN) 85 85 K @C0CXMLIN 86 86 M @C0CXMLIN=GTMP … … 91 91 ;D START^C0CMXMLB($$TAG(1),,"G") 92 92 ;D NDOUT($$FIRST(1)) 93 ;D END^C0CMXMLB ;E ND THE DOCUMENT93 ;D END^C0CMXMLB ;EOND THE DOCUMENT 94 94 ;M ZCCD=^TMP("MXMLBLD",$J) 95 95 ZWR ZCCD(1:30) -
ccr/trunk/p/C0CMXP.m
r630 r639 20 20 Q 21 21 ; 22 TEST ;23 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))24 K GARY25 W $$FTG^%ZISH("/home/vademo2/EHR/p/","mxml-test.xml",$NA(@C0CXMLIN@(1)),3)26 S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DocID: ",C0CDOCID27 S REDUX="//ContinuityOfCareRecord/Body"28 D XPATH(1,"/","GIDX","GARY",,REDUX)29 Q30 ;31 TEST2 ;32 S REDUX="//soap:Envelope/soap:Body/GetPatientFullMedicationHistory5Response/GetPatientFullMedicationHistory5Result/patientDrugDetail"33 D XPATH(1,"/","GIDX","GARY","",REDUX)34 Q35 ;36 TEST337 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))38 K GARY,GTMP,GIDX39 K @C0CXMLIN40 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3)41 D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS42 K @C0CXMLIN43 M @C0CXMLIN=GTMP44 K GTMP45 D STRIPTXT("GTMP",C0CXMLIN)46 K @C0CXMLIN47 M @C0CXMLIN=GTMP48 K GTMP49 S C0CDOCID=$$PARSCCD(C0CXMLIN,"W") W !,"DocID: ",C0CDOCID50 S REDUX="//ClinicalDocument/component/structuredBody"51 D FINDTID ; FIND THE TEMPLATE IDS52 D FINDALT ; FIND ALTERNATE TAGS53 D SETCBK ; SET THE CALLBACK ROUTINE FOR TAGS54 D XPATH(1,"/","GIDX","GARY",,REDUX)55 K C0CCBK("TAG")56 D SEPARATE("GARY2","GARY") ; SEPARATE FOR EASIER BROWSING57 ;S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER58 ;D XPATH(1,"/","GIDX2","GARY2",,REDUX)59 Q60 ;61 TEST4 ; TEST OF OUTPUTING AN XML FILE FROM THE DOM .. this one is the CCR62 ;63 D TEST ; SET UP THE DOM64 D START^C0CMXMLB($$TAG(1),,"G")65 D NDOUT($$FIRST(1))66 D END^C0CMXMLB ;END THE DOCUMENT67 M ZCCR=^TMP("MXMLBLD",$J)68 ZWR ZCCR69 Q70 ;71 TEST5 ; SAME AS TEST4, BUT THIS TIME THE CCD72 S C0CXMLIN=$NA(^TMP("C0CMXML",$J))73 K GARY,GTMP,GIDX74 K @C0CXMLIN75 W $$FTG^%ZISH("/home/vademo2/CCR/","SampleCCDDocument.xml",$NA(@C0CXMLIN@(1)),3)76 D CLEANARY("GTMP",C0CXMLIN) ; REMOVE CONTROL CHARACTERS77 K @C0CXMLIN78 M @C0CXMLIN=GTMP79 K GTMP80 D STRIPTXT("GTMP",C0CXMLIN)81 K @C0CXMLIN82 M @C0CXMLIN=GTMP83 K GTMP84 S C0CDOCID=$$PARSE(C0CXMLIN) W !,"DOCID: ",C0CDOCID ;CALL REGULAR PARSER85 ;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 DOCUMENT90 ;M ZCCD=^TMP("MXMLBLD",$J)91 ZWR ZCCD(1:30)92 Q93 ;94 22 MKTPLATE(INXML,OUTT) ;MAKE A TEMPLATE FROM INXML, RETURNED IN OUTT 95 23 ; BOTH PASSED BY NAME
Note:
See TracChangeset
for help on using the changeset viewer.