VistA-FOIAVistA/r/LAB_SERVICE-LR-LS/LRARCU.m

107 lines
4.4 KiB
Mathematica

LRARCU ;DALISC/CKA - LAB ARCHIVED CAP UTILITIES ;5/22/95
;;5.2;LAB SERVICE;**59**;Aug 31, 1995
;same as LRCAPU except archived wkld file
WKLDNAME(LRCC) ;Call with CAP code or IFN, returns WKLD proc name.
;Sets these vars:
; LRCAPNAM=WKLD proc name
; LRCAPFLG=Reportable flag
; LRCAPNUM=the WKLD code #
; LRCAPIFN=IFN of the WKLD entry
;The caller must kill these when done.
;Called by: LRARCAM5,LRARCMA1,LRARCML1,LRARCMR1,LRARCPTS,LRARCR2
;Called by:
;
N LRNOD,LRNAM
S LRNAM="*ERROR* CAN'T FIND WKLD CODE: "_LRCC
S LRCAPFLG=-1,(LRCAPNAM,LRCAPNUM,LRCAPIFN)=""
Q:'$L($G(LRCC)) LRNAM
I LRCC["." S LRCC=$O(^LAM("C",LRCC_" ",0)) Q:'LRCC LRNAM
S LRNOD=$G(^LAM(LRCC,0)) Q:'$L(LRNOD) LRNAM
S (LRCAPNAM,LRNAM)=$E($P(LRNOD,U),1,63),LRCAPNUM=$P(LRNOD,U,2)
S LRCAPFLG=+$P(LRNOD,U,5),LRCAPIFN=LRCC
S:LRCAPFLG (LRCAPNAM,LRNAM)="+"_LRCAPNAM
Q LRNAM
WKLDCODE(LRCC) ;Call with WKLD proc name, returns WKLD code #.
;Sets these vars:
; LRCAPNUM=the WKLD code #
; LRCAPIFN=the IFN of the WKLD entry
;Called by: LRARCMA1,LRARCML1,LRARCPTS
;Called by:
;
N LRNOD
S (LRCAPNUM,LRCAPIFN)=""
Q:'$L($G(LRCC)) LRCAPNUM
S LRCAPIFN=$O(^LAM("B",LRCC,0)) Q:'LRCAPIFN LRCAPNUM
S LRNOD=$G(^LAM(LRCAPIFN,0)) Q:'$L(LRNOD) LRCAPNUM
S LRCAPNUM=$P(LRNOD,U,2)
Q LRCAPNUM
WKLDCLN ;Kill WKLD vars
;CALLED BY: LR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RAD,DA(4)=LRAA,LRICS="^LRO(68,"_DA(4)_",1,"_DA(3)_",1,"_DA(2)_",4," W @IOF
S IX=0 F S IX=$O(LRTS(IX)) Q:IX<1!($G(LREND)) D
. S DA(1)=IX,DIC=LRICS_DA(1)_",1," S X=$G(^LAB(60,DA(1),0)) I $L(X) W !,$P(X,U),! S DA=0 D
. .F S DA=$O(@(DIC_DA_")")) Q:DA<1!($G(LREND)) D EN^DIQ I $E(IOST,1,2)="C-"&($Y>16) D PAUSE W:'$G(LREND) @IOF
Q
PRTINIT ;
S (LRDSHS,LRSTRS)=""
S $P(LRDSHS,"-",IOM)="-"
S $P(LRSTRS,"*",IOM)="*"
S LRPAG=0
Q
PRTCLN ;
K LRHDR,LRHDR2,LRHDR3,LRCLHDR,LRCLHDR2,LRCLHDR3,LRDSHS,LRSTRS,LRPAG
Q
NPG ;New page
D:$E(IOST,1,2)="C-" PAUSE
Q:LREND
W @IOF
D HDR
Q
HDR ;Header for 80 col.
S LRPAG=LRPAG+1
W:$D(LRHDR)#2 !?((80-$L(LRHDR))/2),LRHDR,?72,"Page ",$J(LRPAG,3),!
W:$D(LRHDR2)#2 ?((80-$L(LRHDR2))/2),LRHDR2,!
W:$D(LRHDR3)#2 ?((80-$L(LRHDR3))/2),LRHDR3,!
W:$D(LRCLHDR)#2 !,LRCLHDR,!
W:$D(LRCLHDR2)#2 LRCLHDR2,!
W:$D(LRCLHDR3)#2 LRCLHDR3,!
W $E(LRDSHS,1,80),!
Q
PAUSE ;
K DIR S DIR(0)="E" D ^DIR
S:($D(DTOUT))!($D(DUOUT)) LREND=1
Q