source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVLGQU.m@ 1751

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1GMVLGQU ;HIOFO/YH,FT-UTILITY FOR LEGEND, PO2 AND QUALIFIER ;11/8/01 14:31
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10104 - ^XLFSTR calls (supported)
6 ;
7LEGEND ;CREATE VITAL/QUALIFIER/SYNONYM LEGEND STORED IN GLINE LOCAL GLOBAL
8 N I,X,J,K,G,B S (I,J,B)=0,(X,GLINE(1),GLINE(2),GLINE(3),GLINE(4),GLINE(5),GLINE)=""
9 F G(1)="T","P","R","B","H","W","PO2","CG","CVP","PN" I $D(GMRQUAL(G(1))) D LEGEND1
10 S J=J+1,GLINE(J)=X
11 K ^UTILITY($J),DIWF,DIWL,WIWR Q
12LEGEND1 ;
13 S G=$S(G(1)="CG":"CIRC/GIRTH",G(1)="PO2":"PULSE OX",G(1)="B":"BP",G(1)="W":"WT",G(1)="H":"HT",G(1)="T":"TEMP",G(1)="P":"PULSE",G(1)="R":"RESP",G(1)="PN":"PAIN",1:G(1))_" - "
14 S X=X_$S(B=0:"",1:" ")_G S B=1 D:$L(X)>150 CUT D
15 . S G="" F S G=$O(GMRQUAL(G(1),G)) Q:G="" S X=X_G_" " I $L(X)>150 D CUT
16 Q
17CUT ;
18 S DIWF="",DIWL=0,DIWR=$S(+$G(GLPRNTR):120,1:150) K ^UTILITY($J) D ^DIWP
19 S I=+$P(^UTILITY($J,"W",0),"^")
20 S J=J+1,GLINE(J)=$G(^UTILITY($J,"W",0,1,0)),X=$G(^UTILITY($J,"W",0,2,0))
21 K ^UTILITY($J)
22 Q
23SYNOARY ;
24 K GG S GG=$L(GMRSITE(1),";") F GG(1)=1:1:GG S GG(2)=$P(GMRSITE(1),";",GG(1)) S GG(3)=$O(^GMRD(120.52,"B",GG(2),0)) D:GG(3)>0
25 . S GMRSITE=GMRSITE_$S(GMRSITE="":"",1:" "),GSYNO=""
26 . I $P($G(^GMRD(120.52,GG(3),0)),"^",2)'="" S GSYNO=$P(^(0),"^",2)
27 . E S GCHA=GG(2) D
28 . . I GCHA["-" S GCHA=$P(GCHA,"-")_" "_$P(GCHA,"-",2)
29 . . I $L(GCHA," ")<2 S GSYNO=$E(GCHA)_$$LOW^XLFSTR($E(GCHA,2,3))
30 . . E S GLEN=$L(GCHA," ") F I=1:1:GLEN S GSYNO=GSYNO_$S($E($P(GCHA," ",I))'="(":$E($P(GCHA," ",I)),1:"")
31 . I GG(2)'="" S GG(2)=$E(GG(2))_$$LOW^XLFSTR($E(GG(2),2,30))
32 . S GMRSITE=GMRSITE_GSYNO S:GI'="C" GMRQUAL(GI,GSYNO_": "_GG(2))="" K GLEN
33 Q
34PO2(X) ;
35 I X="" Q
36 I X["%" D
37 . S X(2)=$P(X,"%")
38 . I X(2)["l/min" S X(2)=$P(X(2),"l/min",2)
39 I X["l/min" D
40 . S X(1)=$P(X,"l/min")
41 . I X(1)["%" S X(1)=$P(X(1),"%",2)
42 S X(1)=$$STRIP^XLFSTR(X(1)," "),X(2)=$$STRIP^XLFSTR(X(2)," ")
43 Q
Note: See TracBrowser for help on using the repository browser.