source: FOIAVistA/trunk/r/DRUG_ACCOUNTABILITY-PSA/PSALOGON.m@ 914

Last change on this file since 914 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1PSALOGON ;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 ;
9SIGNON 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
14VERIFY 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 ;
26SEND D SET^XUS1A(PSAMSG)
27 ;
28EXIT K PSACNTP,PSACNTV,PSACTRL,PSAINV,PSAMSG,PSAORD
29 Q
Note: See TracBrowser for help on using the repository browser.