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

PRCHAM8.m

Go to the documentation of this file.
  1. PRCHAM8 ;WISC/RHD,AKS-AMENDMENTS TO P.O. ASKER & SIGNER ;
  1. V ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ASK(PRCHPO,PRCHAN) ;Ask user for their Esig
  1. ;USAGE: $$ASK^PRCHAM8(PODA,AN)
  1. ;PRCHPO is internal PO number
  1. ;PRCHAN is internal amendment number
  1. ;RETURN is the return value passed back to caller, 0=FAIL 1=SUCCESS
  1. ;P is the pointer of who was assigned to the amendment
  1. ;PNAM is the name of the person identified by P in file 200
  1. N P,PRCSIG,ROUTINE
  1. S RETURN=0,P=+$G(^PRC(443.6,PRCHPO,6,PRCHAN,1))
  1. I P<1 W !?5,"Purchasing Agent Field is undefined !",$C(7) Q RETURN
  1. I P'=DUZ D Q RETURN
  1. .N PNAM S PNAM=$P($G(^VA(200,P,0)),"^",1)
  1. .W !?5,PNAM," was assigned to this Amendment."
  1. .W !?5,"Either have them sign the Amendment or"
  1. .W !?5,"reassign the Amendment to yourself.",$C(7)
  1. .Q
  1. S PRCSIG="" D ESIG^PRCUESIG(P,.PRCSIG) I PRCSIG<1 W !?5,"<NO ACTION TAKEN>" S ROUTINE="PRCUESIG" D QQ Q RETURN
  1. S RETURN=1
  1. Q RETURN
  1. ;
  1. COMMIT(PRCHPO,PRCHAN,RETURN) ;put on validation code
  1. ;USAGE: D COMMIT^PRCHAM8(PODA,AN,.Y) then check Y value
  1. ;PRCHPO is internal PO number
  1. ;PRCHAN is internal amendment number
  1. ;RETURN is the return value passed back to caller, 0=FAIL 1=SUCCESS
  1. ;DO NOT 'NEW' THE VARIABLE 'RETURN' IN HERE
  1. ; SINCE IT IS PASSED BACK TO CALLING ROUTINE!
  1. N PRCSUM,PRCSIG,ROUTINE
  1. S RETURN=0
  1. Q:'$D(^PRC(442,PRCHPO,0)) RETURN
  1. Q:'$D(^PRC(443.6,PRCHPO,0)) RETURN
  1. S PRCSUM=$$SUM^PRCUESIG(PRCHPO_"^"_$$STRING^PRCHES5(^PRC(442,PRCHPO,0),^PRC(442,PRCHPO,1),^PRC(442,PRCHPO,12)))
  1. S PRCSIG="" D ENCODE^PRCHES10(PRCHPO,PRCHAN,DUZ,.PRCSIG) S ROUTINE="PRCHMA" I PRCSIG<1 G QQ
  1. ;S X=$P(^PRC(443.6,PRCHPO,6,PRCHAN,1),U,4) S:X]"" $P(^PRC(443.6,PRCHPO,7),U,1)=X
  1. S PRCSIG="" D RECODE^PRCHES12(PRCHPO,PRCSUM,.PRCSIG) S ROUTINE="PRCHMA" I PRCSIG<1 G QQ
  1. S RETURN=1
  1. Q
  1. ;
  1. QQ ;error reporter
  1. N DIR
  1. S:'$D(ROUTINE) ROUTINE=$T(+0)
  1. W !!,$$ERR^PRCHQQ(ROUTINE,PRCSIG) W:PRCSIG=0!(PRCSIG=-3) !,"Notify Application Coordinator!"
  1. S DIR(0)="EAO",DIR("A")="Press <Return> to continue " D ^DIR
  1. Q