source: ePrescribing/trunk/p/C0PEWD1.m@ 1678

Last change on this file since 1678 was 1595, checked in by George Lilly, 12 years ago

initial release of ePrescribing

File size: 3.8 KB
Line 
1C0PEWD1 ; CCDCCR/GPL - ePrescription utilities; 12/6/08 ; 5/8/12 3:57pm
2 ;;1.0;C0P;;Apr 25, 2012;Build 103
3 ;Copyright 2008 WorldVistA. 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 ; THE FOLLOWING ROUTINES ARE EXPERIMENTS USED TO TEST HTTP CALLS FROM
22 ; MUMPS USING EWD. NONE OF THE ROUTINES ARE USED FOR PROCESSING IN THE
23 ; ERX PACKAGE. THEY ARE INCLUDED AND BROUGHT FORWARD FOR USE IN DEBUGGING
24 ; AND FUTURE DEVELOPMENT
25 ; GPL JUN 2010
26 ;
27 ;TEST(filepath) ; filepath IS THE PATH/FILE TO BE READ IN
28 i $g(^%ZISH)["" d ; if the VistA Kernal routine %ZISH exists
29 . n zfile,zpath,ztmp s (zfile,zpath,ztmp)=""
30 . s zfile=$re($p($re(filepath),"/",1)) ;file name
31 . s zpath=$p(filepath,zfile,1) ; file path
32 . s ztmp=$na(^CacheTempEWD($j,0))
33 . s ok=$$FTG^%ZISH(zpath,zfile,ztmp,2) ; import the file incrementing subscr 2
34 q
35 ;
36TEST2 ;
37 s zfilepath="/home/vademo2/CCR/PAT_780_CCR_V1_0_17.xml"
38 ;s ok=$$gtmImportFile^%zewdHTMLParser(zfilepath)
39 s ok=$$LOAD(zfilepath) ;load the XML file to the EWD global
40 s ok=$$parseDocument^%zewdHTMLParser("DerekDOM",0)
41 ;s ok=$$parseXMLFile^%zewdAPI(zfilepath,"fourthDOM")
42 w ok,!
43 q
44 ;
45GPLTEST ;
46 ;s ok=$$httpGET^%zewdGTM("http://preproduction.newcropaccounts.com/InterfaceV7/NewrxFDB.xml",.gpl)
47 s URL="https://trac.opensourcevista.net/CCD-CCR-Project/browser/ccr/tags/CCR_1_0_7/output"
48 s ok=$$httpGET^%zewdGTM(URL,.gpl)
49 S ZG=""
50 F S ZG=$O(gpl(ZG)) Q:ZG="" D ;
51 . s gpl(ZG)=$$CLEAN^C0PEWDU(gpl(ZG)) ;
52 . ;w gpl(ZG)
53 m ^CacheTempEWD($j)=gpl
54 ; b
55 s ok=$$parseDocument^%zewdHTMLParser("gpl2",0)
56 s ok=$$outputDOM^%zewdDOM("gpl2",1,1)
57 Q
58 ;
59GPLTEST2 ;
60 s URL="https://preproduction.newcropaccounts.com/InterfaceV7/NewrxFDB.xml"
61 ;s URL="https://trac.opensourcevista.net/CCD-CCR-Project/browser/ccr/tags/CCR_1_0_7/output"
62 s ok=$$httpGET^%zewdGTM(URL,.gpl)
63 D INDEX^C0CXPATH("gpl","gpl2")
64 S G=""
65 F S G=$O(gpl2(G)) Q:G="" D ;
66 . W !,G," = ",gpl2(G)
67 W !
68 Q
69 ;
70CLEAN(INX) ;DELETE NON-PRINTING CHARACTER IN INX, PASSED BY VALUE
71 ;DON'T USE THIS -- IT DOESN'T WORK -- USE $$CLEAN^C0PEWDU
72 ;N ZT,ZI
73 S ZT=""
74 F ZI=32:1:126 S ZT=ZT_$CHAR(ZI)
75 S ZZ=$TR(INX,ZT)
76 Q ZZ
77 ;
78LOAD(filepath) ; load an xml file into the EWD global for DOM processing
79 ; need to call s error=$$parseDocument^%zewdHTMLParser(docName,isHTML)
80 ; after to process it to the DOM - isHTML=0 for XML files
81 n i
82 i $g(^%ZISH)["" d QUIT i ; if VistA Kernal routine %ZISH exists - gpl 2/23/09
83 . n zfile,zpath,ztmp,zok s (zfile,zpath,ztmp)=""
84 . s zfile=$re($p($re(filepath),"/",1)) ;file name
85 . s zpath=$p(filepath,zfile,1) ; file path
86 . s ztmp=$na(^CacheTempEWD($j,0))
87 . s zok=$$FTG^%ZISH(zpath,zfile,ztmp,2) ; import the file increment subscr 2
88 . s i=$o(^CacheTempEWD($j,""),-1) ; highest line number
89 q i
90 ;
91Q(ZQ,ZD) ; SEND QUERY ZQ TO DOM ZD AND DIPLAY NODES RETURNED
92 I '$D(ZD) S ZD="DerekDOM"
93 s error=$$select^%zewdXPath(ZQ,ZD,.nodes) ;
94 d displayNodes^%zewdXPath(.nodes)
95 q
96 ;
97TEST1
98 S url="https://ec2-75-101-247-83.compute-1.amazonaws.com:8181/ccr/CCRService?wsdl"
99 ;S url="http://ec2-75-101-247-83.compute-1.amazonaws.com"
100 D GET1URL^C0PEWD2(url)
101 Q
102 ;
Note: See TracBrowser for help on using the repository browser.