Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMVVS1

GMVVS1.m

Go to the documentation of this file.
GMVVS1 ;HIOFO/YH,FT-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 1 ;11/6/01  14:43
 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
 ;
 ; This routine uses the following IAs:
 ; #10104 - ^XLFSTR calls          (supported)
 ;
GRAPH ;
 S GMRPGC=0,GMRX1="" F X=1:1:111 S GMRX1=GMRX1_$S(X#11:" ",1:"|")
 S (GMRX,GMRX2)=GMRX1 F X=1:1:10 S $P(GMRX,"|",X)="__________",$P(GMRX2,"|",X)="----------"
 S GMRPG=GMRTNM\10+$S(GMRTNM#10>0:1,1:0) I GMRPG=0 D HEADER^GMVVS2 W !,"THERE IS NO DATA FOR THIS REPORT" X "F Y=$Y:1:(IOSL-6) W !" D FOOTER^GMVVS2 Q
 F GMRPGS=1:1:GMRPG S GMRTLO=105.8335,GMRPLO=198.335 D PAGE Q:GMROUT
 Q
PAGE ;
 K GMRQUAL,GLINE,GVAR D HEADER^GMVVS2 W "T: Temperature   P: Pulse   BMI: Body Mass Index   C/G: Circumference/Girth   * - Abnormal value   ** - Abnormal value off of graph",! D DATES^GMVVS2 W !,?10,"|",?11,GMRX
 F GMRI=0:0 Q:$Y>51  W ! D SETHD^GMVVS4 W GMRHDR1,?9,$S(GMR3!($Y=28):"-",1:""),?10,"|" D DATAPRT^GMVVS4 W $S(GMR3!($Y=28):"-",1:""),?106,GMRHDR2
 W !,?10,"|",GMRX2 F GMRI="T","P","R","B","B1","B2","W","H","P1","BMI" S GMRLINE(GMRI)=GMRX1,GVAR(GMRI)=""
 F GMRI="PO2","OX1","OX2","OX3","CVP","CVP1","CG","CG1","CG2" K GVAR(GMRI)
 S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0  S GMRNM=GMRNM+1 Q:GMRNM>12  F GMRI="T","P","R","H","W" D STLNP
 S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0  S GMRNM=GMRNM+1 Q:GMRNM>12  D BP^GMVVS2
 F GMRI="T","P","P1","R","B","B1","B2","W","BMI","H" I $D(GVAR(GMRI)) D
 .I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER^GMVVS2,HEADER^GMVVS2,DATES^GMVVS2 S GMRI=GMRI(1) W !,?10,"|",?11,GMRX
 . S G=$S(GMRI="T":"TEMP.",GMRI="P":"PULSE",GMRI="R":"RESP.",GMRI="W":"WEIGHT(LB)",GMRI="H":"HEIGHT(IN)",GMRI="B":"BLOOD",GMRI="B1":"  PRESSURE",GMRI="BMI":"BMI",1:"")
 . I G="" S G=$S(GMRI="PO2":"PULSE OX.",GMRI="OX1":"  L/MIN",GMRI="OX2":"  %",GMRI="OX3":"  METHOD",GMRI="CG":"C/G (IN)",GMRI="CVP":"CVP cm H2O",GMRI="CVP1":"    mmHg",GMRI="CG1":"          ",GMRI="CG2":"    (CM)",1:"")
 . W !,G,?10,"|",GMRLINE(GMRI)
 D IO^GMVVS2 I 'GMROUT W !,?10,"|",GMRX,!
 I IOSL<($Y+6) D FOOTER^GMVVS2,HEADER^GMVVS2
 I $D(GMRQUAL),'GMROUT W ! S GLINE="Qualifier: " S G="" F  S G=$O(GMRQUAL(G)) Q:G=""  D LEGEND^GMVLGQU
 I 'GMROUT W GLINE F X=0:0 W ! Q:IOSL<($Y+6)
 D FOOTER^GMVVS2 S GMRDT="" F GMRNM=1:1:12 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0  K ^TMP($J,"GMRDT",GMRDT)
 Q
STLNP ;
 S GMR(GMRI)=$O(^TMP($J,"GMR",GMRI,GMRDT,"")) Q:GMR(GMRI)=""
 S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
 S GMRSITE(1)=$P($G(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI))),"^"),GMRSITE(2)=$P($G(^(GMR(GMRI))),"^",3),GMRINF=$P($G(^(GMR(GMRI))),"^",4) I GMRSITE(1)'="" S GI=GMRI D SYNOARY^GMVLGQU
 I GMRI'="CVP" S GI=$S(GMR(GMRI)>0:$J(GMR(GMRI),0,$S(GMRI="W"!(GMRI="H")!(GMRI="CG"):2,GMRI'="T":0,1:1)),1:GMR(GMRI))
 E  S GI=$S(GMR(GMRI)>0!(GMR(GMRI)<0)!($E(GMR(GMRI))="0"):$J(GMR(GMRI),0,1),1:GMR(GMRI))
 I "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GI) S GI=GI_$S($P(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",2)'=1:" ",1:"*")
 I GMRI="P",($P(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",1)["DORSALIS PEDIS"),(+GI=1) S:$E(GI,$L(GI))="*" GI=$E(GI,1,$L(GI)-1)
 S $P(GMRLINE(GMRI),"|",GMRNM)=GI_$S(GMRI="P"&($L(GMRSITE," ")>3):""_$P(GMRSITE," "),GMRI="R"!(GMRI="T")!(GMRI="H")!(GMRI="W")!(GMRI="CG"):""_GMRSITE,1:"")
 S $P(GMRLINE(GMRI),"|",GMRNM)=$E($P(GMRLINE(GMRI),"|",GMRNM)_"          ",1,10)
 D SETLN
 I GMRI="CG",$D(GMRLINE("CG2")) S $P(GMRLINE("CG2"),"|",GMRNM)=$E($S(GMR(GMRI)>0:$J(GMR(GMRI)/.3937,0,2),1:"")_"          ",1,10)
 I GMRI="P" S $P(GMRLINE("P1"),"|",GMRNM)=$E($S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)_"          ",1,10)
 I GMRI="H",$D(GMRLINE("H1")) S:GMR(GMRI)>0 $P(GMRLINE("H1"),"|",GMRNM)=$E($S(GMR(GMRI)>0:$J(GMR(GMRI)*2.54,0,2),1:GMR(GMRI))_"          ",1,10)
 I GMRI="W",$D(GMRLINE("W1")) S:GMR(GMRI)>0 $P(GMRLINE("W1"),"|",GMRNM)=$E($S(GMR(GMRI)>0:$J(GMR(GMRI)/2.2,0,2),1:GMR(GMRI))_"          ",1,10)
 I GMRI="W",$D(GMRLINE("BMI")),GMR(GMRI)>0 D
 . S GMRBMI="",GMRBMI(1)=GMRDT,GMRBMI(2)=GMR(GMRI) D CALBMI^GMVBMI(.GMRBMI)
 . S $P(GMRLINE("BMI"),"|",GMRNM)=$E(GMRBMI_"          ",1,10) K GMRBMI
 I GMRI="PO2",$D(GMRLINE("OX1")) D
 . S $P(GMRLINE("OX3"),"|",GMRNM)=$E(GMRSITE_"          ",1,10)
 . S GMRINF=$P(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",4),(GMRINF(1),GMRINF(2))="" D
 . . I GMRINF="" S $P(GMRLINE("OX1"),"|",GMRNM)="          ",$P(GMRLINE("OX2"),"|",GMRNM)="          "
 . . E  D PO2^GMVLGQU(.GMRINF) S $P(GMRLINE("OX1"),"|",GMRNM)=$E(GMRINF(1)_"          ",1,10),$P(GMRLINE("OX2"),"|",GMRNM)=$E(GMRINF(2)_"          ",1,10)
 I GMRI="CVP",$D(GMRLINE("CVP1")) S $P(GMRLINE("CVP1"),"|",GMRNM)=$E($S(GMR(GMRI)>0!(GMR(GMRI)<0)!($E(GMR(GMRI))="0"):$J(GMR(GMRI)/1.36,0,1),1:"")_$S(GI["*":"*",1:"")_"          ",1,10)
 I GMRI="PN",$D(GMRLINE("PN")) S $P(GMRLINE("PN"),"|",GMRNM)=$E($S(GMR(GMRI)?1.2N&(GMR(GMRI)'>10):GMR(GMRI),GMR(GMRI)=99:GMR(GMRI),1:"")_"          ",1,10)
 K GI Q
SETLN ;
 S GVAR(GMRI)=""
 I GMRI="PO2" S (GVAR("PO2"),GVAR("OX1"),GVAR("OX2"),GVAR("OX3"))="" Q
 I GMRI="CVP" S (GVAR("CVP"),GVAR("CVP1"))="" Q
 I GMRI="CG" S (GVAR("CG"),GVAR("CG2"))="" Q
 Q