Changeset 1333 for ccr/branches/ohum/p/C0CEWD1.m
- Timestamp:
- Jan 4, 2012, 12:05:49 AM (14 years ago)
- File:
-
- 1 edited
-
ccr/branches/ohum/p/C0CEWD1.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ccr/branches/ohum/p/C0CEWD1.m
r1332 r1333 1 C0CEWD1 ; CCDCCR/GPL - CCR FILEMAN utilities; 12/6/082 ;;0.1;CCDCCR;nopatch;noreleasedate 3 ;Copyright 2009 George Lilly. Licensed under the terms of the GNU4 ;General Public License See attached copy of the License.5 ;6 ;This program is free software; you can redistribute it and/or modify7 ;it under the terms of the GNU General Public License as published by8 ;the Free Software Foundation; either version 2 of the License, or9 ;(at your option) any later version.10 ;11 ;This program is distributed in the hope that it will be useful,12 ;but WITHOUT ANY WARRANTY; without even the implied warranty of13 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 ;GNU General Public License for more details.15 ;16 ;You should have received a copy of the GNU General Public License along17 ;with this program; if not, write to the Free Software Foundation, Inc.,18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.19 ;20 Q21 ;22 TEST(filepath) ; filepath IS THE PATH/FILE TO BE READ IN23 i $g(^%ZISH)["" d ; if the VistA Kernal routine %ZISH exists24 . n zfile,zpath,ztmp s (zfile,zpath,ztmp)=""25 . s zfile=$re($p($re(filepath),"/",1)) ;file name26 . s zpath=$p(filepath,zfile,1) ; file path27 . s ztmp=$na(^CacheTempEWD($j,0))28 . s ok=$$FTG^%ZISH(zpath,zfile,ztmp,2) ; import the file incrementing subscr 229 q30 ;31 TEST2 ;32 s zfilepath="/home/vademo2/CCR/PAT_780_CCR_V1_0_17.xml"33 ;s ok=$$gtmImportFile^%zewdHTMLParser(zfilepath)34 s ok=$$LOAD(zfilepath) ;load the XML file to the EWD global35 s ok=$$parseDocument^%zewdHTMLParser("DerekDOM",0)36 ;s ok=$$parseXMLFile^%zewdAPI(zfilepath,"fourthDOM")37 w ok,!38 q39 ;40 LOAD(filepath) ; load an xml file into the EWD global for DOM processing41 ; need to call s error=$$parseDocument^%zewdHTMLParser(docName,isHTML)42 ; after to process it to the DOM - isHTML=0 for XML files43 n i44 i $g(^%ZISH)["" d QUIT i ; if VistA Kernal routine %ZISH exists - gpl 2/23/0945 . n zfile,zpath,ztmp,zok s (zfile,zpath,ztmp)=""46 . s zfile=$re($p($re(filepath),"/",1)) ;file name47 . s zpath=$p(filepath,zfile,1) ; file path48 . s ztmp=$na(^CacheTempEWD($j,0))49 . s zok=$$FTG^%ZISH(zpath,zfile,ztmp,2) ; import the file increment subscr 250 . s i=$o(^CacheTempEWD($j,""),-1) ; highest line number51 q i52 ;53 Q(ZQ,ZD) ; SEND QUERY ZQ TO DOM ZD AND DIPLAY NODES RETURNED54 I '$D(ZD) S ZD="DerekDOM"55 s error=$$select^%zewdXPath(ZQ,ZD,.nodes) ;56 d displayNodes^%zewdXPath(.nodes)57 q58 ;59 GET1URL0(URL) ;60 s ok=$$httpGET^%zewdGTM(URL,.gpl)61 D INDEX^C0CXPATH("gpl","gpl2")62 W !,"S URL=""",URL,"""",!63 S G=""64 F S G=$O(gpl2(G)) Q:G="" D ;65 . W " S VDX(""",G,""")=""",gpl2(G),"""",!66 W !67 Q1 C0CEWD1 ; CCDCCR/GPL - CCR FILEMAN utilities; 12/6/08 2 ;;0.1;CCDCCR;nopatch;noreleasedate;Build 1 3 ;Copyright 2009 George Lilly. Licensed under the terms of the GNU 4 ;General Public License See attached copy of the License. 5 ; 6 ;This program is free software; you can redistribute it and/or modify 7 ;it under the terms of the GNU General Public License as published by 8 ;the Free Software Foundation; either version 2 of the License, or 9 ;(at your option) any later version. 10 ; 11 ;This program is distributed in the hope that it will be useful, 12 ;but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ;GNU General Public License for more details. 15 ; 16 ;You should have received a copy of the GNU General Public License along 17 ;with this program; if not, write to the Free Software Foundation, Inc., 18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 ; 20 Q 21 ; 22 TEST(filepath) ; filepath IS THE PATH/FILE TO BE READ IN 23 i $g(^%ZISH)["" d ; if the VistA Kernal routine %ZISH exists 24 . n zfile,zpath,ztmp s (zfile,zpath,ztmp)="" 25 . s zfile=$re($p($re(filepath),"/",1)) ;file name 26 . s zpath=$p(filepath,zfile,1) ; file path 27 . s ztmp=$na(^CacheTempEWD($j,0)) 28 . s ok=$$FTG^%ZISH(zpath,zfile,ztmp,2) ; import the file incrementing subscr 2 29 q 30 ; 31 TEST2 ; 32 s zfilepath="/home/vademo2/CCR/PAT_780_CCR_V1_0_17.xml" 33 ;s ok=$$gtmImportFile^%zewdHTMLParser(zfilepath) 34 s ok=$$LOAD(zfilepath) ;load the XML file to the EWD global 35 s ok=$$parseDocument^%zewdHTMLParser("DerekDOM",0) 36 ;s ok=$$parseXMLFile^%zewdAPI(zfilepath,"fourthDOM") 37 w ok,! 38 q 39 ; 40 LOAD(filepath) ; load an xml file into the EWD global for DOM processing 41 ; need to call s error=$$parseDocument^%zewdHTMLParser(docName,isHTML) 42 ; after to process it to the DOM - isHTML=0 for XML files 43 n i 44 i $g(^%ZISH)["" d QUIT i ; if VistA Kernal routine %ZISH exists - gpl 2/23/09 45 . n zfile,zpath,ztmp,zok s (zfile,zpath,ztmp)="" 46 . s zfile=$re($p($re(filepath),"/",1)) ;file name 47 . s zpath=$p(filepath,zfile,1) ; file path 48 . s ztmp=$na(^CacheTempEWD($j,0)) 49 . s zok=$$FTG^%ZISH(zpath,zfile,ztmp,2) ; import the file increment subscr 2 50 . s i=$o(^CacheTempEWD($j,""),-1) ; highest line number 51 q i 52 ; 53 Q(ZQ,ZD) ; SEND QUERY ZQ TO DOM ZD AND DIPLAY NODES RETURNED 54 I '$D(ZD) S ZD="DerekDOM" 55 s error=$$select^%zewdXPath(ZQ,ZD,.nodes) ; 56 d displayNodes^%zewdXPath(.nodes) 57 q 58 ; 59 GET1URL0(URL) ; 60 s ok=$$httpGET^%zewdGTM(URL,.gpl) 61 D INDEX^C0CXPATH("gpl","gpl2") 62 W !,"S URL=""",URL,"""",! 63 S G="" 64 F S G=$O(gpl2(G)) Q:G="" D ; 65 . W " S VDX(""",G,""")=""",gpl2(G),"""",! 66 W ! 67 Q
Note:
See TracChangeset
for help on using the changeset viewer.
