source: ccr/trunk/p/C0CEVC.m@ 1736

Last change on this file since 1736 was 1586, checked in by Sam Habiel, 12 years ago

Changed license to AGPL. Some clean-up for XINDEX

  • Property svn:mergeinfo set to (toggle deleted branches)
    /ccr/branches/ohum/o-old/p/C0CEVC.m1290
    /ccr/branches/ohum/p/C0CEVC.m1291-1543
    /ccr/branches/ohum/p/p/C0CEVC.m1287-1289
File size: 5.1 KB
Line 
1C0CEVC ; CCDCCR/GPL - SUPPORT FOR EWD VISTCOM PAGES ; 3/1/2010
2 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 50
3 ;
4 ; (C) Geroge Lilly 2010.
5 ;
6 ; This program is free software: you can redistribute it and/or modify
7 ; it under the terms of the GNU Affero General Public License as
8 ; published by the Free Software Foundation, either version 3 of the
9 ; License, or (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 Affero General Public License for more details.
15 ;
16 ; You should have received a copy of the GNU Affero General Public License
17 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ;
19gpltest2 ; experiment with sending a CCR to an ewd page
20 N ZI
21 S ZI=""
22 D PSEUDO
23 N ZIO
24 S ZIO=IO
25 S IO="/dev/null"
26 OPEN IO
27 U IO
28 N G
29 S G=$$URLTOKEN^C0CEWD
30 D CCRRPC^C0CCCR(.GPL,2)
31 S IO=ZIO
32 OPEN IO
33 U IO
34 K GPL(0)
35 F S ZI=$O(GPL(ZI)) Q:ZI="" W GPL(ZI),!
36 Q
37 ;
38gpltest ; experiment with sending a CCR to an ewd page
39 N ZI
40 S ZI=""
41 K ^GPL(0)
42 S ^GPL(2)="<?xml-stylesheet type=""text/xsl"" href=""/resources/ccr.xsl""?>"
43 F S ZI=$O(^GPL(ZI)) Q:ZI="" W ^GPL(ZI),!
44 Q
45 ;
46TEST(sessid);
47 d setSessionValue^%zewdAPI("person.Name","Rob",sessid)
48 d setSessionValue^%zewdAPI("person.DateOfBirth","13/06/55",sessid)
49 d setSessionValue^%zewdAPI("person.Address.PostCode","SW1 3QA",sessid)
50 d setSessionValue^%zewdAPI("person.Address.Line1","1 The Street",sessid)
51 d setSessionValue^%zewdAPI("person.Address.2.hello","world",sessid)
52 d setJSONValue^%zewdAPI("json","person",sessid)
53 Q ""
54
55PARSE(INXML,INDOC) ;CALL THE EWD PARSER ON INXML, PASSED BY NAME
56 ; INDOC IS PASSED AS THE DOCUMENT NAME TO EWD
57 ; EXTRINSIC WHICH RETURNS THE DOCID ASSIGNED BY EWD
58 N ZR
59 M ^CacheTempEWD($j)=@INXML ;
60 S ZR=$$parseDocument^%zewdHTMLParser(INDOC)
61 Q ZR
62 ;
63TEST2(sessid) ; try to put a ccr in the session
64 S U="^"
65 D PSEUDO ; FAKE LOGIN
66 S ZIO=$IO
67 S DEV="/dev/null"
68 O DEV U DEV
69 N G
70 N ZDFN
71 S ZDFN=$$getSessionValue^%zewdAPI("vista.dfn",sessid)
72 I ZDFN="" S ZDFN=2
73 ;K ^TMP("GPL")
74 ;M ^TMP("GPL")=^%zewdSession("session",sessid)
75 D CCRRPC^C0CCCR(.GPL,ZDFN)
76 K GPL(0)
77 S GPL(2)="<?xml-stylesheet type=""text/xsl"" href=""/resources/ccr.xsl""?>"
78 C DEV U ZIO
79 ;M ^CacheTempEWD($j)=GPL
80 S DOCNAME="CCR"
81 ;ZWR GPL
82 ;S ZR=$$parseDocument^%zewdHTMLParser(DOCNAME)
83 ;d setSessionValues^%zewdAPI(DOCNAME,GPL,sessid)
84 d mergeArrayToSession^%zewdAPI(.GPL,DOCNAME,sessid)
85 Q ""
86 ;
87INITSES(sessid) ;initialize an EWD/CPRS session
88 K ^TMP("GPL")
89 ;M ^TMP("GPL")=^%zewdSession("session",sessid)
90 N ZT,ZDFN
91 S ZT=$$URLTOKEN^C0CEWD(sessid)
92 ;S ^TMP("GPL")=ZT
93 d trace^%zewdAPI("*********************ZT="_ZT)
94 S ZDFN=$$PRSEORTK(ZT) ; PARSE THE TOKEN AND LOOK UP THE DFN
95 S ^TMP("GPL","DFN")=ZDFN
96 I ZDFN=0 S DFN=2 ; DEFAULT TEST PATIENT
97 D setSessionValue^%zewdAPI("vista.dfn",ZDFN,sessid)
98 ;M ^TMP("GPL","request")=requestArray
99 ;D PSEUDO
100 ;D ^%ZTER
101 q ""
102 ;
103PRSEORTK(ZTOKEN) ;PARSES THE TOKEN SENT BY CPRS AND RETURNS THE DFN
104 ; OF THE PATIENT ; HERE'S WHAT THE TOKEN LOOKS LIKE:
105 ; ^TMP('ORWCHART',6547,'192.168.169.8',002E0FE6)
106 N ZX,ZN1,ZIP,ZN2,ZDFN,ZG
107 S ZDFN=0 ; DEFAULT RETURN
108 S ZN1=$P(ZTOKEN,",",2) ; FIRST NUMBER
109 S ZIP=$P(ZTOKEN,",",3) ; IP NUMBER
110 S ZIP=$P(ZIP,"'",2) ; GET RID OF '
111 S ZN2=$P(ZTOKEN,",",4) ; SECOND NUMBER
112 S ZN2=$P(ZN2,")",1) ; GET RID OF )
113 S ZG=$NA(^TMP("ORWCHART",ZN1,ZIP,ZN2)) ; BUILD THE GLOBAL NAME
114 I $G(@ZG)'="" S ZDFN=@ZG ; ACCESS THE GLOBAL
115 S ^TMP("GPL","FIRSTDFN")=ZDFN
116 S ^TMP("GPL","FIRSTGLB")=ZG
117 Q ZDFN
118 ;
119GETPATIENTLIST(sessid) ;
120 D PSEUDO
121 D LISTALL^ORWPT(.RTN,"NAME","1")
122 N ZI
123 S ZI=""
124 F S ZI=$O(RTN(ZI)) Q:ZI="" D ;
125 . S data(ZI,"DFN")=$P(RTN(ZI),"^",1)
126 . S data(ZI,"Name")=$P(RTN(ZI),"^",2)
127 ; ZWR data
128 ;S data(1,"DFN")=$P(RTN(1),"^",1)
129 ;S data(1,"Name")=$P(RTN(1),"^",2)
130 d deleteFromSession^%zewdAPI("patients",sessid)
131 d createDataTableStore^%zewdYUIRuntime(.data,"patients",sessid)
132 ;d mergeArrayToSession^%zewdAPI(.data,"patients",sessid)
133 Q ""
134 ;
135PSEUDO
136 S U="^"
137 S DILOCKTM=3
138 S DISYS=19
139 S DT=3100219
140 S DTIME=999
141 S DUZ=10
142 S DUZ(0)="@"
143 S DUZ(1)=""
144 S DUZ(2)=1
145 S DUZ("AG")="V"
146 S DUZ("BUF")=1
147 S DUZ("LANG")=""
148 ;S IO="/dev/pts/2"
149 ;S IO(0)="/dev/pts/2"
150 ;S IO(1,"/dev/pts/2")=""
151 ;S IO("ERROR")=""
152 ;S IO("HOME")="41^/dev/pts/2"
153 ;S IO("ZIO")="/dev/pts/2"
154 ;S IOBS="$C(8)"
155 ;S IOF="#,$C(27,91,50,74,27,91,72)"
156 ;S SIOM=80
157 Q
158 ;
159PSEUDO2 ; FAKE LOGIN SETS SOME LOCAL VARIABLE TO FOOL FILEMAN
160 S DILOCKTM=3
161 S DISYS=19
162 S DT=3100112
163 S DTIME=9999
164 S DUZ=10000000020
165 S DUZ(0)="@"
166 S DUZ(1)=""
167 S DUZ(2)=67
168 S DUZ("AG")="E"
169 S DUZ("BUF")=1
170 S DUZ("LANG")=1
171 S IO="/dev/pts/0"
172 ;S IO(0)="/dev/pts/0"
173 ;S IO(1,"/dev/pts/0")=""
174 ;S IO("ERROR")=""
175 ;S IO("HOME")="50^/dev/pts/0"
176 ;S IO("ZIO")="/dev/pts/0"
177 ;S IOBS="$C(8)"
178 ;S IOF="!!!!!!!!!!!!!!!!!!!!!!!!,#,$C(27,91,50,74,27,91,72)"
179 ;S IOM=80
180 ;S ION="GTM/UNIX TELNET"
181 ;S IOS=50
182 ;S IOSL=24
183 ;S IOST="C-VT100"
184 ;S IOST(0)=9
185 ;S IOT="VTRM"
186 ;S IOXY="W $C(27,91)_((DY+1))_$C(59)_((DX+1))_$C(72)"
187 S U="^"
188 S X="1;DIC(4.2,"
189 S XPARSYS="1;DIC(4.2,"
190 S XQXFLG="^^XUP"
191 S Y="DEV^VISTA^hollywood^VISTA:hollywood"
192 Q
193 ;
Note: See TracBrowser for help on using the repository browser.