RTRPT1 ;MJK/TROY ISC - Borrower Request Report;4/19/2017 10:45 AM
;;2.0;Record Tracking;**47**;10/22/91 ;Build 12
W ! S DIC="^RTV(195.9,",DIC(0)="IAEMQ",DIC("S")="I $P(^(0),U,3)="_+RTAPL,DIC("A")="Select Borrower: " D ^DIC K DIC G Q:Y<0
S RTB=+Y,RTVAR="RTAPL^RTB"_$S($D(RTTY):"^RTTY",1:"")_$S($D(RTQDC("S")):"^RTQDC(""S"")",1:""),RTPGM="START^RTRPT1" D ZIS^RTUTL G Q:POP D START G RTRPT1
;
START U IO K ^TMP($J),RTS,RTC,RTC1,RTX S RTC1=0,U="^",RTPAGE=0,RTPCE=9 D WINDOW^RTRPT K RTPCE
F I=0:0 S I=$O(^RTV(190.1,"ABOR",RTB,I)) Q:'I I $D(^RTV(190.1,I,0)),$D(^RT(+^(0),0)),$S('$D(RTTY):1,$P(^(0),"^",3)=+RTTY:1,1:0),$P(^(0),"^",4)=+RTAPL S I1=+^RTV(190.1,I,0) D SORT
D HD I RTC1 D REC I $D(RTASK),X'="^" D SELECT^RTRPT2
W:'RTC1 !!?3,"No '",$S($D(RTTY):$P($P(RTTY,"^"),";",2),1:$P($P(RTAPL,"^"),";",2)),"' requests pending for this borrower."
I $E(IOST,1,2)="C-",'$D(RTASK),$S('RTC1:1,1:RTLC>0),($Y+5)>IOSL W !!,"Press RETURN to continue: " R X:DTIME
Q K RTPGM,RTVAR,RTPAGE,B1,RTP,RTP1,RTASK,RTLC,RTB,RTTPH,RTC1,D,D1,T,V,O,I,^TMP($J) D CLOSE^RTUTL Q
;
SORT I $D(RTQDC("S")) S Y=I,X=^RTV(190.1,I,0) X RTQDC("S") Q:'$T
Q:'$D(^RT(I1,0)) S V=999-$P(^(0),"^",7),O=$S($D(^DIC(195.2,+$P(^(0),"^",3),0)):+$P(^(0),"^",4),1:0) Q:'O S RT=I1 D DEMOS^RTUTL1 K RT
S B1="" I $D(^RTV(195.9,+$P(X,"^",14),0)) S Y=$P(^(0),"^") D NAME^RTB S B1=Y
S ^TMP($J,O,RTD("N"),V,+$P(X,"^",4))=I_"^"_$P(RTD("T")," (V",1)_"^"_(999-V)_"^"_RTD("N")_"^"_$S($P(X,"^",10):"*",1:"")_"^"_B1_"^"_$E($TR(RTD("SSN"),"-"),6,9)
S RTC1=RTC1+1 W:$D(RTASK) "." K RTD Q
;
REC S RTC=0 F O=0:0 S O=$O(^TMP($J,O)) Q:'O D LINE^RTUTL3:RTC S RTP="%" F RTP1=0:0 S RTP=$O(^TMP($J,O,RTP)) Q:RTP="" D VOL G RECQ:X="^"
RECQ Q
;
VOL F V=0:0 S V=$O(^TMP($J,O,RTP,V)) Q:'V F D=0:0 S D=$O(^TMP($J,O,RTP,V,D)) Q:'D S X=^(D),RTC=RTC+1,RTS(RTC)=+X D PRT Q:X="^"
Q
;
PRT S RTLC=RTLC+1 W !,RTC,?3,$E($P(X,"^",2),1,19),?21,"V",$P(X,"^",3),?26,$E($P(X,"^",4),1,18),?44,$P(X,"^",5) S Y=D D D^DIQ W ?45,Y,?65,$E($P(X,"^",6),1,15),!?26,$P(X,U,7)
I $D(^RTV(190.1,+X,"COMMENT")) S RTLC=RTLC+1 W !?3,"(Comment: ",^("COMMENT"),")"
S X=^RT(+^RTV(190.1,+X,0),0),RTHD="HD^RTRPT1" D PRT1^RTRPT2 K RTHD Q
;
HD S X="**** "_$S($D(RTTY):$P($P(RTTY,"^"),";",2),1:$P($P(RTAPL,"^"),";",2))_" Requests Pending for Borrower ****" D HD1^RTRPT2
W !,"* - indicates request is part of a pull list"
W !!,?26,$S($P(RTAPL,"^",9)]"":$P(RTAPL,"^",9),1:"???")
W !?3,"Record Type",?21,"Vol",?26,"Last 4/SSN",?45,"Date/Time Needed",?65,"Associated Reqr"
W !?3,"-----------",?21,"---",?26,"------------------",?45,"-------------------",?65,"---------------"
S RTLC=$Y Q
;
PEND ;Entry point for pending request only
S RTQDC("S")="S Z=^(0) I $P(Z,U,6)=""r""!($P(Z,U,6)=""n""),$D(^RT(+Z,0)),$D(RTWND(+$P(^(0),U,3))),RTWND(+$P(^(0),U,3))'>$P(Z,U,4)" D RTRPT1 K RTQDC,RTWND
K N,P,RTC,RTS,IO("Q"),SSN,X,Y,I1,DUOUT Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRTRPT1 2877 printed Oct 16, 2024@18:35:22 Page 2
RTRPT1 ;MJK/TROY ISC - Borrower Request Report;4/19/2017 10:45 AM
+1 ;;2.0;Record Tracking;**47**;10/22/91 ;Build 12
+2 WRITE !
SET DIC="^RTV(195.9,"
SET DIC(0)="IAEMQ"
SET DIC("S")="I $P(^(0),U,3)="_+RTAPL
SET DIC("A")="Select Borrower: "
DO ^DIC
KILL DIC
if Y<0
GOTO Q
+3 SET RTB=+Y
SET RTVAR="RTAPL^RTB"_$SELECT($DATA(RTTY):"^RTTY",1:"")_$SELECT($DATA(RTQDC("S")):"^RTQDC(""S"")",1:"")
SET RTPGM="START^RTRPT1"
DO ZIS^RTUTL
if POP
GOTO Q
DO START
GOTO RTRPT1
+4 ;
START USE IO
KILL ^TMP($JOB),RTS,RTC,RTC1,RTX
SET RTC1=0
SET U="^"
SET RTPAGE=0
SET RTPCE=9
DO WINDOW^RTRPT
KILL RTPCE
+1 FOR I=0:0
SET I=$ORDER(^RTV(190.1,"ABOR",RTB,I))
if 'I
QUIT
IF $DATA(^RTV(190.1,I,0))
IF $DATA(^RT(+^(0),0))
IF $SELECT('$DATA(RTTY):1,$PIECE(^(0),"^",3)=+RTTY:1,1:0)
IF $PIECE(^(0),"^",4)=+RTAPL
SET I1=+^RTV(190.1,I,0)
DO SORT
+2 DO HD
IF RTC1
DO REC
IF $DATA(RTASK)
IF X'="^"
DO SELECT^RTRPT2
+3 if 'RTC1
WRITE !!?3,"No '",$SELECT($DATA(RTTY):$PIECE($PIECE(RTTY,"^"),";",2),1:$PIECE($PIECE(RTAPL,"^"),";",2)),"' requests pending for this borrower."
+4 IF $EXTRACT(IOST,1,2)="C-"
IF '$DATA(RTASK)
IF $SELECT('RTC1:1,1:RTLC>0)
IF ($Y+5)>IOSL
WRITE !!,"Press RETURN to continue: "
READ X:DTIME
Q KILL RTPGM,RTVAR,RTPAGE,B1,RTP,RTP1,RTASK,RTLC,RTB,RTTPH,RTC1,D,D1,T,V,O,I,^TMP($JOB)
DO CLOSE^RTUTL
QUIT
+1 ;
SORT IF $DATA(RTQDC("S"))
SET Y=I
SET X=^RTV(190.1,I,0)
XECUTE RTQDC("S")
if '$TEST
QUIT
+1 if '$DATA(^RT(I1,0))
QUIT
SET V=999-$PIECE(^(0),"^",7)
SET O=$SELECT($DATA(^DIC(195.2,+$PIECE(^(0),"^",3),0)):+$PIECE(^(0),"^",4),1:0)
if 'O
QUIT
SET RT=I1
DO DEMOS^RTUTL1
KILL RT
+2 SET B1=""
IF $DATA(^RTV(195.9,+$PIECE(X,"^",14),0))
SET Y=$PIECE(^(0),"^")
DO NAME^RTB
SET B1=Y
+3 SET ^TMP($JOB,O,RTD("N"),V,+$PIECE(X,"^",4))=I_"^"_$PIECE(RTD("T")," (V",1)_"^"_(999-V)_"^"_RTD("N")_"^"_$SELECT($PIECE(X,"^",10):"*",1:"")_"^"_B1_"^"_$EXTRACT($TRANSLATE(RTD("SSN"),"-"),6,9)
+4 SET RTC1=RTC1+1
if $DATA(RTASK)
WRITE "."
KILL RTD
QUIT
+5 ;
REC SET RTC=0
FOR O=0:0
SET O=$ORDER(^TMP($JOB,O))
if 'O
QUIT
if RTC
DO LINE^RTUTL3
SET RTP="%"
FOR RTP1=0:0
SET RTP=$ORDER(^TMP($JOB,O,RTP))
if RTP=""
QUIT
DO VOL
if X="^"
GOTO RECQ
RECQ QUIT
+1 ;
VOL FOR V=0:0
SET V=$ORDER(^TMP($JOB,O,RTP,V))
if 'V
QUIT
FOR D=0:0
SET D=$ORDER(^TMP($JOB,O,RTP,V,D))
if 'D
QUIT
SET X=^(D)
SET RTC=RTC+1
SET RTS(RTC)=+X
DO PRT
if X="^"
QUIT
+1 QUIT
+2 ;
PRT SET RTLC=RTLC+1
WRITE !,RTC,?3,$EXTRACT($PIECE(X,"^",2),1,19),?21,"V",$PIECE(X,"^",3),?26,$EXTRACT($PIECE(X,"^",4),1,18),?44,$PIECE(X,"^",5)
SET Y=D
DO D^DIQ
WRITE ?45,Y,?65,$EXTRACT($PIECE(X,"^",6),1,15),!?26,$PIECE(X,U,7)
+1 IF $DATA(^RTV(190.1,+X,"COMMENT"))
SET RTLC=RTLC+1
WRITE !?3,"(Comment: ",^("COMMENT"),")"
+2 SET X=^RT(+^RTV(190.1,+X,0),0)
SET RTHD="HD^RTRPT1"
DO PRT1^RTRPT2
KILL RTHD
QUIT
+3 ;
HD SET X="**** "_$SELECT($DATA(RTTY):$PIECE($PIECE(RTTY,"^"),";",2),1:$PIECE($PIECE(RTAPL,"^"),";",2))_" Requests Pending for Borrower ****"
DO HD1^RTRPT2
+1 WRITE !,"* - indicates request is part of a pull list"
+2 WRITE !!,?26,$SELECT($PIECE(RTAPL,"^",9)]"":$PIECE(RTAPL,"^",9),1:"???")
+3 WRITE !?3,"Record Type",?21,"Vol",?26,"Last 4/SSN",?45,"Date/Time Needed",?65,"Associated Reqr"
+4 WRITE !?3,"-----------",?21,"---",?26,"------------------",?45,"-------------------",?65,"---------------"
+5 SET RTLC=$Y
QUIT
+6 ;
PEND ;Entry point for pending request only
+1 SET RTQDC("S")="S Z=^(0) I $P(Z,U,6)=""r""!($P(Z,U,6)=""n""),$D(^RT(+Z,0)),$D(RTWND(+$P(^(0),U,3))),RTWND(+$P(^(0),U,3))'>$P(Z,U,4)"
DO RTRPT1
KILL RTQDC,RTWND
+2 KILL N,P,RTC,RTS,IO("Q"),SSN,X,Y,I1,DUOUT
QUIT