source: ccr/trunk/p/C0CEWD1.m@ 790

Last change on this file since 790 was 404, checked in by George Lilly, 16 years ago

update copyright notice

File size: 2.3 KB
RevLine 
[387]1C0CEWD1 ; CCDCCR/GPL - CCR FILEMAN utilities; 12/6/08
2 ;;0.1;CCDCCR;nopatch;noreleasedate
[404]3 ;Copyright 2009 George Lilly. Licensed under the terms of the GNU
[387]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 ;
22TEST(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 ;
31TEST2 ;
[393]32 s zfilepath="/home/vademo2/CCR/PAT_780_CCR_V1_0_17.xml"
[387]33 ;s ok=$$gtmImportFile^%zewdHTMLParser(zfilepath)
34 s ok=$$LOAD(zfilepath) ;load the XML file to the EWD global
[404]35 s ok=$$parseDocument^%zewdHTMLParser("DerekDOM",0)
[387]36 ;s ok=$$parseXMLFile^%zewdAPI(zfilepath,"fourthDOM")
37 w ok,!
38 q
39 ;
40LOAD(filepath) ; load an xml file into the EWD global for DOM processing
[404]41 ; need to call s error=$$parseDocument^%zewdHTMLParser(docName,isHTML)
[387]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 ;
53Q(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 ;
Note: See TracBrowser for help on using the repository browser.