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

PRCNPPM.m

Go to the documentation of this file.
  1. PRCNPPM ;SSI/ALA-PPM Equipment Request Process ;[ 08/07/96 2:58 PM ]
  1. ;;1.0;Equipment/Turn-In Request;**10**;Sep 13, 1996
  1. REV ; Review transaction
  1. S DIC("S")="I $P(^(0),U,7)=6!($P(^(0),U,7)=27)!($P(^(0),U,7)=32)"
  1. S DIC="^PRCN(413,",DIC(0)="AEQZ",DIE=413 D ^DIC G EXIT:+Y<0 K DIC("S")
  1. S (IN,DA)=+Y,STAT=$P(^PRCN(413,DA,0),U,7),STATS="6^^27^^^32^"
  1. D CMR
  1. F PRCNUSR=1:1:7 Q:STAT=$P(STATS,U,PRCNUSR)
  1. S DR=$S(STAT=6:"[PRCNPPM]",STAT=27:"[PRCNPPM1]",1:"[PRCNPPM2]")
  1. D SETUP^PRCNPRNT,^DIE
  1. I $G(STAT)=6,$P($G(^PRCN(413,DA,4)),U)="Y" W !!,"Transaction sent to Engineering for Review",!!
  1. I $G(STAT)=9 W !!,"Transaction sent to Selected Concurring Officials for Review",!!
  1. G REV
  1. EXIT K IN,DA,STAT,STATS,PRCNUSR,DR,DIC,DIE,PRCNC,PRCN,PRCNCMR,PRCNDATA
  1. K PRCNDAT4,PROG,FL,I,%,D,D0,SERV,LPRI,OLDPRI,PRIMAX,REQ,X,J
  1. Q
  1. CMR S PRCNC=$P(^PRCN(413,DA,0),U,16),PRCNCMR=""
  1. S PRCNCMR=$P(^ENG(6914.1,PRCNC,0),U,2)_U_$P($G(^(20)),U)
  1. Q
  1. MES ; Send mail message from PPM to requestor and CMR Official
  1. I $G(PRCNCMR)="" D CMR
  1. S XMB(1)=$P(^PRCN(413,D0,0),U),XMDUZ=DUZ
  1. I MSGN'=6 D
  1. . S REQ=$P(^PRCN(413,DA,0),U,2),XMY(REQ)=""
  1. . F II=1:1 S PRCNCMN=$P(PRCNCMR,U,II) Q:PRCNCMN="" D
  1. . . I PRCNCMN'="" S XMY(PRCNCMN)=""
  1. I MSGN=6 D
  1. . NEW Y
  1. . S Y=$P(^PRCN(413,D0,5,D1,0),U,5) X ^DD("DD") S XMB(2)=Y,XMB="PRCNCONC"
  1. . NEW DA S DA=D0 D CON^PRCNMESG
  1. . S KEY="PRCNPPM" D FND^PRCNMESG
  1. . S MSG(1)=""
  1. S XMB=$S(MSGN=1:"PRCNPPM1",1:$G(XMB))
  1. I $G(CFL)=0 Q
  1. I $G(NOD)="" G MS
  1. ; Append the explanation text to end of this mail message
  1. S NL=$P($G(^PRCN(413,DA,NOD,0)),U,3)
  1. I NL'="" F II=1:1:NL S MSG(II)=$G(^PRCN(413,DA,NOD,II,0))
  1. MS S XMTEXT="MSG(" D ^XMB
  1. K NL,MSGN,II,MSG,PRCNCMN,PRCNVA1,PRCNVA2,KEY,CFL,NOD,XMB,XMTEXT
  1. K PRCNCMR,PRCN,XMDUZ
  1. Q
  1. MESG ; Display message w/number of transactions for PPM stages
  1. W !,$C(7)
  1. D WOC^PRCNTIPP
  1. NEW ERROR S ERROR=""
  1. S PJ=0 F ST=6,7,10,13,19,27,32,33,37,39 D
  1. . S NI=0 F S NI=$O(^PRCN(413,"AC",ST,NI)) Q:'+NI S STA(ST)=$G(STA(ST))+1
  1. S NXI="" F S NXI=$O(STA(NXI)) Q:NXI="" D
  1. . S TEX3=$P(^PRCN(413.5,NXI,0),U),TEX1=$S(STA(NXI)=1:"is",1:"are")
  1. . S TEX2=$S(STA(NXI)=1:"request",1:"requests")
  1. . W !,?3,"There "_TEX1_" "_STA(NXI)_" equipment "_TEX2_" "_TEX3_"."
  1. K STA S PJ=0 F ST=6,23,25 D
  1. . S NI=0 F S NI=$O(^PRCN(413.1,NI)) Q:'+NI D
  1. . . ;
  1. . . I '$D(^PRCN(413.1,NI,0)) D QUIT ;FNC-1101-30237
  1. . . . QUIT:$D(ERROR(NI)) S ERROR(NI)=""
  1. . . . W !!,?3,"There is an invalid internal entry number in the "
  1. . . . W "TURN-IN REQUEST file."
  1. . . . W !,?3,"Please call NVS to review internal entry number ",NI
  1. . . . W " in file 413.1",!
  1. . . . ;
  1. . . I $P(^PRCN(413.1,NI,0),U,7)=ST S STA(ST)=$G(STA(ST))+1
  1. . . ;
  1. W ! S NXI="" F S NXI=$O(STA(NXI)) Q:NXI="" D
  1. . S TEX3=$P(^PRCN(413.5,NXI,0),U),TEX1=$S(STA(NXI)=1:"is",1:"are")
  1. . S TEX2=$S(STA(NXI)=1:"request",1:"requests")
  1. . W !,?3,"There "_TEX1_" "_STA(NXI)_" turn-in "_TEX2_" "_TEX3_"."
  1. K PJ,ST,NI,STA,NXI,TEX1,TEX2,TEX3
  1. Q