- RMPR21B ;PHX/HNB/JLT-CREATE 1358 TRANSACTION, POST TO 2319 ;8/29/1994
- ;;3.0;PROSTHETICS;**129**;Feb 09, 1996;Build 2
- ;Per VHA Directive 10-93-142, this routine should not be modified.
- FILE ;CREATE 1358 DAILY RECORD
- I RMPRF=1!(RMPRF=2) D PR^RMPR21A G:$D(DTOUT) KILL^RMPR21 I %=-1 S RMPRGO=$S(RMPRF=1:"ASK^RMPR21",1:"ASK5^RMPR21A") G @RMPRGO
- W !?5,"Posting Now ..."
- S $P(^RMPR(664,RMPRA,0),U,3)=RMPROB,$P(^(0),U,14)=RMPR("STA")
- S (R1,RMPRCT,RMPRQT,RMPRTO,RMPRI)=0
- S RMPRSH=$S($P(^RMPR(664,RMPRA,0),U,10):$P(^(0),U,10),1:"")
- F S R1=$O(^RMPR(664,RMPRA,1,R1)) Q:R1'>0 D
- .S RB=^RMPR(664,RMPRA,1,R1,0)
- .S RMPRCT=$P(RB,U,3)
- .S RMPRQT=$P(RB,U,4)
- .S RMPRR=$S($P(RB,U,8)'="":RMPRR_" "_$P(RB,U,8),1:"")
- .S RMPRTO=RMPRTO+$J(RMPRCT*RMPRQT,0,2)
- K RB
- POST S RMPRTO=$S($D(^RMPR(664,RMPRA,2)):RMPRTO-$J((RMPRTO*$P(^(2),U,6)/100),0,2),1:RMPRTO)
- I RMPRF'=10,RMPRF'=1 D CHECK^RMPRCT
- I '$D(RMPRTO) G KILL^RMPR21
- S X=RMPROB_U_DT_U_$J(RMPRTO+RMPRSH,0,2)_U_U_$E($P(RMPRNAM,",",1),1,6)_","_$E(RMPRSSN,6,9)_U_$E(RMPRR,1,60)
- S PRCS("TYPE")="FB" K DO,DD,D0
- D EN2^PRCS58 G:+Y'=1 ERROR^RMPR21
- S RMPRTN=$P(Y,U,2)
- S RMPRTRN=$P(^PRC(424,RMPRTN,0),U,1)
- M W !?5,"1358 Transaction has been assigned Number: ",RMPRTRN
- S RMPRV=$P(^RMPR(664,RMPRA,0),U,4)
- S $P(^RMPR(664,RMPRA,0),U,7)=RMPRTRN
- S $P(^RMPR(664,RMPRA,0),U,6)=PRCSCPAN
- S:'RMPRF RMPRF=9
- S RA="1:PSC;2:2421;3:2237;4:2529-3;5:2529-7;6:2474;7:2431;8:2914;9:OTHER;10:2520;11:STOCK ISSUE;12:INVENTORY ISSUE;13:HISTORICAL DATA;"
- S $P(^RMPR(664,RMPRA,2),U,4)=$P($P(RA,";",+RMPRF),":",2) K RA
- I $D(RMPRPSC) S $P(^RMPR(664,RMPRA,2),U,5)=RMPRPSC
- S:$D(RMPRDELN) $P(^RMPR(664,RMPRA,3),U)=RMPRDELN
- S DA=RMPRA,DIK="^RMPR(664," D IX1^DIK
- ;get AMIS grouper number
- L +^RMPR(669.9,RMPRSITE,0):999 I $T=0 S RMPRG=DT_99 G GGC
- S RMPRG=$P(^RMPR(669.9,RMPRSITE,0),U,7),RMPRG=RMPRG-1,$P(^(0),U,7)=RMPRG L -^RMPR(669.9,RMPRSITE,0)
- GGC S RMPRWO=$P(^RMPR(664,RMPRA,0),U,15)
- ;check for lab
- I RMPRWO,$D(^RMPR(664.2,+RMPRWO,0)) D
- .F DA=0:0 S DA=$O(^RMPR(664.2,RMPRWO,1,"AC",RMPRA,DA)) Q:DA'>0 S DIK="^RMPR(664.2,"_RMPRWO_",1,",DA(1)=RMPRWO D ^DIK
- F S B2=$O(^RMPR(664,RMPRA,1,B2)) Q:B2'>0 D R19^RMPR21C
- K RMPRDP G:RMPRSH="" NS
- K DD,DO S X=DT,DIC="^RMPR(660,",DIC(0)="LZ" D FILE^DICN S (RMPR660,DA)=+Y
- ;
- S ^RMPR(660,RMPR660,0)=DT_U_RMPRDFN_U_DT_"^X^^^^^"_RMPRV_U_RMPR("STA")_"^^^"_RMPRF_U_RMPRS_"^^^"_RMPRSH_"^^^^^",^("AMS")=RMPRG,^("AM")=U_U_RMPRDIS_U_RMPRSC,$P(^(0),U,27)=DUZ,^(1)=RMPRTRN I $D(RMPRWO),RMPRWO S $P(^("AM"),U,2)=1 D
- .I $D(^RMPR(664.2,RMPRWO,0)) S $P(^(0),U,6)=$P(^(0),U,6)+RMPRSH
- S ^RMPR(660,RMPR660,3)=$P($G(^RMPR(664,RMPRA,3)),U,4)
- S DIK="^RMPR(660," D IX1^DIK S $P(^RMPR(664,RMPRA,0),U,12)=RMPR660 K RMPRDP
- NS ;check approval
- ;D NOW^%DTC S ^RMPR(664,"AP",RMPR("STA"),%,RMPRA)="",$P(^RMPR(664,RMPRA,4),U,9)=%,$P(^(4),U,8)=1
- ;S $P(^RMPR(664,RMPRA,4),U)=DUZ,$P(^RMPR(664,RMPRA,4),U,2)=$P(^VA(200,DUZ,20),U,3)
- ;e-sig
- ;I $D(^XUSEC("RMPR WARRANT",DUZ))!($D(^XUSEC("RMPR SUPERVISOR",DUZ))) I $G(RMPRSBP)'="" D
- ;.S $P(^RMPR(664,RMPRA,4),U,3)=DUZ,$P(^(4),U,4)=RMPRSBT
- ;.S $P(^RMPR(664,RMPRA,4),U,7)=$$SUM^RMPRSEC(RMPRSBP),$P(^RMPR(664,RMPRA,4),U,6)=$$ENCODE^RMPRSEC(RMPRSBP,DUZ,1),$P(^RMPR(664,RMPRA,4),U,5)=DT
- ;.K ^RMPR(664,"AP",RMPR("STA"),$P($G(^RMPR(664,RMPRA,4)),U,9),RMPRA) S $P(^RMPR(664,RMPRA,4),U,8)=""
- W !,?5,"Updated 10-2319" G:'$D(RMPRF) EXIT^RMPR21
- Q:$D(RMPRDP) D:RMPRF=1 ^RMPRP55 D:RMPRF=2 ^RMPRP21
- ;
- I RMPRF=10 D ASK^RMPRE21
- G EXIT^RMPR21
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPR21B 3477 printed Dec 13, 2024@02:31:58 Page 2
- RMPR21B ;PHX/HNB/JLT-CREATE 1358 TRANSACTION, POST TO 2319 ;8/29/1994
- +1 ;;3.0;PROSTHETICS;**129**;Feb 09, 1996;Build 2
- +2 ;Per VHA Directive 10-93-142, this routine should not be modified.
- FILE ;CREATE 1358 DAILY RECORD
- +1 IF RMPRF=1!(RMPRF=2)
- DO PR^RMPR21A
- if $DATA(DTOUT)
- GOTO KILL^RMPR21
- IF %=-1
- SET RMPRGO=$SELECT(RMPRF=1:"ASK^RMPR21",1:"ASK5^RMPR21A")
- GOTO @RMPRGO
- +2 WRITE !?5,"Posting Now ..."
- +3 SET $PIECE(^RMPR(664,RMPRA,0),U,3)=RMPROB
- SET $PIECE(^(0),U,14)=RMPR("STA")
- +4 SET (R1,RMPRCT,RMPRQT,RMPRTO,RMPRI)=0
- +5 SET RMPRSH=$SELECT($PIECE(^RMPR(664,RMPRA,0),U,10):$PIECE(^(0),U,10),1:"")
- +6 FOR
- SET R1=$ORDER(^RMPR(664,RMPRA,1,R1))
- if R1'>0
- QUIT
- Begin DoDot:1
- +7 SET RB=^RMPR(664,RMPRA,1,R1,0)
- +8 SET RMPRCT=$PIECE(RB,U,3)
- +9 SET RMPRQT=$PIECE(RB,U,4)
- +10 SET RMPRR=$SELECT($PIECE(RB,U,8)'="":RMPRR_" "_$PIECE(RB,U,8),1:"")
- +11 SET RMPRTO=RMPRTO+$JUSTIFY(RMPRCT*RMPRQT,0,2)
- End DoDot:1
- +12 KILL RB
- POST SET RMPRTO=$SELECT($DATA(^RMPR(664,RMPRA,2)):RMPRTO-$JUSTIFY((RMPRTO*$PIECE(^(2),U,6)/100),0,2),1:RMPRTO)
- +1 IF RMPRF'=10
- IF RMPRF'=1
- DO CHECK^RMPRCT
- +2 IF '$DATA(RMPRTO)
- GOTO KILL^RMPR21
- +3 SET X=RMPROB_U_DT_U_$JUSTIFY(RMPRTO+RMPRSH,0,2)_U_U_$EXTRACT($PIECE(RMPRNAM,",",1),1,6)_","_$EXTRACT(RMPRSSN,6,9)_U_$EXTRACT(RMPRR,1,60)
- +4 SET PRCS("TYPE")="FB"
- KILL DO,DD,D0
- +5 DO EN2^PRCS58
- if +Y'=1
- GOTO ERROR^RMPR21
- +6 SET RMPRTN=$PIECE(Y,U,2)
- +7 SET RMPRTRN=$PIECE(^PRC(424,RMPRTN,0),U,1)
- M WRITE !?5,"1358 Transaction has been assigned Number: ",RMPRTRN
- +1 SET RMPRV=$PIECE(^RMPR(664,RMPRA,0),U,4)
- +2 SET $PIECE(^RMPR(664,RMPRA,0),U,7)=RMPRTRN
- +3 SET $PIECE(^RMPR(664,RMPRA,0),U,6)=PRCSCPAN
- +4 if 'RMPRF
- SET RMPRF=9
- +5 SET RA="1:PSC;2:2421;3:2237;4:2529-3;5:2529-7;6:2474;7:2431;8:2914;9:OTHER;10:2520;11:STOCK ISSUE;12:INVENTORY ISSUE;13:HISTORICAL DATA;"
- +6 SET $PIECE(^RMPR(664,RMPRA,2),U,4)=$PIECE($PIECE(RA,";",+RMPRF),":",2)
- KILL RA
- +7 IF $DATA(RMPRPSC)
- SET $PIECE(^RMPR(664,RMPRA,2),U,5)=RMPRPSC
- +8 if $DATA(RMPRDELN)
- SET $PIECE(^RMPR(664,RMPRA,3),U)=RMPRDELN
- +9 SET DA=RMPRA
- SET DIK="^RMPR(664,"
- DO IX1^DIK
- +10 ;get AMIS grouper number
- +11 LOCK +^RMPR(669.9,RMPRSITE,0):999
- IF $TEST=0
- SET RMPRG=DT_99
- GOTO GGC
- +12 SET RMPRG=$PIECE(^RMPR(669.9,RMPRSITE,0),U,7)
- SET RMPRG=RMPRG-1
- SET $PIECE(^(0),U,7)=RMPRG
- LOCK -^RMPR(669.9,RMPRSITE,0)
- GGC SET RMPRWO=$PIECE(^RMPR(664,RMPRA,0),U,15)
- +1 ;check for lab
- +2 IF RMPRWO
- IF $DATA(^RMPR(664.2,+RMPRWO,0))
- Begin DoDot:1
- +3 FOR DA=0:0
- SET DA=$ORDER(^RMPR(664.2,RMPRWO,1,"AC",RMPRA,DA))
- if DA'>0
- QUIT
- SET DIK="^RMPR(664.2,"_RMPRWO_",1,"
- SET DA(1)=RMPRWO
- DO ^DIK
- End DoDot:1
- +4 FOR
- SET B2=$ORDER(^RMPR(664,RMPRA,1,B2))
- if B2'>0
- QUIT
- DO R19^RMPR21C
- +5 KILL RMPRDP
- if RMPRSH=""
- GOTO NS
- +6 KILL DD,DO
- SET X=DT
- SET DIC="^RMPR(660,"
- SET DIC(0)="LZ"
- DO FILE^DICN
- SET (RMPR660,DA)=+Y
- +7 ;
- +8 SET ^RMPR(660,RMPR660,0)=DT_U_RMPRDFN_U_DT_"^X^^^^^"_RMPRV_U_RMPR("STA")_"^^^"_RMPRF_U_RMPRS_"^^^"_RMPRSH_"^^^^^"
- SET ^("AMS")=RMPRG
- SET ^("AM")=U_U_RMPRDIS_U_RMPRSC
- SET $PIECE(^(0),U,27)=DUZ
- SET ^(1)=RMPRTRN
- IF $DATA(RMPRWO)
- IF RMPRWO
- SET $PIECE(^("AM"),U,2)=1
- Begin DoDot:1
- +9 IF $DATA(^RMPR(664.2,RMPRWO,0))
- SET $PIECE(^(0),U,6)=$PIECE(^(0),U,6)+RMPRSH
- End DoDot:1
- +10 SET ^RMPR(660,RMPR660,3)=$PIECE($GET(^RMPR(664,RMPRA,3)),U,4)
- +11 SET DIK="^RMPR(660,"
- DO IX1^DIK
- SET $PIECE(^RMPR(664,RMPRA,0),U,12)=RMPR660
- KILL RMPRDP
- NS ;check approval
- +1 ;D NOW^%DTC S ^RMPR(664,"AP",RMPR("STA"),%,RMPRA)="",$P(^RMPR(664,RMPRA,4),U,9)=%,$P(^(4),U,8)=1
- +2 ;S $P(^RMPR(664,RMPRA,4),U)=DUZ,$P(^RMPR(664,RMPRA,4),U,2)=$P(^VA(200,DUZ,20),U,3)
- +3 ;e-sig
- +4 ;I $D(^XUSEC("RMPR WARRANT",DUZ))!($D(^XUSEC("RMPR SUPERVISOR",DUZ))) I $G(RMPRSBP)'="" D
- +5 ;.S $P(^RMPR(664,RMPRA,4),U,3)=DUZ,$P(^(4),U,4)=RMPRSBT
- +6 ;.S $P(^RMPR(664,RMPRA,4),U,7)=$$SUM^RMPRSEC(RMPRSBP),$P(^RMPR(664,RMPRA,4),U,6)=$$ENCODE^RMPRSEC(RMPRSBP,DUZ,1),$P(^RMPR(664,RMPRA,4),U,5)=DT
- +7 ;.K ^RMPR(664,"AP",RMPR("STA"),$P($G(^RMPR(664,RMPRA,4)),U,9),RMPRA) S $P(^RMPR(664,RMPRA,4),U,8)=""
- +8 WRITE !,?5,"Updated 10-2319"
- if '$DATA(RMPRF)
- GOTO EXIT^RMPR21
- +9 if $DATA(RMPRDP)
- QUIT
- if RMPRF=1
- DO ^RMPRP55
- if RMPRF=2
- DO ^RMPRP21
- +10 ;
- +11 IF RMPRF=10
- DO ASK^RMPRE21
- +12 GOTO EXIT^RMPR21