source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAPWKA.m@ 836

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

initial load of WorldVistAEHR

File size: 2.8 KB
RevLine 
[613]1LRAPWKA ;AVAMC/REG - STUFF AP WORKLOAD ;7/22/94 15:28
2 ;;5.2;LAB SERVICE;;Sep 27, 1994
3 I $D(LRF) D G Q
4 F A=0:0 S A=$O(^LR(LRDFN,LRSS,LRI,.1,A)) Q:'A F B=0:0 S B=$O(^LR(LRDFN,LRSS,LRI,.1,A,B)) Q:'B S E=0 F G=1:1 S E=$O(^LR(LRDFN,LRSS,LRI,.1,A,B,E)) Q:'E S X=^(E,0),LR(63.8122)=$P(X,U,9),(F(1),F)=0 D:'$P(X,"^",3)&("SPEM"[LRSS) BLK D T
5 Q
6T F LRT=0:0 S LRT=$O(^LR(LRDFN,LRSS,LRI,.1,A,B,E,1,LRT)) Q:'LRT S X=^(LRT,0) D C
7 I LRSS="SP",B=1,F(1)>1 S X(9)=$S(LR(63.8122):F-1,1:F),LRT=LRW(0),LRK=LRK(2) D:LRK A
8 I LRSS="SP",B=3,F(1)>0 S X(9)=F,LRT=LRW(6),LRK=LRK(2) D:LRK A
9 Q
10C S Y=$P(X,"^",2)+$P(X,"^",3),X(9)=$P(X,"^",2)-$P(X,"^",9),X(6)=Y-$P(X,"^",6) S:X(6)>0 $P(X,"^",6)=Y,$P(X,"^",7)=X(6) S:X(9)>0 $P(X,"^",9)=$P(X,"^",2) S ^LR(LRDFN,LRSS,LRI,.1,A,B,E,1,LRT,0)=X
11 I X(9)>0 S:B=1!(B=3) F=F+X(9),F(1)=F(1)+Y S $P(X,"^",6)=Y,$P(X,"^",7)=X(6),^(0)=X,LRK=$P(X,"^",4) D A
12 Q
13A S:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,0)) ^(0)="^68.04PA^^" S:LRK>LRK(2)&((B=1)!(B=3)) LRK(2)=LRK
14 I LRSS="SP",B=3,LRT=LRW(7) S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A
27 Q
28GA S LRK=$P(X,"^",3),X=$P(X,"^",4) Q:'LRK!('X) S LRT=LRW(X) D A Q
29EN ;
30 G:'LRCAPA ^LRAPWKA1 S LRK(2)=0 G:LRSS'="AU" LRAPWKA
31 F A=0:0 S A=$O(^LR(LRDFN,33,A)) Q:'A F B=0:0 S B=$O(^LR(LRDFN,33,A,B)) Q:'B S E=0 F G=1:1 S E=$O(^LR(LRDFN,33,A,B,E)) Q:'E S X=^(E,0) D:'$P(X,"^",3) AUBLK D AUT
32 Q
33AUT F LRT=0:0 S LRT=$O(^LR(LRDFN,33,A,B,E,1,LRT)) Q:'LRT S X=^(LRT,0) D C1
34 Q
35C1 S Y=$P(X,"^",2)+$P(X,"^",3),X(9)=$P(X,"^",2)-$P(X,"^",9),X(6)=Y-$P(X,"^",6) I LRT=LRW(0),X(9)>0 S X(9)=$S($P(X,"^",9)=0&(X(9)=1):0,X(9)>0:X(9)-1,1:0)
36 S:X(9)>0 $P(X,"^",9)=$P(X,"^",2) S $P(X,"^",6)=Y,$P(X,"^",7)=X(6),LRK=$P(X,"^",4),^LR(LRDFN,33,A,B,E,1,LRT,0)=X D:X(9)>0 A Q
37 ;
38AUBLK S LRK=$P(X,"^",2) Q:'LRK S X(9)=1,LRT=LRW(1) Q:'LRT D A
39 S $P(^LR(LRDFN,33,A,B,E,0),"^",3)=1 Q
Note: See TracBrowser for help on using the repository browser.