1 | PSALOGON ;BIR/JMB-Logon Utility ;7/23/97
|
---|
2 | ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;; 10/24/97
|
---|
3 | ;This routine displays the number of invoices the user needs to process
|
---|
4 | ;or verify when the user signs on the system. The PSALOGON option needs
|
---|
5 | ;to be placed on the system that the users signon to. Then PSA ORDERS
|
---|
6 | ;ALERT option needs to be added as an item to the XU USER SIGN-ON
|
---|
7 | ;option.
|
---|
8 | ;
|
---|
9 | SIGNON Q:'$D(^XUSEC("PSA ORDERS",DUZ))
|
---|
10 | S (PSACNTP,PSACTRL)=0
|
---|
11 | F S PSACTRL=$O(^XTMP("PSAPV",PSACTRL)) Q:'PSACTRL D
|
---|
12 | .Q:'$D(^XTMP("PSAPV",PSACTRL,"IN"))
|
---|
13 | .S:$P(^XTMP("PSAPV",PSACTRL,"IN"),"^",8)'="P" PSACNTP=PSACNTP+1
|
---|
14 | VERIFY S (PSACNTV,PSAORD)=0
|
---|
15 | F S PSAORD=$O(^PSD(58.811,"ASTAT","P",PSAORD)) Q:'PSAORD D
|
---|
16 | .S PSAINV=0 F S PSAINV=$O(^PSD(58.811,"ASTAT","P",PSAORD,PSAINV)) Q:'PSAINV D
|
---|
17 | ..Q:+$P($G(^PSD(58.811,PSAORD,1,PSAINV,0)),"^",10)=DUZ
|
---|
18 | ..I $P($G(^PSD(58.811,PSAORD,1,PSAINV,0)),"^",8)="S"!($P($G(^PSD(58.811,PSAORD,0)),"^",8)="A"),'$D(^XUSEC("PSJ RPHARM",DUZ)) Q
|
---|
19 | ..S PSACNTV=PSACNTV+1
|
---|
20 | G:'PSACNTP&('PSACNTV) EXIT
|
---|
21 | I PSACNTP,PSACNTV S PSAMSG="!There "_$S(PSACNTP>1:"are "_PSACNTP_" invoices",1:"is 1 invoice")_" to process and "_$S(PSACNTV>1:PSACNTV_" invoices",1:"1 invoice")_" to verify." G SEND
|
---|
22 | I PSACNTP S:PSACNTP>1 PSAMSG="!There are "_PSACNTP_" invoices to process." S:PSACNTP=1 PSAMSG="!There is 1 invoice to process." G SEND
|
---|
23 | I PSACNTV S:PSACNTV>1 PSAMSG="!There are "_PSACNTV_" invoices to verify." S:PSACNTV=1 PSAMSG="!There is 1 invoice to verify." G SEND
|
---|
24 | Q
|
---|
25 | ;
|
---|
26 | SEND D SET^XUS1A(PSAMSG)
|
---|
27 | ;
|
---|
28 | EXIT K PSACNTP,PSACNTV,PSACTRL,PSAINV,PSAMSG,PSAORD
|
---|
29 | Q
|
---|