1 | C0CEVC ; CCDCCR/GPL - SUPPORT FOR EWD VISTCOM PAGES ; 3/1/2010
|
---|
2 | ;;1.0;C0C;;Mar 1, 2010;
|
---|
3 | gpltest2 ; experiment with sending a CCR to an ewd page
|
---|
4 | N ZI
|
---|
5 | S ZI=""
|
---|
6 | D PSEUDO
|
---|
7 | N ZIO
|
---|
8 | S ZIO=IO
|
---|
9 | S IO="/dev/null"
|
---|
10 | OPEN IO
|
---|
11 | U IO
|
---|
12 | N G
|
---|
13 | S G=$$URLTOKEN^C0CEWD
|
---|
14 | D CCRRPC^C0CCCR(.GPL,2)
|
---|
15 | S IO=ZIO
|
---|
16 | OPEN IO
|
---|
17 | U IO
|
---|
18 | K GPL(0)
|
---|
19 | F S ZI=$O(GPL(ZI)) Q:ZI="" W GPL(ZI),!
|
---|
20 | Q
|
---|
21 | ;
|
---|
22 | gpltest ; experiment with sending a CCR to an ewd page
|
---|
23 | N ZI
|
---|
24 | S ZI=""
|
---|
25 | K ^GPL(0)
|
---|
26 | S ^GPL(2)="<?xml-stylesheet type=""text/xsl"" href=""/resources/ccr.xsl""?>"
|
---|
27 | F S ZI=$O(^GPL(ZI)) Q:ZI="" W ^GPL(ZI),!
|
---|
28 | Q
|
---|
29 | ;
|
---|
30 | TEST(sessid);
|
---|
31 | d setSessionValue^%zewdAPI("person.Name","Rob",sessid)
|
---|
32 | d setSessionValue^%zewdAPI("person.DateOfBirth","13/06/55",sessid)
|
---|
33 | d setSessionValue^%zewdAPI("person.Address.PostCode","SW1 3QA",sessid)
|
---|
34 | d setSessionValue^%zewdAPI("person.Address.Line1","1 The Street",sessid)
|
---|
35 | d setSessionValue^%zewdAPI("person.Address.2.hello","world",sessid)
|
---|
36 | d setJSONValue^%zewdAPI("json","person",sessid)
|
---|
37 | Q ""
|
---|
38 |
|
---|
39 | PARSE(INXML,INDOC) ;CALL THE EWD PARSER ON INXML, PASSED BY NAME
|
---|
40 | ; INDOC IS PASSED AS THE DOCUMENT NAME TO EWD
|
---|
41 | ; EXTRINSIC WHICH RETURNS THE DOCID ASSIGNED BY EWD
|
---|
42 | N ZR
|
---|
43 | M ^CacheTempEWD($j)=@INXML ;
|
---|
44 | S ZR=$$parseDocument^%zewdHTMLParser(INDOC)
|
---|
45 | Q ZR
|
---|
46 | ;
|
---|
47 | TEST2(sessid) ; try to put a ccr in the session
|
---|
48 | S U="^"
|
---|
49 | D PSEUDO ; FAKE LOGIN
|
---|
50 | S ZIO=$IO
|
---|
51 | S DEV="/dev/null"
|
---|
52 | O DEV U DEV
|
---|
53 | N G
|
---|
54 | N ZDFN
|
---|
55 | S ZDFN=$$getSessionValue^%zewdAPI("vista.dfn",sessid)
|
---|
56 | I ZDFN="" S ZDFN=2
|
---|
57 | ;K ^TMP("GPL")
|
---|
58 | ;M ^TMP("GPL")=^%zewdSession("session",sessid)
|
---|
59 | D CCRRPC^C0CCCR(.GPL,ZDFN)
|
---|
60 | K GPL(0)
|
---|
61 | S GPL(2)="<?xml-stylesheet type=""text/xsl"" href=""/resources/ccr.xsl""?>"
|
---|
62 | C DEV U ZIO
|
---|
63 | ;M ^CacheTempEWD($j)=GPL
|
---|
64 | S DOCNAME="CCR"
|
---|
65 | ;ZWR GPL
|
---|
66 | ;S ZR=$$parseDocument^%zewdHTMLParser(DOCNAME)
|
---|
67 | ;d setSessionValues^%zewdAPI(DOCNAME,GPL,sessid)
|
---|
68 | d mergeArrayToSession^%zewdAPI(.GPL,DOCNAME,sessid)
|
---|
69 | Q ""
|
---|
70 | ;
|
---|
71 | INITSES(sessid) ;initialize an EWD/CPRS session
|
---|
72 | K ^TMP("GPL")
|
---|
73 | ;M ^TMP("GPL")=^%zewdSession("session",sessid)
|
---|
74 | N ZT,ZDFN
|
---|
75 | S ZT=$$URLTOKEN^C0CEWD(sessid)
|
---|
76 | ;S ^TMP("GPL")=ZT
|
---|
77 | d trace^%zewdAPI("*********************ZT="_ZT)
|
---|
78 | S ZDFN=$$PRSEORTK(ZT) ; PARSE THE TOKEN AND LOOK UP THE DFN
|
---|
79 | S ^TMP("GPL","DFN")=ZDFN
|
---|
80 | I ZDFN=0 S DFN=2 ; DEFAULT TEST PATIENT
|
---|
81 | D setSessionValue^%zewdAPI("vista.dfn",ZDFN,sessid)
|
---|
82 | ;M ^TMP("GPL","request")=requestArray
|
---|
83 | ;D PSEUDO
|
---|
84 | ;D ^%ZTER
|
---|
85 | q ""
|
---|
86 | ;
|
---|
87 | PRSEORTK(ZTOKEN) ;PARSES THE TOKEN SENT BY CPRS AND RETURNS THE DFN
|
---|
88 | ; OF THE PATIENT ; HERE'S WHAT THE TOKEN LOOKS LIKE:
|
---|
89 | ; ^TMP('ORWCHART',6547,'192.168.169.8',002E0FE6)
|
---|
90 | N ZX,ZN1,ZIP,ZN2,ZDFN,ZG
|
---|
91 | S ZDFN=0 ; DEFAULT RETURN
|
---|
92 | S ZN1=$P(ZTOKEN,",",2) ; FIRST NUMBER
|
---|
93 | S ZIP=$P(ZTOKEN,",",3) ; IP NUMBER
|
---|
94 | S ZIP=$P(ZIP,"'",2) ; GET RID OF '
|
---|
95 | S ZN2=$P(ZTOKEN,",",4) ; SECOND NUMBER
|
---|
96 | S ZN2=$P(ZN2,")",1) ; GET RID OF )
|
---|
97 | S ZG=$NA(^TMP("ORWCHART",ZN1,ZIP,ZN2)) ; BUILD THE GLOBAL NAME
|
---|
98 | I $G(@ZG)'="" S ZDFN=@ZG ; ACCESS THE GLOBAL
|
---|
99 | S ^TMP("GPL","FIRSTDFN")=ZDFN
|
---|
100 | S ^TMP("GPL","FIRSTGLB")=ZG
|
---|
101 | Q ZDFN
|
---|
102 | ;
|
---|
103 | GETPATIENTLIST(sessid) ;
|
---|
104 | D PSEUDO
|
---|
105 | D LISTALL^ORWPT(.RTN,"NAME","1")
|
---|
106 | N ZI
|
---|
107 | S ZI=""
|
---|
108 | F S ZI=$O(RTN(ZI)) Q:ZI="" D ;
|
---|
109 | . S data(ZI,"DFN")=$P(RTN(ZI),"^",1)
|
---|
110 | . S data(ZI,"Name")=$P(RTN(ZI),"^",2)
|
---|
111 | ; ZWR data
|
---|
112 | ;S data(1,"DFN")=$P(RTN(1),"^",1)
|
---|
113 | ;S data(1,"Name")=$P(RTN(1),"^",2)
|
---|
114 | d deleteFromSession^%zewdAPI("patients",sessid)
|
---|
115 | d createDataTableStore^%zewdYUIRuntime(.data,"patients",sessid)
|
---|
116 | ;d mergeArrayToSession^%zewdAPI(.data,"patients",sessid)
|
---|
117 | Q ""
|
---|
118 | ;
|
---|
119 | PSEUDO
|
---|
120 | S U="^"
|
---|
121 | S DILOCKTM=3
|
---|
122 | S DISYS=19
|
---|
123 | S DT=3100219
|
---|
124 | S DTIME=999
|
---|
125 | S DUZ=10
|
---|
126 | S DUZ(0)="@"
|
---|
127 | S DUZ(1)=""
|
---|
128 | S DUZ(2)=1
|
---|
129 | S DUZ("AG")="V"
|
---|
130 | S DUZ("BUF")=1
|
---|
131 | S DUZ("LANG")=""
|
---|
132 | ;S IO="/dev/pts/2"
|
---|
133 | ;S IO(0)="/dev/pts/2"
|
---|
134 | ;S IO(1,"/dev/pts/2")=""
|
---|
135 | ;S IO("ERROR")=""
|
---|
136 | ;S IO("HOME")="41^/dev/pts/2"
|
---|
137 | ;S IO("ZIO")="/dev/pts/2"
|
---|
138 | ;S IOBS="$C(8)"
|
---|
139 | ;S IOF="#,$C(27,91,50,74,27,91,72)"
|
---|
140 | ;S SIOM=80
|
---|
141 | Q
|
---|
142 | ;
|
---|
143 | PSEUDO2 ; FAKE LOGIN SETS SOME LOCAL VARIABLE TO FOOL FILEMAN
|
---|
144 | S DILOCKTM=3
|
---|
145 | S DISYS=19
|
---|
146 | S DT=3100112
|
---|
147 | S DTIME=9999
|
---|
148 | S DUZ=10000000020
|
---|
149 | S DUZ(0)="@"
|
---|
150 | S DUZ(1)=""
|
---|
151 | S DUZ(2)=67
|
---|
152 | S DUZ("AG")="E"
|
---|
153 | S DUZ("BUF")=1
|
---|
154 | S DUZ("LANG")=1
|
---|
155 | S IO="/dev/pts/0"
|
---|
156 | ;S IO(0)="/dev/pts/0"
|
---|
157 | ;S IO(1,"/dev/pts/0")=""
|
---|
158 | ;S IO("ERROR")=""
|
---|
159 | ;S IO("HOME")="50^/dev/pts/0"
|
---|
160 | ;S IO("ZIO")="/dev/pts/0"
|
---|
161 | ;S IOBS="$C(8)"
|
---|
162 | ;S IOF="!!!!!!!!!!!!!!!!!!!!!!!!,#,$C(27,91,50,74,27,91,72)"
|
---|
163 | ;S IOM=80
|
---|
164 | ;S ION="GTM/UNIX TELNET"
|
---|
165 | ;S IOS=50
|
---|
166 | ;S IOSL=24
|
---|
167 | ;S IOST="C-VT100"
|
---|
168 | ;S IOST(0)=9
|
---|
169 | ;S IOT="VTRM"
|
---|
170 | ;S IOXY="W $C(27,91)_((DY+1))_$C(59)_((DX+1))_$C(72)"
|
---|
171 | S U="^"
|
---|
172 | S X="1;DIC(4.2,"
|
---|
173 | S XPARSYS="1;DIC(4.2,"
|
---|
174 | S XQXFLG="^^XUP"
|
---|
175 | S Y="DEV^VISTA^hollywood^VISTA:hollywood"
|
---|
176 | Q
|
---|
177 | ;
|
---|