source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRRP.m@ 1150

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1LRRP ;DALOI/RWF/BA - PROCESS DATA FOR INTERIM REPORTS ; 11/10/88 08:48
2 ;;5.2;LAB SERVICE;**195,221,283,286**;Sep 27, 1994
3 ;
4SET ;from LRRSP, LRRS, LRRD - call with LRORDER=ORDERS, LRODT=DATE, LRDFN
5 K ^TMP("LR",$J,"TP"),LRORD
6 S:'$D(LRTSCRN) LRTSCRN=0
7 S LRLAB=$S($D(LRLABKY):1,1:0),LRHF=1,LRFOOT=0,LRCW=8 Q:'$D(LRODT)
8 F LROP=1:1 S LRORD(1)=$P(LRORDER,U,LROP) D TEST Q:LRSTOP!LREND!(LRORD(1)="")
9 I 'LREND,'LRSTOP,LRFOOT D FOOT^LRRP1
10 K ^TMP("LR",$J,"TP"),LRORD
11 Q
12 ;
13 ;
14TEST ;
15 I LRORD(1)="" K ^TMP("LR",$J,"TP") Q
16 S LRFOUND=1,LRORD=$S($D(^LRO(69,LRODT,1,LRORD(1),0))#2:^(0),1:"") Q:LRORD=""!(+LRORD'=LRDFN)
17 K S,LRAAO S LRTEST=0
18 F S LRTEST=+$O(^LRO(69,LRODT,1,LRORD(1),2,LRTEST)) Q:LRTEST<1 S X=^(LRTEST,0) I LRTSCRN=0!(LRTSCRN=+X) D DATA K S
19 K S Q:'$D(LRAAO) Q:LRAAO<.1
20 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX
21 S LROC=$S($D(^LR(LRDFN,.1)):^(.1),LRDPF=2&$D(^DPT(DFN,.1)):^(.1),1:"FILE ROOM")
22 D ^LRRP1
23 Q
24 ;
25 ;
26DATA S LRTSTS=+X,LRAD=$P(X,U,3),LRAA=+$P(X,U,4),LRAN=$P(X,U,5)
27 S LRAAO=$S($D(^LRO(68,LRAA,0)):$P(^(0),U,8),1:0)
28 I LRAAO<.1 Q:'LRAA D Q
29 . W !?2,$C(7),$P(^LRO(68,LRAA,0),"^")_" accession area is missing a print order!",!?2,$P(^LAB(60,LRTSTS,0),"^")_" results will not be displayed until this is corrected.",!?2,"Please contact IRM or the Lab ADPAC."
30 S LRSS=$P(^LRO(68,LRAA,0),U,2)
31 Q:'$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) Q:'$D(^(3))
32 S ^TMP("LR",$J,"TP",LRAAO)=LRAA_U_LRSS
33 S LRCDT=$P(^LRO(68,LRAA,1,LRAD,1,LRAN,3),U)
34 S LRIDT=+$P(^LRO(68,LRAA,1,LRAD,1,LRAN,3),U,5)
35 I 'LRIDT S LRIDT=9999999-LRCDT
36 S ^TMP("LR",$J,"TP",LRAAO,LRCDT,-1)=$S($D(^TMP("LR",$J,"TP",LRAAO,-1)):^(-1),1:"")_LRTSTS_U
37 S ^TMP("LR",$J,"TP",LRAAO,LRCDT,-2)=LRIDT
38 Q:LRSS="MI"
39 S (S,J)=0
40 F S J=+$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,J)) Q:J<1 S:^(J,0)>0 S=S+1,S(S)=+^(0)
41 S LR0=$S($D(^LR(LRDFN,LRSS,LRIDT,0)):^(0),1:""),LRSPEC=+$P(LR0,U,5),(LRTC,LRLLT)=0
42 F S LRLLT=+$O(S(LRLLT)) Q:LRLLT<1 S LRTSTS=+S(LRLLT) D XPND
43 D CMNT
44 Q
45 ;
46 ;
47XPND Q:'$D(^LAB(60,LRTSTS,.1)) S LRDN=$P($P(^(0),U,5),";",2)
48 I '$L(LRDN) S LRJJ=0 F S LRJJ=+$O(^LAB(60,LRTSTS,2,LRJJ)) Q:LRJJ<1 S S=S+1,S(S)=+^(LRJJ,0)
49 D:$L(LRDN) SETUP
50 Q
51 ;
52 ;
53SETUP Q:'LRTSTS Q:'$D(^LAB(60,LRTSTS,.1)) S X=^(.1)
54 I 'LRLAB,"BO"'[$P(^LAB(60,LRTSTS,0),U,3) Q
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;"_LRDN_";1",0)) D SETUP
79 D CMNT,^LRRP1
80 Q
81 ;
82 ;
83GO ;from LRRP3
84 S LRLAB=$S($D(LRLABKY):1,1:0),LRDN=1
85 F S LRDN=$O(^TMP("LR",$J,"TMP",LRDN)) Q:LRDN<1 S LRTSTS=+^(LRDN) D SETUP
86 D CMNT,^LRRP1
87 Q
Note: See TracBrowser for help on using the repository browser.