Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSALOGON

PSALOGON.m

Go to the documentation of this file.
  1. PSALOGON ;BIR/JMB-Logon Utility ;7/23/97
  1. ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;; 10/24/97
  1. ;This routine displays the number of invoices the user needs to process
  1. ;or verify when the user signs on the system. The PSALOGON option needs
  1. ;to be placed on the system that the users signon to. Then PSA ORDERS
  1. ;ALERT option needs to be added as an item to the XU USER SIGN-ON
  1. ;option.
  1. ;
  1. SIGNON Q:'$D(^XUSEC("PSA ORDERS",DUZ))
  1. S (PSACNTP,PSACTRL)=0
  1. F S PSACTRL=$O(^XTMP("PSAPV",PSACTRL)) Q:'PSACTRL D
  1. .Q:'$D(^XTMP("PSAPV",PSACTRL,"IN"))
  1. .S:$P(^XTMP("PSAPV",PSACTRL,"IN"),"^",8)'="P" PSACNTP=PSACNTP+1
  1. VERIFY S (PSACNTV,PSAORD)=0
  1. F S PSAORD=$O(^PSD(58.811,"ASTAT","P",PSAORD)) Q:'PSAORD D
  1. .S PSAINV=0 F S PSAINV=$O(^PSD(58.811,"ASTAT","P",PSAORD,PSAINV)) Q:'PSAINV D
  1. ..Q:+$P($G(^PSD(58.811,PSAORD,1,PSAINV,0)),"^",10)=DUZ
  1. ..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
  1. ..S PSACNTV=PSACNTV+1
  1. G:'PSACNTP&('PSACNTV) EXIT
  1. 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
  1. I PSACNTP S:PSACNTP>1 PSAMSG="!There are "_PSACNTP_" invoices to process." S:PSACNTP=1 PSAMSG="!There is 1 invoice to process." G SEND
  1. I PSACNTV S:PSACNTV>1 PSAMSG="!There are "_PSACNTV_" invoices to verify." S:PSACNTV=1 PSAMSG="!There is 1 invoice to verify." G SEND
  1. Q
  1. ;
  1. SEND D SET^XUS1A(PSAMSG)
  1. ;
  1. EXIT K PSACNTP,PSACNTV,PSACTRL,PSAINV,PSAMSG,PSAORD
  1. Q