source: ccr/branches/ohum/p/C0CEVC.m@ 1325

Last change on this file since 1325 was 1325, checked in by George Lilly, 13 years ago

latest ohum update

File size: 4.3 KB
Line 
1C0CEVC ; CCDCCR/GPL - SUPPORT FOR EWD VISTCOM PAGES ; 3/1/2010
2 ;;1.0;C0C;;Mar 1, 2010;
3gpltest2 ; 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 ;
22gpltest ; 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 ;
30TEST(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
39PARSE(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 ;
47TEST2(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 ;
71INITSES(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 S ZDFN=$$PRSEORTK(ZT) ; PARSE THE TOKEN AND LOOK UP THE DFN
78 S ^TMP("GPL","DFN")=ZDFN
79 I ZDFN=0 S DFN=2 ; DEFAULT TEST PATIENT
80 D setSessionValue^%zewdAPI("vista.dfn",ZDFN,sessid)
81 ;M ^TMP("GPL","request")=requestArray
82 ;D PSEUDO
83 ;D ^%ZTER
84 q ""
85 ;
86PRSEORTK(ZTOKEN) ;PARSES THE TOKEN SENT BY CPRS AND RETURNS THE DFN
87 ; OF THE PATIENT ; HERE'S WHAT THE TOKEN LOOKS LIKE:
88 ; ^TMP('ORWCHART',6547,'192.168.169.8',002E0FE6)
89 N ZX,ZN1,ZIP,ZN2,ZDFN,ZG
90 S ZDFN=0 ; DEFAULT RETURN
91 S ZN1=$P(ZTOKEN,",",2) ; FIRST NUMBER
92 S ZIP=$P(ZTOKEN,",",3) ; IP NUMBER
93 S ZIP=$P(ZIP,"'",2) ; GET RID OF '
94 S ZN2=$P(ZTOKEN,",",4) ; SECOND NUMBER
95 S ZN2=$P(ZN2,")",1) ; GET RID OF )
96 S ZG=$NA(^TMP("ORWCHART",ZN1,ZIP,ZN2)) ; BUILD THE GLOBAL NAME
97 I $G(@ZG)'="" S ZDFN=@ZG ; ACCESS THE GLOBAL
98 S ^TMP("GPL","FIRSTDFN")=ZDFN
99 S ^TMP("GPL","FIRSTGLB")=ZG
100 Q ZDFN
101 ;
102GETPATIENTLIST(sessid) ;
103 D PSEUDO
104 D LISTALL^ORWPT(.RTN,"NAME","1")
105 N ZI
106 S ZI=""
107 F S ZI=$O(RTN(ZI)) Q:ZI="" D ;
108 . S data(ZI,"DFN")=$P(RTN(ZI),"^",1)
109 . S data(ZI,"Name")=$P(RTN(ZI),"^",2)
110 ; ZWR data
111 ;S data(1,"DFN")=$P(RTN(1),"^",1)
112 ;S data(1,"Name")=$P(RTN(1),"^",2)
113 d deleteFromSession^%zewdAPI("patients",sessid)
114 d createDataTableStore^%zewdYUIRuntime(.data,"patients",sessid)
115 ;d mergeArrayToSession^%zewdAPI(.data,"patients",sessid)
116 Q ""
117 ;
118PSEUDO
119 S U="^"
120 S DILOCKTM=3
121 S DISYS=19
122 S DT=3100219
123 S DTIME=999
124 S DUZ=10
125 S DUZ(0)="@"
126 S DUZ(1)=""
127 S DUZ(2)=1
128 S DUZ("AG")="V"
129 S DUZ("BUF")=1
130 S DUZ("LANG")=""
131 ;S IO="/dev/pts/2"
132 ;S IO(0)="/dev/pts/2"
133 ;S IO(1,"/dev/pts/2")=""
134 ;S IO("ERROR")=""
135 ;S IO("HOME")="41^/dev/pts/2"
136 ;S IO("ZIO")="/dev/pts/2"
137 ;S IOBS="$C(8)"
138 ;S IOF="#,$C(27,91,50,74,27,91,72)"
139 ;S SIOM=80
140 Q
141 ;
142PSEUDO2 ; FAKE LOGIN SETS SOME LOCAL VARIABLE TO FOOL FILEMAN
143 S DILOCKTM=3
144 S DISYS=19
145 S DT=3100112
146 S DTIME=9999
147 S DUZ=10000000020
148 S DUZ(0)="@"
149 S DUZ(1)=""
150 S DUZ(2)=67
151 S DUZ("AG")="E"
152 S DUZ("BUF")=1
153 S DUZ("LANG")=1
154 S IO="/dev/pts/0"
155 ;S IO(0)="/dev/pts/0"
156 ;S IO(1,"/dev/pts/0")=""
157 ;S IO("ERROR")=""
158 ;S IO("HOME")="50^/dev/pts/0"
159 ;S IO("ZIO")="/dev/pts/0"
160 ;S IOBS="$C(8)"
161 ;S IOF="!!!!!!!!!!!!!!!!!!!!!!!!,#,$C(27,91,50,74,27,91,72)"
162 ;S IOM=80
163 ;S ION="GTM/UNIX TELNET"
164 ;S IOS=50
165 ;S IOSL=24
166 ;S IOST="C-VT100"
167 ;S IOST(0)=9
168 ;S IOT="VTRM"
169 ;S IOXY="W $C(27,91)_((DY+1))_$C(59)_((DX+1))_$C(72)"
170 S U="^"
171 S X="1;DIC(4.2,"
172 S XPARSYS="1;DIC(4.2,"
173 S XQXFLG="^^XUP"
174 S Y="DEV^VISTA^hollywood^VISTA:hollywood"
175 Q
176 ;
Note: See TracBrowser for help on using the repository browser.