87 lines
3.3 KiB
Mathematica
87 lines
3.3 KiB
Mathematica
LRARCMA1 ;DALISC/CKA - ARCHIVED WKLD REPORT BY MAJ SCTN; 2/6/91
|
|
;;5.2;LAB SERVICE;**59**;Aug 31,1995
|
|
;same as LRCAPMA1 except archived wkld file
|
|
EN ;
|
|
D INITMAN^LRARCMR1
|
|
S LRGETIN=$S(LRIN:0,1:1)
|
|
F D BUILD Q:(LREND)!('LRLOOP)!(LRBLDONE)
|
|
Q
|
|
BUILD ; BUILD DATA SUBSET IN ^TMP
|
|
D GTIN
|
|
I 'LRIN S LRBLDONE=1 Q
|
|
;D GENCOM^LRARCMR1,CAPCOM^LRARCMR1
|
|
S (LRAPINGT,LRCPINGT)=0
|
|
S LRCDT=LRCDTB-1
|
|
F S LRCDT=$O(^LAR(64.19999,LRIN,1,"B",LRCDT)) Q:(LRCDT>LRCDTE)!(LRCDT<1) D
|
|
. S LRCDTN=0,LRCDTN=$O(^LAR(64.19999,LRIN,1,"B",LRCDT,LRCDTN))
|
|
. D DATCOM^LRARCMR1
|
|
. W:$E(IOST,1,2)="C-" "."
|
|
. S LRCC=0
|
|
. F S LRCC=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,"B",LRCC)) Q:(LRCC="") D CC
|
|
S LRGTOTS=$G(^TMP("LRAR-WL",$J,0))
|
|
S $P(LRGTOTS,U)=$P(LRGTOTS,U)+LRAPINGT+LRCPINGT
|
|
S ^TMP("LRAR-WL",$J,0)=LRGTOTS
|
|
S LRGTOTS=$G(^TMP("LRAR-WL",$J,"DIV","AP",LRIN,0))
|
|
S $P(LRGTOTS,U)=$P(LRGTOTS,U)+LRAPINGT
|
|
S ^TMP("LRAR-WL",$J,"DIV","AP",LRIN,0)=LRGTOTS
|
|
S LRGTOTS=$G(^TMP("LRAR-WL",$J,"DIV","CP",LRIN,0))
|
|
S $P(LRGTOTS,U)=$P(LRGTOTS,U)+LRCPINGT
|
|
S ^TMP("LRAR-WL",$J,"DIV","CP",LRIN,0)=LRGTOTS
|
|
Q
|
|
CC ;
|
|
S LRCCN=0,LRCCN=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,"B",LRCC,LRCCN))
|
|
S LRCCZ=$P(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,0),U)
|
|
S:$E(LRCCZ)="+" LRCCZ=$E(LRCCZ,2,99)
|
|
S LRCAPNUM=$$WKLDCODE^LRARCU(LRCCZ)
|
|
S LRCAPNAM=$$WKLDNAME^LRARCU(LRCAPIFN)
|
|
D BMPMANL^LRARCMR1
|
|
S LRCTM=$S(LRCTMB=0:"",1:LRCTMB-.001)
|
|
F S LRCTM=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,"B",LRCTM)) Q:(LRCTM>LRCTME)!(LRCTM="") S LRCTMN=0,LRCTMN=$O(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,"B",LRCTM,LRCTMN)) D TM
|
|
Q
|
|
TM ;
|
|
Q:'($D(^LAR(64.19999,LRIN,1,LRCDTN,1,LRCCN,1,LRCTMN,0))#2) S LRX=^(0),LRX1=^(1)
|
|
S LRMA=$P(LRX,U,5),X=LRMA D GETA S LRMA=+Y
|
|
I LRAA Q:'$D(LRAA(LRMA))
|
|
S LRUC=+$P(LRX,U,3),LRLDIV=$P(LRX,U,4),LRLSS=$P(LRX,U,6),X=LRLSS D GETA S LRLSS=+Y S:LRLDIV=""!(LRLDIV="CLINICAL PATHOLOGY") LRLDIV="CP"
|
|
I LRLDIV="ANATOMIC PATHOLOGY" S LRLDIV="AP"
|
|
S:'LRUC LRUC=1
|
|
I +LRMA D
|
|
. S LRREC=$G(^LRO(68,LRMA,0))
|
|
. S LRMAA=$S($P(LRREC,U,11)]"":$P(LRREC,U,11),1:LRNDFN)
|
|
. S LRMAN=$S($P(LRREC,U)]"":$P(LRREC,U),1:LRNDFN)
|
|
. S LRMAN(LRMAA)=LRMAN
|
|
I '+LRMA S (LRMAA,LRMAN)=LRNDFN,LRMAN(LRMAA)=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$O(^LAR(64.19999,LRIN))
|
|
S:LRIN LRINN=^LAR(64.19999,LRIN,0)
|
|
S LRGETIN=1
|
|
Q
|
|
GETA ;Get pointer value for file 68
|
|
K DIC S DIC=68,DIC(0)="XMZ"
|
|
D ^DIC Q:Y=-1
|
|
Q
|