PRCHED ;WISC/RHD,AKS-EDIT ROUTINES FOR SUPPLY SYSTEM--LOG CODE SHEETS ;10/30/92 1:55 PM
V ;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
;
EN1 ;CREATE ISSUE REQUEST LOG CODE SHEETS
D ST
EN01 Q:'$D(PRC("SITE")) S DIC="^PRC(443,",DIC(0)="AEQMZ",DIC("A")="Select TRANSACTION NUMBER: "
S DIC("S")="I $P(^(0),U,3)]"""",$D(^PRCS(410,+Y,0)),+^(0)=PRC(""SITE""),$P(^(0),U,2)=""O"",$P(^(0),U,4)=5,$D(^(""IT"",""AB""))" D ^DIC K DIC G:Y'>0 Q S PRCHR=+Y
;
EN11 ;ENTRY POINT IF CALLED
I $D(^PRCS(410,PRCHR,100)),$P(^(100),U,5)]"" D ERR G EN01
;LOOP THRU ITEMS TO FIND NSN'S
F PRCHIT=0:0 S PRCHIT=$O(^PRCS(410,PRCHR,"IT",PRCHIT)) Q:'PRCHIT I ^(PRCHIT,0) S PRCHPRN=$P(^(0),U,5) I 'PRCHPRN W !!,$C(7),"There is no Repetitive (PR Card) Number for Line Item # "_$P(^(0),U,1)_".",!!?16,"** CANNOT CONTINUE! **" K PRCHR Q
G:'$D(PRCHR) Q
S PRCHTYP="I",PRCHKEY=$P(^PRCS(410,PRCHR,0),U,1) W !!!
S PRCFA("DICS")="I Y=661!(Y=662)!(Y=663)!(Y=666)!(Y=671)!(Y=669)"
K PRCFA("TTF") S PRCFA("TT")=663 D GT G:'% EN01
S PRCHCP=+$P(PRCHKEY,"-",4),PRCHCP=$S($L(PRCHCP)=2:"0"_PRCHCP,1:PRCHCP)
I '$D(^PRC(420,PRC("SITE"),1,+PRCHCP,0)) S PRCHCP="ER" G Q
S PRCHCPN=+PRCHCP
I $L(PRCHCP)'=3 S PRCHCP=$S($P(^PRC(420,PRC("SITE"),1,+PRCHCP,0),U,12)=1:"GPF",$P(^(0),U,12)=3:"",1:"ER") G Q:PRCHCP="ER"
I PRCHCP="" D CP
;S PRCHDPT=$S($D(^PRC(420,PRC("SITE"),1,PRCHCPN,0)):$P($P(^(0),U,18)," ",1),1:"")
S PRCHDPT=$P($P($G(^PRC(420,PRC("SITE"),1,PRCHCPN,0)),U,18)," ",1)
I PRCHDPT="" W !!,$C(7),"THIS CONTROL POINT HAS NO LOG DEPT #, YOU CANNOT PROCEED!" G Q
D EDIT G:'$D(^PRCS(410,DA,100)) EN01 S X=^(100) I $P(X,U,1)=""!($P(X,U,3)="")!($P(X,U,8)="") W $C(7),!!,"YOU MUST FILL IN ALL THIS DATA TO GENERATE THE LOG CODE SHEETS!!" G EN01
D EN^PRCHCS6,^PRCHCS3
G EN01
;
Q I $D(PRCHCP) W:PRCHCP="ER" !,"THIS IS NOT A VALID CONTROL POINT, YOU CANNOT PROCEED!",$C(7)
K PRCHCS,PRCHCP,PRCHCPN,PRCHTP,PRCHAMT,PRCHRPT,PRCHRD,PRCHCMI,PRCHFA,PRCHLOG,PRCHDIET,PRCHDPT,PRCHDRD,PRCHDT,PRCHDTP,PRCHKEY,PRCHN,PRCHNM,PRCHREQ,PRCHTYP
Q
;
CP W !!,"This Special Control Point is CASCA/CANTEEN.",!
;
C1 R "Select ""OGA"" or ""CTN"": ",PRCHCP:DTIME
I PRCHCP["^" S PRCHCP="ER" G Q
S PRCHCP=$S(PRCHCP["O":"OGA",PRCHCP["C":"CTN",1:"")
I PRCHCP="" W !!,"Enter ""O"" for Other Goverment Agencies, or ""C"" for Canteen.",!! G C1
Q
;
EDIT S PRCHMO=$E(DT,4,5),DIE="^PRCS(410,",DA=PRCHR
S DR="66//"_PRCHDPT_";57;59//"_$S(PRCHMO="10":"0",PRCHMO="11":"J",PRCHMO="12":"K",1:+PRCHMO)_";I $E(PRCHDPT,1,2)'=""11"" S Y="""";58//"_$S($P(DT,6,7)>15:2,1:2) D ^DIE
S:$D(^PRCS(410,DA,100)) PRCHDPT=$P(^(100),U,8)
Q
;
ST S PRCF("X")="S" D ^PRCFSITE
Q
;
GT S PRCHLOG=1 D TT^PRCFAC Q:'% S PRCFA("TTF")=PRCFA("TT")
K PRCHTP S PRCHTP(1)="410,"_PRCHR_",^PRCS(410,",PRCHTP(2)="410.02,PRCHLI,^PRCS(410,"_PRCHR_",""IT"","
Q
;
ERR W !?3,"LOG code sheets already created and signed. Use Edit A Code Sheet option.",$C(7)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCHED 2970 printed Dec 13, 2024@02:07:10 Page 2
PRCHED ;WISC/RHD,AKS-EDIT ROUTINES FOR SUPPLY SYSTEM--LOG CODE SHEETS ;10/30/92 1:55 PM
V ;;5.1;IFCAP;;Oct 20, 2000
+1 ;Per VHA Directive 10-93-142, this routine should not be modified.
+2 ;
EN1 ;CREATE ISSUE REQUEST LOG CODE SHEETS
+1 DO ST
EN01 if '$DATA(PRC("SITE"))
QUIT
SET DIC="^PRC(443,"
SET DIC(0)="AEQMZ"
SET DIC("A")="Select TRANSACTION NUMBER: "
+1 SET DIC("S")="I $P(^(0),U,3)]"""",$D(^PRCS(410,+Y,0)),+^(0)=PRC(""SITE""),$P(^(0),U,2)=""O"",$P(^(0),U,4)=5,$D(^(""IT"",""AB""))"
DO ^DIC
KILL DIC
if Y'>0
GOTO Q
SET PRCHR=+Y
+2 ;
EN11 ;ENTRY POINT IF CALLED
+1 IF $DATA(^PRCS(410,PRCHR,100))
IF $PIECE(^(100),U,5)]""
DO ERR
GOTO EN01
+2 ;LOOP THRU ITEMS TO FIND NSN'S
+3 FOR PRCHIT=0:0
SET PRCHIT=$ORDER(^PRCS(410,PRCHR,"IT",PRCHIT))
if 'PRCHIT
QUIT
IF ^(PRCHIT,0)
SET PRCHPRN=$PIECE(^(0),U,5)
IF 'PRCHPRN
WRITE !!,$CHAR(7),"There is no Repetitive (PR Card) Number for Line Item # "_$PIECE(^(0),U,1)_".",!!?16,"** CANNOT CONTINUE! **"
KILL PRCHR
QUIT
+4 if '$DATA(PRCHR)
GOTO Q
+5 SET PRCHTYP="I"
SET PRCHKEY=$PIECE(^PRCS(410,PRCHR,0),U,1)
WRITE !!!
+6 SET PRCFA("DICS")="I Y=661!(Y=662)!(Y=663)!(Y=666)!(Y=671)!(Y=669)"
+7 KILL PRCFA("TTF")
SET PRCFA("TT")=663
DO GT
if '%
GOTO EN01
+8 SET PRCHCP=+$PIECE(PRCHKEY,"-",4)
SET PRCHCP=$SELECT($LENGTH(PRCHCP)=2:"0"_PRCHCP,1:PRCHCP)
+9 IF '$DATA(^PRC(420,PRC("SITE"),1,+PRCHCP,0))
SET PRCHCP="ER"
GOTO Q
+10 SET PRCHCPN=+PRCHCP
+11 IF $LENGTH(PRCHCP)'=3
SET PRCHCP=$SELECT($PIECE(^PRC(420,PRC("SITE"),1,+PRCHCP,0),U,12)=1:"GPF",$PIECE(^(0),U,12)=3:"",1:"ER")
if PRCHCP="ER"
GOTO Q
+12 IF PRCHCP=""
DO CP
+13 ;S PRCHDPT=$S($D(^PRC(420,PRC("SITE"),1,PRCHCPN,0)):$P($P(^(0),U,18)," ",1),1:"")
+14 SET PRCHDPT=$PIECE($PIECE($GET(^PRC(420,PRC("SITE"),1,PRCHCPN,0)),U,18)," ",1)
+15 IF PRCHDPT=""
WRITE !!,$CHAR(7),"THIS CONTROL POINT HAS NO LOG DEPT #, YOU CANNOT PROCEED!"
GOTO Q
+16 DO EDIT
if '$DATA(^PRCS(410,DA,100))
GOTO EN01
SET X=^(100)
IF $PIECE(X,U,1)=""!($PIECE(X,U,3)="")!($PIECE(X,U,8)="")
WRITE $CHAR(7),!!,"YOU MUST FILL IN ALL THIS DATA TO GENERATE THE LOG CODE SHEETS!!"
GOTO EN01
+17 DO EN^PRCHCS6
DO ^PRCHCS3
+18 GOTO EN01
+19 ;
Q IF $DATA(PRCHCP)
if PRCHCP="ER"
WRITE !,"THIS IS NOT A VALID CONTROL POINT, YOU CANNOT PROCEED!",$CHAR(7)
+1 KILL PRCHCS,PRCHCP,PRCHCPN,PRCHTP,PRCHAMT,PRCHRPT,PRCHRD,PRCHCMI,PRCHFA,PRCHLOG,PRCHDIET,PRCHDPT,PRCHDRD,PRCHDT,PRCHDTP,PRCHKEY,PRCHN,PRCHNM,PRCHREQ,PRCHTYP
+2 QUIT
+3 ;
CP WRITE !!,"This Special Control Point is CASCA/CANTEEN.",!
+1 ;
C1 READ "Select ""OGA"" or ""CTN"": ",PRCHCP:DTIME
+1 IF PRCHCP["^"
SET PRCHCP="ER"
GOTO Q
+2 SET PRCHCP=$SELECT(PRCHCP["O":"OGA",PRCHCP["C":"CTN",1:"")
+3 IF PRCHCP=""
WRITE !!,"Enter ""O"" for Other Goverment Agencies, or ""C"" for Canteen.",!!
GOTO C1
+4 QUIT
+5 ;
EDIT SET PRCHMO=$EXTRACT(DT,4,5)
SET DIE="^PRCS(410,"
SET DA=PRCHR
+1 SET DR="66//"_PRCHDPT_";57;59//"_$SELECT(PRCHMO="10":"0",PRCHMO="11":"J",PRCHMO="12":"K",1:+PRCHMO)_";I $E(PRCHDPT,1,2)'=""11"" S Y="""";58//"_$SELECT($PIECE(DT,6,7)>15:2,1:2)
DO ^DIE
+2 if $DATA(^PRCS(410,DA,100))
SET PRCHDPT=$PIECE(^(100),U,8)
+3 QUIT
+4 ;
ST SET PRCF("X")="S"
DO ^PRCFSITE
+1 QUIT
+2 ;
GT SET PRCHLOG=1
DO TT^PRCFAC
if '%
QUIT
SET PRCFA("TTF")=PRCFA("TT")
+1 KILL PRCHTP
SET PRCHTP(1)="410,"_PRCHR_",^PRCS(410,"
SET PRCHTP(2)="410.02,PRCHLI,^PRCS(410,"_PRCHR_",""IT"","
+2 QUIT
+3 ;
ERR WRITE !?3,"LOG code sheets already created and signed. Use Edit A Code Sheet option.",$CHAR(7)
+1 QUIT