source: ePrescribing/trunk/p/C0PEWD4.m@ 1604

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

initial release of ePrescribing

File size: 4.6 KB
RevLine 
[1595]1C0PEWD4 ; CCDCCR/GPL - ePrescription utilities; 4/24/09 ; 5/8/12 10:23pm
2 ;;1.0;C0P;;Apr 25, 2012;Build 103
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 ; TEST Lines below not intended for End Users. Programmers only.
22 ; BEWARE ZWRITE SYNTAX. It may not work in other M Implementations.
23gpltest ; experiment with sending a CCR to an ewd page
24 N ZI
25 S ZI=""
26 W "HELLO WORLD!",!
27 Q 1
28 F S ZI=$O(^GPL(ZI)) Q:ZI="" W ^GPL(ZI)
29 Q
30 ;
31TESTSSL ;
32 s URL="https://preproduction.newcropaccounts.com/InterfaceV7/NewrxFDB.xml"
33 D GET1URL(URL) ;
34 Q
35 ;
36TEST2 ;
37 ; httpPOST(url,payload,mimeType,html,headerArray,timeout,test,rawResponse,respHeaders,sslHost,sslPort)
38 ;
39 s URL="http://preproduction.newcropaccounts.com/InterfaceV7/Doctor.xml"
40 D GET1URL(URL) ;
41 s gpl4(2)="<NCScript xmlns=""http://secure.newcropaccounts.com/interfaceV7"""
42 s g1="xmlns:NCStandard="
43 s g2="""http://secure.newcropaccounts.com/interfaceV7:NCStandard"""
44 s gpl4(2)=gpl4(2)_" "_g1_g2
45 s gpl4(2)=gpl4(2)_" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">"
46 k gpl4(0) ; array size node
47 s gpl4(3)="<Account ID=""demo"">"
48 s gpl4(40)="<Location ID=""DEMOLOC1"">"
49 s gpl4(28)="<LicensedPrescriber ID=""DEMOLP1"">"
50 s gpl4(55)="<Patient ID=""DEMOPT1"">"
51 W $$OUTPUT^C0CXPATH("gpl4(1)","NewCropV7-DOCTOR.xml","/home/dev/CCR/"),!
52 S ok=$$httpPOST^%zewdGTM("https://preproduction.newcropaccounts.com/InterfaceV7/RxEntry.aspx",.gpl4,"Content-Type: text/html",.gpl6,"","",.gpl5,.gpl7)
53 ZWRITE gpl6
54 q
55 ;
56TEST3 ;
57 ; httpPOST(url,payload,mimeType,html,headerArray,timeout,test,rawResponse,respHeaders,sslHost,sslPort)
58 ;
59 s URL="http://preproduction.newcropaccounts.com/InterfaceV7/Doctor.xml"
60 D GET1URL(URL) ;
61 N I,J
62 S J=$O(gpl(""),-1) ; count of things in gpl
63 F I=1:1:J S gpl(I)=$$CLEAN^C0PEWDU(gpl(I))
64 K gpl(0)
65 S gpl(1)="RxInput="_gpl(1)
66 S url="https://preproduction.newcropaccounts.com/InterfaceV7/RxEntry.aspx"
67 W $$OUTPUT^C0CXPATH("gpl(1)","NewCropV7-DOCTOR2.xml","/home/dev/CCR/"),!
68 ; S ok=$$httpPOST^%zewdGTM("https://preproduction.newcropaccounts.com/InterfaceV7/RxEntry.aspx",.gpl,"application/x-www-form-urlencoded",.gpl6,"","",.gpl5,.gpl7)
69 S ok=$$httpPOST^%zewdGTM("https://preproduction.newcropaccounts.com/InterfaceV7/ComposeRX.aspx",.gpl,"application/x-www-form-urlencoded",.gpl6,"","",.gpl5,.gpl7)
70 ZWRITE gpl6
71 q
72 ;
73TEST ;
74 ;s URL="https://preproduction.newcropaccounts.com/InterfaceV7/NewrxFDB.xml"
75 ; D GET1URL(URL) ;
76 ;Q
77 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/NCScript-RegisterLP.xml"
78 D GET1URL(URL)
79 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/GenTestRenewalFDB.xml"
80 D GET1URL(URL)
81 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/NewrxFDB.xml"
82 D GET1URL(URL)
83 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/NewrxRxNorm.xml"
84 D GET1URL(URL)
85 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/NewrxExternalDrugOpt1.xml"
86 D GET1URL(URL)
87 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/NewrxExternalDrugOpt2.xml"
88 D GET1URL(URL)
89 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/RenewalResponseAccept.xml"
90 D GET1URL(URL)
91 S URL="http://preproduction.newcropaccounts.com/InterfaceV7/RenewalResponseDeny.xml"
92 D GET1URL(URL)
93 Q
94 ;
95GET1URL0(URL) ;
96 s ok=$$httpGET^%zewdGTM(URL,.gpl)
97 D INDEX^C0CXPATH("gpl","gpl2")
98 W !,"S URL=""",URL,"""",!
99 S G=""
100 F S G=$O(gpl2(G)) Q:G="" D ;
101 . W " S VDX(""",G,""")=""",gpl2(G),"""",!
102 W !
103 Q
104 ;
105GET1URL(URL) ;
106 s ok=$$httpGET^%zewdGTM(URL,.gpl)
107 W "XML retrieved from Web Service:",!
108 ZWRITE gpl
109 D INDEX^C0CXPATH("gpl","gpl2",-1,"gplTEMP")
110 W "VDX array displayed as a prototype Mumps routine:",!
111 W !,"S URL=""",URL,"""",!
112 S G=""
113 F S G=$O(gpl2(G)) Q:G="" D ;
114 . W " S VDX(""",G,""")=""",gpl2(G),"""",!
115 W !
116 D VDX2XPG^C0CXPATH("gpl3","gpl2")
117 W "Conversion of VDX array to XPG format:",!
118 ZWRITE gpl3
119 W "Conversion of XPG array to XML:",!
120 D XPG2XML^C0CXPATH("gpl4","gpl3")
121 ZWRITE gpl4
122 Q
123 ;
Note: See TracBrowser for help on using the repository browser.