source: ccr/trunk/p/C0CEWD.m@ 1056

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

updates to EWD utilities for vistacom

File size: 2.1 KB
Line 
1C0CEWD ; CCDCCR/GPL - CCR EWD utilities; 1/6/11
2 ;;0.1;CCDCCR;nopatch;noreleasedate
3 ;Copyright 2011 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 ;
22TOKEN() ; EXTRINSIC WHICH RETURNS A NEW RANDOM TOKEN
23 Q $$UUID^C0CUTIL ; USE THE UUID FUNCTION IN THE CCR PACKAGE
24 ;
25STORE(ZARY) ; STORE AN ARRAY OF VALUES INDEXED BY A NEW TOKEN
26 ; IN ^TMP("C0E","TOKEN") FOR LATER RETRIEVAL FROM INSIDE AN EWD SESSION
27 ; RETURNS THE TOKEN. ZARY IS PASSED BY NAME
28 N ZT
29 S ZT=$$TOKEN ; GET A NEW TOKEN
30 M ^TMP("C0E","TOKEN",ZT)=@ZARY ;
31 Q ZT
32 ;
33GET(ZRTN,ZTOKEN,NOKILL) ; RETRIEVE A STORED ARRAY INDEXED BY ZTOKEN
34 ; KILL THE ARRAY AFTER RETRIEVAL UNLESS NOKILL=1
35 ; ZRTN IS PASSED BY NAME
36 I '$D(^TMP("C0E","TOKEN",ZTOKEN)) D Q ; DOESN'T EXIST
37 . S @ZRTN="" ; PASS BACK NULL
38 M @ZRTN=^TMP("C0E","TOKEN",ZTOKEN) ; RETRIEVE
39 I $G(NOKILL)'=1 K ^TMP("C0E","TOKEN",ZTOKEN) ; DELETE
40 Q
41 ;
42cbTestMethod(prefix,seedValue,lastSeedValue,optionNo,options)
43 ;
44 n maxNo,noFound
45 ;
46 s maxNo=50
47 s noFound=0
48 f s seedValue=$o(^DPT("B",seedValue)) q:seedValue="" q:noFound=maxNo d
49 . s lastSeedValue=seedValue
50 . i prefix'="",$e(seedValue,1,$l(prefix))'=prefix q
51 . s optionNo=optionNo+1
52 . s noFound=noFound+1
53 . s options(optionNo)=seedValue
54 QUIT
55 ;
56set1 ;
57 s ^zewd("comboPlus","methodMap","test")="cbTestMethod^C0PEREW"
58 q
59 ;
60test1(sessid) ;
61 d setSessionValue^%zewdAPI("testing","ZZ",sessid)
62 q 0
63 ;
Note: See TracBrowser for help on using the repository browser.