1 | PRPFSIG ;WISC@ALTOONA/CTB/TEN-ROUTINE TO ENTER OR CHANGE ELECTRONIC SIGNATURE CODE ;7/15/97 9:56 AM
|
---|
2 | V ;;3.0;PATIENT FUNDS;**6,7**;JUNE 1, 1989
|
---|
3 | ENCODE(X,X1,X2) D EN^XUSHSHP Q X
|
---|
4 | DECODE(X,X1,X2) D DE^XUSHSHP Q X
|
---|
5 | HASH(X) D HASH^XUSHSHP Q X
|
---|
6 | SUM(X) ;CREATE CHECKSUM VALUE FOR STRING
|
---|
7 | N I,Y
|
---|
8 | S Y=0 F I=1:1:$L(X) S Y=$A(X,I)*I+Y
|
---|
9 | Q Y
|
---|
10 | ESIG(USERNUM,MESSAGE) ;interogate user for electronic signature code
|
---|
11 | ;1= valid code entered
|
---|
12 | ;0= invalid code entered
|
---|
13 | ;-1= user up arrowed out
|
---|
14 | ;-2= signature read time out
|
---|
15 | ;-3= no signature on file
|
---|
16 | NEW X,SIGCODE,ZZI,OUT
|
---|
17 | S SIGCODE=$P($G(^VA(200,USERNUM,20)),"^",4)
|
---|
18 | I SIGCODE="" W !,"You have no signature code on file. Please contact your IRM staff for assistance.",*7,! S MESSAGE=-3 QUIT
|
---|
19 | F ZZI=1:1:3 D Q:OUT]""
|
---|
20 | . K OUT
|
---|
21 | . W !,"Enter ELECTRONIC SIGNATURE CODE: "
|
---|
22 | . X ^%ZOSF("EOFF") R X:60 X ^%ZOSF("EON")
|
---|
23 | . I '$T S OUT=-2 QUIT
|
---|
24 | . I $E(X)="^" S OUT=-1 QUIT
|
---|
25 | . S X=$TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
---|
26 | . I $$HASH(X)=SIGCODE W ?60,"Thank you." S OUT=1 QUIT
|
---|
27 | . W !,"Sorry, but that's not your correct electronic signature code."
|
---|
28 | . S OUT=""
|
---|
29 | . QUIT
|
---|
30 | S MESSAGE=+$G(OUT) QUIT
|
---|
31 | ;
|
---|
32 | NOW() ;Extrinsic function to return current time
|
---|
33 | N %,%I,%H,X
|
---|
34 | D NOW^%DTC
|
---|
35 | QUIT %
|
---|