Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LRCAPU

LRCAPU.m

Go to the documentation of this file.
LRCAPU ;DALISC/J0 - LAB CAP UTILITIES ;3/17/93
 ;;5.2;LAB SERVICE;**101,105**;Sep 27, 1994
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: LRCAPML/LRCAPR2/LRRP6A1/LRRP6B1,LRRP8C,LRCAPMA
 ;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?5N1"."4N.5N 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
WKLDCLN ;Kill WKLD vars
 ;CALLED BY: LRCAPML/LRCAPR4/LRRP6,LRCAPMA,LRRP8
 K LRCAPIFN,LRCAPNAM,LRCAPNUM,LRCAPFLG
 Q
DIS ;Display Accession workload  called by LRCAPVM
 N DA,DIC,D0,DIE,DX,DR,IX,LRICS,X,LREND
 S DR=0,DA(1)=0,DA(2)=LRAN,DA(3)=LRAD,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 ;
 Q:$G(LREND)
 K DIR S DIR(0)="E" D ^DIR
 S:($D(DTOUT))!($D(DUOUT)) LREND=1
 Q