source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAPSWK.m@ 1258

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

initial load of WorldVistAEHR

File size: 4.0 KB
RevLine 
[613]1LRAPSWK ;AVAMC/REG - STUFF AP WORKLOAD ;2/22/96 10:27
2 ;;5.2;LAB SERVICE;**91**;Sep 27, 1994
3 S LRK=LRRC S:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,0)) ^(0)="^68.04PA^^" D STF
4 I "SPEM"[LRSS S A(1)=0 F A=0:0 S A=$O(^LR(LRDFN,LRSS,LRI,.1,A)) Q:'A S A(1)=A(1)+1,A(2)=$E($P(^(A,0),"^"),1,9) D @(LRSS_1)
5 I "SPCYEM"[LRSS,$G(LRW("S")) S C=LRW("S") D CAP
6 D:LRSS="AU" AU1 S A(1)=1 F C=0:0 S C=$O(^LAB(60,LRT,9,C)) Q:'C D CAP
7 S A(1)=1 F C=0:0 S C=$O(^LAB(60,LRT,9.1,C)) Q:'C D CAP
8 S ^LRO(68,"AA",LRAA_"|"_LRAD_"|"_LRAN_"|"_LRT)=""
9 Q
10 ;
11SP1 S ^LR(LRDFN,"SP",LRI,.1,A,1,0)="^63.8121A^1^1",^(1,0)=A(2),^(1,0)="^63.8122PA^"_LRW("H&E")_"^1",^(LRW("H&E"),0)=LRW("H&E")_"^1" S:A(2)]"" ^LR(LRDFN,"SP",LRI,.1,A,1,"B",A(2),1)="" Q
12EM1 S ^LR(LRDFN,"EM",LRI,.1,A,1,0)="^63.2021A^1^1",^(1,0)="EPON 1",^(1,0)="^63.20211PA^"_+LRW("G")_"^2",^(+LRW("SS"),0)=LRW("SS")
13 S ^LR(LRDFN,"EM",LRI,.1,A,1,1,1,+LRW("G"),0)=LRW("G"),^LR(LRDFN,"EM",LRI,.1,A,1,"B","EPON 1",1)="" Q
14AU1 K E I $O(^LRO(69.2,LRAA,6,0)) S E=0 F A=0:0 S A=$O(^LRO(69.2,LRAA,6,A)) Q:'A S B=$P(^(A,0),"^") I B]"" S E=E+1,^LR(LRDFN,33,E,0)=B,^LR(LRDFN,33,"B",B,E)="" D AU2
15 S:$D(E) ^LR(LRDFN,33,0)="^63.033A^"_E_"^"_E Q
16AU2 S ^LR(LRDFN,33,E,1,0)="^63.331A^1^1",^(1,0)=$E(B,1,9),^(1,0)="^63.3311PA^"_LRW("H&E")_"^1",^(LRW("H&E"),0)=LRW("H&E")_"^1" Q
17 ;
18STF I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,0)) S ^(0)=LRT_"^50^^"_DUZ_"^"_LRRC,X=^LRO(68,LRAA,1,LRAD,1,LRAN,4,0),^(0)=$P(X,"^",1,2)_"^"_LRT_"^"_($P(X,"^",4)+1)
19 S:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,0)) ^(0)="^68.14P^^" Q
20 ;
21CAP I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,C,0)) S ^(0)=C_"^"_A(1)_"^0^0^^"_LRRC_"^"_DUZ_"^"_DUZ(2)_"^"_LRAA_"^"_LRAA_"^"_LRAA,X=^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,0),^(0)=$P(X,"^",1,2)_"^"_C_"^"_($P(X,"^",4)+1) Q
22 S X=^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,C,0),$P(X,"^",2)=$S($P(X,"^",3):A(1),1:$P(X,"^",2)+A(1)),$P(X,"^",3)=0,^(0)=X Q
23 ;
24SP S X="SURGICAL PATHOLOGY LOG-IN" D A^LRUWK Q:'$D(X) S (LRW("S"),X)=$O(^LAM("E","88000.0000",0)) Q:X S X="SP SPECIMEN",Y="88000.0000" D W^LRUWK Q
25CY S LRT="",(LRW("S"),X)=$O(^LAM("E","88056.0000",0)) Q:X S X="CY Specimen",Y="88056.0000" D W^LRUWK Q
26EM S LRW("S")=$O(^LAM("E","88057.0000",0)),X="EM LOG-IN" D A^LRUWK Q:$D(X) S X="EM Specimen",Y="88057.0000" D W^LRUWK Q
27AU S X="AUTOPSY LOG-IN" D A^LRUWK Q
28 ;
29CK I '$O(^LR(LRDFN,LRSS,LRI,.1,0)) S Y=1 W !!,"No SPECIMEN entered." G OUT
30 S A=0 F B=1:1 S A=$O(^LR(LRDFN,LRSS,LRI,.1,A)) Q:'A S X=^(A,0) I '$P(X,"^",2) W:B=1 ! W !,"WORKLOAD PROFILE NOT ENTERED FOR ",$P(X,U) S Y=1
31 ;
32C ;count number of specimens, called by LRAPED,LRAPDA,LRAPM
33 K LRL,LRN S LRM=0
34D S LRL=0 F A=0:0 S A=$O(^LR(LRDFN,LRSS,LRI,.1,A)) Q:'A S LRL=LRL+1 I LRSS="CY",'LRM S X=^(A,0),B=$P(X,"^",2) I B S:'$D(LRN(B)) LRN(B)=0 S LRN(B)=LRN(B)+1
35 Q
36C1 ; Workload code count update SURG PATH, CYTO or EM specimens
37 I "EM"[LRSS,$G(LRSOP)="Z" Q
38 Q:'LRW("S") S LRL(1)=LRL,LRM=1 D D Q:LRL'>LRL(1) S A(1)=LRL-LRL(1) I LRSS'="CY" D STF1,SET Q
39 K LRL F A=0:0 S A=$O(^LR(LRDFN,LRSS,LRI,.1,A)) Q:'A S X=^(A,0),B=$P(X,"^",2) I B S:'$D(LRL(B)) LRL(B)=0 S LRL(B)=LRL(B)+1
40 S LRT=0 F S LRT=$O(LRL(LRT)) Q:'LRT S LRL=LRL(LRT) S A(1)=LRL(LRT)-$G(LRN(LRT)) D:A(1)>0 STF1,SET
41 Q
42SET S ^LRO(68,"AA",LRAA_"|"_LRAD_"|"_LRAN_"|"_LRT)=""
43 Q
44 ;
45STF1 I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,0)) S ^(0)=LRT_"^50^^"_DUZ_"^"_LRRC
46 S:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,0)) ^(0)="^68.04PA^^"
47 S X=^LRO(68,LRAA,1,LRAD,1,LRAN,4,0),^(0)=$P(X,"^",1,2)_"^"_LRT_"^"_($P(X,"^",4)+1)
48 S:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,0)) ^(0)="^68.14P^^" S C=LRW("S")
49 I $D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,C,0)) S X=^(0) N LRTALLY D
50 . S LRTALLY=$P(X,U,4)
51 . S A(1)=LRL-LRTALLY
52 I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,C,0)) S ^(0)=C_"^"_A(1)_"^0^0^^"_LRRC_"^"_DUZ_"^"_DUZ(2)_"^"_LRAA_"^"_LRAA_"^"_LRAA,X=^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,0),^(0)=$P(X,"^",1,2)_"^"_C_"^"_($P(X,"^",4)+1) Q
53 ;S X=^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,C,0),Y=$P(X,"^",2) S Y=Y+A(1),$P(X,"^",2)=Y,^(0)=X Q
54 S ^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,1,C,0)=C_"^"_A(1)_"^"_"0"_"^"_LRTALLY_"^^"_LRRC_"^"_DUZ_"^"_DUZ(2)_"^"_LRAA_"^"_LRAA_"^"_LRAA Q
55 ;
56OUT Q
Note: See TracBrowser for help on using the repository browser.