source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRABG1.m@ 1801

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1LRABG1 ;SLC/RWF - PULMONARY LAB DATA DISPLAY ;2/22/87 2:08 PM ;
2 ;;5.2;LAB SERVICE;**187,201,213**;Sep 27, 1994
3PRL K LRXCH S:IOST["P-" LRXCH=1 D:$Y+4>IOSL WAIT,HEAD:'LREND S LRIDT=$O(^LR(LRDFN,"CH",LRIDT)) G LREND:LRIDT="",LREND:LREND I $G(LREDT),LRIDT>LREDT G LREND
4 G PRL:$O(^LR(LRDFN,"CH",LRIDT,443))=""!($O(^(443))>459) S Z=^(0) G PRL:'$P(Z,U,3) I LRTOP>0 G:LRTOP'=$P(Z,U,5) PRL
5 S Z6="" F I=444,446:1:449,451:1:459 S Z6=Z6_$S($D(^LR(LRDFN,"CH",LRIDT,I)):$P(^(I),"^",1),1:"")_"^"
6 S Z2=$S($D(^LR(LRDFN,"CH",LRIDT,445)):^(445),1:"")
7 S Z8=$S($D(^LR(LRDFN,"CH",LRIDT,450)):^(450),1:"")
8 S Z=^LR(LRDFN,"CH",LRIDT,0),X=$P(Z,U,1) D DAT
9 W ! W:Y'=LRLDT Y
10 W !?2,"@"_T S LRSPEC=$P(Z,U,5),LRLDT=Y W $E("AVC W",LRSPEC-79),?11
11 S LRZZ=$P(Z2,U,1),I=1 X LRXW
12 S I=2,LRZZ=$P(Z6,U,I) X LRXW S I=3,LRZZ=$P(Z6,U,I) X LRXW S I=4,LRZZ=$P(Z6,U,5) X LRXW
13 S LRZZ=$P(Z8,U,1),I=5 X LRXW
14 F I=6:1:9 S LRZZ=$P(Z6,U,I) X LRXW
15FI W ?75 S LRFIO2=$P(Z6,U,1) W LRFIO2 IF LRFIO2["L" S LRFIO2=LRFIO2*4+20 W "=",LRFIO2,"%"
16 W ! I $L($P(Z,U,5)),$D(^LAB(61,$P(Z,U,5),0)) W $E($P(^(0),U,1),1,14)
17 IF $P(Z6,U,4)>1 W ?15,"%MetHb IS ",$P(Z6,U,4)
18 S LRPT=$P(Z6,U,11) IF LRPT,LRPT'=37 W ?26,"TEMP ",LRPT,": " F K=12:1:14 S LRZZ=$P(Z6,U,K),I=K-7 X LRXW
19 IF $D(^LR(LRDFN,"CH",LRIDT,1)) W !,?6,"NOTE:" S I=0 F S I=$O(^LR(LRDFN,"CH",LRIDT,1,I)) Q:I<1 W ^(I,0),!
20 D AA G PRL
21AA S LRPCO2=$P(Z6,U,6),LRPO2=$P(Z6,U,7) ;DIF=AGE*.28-3.06
22 IF $P(Z6,U,11)-37 S X=$P(Z6,U,13),Y=$P(Z,U,14) S:X>1 LRPCO2=X S:Y>1 LRPO2=Y
23 IF LRSPEC-80!(LRFIO2["CA") W ! Q ;SPEC'=ART. BLOOD
24 S LRFIO2=LRFIO2/100,LRALV=600*LRFIO2-(LRPCO2*(LRFIO2+(1-LRFIO2/.79)))
25 W !?6,"computed LRALV-art=",$J(LRALV-LRPO2,1,0) W:LRALV<LRPO2 " ERROR,",$C(7)
26 IF LRALV S X=$J(LRPO2/LRALV,1,2) W " art/LRALV=",X W:X'>.75 " (ratio should be above .75)" W:X>1 " ERROR",$C(7)
27 W ! Q
28HEAD ;from LRABG
29 W @IOF S LRLDT=0,X=DT D DAT
30 W !,$P($G(^DIC(4,+$P($G(^XMB(1,1,"XUS")),U,17),0)),U)," BLOOD GAS REPORT",?60,Y
31 W !?5,SSN,?30,PNM,?60,"AGE ",AGE
32 W !,"DATE A/V"
33H4 F I=1:1:3 W ! F J=0:1:10 W:J=0 $S(I=1:" TIME",I=2:"Ref High",1:"Ref Low ") I J>0 W $S($D(LRLN(J)):$J($P(LRLN(J),U,I),7),I=1:$J($P(^LAB(60,$P(LRTST,U,J),.1),U,1),7),1:" ")
34 W ! F J=1:4:76 W "----"
35 W "---" Q
36DAT S Y=$$FMTE^XLFDT(X,"5ZM")
37 S T=$P(Y,"@",2),Y=$P(Y,"@") Q
38 ;
39WAIT Q:$D(LRXCH) S LREND=0 R !,"PRESS '^' TO STOP ",J:DTIME U IO
40 S:J="" J=1 S LREND=".^"[J Q
41LREND W:'LREND !," last blood gas" D:LRIDT<1 WAIT D ^%ZISC
42 K LRIDT,LRXW,LRPQ,LRPJ,LRFIO2,LRPO2,LRALV,LRDFN,LRDPF,LRLDT,LRLI
43 K LRLL,LRLLT,LRLN,LRLNM,LRLO,LRLOC,LRPCO2,LRPT,LRSPEC,LRTOP,LRTST
44 K LRUTLITY,LRXCH,LRZZ,PNM,SEX,SSN,T,Z,Z2,Z6,Z8,I,J
45 Q
Note: See TracBrowser for help on using the repository browser.