source: WorldVistAEHR/trunk/r/RECORD_TRACKING-RT/RTRPT2.m@ 1476

Last change on this file since 1476 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1RTRPT2 ;MJK,JSM/TROY ISC;Records Charged by Borrower Report;21 June 1986 ; 5/4/87 10:42 AM ;
2 ;;v 2.0;Record Tracking;;10/22/91
3 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
4 S RTB=+Y,RTVAR="RTAPL^RTB^"_$S($D(RTTY):"^RTTY",1:"")_$S($D(RTDC("S")):"^RTDC(""S"")",1:""),RTPGM="START^RTRPT2" D ZIS^RTUTL G Q:POP D START G RTRPT2
5 ;
6START U IO K ^TMP($J),RTS,RTC,RTC1,RTX S RTC1=0,U="^",RTPAGE=0
7 F I=0:0 S I=$O(^RT("ABOR",RTB,I)) Q:'I I $D(^RT(I,0)),$S('$D(RTTY):1,$P(^(0),"^",3)=+RTTY:1,1:0),$P(^(0),"^",4)=+RTAPL S (RT1,Y)=I X:$D(RTDC("S")) RTDC("S") D SORT:$T!('$D(RTDC("S")))
8 D HD I RTC1 D REC I $D(RTASK),X'="^" D SELECT
9 W:'RTC1 !!?3,"No '",$S($D(RTTY):$P($P(RTTY,"^"),";",2),1:$P($P(RTAPL,"^"),";",2)),"' records charged to this borrower."
10 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
11Q K YSAV,RTVAR,RTPGM,RTPAGE,RTP,RTP1,RTASK,RTLC,RTB,RTTPH,RTC1,D,D1,T,V,O,I,^TMP($J) D CLOSE^RTUTL
12 K X1,Y,DUOUT,RTS,SSN,X,RTC,RT1,P Q
13SORT Q:'$D(^RT(I,0)) S (RT0,X)=^(0),V=999-$P(X,"^",7),O=$S($D(^DIC(195.2,+$P(X,"^",3),0)):+$P(^(0),"^",4),1:0) G SORTQ:'O S RTT0=^(0)
14 S RTCL=$S($D(^RT(I,"CL")):^("CL"),1:"") D OVER1^RTUTL1 S RTOVER=X S Y=$E($P(RTCL,"^",6),1,12) D D^DIQ S D=Y
15 S Y=$P(RT0,"^") I Y["DPT" S SSN=$E($P(^DPT(+Y,0),"^",9),6,9)
16 D NAME^RTB S ^TMP($J,O,Y,V)=I_"^"_$P(RTT0,"^")_"^"_(999-V)_"^"_SSN_"^"_Y_"^"_D_"^"_RTOVER,RTC1=RTC1+1 W:$D(RTASK) "."
17SORTQ K RT0,RTT0,RTCL,RTOVER,O,V,T,D,SSN Q
18 ;
19REC 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="" S SSN=0 D VOL G RECQ:X="^"
20RECQ Q
21 ;
22VOL F V=0:0 S V=$O(^TMP($J,O,RTP,V)) Q:'V S X=^(V),RTC=RTC+1 S:$D(RTASK) RTS(RTC)=+X D PRT Q:X="^"
23 Q
24 ;
25 ;
26PRT S RTLC=RTLC+1 W !,$S($D(RTASK):RTC,1:""),?1,$E($P(X,"^",2),1,16),?18,"V",$P(X,"^",3),?23,$S('SSN:$P(X,"^",4),1:""),?28,$E($P(X,"^",5),1,19),?53,$P(X,"^",6),?72,$J($P(X,"^",7),5) S RTHD="HD",SSN=1 D PRT1 K RTHD Q
27 ;
28PRT1 I $D(^RTV(190.2,"AM","s",+X)) D FND^RTUTL1 S RTLC=RTLC+1
29 Q:IOSL>(RTLC+5) I $D(RTASK) Q:RTC'<RTC1 D SELECT S RTLC=0 W ! Q
30 S X="" I $E(IOST,1,2)="C-" W !!,"Press RETURN to continue or '^' to stop: " R X:DTIME S SSN=0 S:'$T X="^"
31 D:X'="^" @RTHD Q
32 ;
33HD S X="**** "_$S($D(RTTY):$P($P(RTTY,"^"),";",2),1:$P($P(RTAPL,"^"),";",2)_" Folders")_" Currently Charged to Borrower ****" D HD1
34 W !!?3,"Record Type",?18,"Vol",?23,$S($P(RTAPL,"^",9)["Patient":"SSN",1:""),?29,$S($P(RTAPL,"^",9)]"":$P(RTAPL,"^",9),1:"???"),?53,"Charged Since...",?72,"Overdue"
35 W !?3,"-----------",?18,"---",?23,"---------------------------",?53,"-----------------",?74,"----"
36 S RTLC=$Y Q
37 ;
38HD1 W @IOF,?(IOM-$L(X))/2,X S X="" D EQUALS^RTUTL3 S RTPAGE=RTPAGE+1,Y=RTB D BOR^RTB S P=$S($D(^RTV(195.9,RTB,0)):$P(^(0),"^",7),1:"")
39 W !,"Borrower : ",Y,?55,"Page: ",RTPAGE,!,"Phone/Location: ",P D NOW^%DTC S Y=$E(%,1,11) D D^DIQ W ?51,"Run Date: ",Y D EQUALS^RTUTL3 Q
40 ;
41SELECT S RTRD("A")="Choose: " S RTZ("RTC")=RTC D SEL^RTRD K RTRD I RTC S X="^" K RTZ Q
42 S RTC=RTZ("RTC") K RTZ Q
Note: See TracBrowser for help on using the repository browser.