source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LR7OSUM6.m@ 738

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1LR7OSUM6 ;DALOI/dcm - Silent Patient cum cont. ;10/10/07 19:26
2 ;;5.2;LAB SERVICE;**121,201,187,286,356**;Sep 27, 1994;Build 2
3 ;
4LRUDT(X) ;Get output date/time
5 N LRTIM,I
6 S LRTIM=$E(X,9,12) F I=0:0 Q:$L(LRTIM)=4 S LRTIM=LRTIM_0
7 S LRTIM=$S(LRTIM?4"0":" ",1:$E(LRTIM,1,2)_":"_$E(LRTIM,3,4)),LRUDT=$$FMTE^XLFDT($P(X,"."),"5Z")_" "_$J(LRTIM,5)_" "
8 Q LRUDT
9 ;
10 ;
11HEAD ;from LR7OSUM3, LR7OSUM4, LR7OSUM5
12 D LRBOT,TOP
13 Q
14 ;
15 ;
16LRBOT ;from LR7OSUM3
17 N L1 D LINE^LR7OSUM4
18Y D LINE^LR7OSUM4
19 Q
20 ;
21 ;
22TOP ;from LR7OSUM3
23 S LRAG=0
24 Q
25 ;
26 ;
27KILL D HEAD Q
28 Q
29 ;
30 ;
31LRMISC S LRFDT=0,LRPG=1 D TOP
32 ;
33MHI S LRMHN=$P(^TMP($J,LRDFN,LRMH),U,1),LRCNT=12 D WR
34 ;
35MDT S LRFDT=$O(^TMP($J,LRDFN,"MISC",LRFDT)) G:LRFDT<1 END
36 S LRUDT=$$LRUDT(9999999-LRFDT) D LRCNT S LRMIT=0
37 ;
38LRMIT S LRMIT=$O(^TMP($J,LRDFN,"MISC",LRFDT,LRMIT)) G:LRMIT="TX" TXT G:LRMIT="" MDT S X=^(LRMIT) G:LRMIT=.1 MSG
39 ;
40 S LRVAL=$P(X,U,1),LRSPE=$P(X,U,2),LRTEST=$P(X,U,3),X1=$P(X,U,4)
41 ;S LRLO="",LRHI=","LRUNT=""
42 S LRLO=$P(X,"^",6),LRHI=$P(X,"^",7),LRUNT=$P(X,"^",8)
43 S LRSPEM=$S($L(LRSPE):$P(^LAB(61,LRSPE,0),U,1),1:"")
44 G:'LRTEST COMM
45 S LRNAME=$P(^LAB(60,LRTEST,0),"^")
46 I $L(LRNAME)>13,$P($G(^LAB(60,LRTEST,.1)),"^")'="" S LRNAME=$P(^LAB(60,LRTEST,.1),"^")
47 E S LRNAME=$E(LRNAME,1,13)
48 ; S LRNAME=$P(^LAB(60,LRTEST,.1),U,1)
49 ;S:$L(LRSPE)&($D(^LAB(60,LRTEST,1,LRSPE,0))) X=^(0),@("LRLO="_$S($L($P(X,U,2)):$P(X,U,2),1:"""""")),@("LRHI="_$S($L($P(X,U,3)):$P(X,U,3),1:"""""")),LRUNT=$P(X,U,7)
50 ;
51WR1 D LINE^LR7OSUM4
52 S LRREF=""
53 I LRLO'="",LRHI'="" S LRREF=LRLO_" to "_LRHI
54 I LRLO'="",LRHI="" S LRREF=$S(LRLO?.AP:LRLO,1:"low: "_LRLO)
55 I LRLO="",LRHI'="" S LRREF=$S(LRHI?.AP:LRHI,1:"high: "_LRHI)
56 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LRUDT)_$$S^LR7OS(19,CCNT,$E(LRSPEM,1,16))_$$S^LR7OS(37,CCNT,LRNAME_":")_$$S^LR7OS(50,CCNT,LRVAL_" "_X1_" "_LRUNT)_$$S^LR7OS(67,CCNT,LRREF)
57 S:'$P($G(^TMP("LRT",$J,LRNAME)),"^",2) $P(^(LRNAME),"^",2)=GCNT
58 K LRREF
59 G LRMIT
60 ;
61 ;
62MSG D LINE^LR7OSUM4,LINE^LR7OSUM4
63 X X ;Need to see what is in X
64 G LRMIT
65 ;
66 ;
67COMM D LN
68 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"COMMENT: "_LRVAL)
69 G LRMIT
70 ;
71 ;
72WR ;
73 D LINE^LR7OSUM4
74 S X=GIOM/2-($L(LRMHN)/2+5)
75 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(X,CCNT,"---- "_LRMHN_" ----"),^TMP("LRH",$J,LRMHN)=GCNT
76 D LINE^LR7OSUM4
77 D LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(4,CCNT,"DATE TIME SPECIMEN")_$$S^LR7OS(37,CCNT,"TEST")_$$S^LR7OS(50,CCNT,"VALUE")_$$S^LR7OS(64,CCNT,"Ref ranges")
78 D LN S X="",$P(X,"-",GIOM)="",^TMP("LRC",$J,GCNT,0)=X
79 Q
80 ;
81 ;
82TXT S I=0
83 F S I=$O(^TMP($J,LRDFN,"MISC",LRFDT,"TX",I)) Q:I<1 S GCNT=GCNT+1,^TMP("LRC",$J,GCNT,0)=^(I,0)
84 G LRMIT
85 ;
86 ;
87END S X="",$P(X,"=",GIOM)="",GCNT=GCNT+1,^TMP("LRC",$J,GCNT,0)=X
88 D LRBOT S LRLO=""
89 K LRSB,LRMISC
90 Q
91 ;
92 ;
93PRE ;from LR7OSUM3
94 Q:$D(^TMP($J,LRDFN,"MISC"))'=11
95 S LRMISC=1,LRPG=0,LRMH="MISC"
96 G LRMISC
97 ;
98 ;
99LRCNT ;
100 S LRCNT=0,I=0
101 F S I=$O(^TMP($J,LRDFN,LRMH,LRFDT,I)) Q:I<1 S LRCNT=LRCNT+1
102 S LRCTN=0
103 I $D(^TMP($J,LRDFN,LRMH,LRFDT,"TX")) D
104 . S J=0
105 . F S J=$O(^TMP($J,LRDFN,LRMH,LRFDT,"TX",J)) Q:J<1 S LRCTN=LRCTN+1
106 S LRCNT=LRCNT*2+5+LRCTN
107 Q
108 ;
109 ;
110LN ;
111 S CCNT=1,GCNT=GCNT+1
112 Q
Note: See TracBrowser for help on using the repository browser.