source: FOIAVistA/trunk/r/RECORD_TRACKING-RT/RTRPT5.m@ 785

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1RTRPT5 ;ISC-ALBANY/PKE; management ward location list; 6/1/91
2 ;;v 2.0;Record Tracking;**1**;10/22/91
3 ;
4 S RTPGM="START^RTRPT5",RTVAR="RTBEG^RTEND^DHD^RTAPL" D ZIS^RTUTL Q:POP D START Q
5 ;
6START K ^TMP($J) D INIT,SORT,SHOW
7 K ^TMP($J),BOR,ABOR,PHON,APHON,PAGE,DATA,NAM,WRD,ONE,POP,LN,EQ,A,B,C,T,Z,E,J
8 K RTN,RTDFN,RTADM,RTB,RTDT,RTESC,RTI,RTPGM,RTTY,RTVAR,RT Q
9 ;
10SORT F RTDT=RTBEG-.0000001:0 S RTDT=$O(^DGPM("ATT1",RTDT)) Q:('RTDT!(RTDT>RTEND)) D SORT1
11 Q
12SORT1 F RTADM=0:0 S RTADM=$O(^DGPM("ATT1",RTDT,RTADM)) Q:'RTADM I $D(^DGPM(RTADM,0)) S Y=^(0),RTDFN=$P(Y,"^",3),WRD=$P(Y,"^",6) I RTDFN,WRD S WRD=$S($D(^DIC(42,WRD,0)):$P(^(0),"^"),1:"") D APL
13 Q
14APL Q:WRD']"" S NAM=$S($D(^DPT(RTDFN,0)):^(0),1:"") Q:NAM']"" S RTN=$P(NAM,"^",9),NAM=$P(NAM,"^")
15 I $D(^RT("C",RTDFN)) F RT=0:0 S RT=$O(^RT("C",RTDFN,RT)) Q:'RT I $D(^RT(RT,0)),$P(^(0),"^",4)=+RTAPL S RTTY=$P(^(0),"^",3),RTB=$S($D(^("CL")):$P(^("CL"),"^",5),1:"") S ^TMP($J,WRD,NAM,RTN,RT)=RTTY_"^"_RTB
16 Q
17SHOW S PAGE=0
18 S WRD="" F A=0:0 S WRD=$O(^TMP($J,WRD)) Q:WRD="" D NAM Q:WRD=""
19 W !,LN
20 Q
21NAM S NAM="" F B=0:0 S NAM=$O(^TMP($J,WRD,NAM)) Q:NAM="" S RTN=$O(^(NAM,0)) D RT Q:WRD=""
22 Q
23RT K ONE S RTI="" F C=0:0 S RTI=$O(^TMP($J,WRD,NAM,RTN,RTI)) Q:RTI="" W:$D(ONE) !?70,EQ S DATA=^(RTI) D WRT I RTESC="^" Q
24 E W !,LN
25 Q
26WRT D BOR,HDR Q:RTESC="^"
27 I '$D(ONE) W !,$E(RTN,6,9),?6,NAM,?30,$E(RTN,1,3)_"-"_$E(RTN,4,5)_"-"_$E(RTN,6,99),?45,WRD
28 E W !
29 W ?70,RTI,?83,$S($D(T(+T)):T(T),1:""),?92,BOR,?116,ABOR,!?92,PHON,?116,APHON S ONE=""
30 Q
31HDR I $Y+3<IOSL,PAGE Q
32 I PAGE,IOST["C-" S DIR(0)="E" D ^DIR K DIR I 'Y S RTESC="^",(NAM,WRD,RT)="" Q
33 S PAGE=PAGE+1 W @IOF K ONE
34 W !,LN,!,DHD,?120,"Page: ",PAGE
35 W !!?6,"Name",?30,"SSN",?45,"WARD LOCATION",?70,"RECORD #",?83,"TYPE",?92,"CURRENT BORROWER",?112,"ASSOCIATED BORROWER"
36 W !,LN
37 Q
38BOR S (BOR,ABOR)="",RTB=$P(DATA,"^",2),T=$P(DATA,"^")
39 I $D(^RTV(195.9,+RTB,0)) S BOR=^(0)
40 S ABOR=$P(BOR,"^",12),PHON=$P(BOR,"^",7),Y=$P(BOR,"^") D NAME^RTB S BOR=$E(Y,1,20)
41 I $D(^RTV(195.9,+ABOR,0)) S ABOR=^(0)
42 S APHON=$P(ABOR,"^",12),Y=$P(ABOR,"^") D NAME^RTB S ABOR=$E(Y,1,15)
43 Q
44INIT F Z=0:0 S Z=$O(^DIC(195.2,"C",+RTAPL,Z)) Q:'Z I $D(^DIC(195.2,Z,0)) S T(Z)=$E($P(^(0),"^"),1,5)
45 S EQ="=",LN="-",$P(EQ,"=",132-71)="",$P(LN,"-",131)="",RTESC="" Q
Note: See TracBrowser for help on using the repository browser.