GMVHG4 ;HIOFO/YH,FT-HP LASER SF 511 GRAPH - ^TMP DATA ;11/6/01 15:08
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; #10104 - ^XLFSTR calls (supported)
;
SETA ;
I GK="Unavailable" S GK="Unavail"
S (GMRSITE,GMRSITE(1),GMRSITE(2),GMRINF,GMRVJ)=""
I GK'="" D
. S GMRSITE(1)=$P($G(^TMP($J,"GMRVG",GI,GDT1,GK)),"^"),GMRVJ=$P($G(^(GK)),"^",2),GMRINF=$P($G(^(GK)),"^",4)
. I GMRSITE(1)'="" D SYNOARY^GMVLGQU
I GI="H" S ^TMP($J,"GMRK","G"_(470+GCNTD))=GK_" "_GMRSITE,^TMP($J,"GMRK","G"_(1100+GCNTD))=$S(GK>0:$J(GK*2.54,0,2),1:"") S:GK>0 GMRHT=GK*2.54/100 Q
I GI="PN" S ^TMP($J,"GMRK","G"_(1660+GCNTD))=GK
I GI="C" S ^TMP($J,"GMRK","G"_(1640+GCNTD))=GK_" "_^TMP($J,"GMRK","G"_(1640+GCNTD)) Q
I GI="PO2"!(GI="CVP")!(GI="CG") D Q
. I GI="PO2" D
. . S (GMRINF(1),GMRINF(2))="" I GMRINF'="" D PO2^GMVLGQU(.GMRINF)
. . S ^TMP($J,"GMRK","G"_(1400+GCNTD))=GK_$S(GMRVJ=1:"*",1:"")
. . S ^TMP($J,"GMRK","G"_(1430+GCNTD))=GMRINF(1)
. . S ^TMP($J,"GMRK","G"_(1450+GCNTD))=GMRINF(2)
. . S ^TMP($J,"GMRK","G"_(1470+GCNTD))=GMRSITE
. . Q
. I GI="CVP" D
. . S ^TMP($J,"GMRK","G"_(1500+GCNTD))=$S(GK>0!(GK<0):$J(GK,0,1),1:GK)_$S(GMRVJ=1:"*",1:"")
. . S ^TMP($J,"GMRK","G"_(1530+GCNTD))=$S(GK>0!(GK<0)!($E(GK)="0"):$J(GK/1.36,0,1),1:"")_$S(GMRVJ=1:"*",1:"")
. . Q
. I GI="CG" D
. . S ^TMP($J,"GMRK","G"_(1550+GCNTD))=GK_GMRSITE,^TMP($J,"GMRK","G"_(1620+GCNTD))=$S(GK>0:$J(GK/.3937,0,2),1:"")
. . Q
I GI="B",GK'="" S ^TMP($J,"GMRK","G"_(450+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE) S:$L(GMRSITE," ")>3 ^TMP($J,"GMRK","G"_(1640+GCNTD))=$P(GMRSITE," ")
I '(GI="T"!(GI="P")) D Q
. S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=GK_$S(GMRVJ=1:"*",1:"")_$S(GI="B":"",1:GMRSITE) S:GI="W" ^TMP($J,"GMRK","G"_(1200+GCNTD))=$S(GK>0:$J(GK/2.2,0,2),1:"")
. I GI="W",GK>0 D
. . S GMRBMI="",GMRBMI(1)=GDT1,GMRBMI(2)=GK D CALBMI^GMVBMI(.GMRBMI)
. . S ^TMP($J,"GMRK","G"_(1300+GCNTD))=GMRBMI K GMRBMI
I GI="T",GK>0 S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=GK-93
I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
. I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") D
. . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=GK-40/10
S ^TMP($J,"GMRK","G"_(GJ+1*16+GCNTD+1))=GK_$S(GMRVJ=1:"*",1:"")_$S(GI="T":GMRSITE,GI="P"&($L(GMRSITE," ")>3):" "_$P(GMRSITE," "),1:" ")
I GI="T",GK>0 S ^TMP($J,"GMRK","G"_(410+GCNTD))=$S(GMRVJ=1:"T*",1:"T")
I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
. I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") S ^TMP($J,"GMRK","G"_(430+GCNTD))=$S(GMRVJ=1:"P*",1:"P")
. S ^TMP($J,"GMRK","G"_(1600+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)
I GK>0,GI="T" S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=$S(^("G"_(GJ*16+GCNTD+1))<0.3:0.3,^("G"_(GJ*16+GCNTD+1))>11.6:11.6,1:^("G"_(GJ*16+GCNTD+1))) S:^("G"_(GJ*16+GCNTD+1))<0.4!(^("G"_(GJ*16+GCNTD+1))>11.5) ^TMP($J,"GMRK","G"_(410+GCNTD))="T**"
I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
. I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") D
. . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=$S(^("G"_(GJ*16+GCNTD+1))<0.3:0.3,^("G"_(GJ*16+GCNTD+1))>11.6:11.6,1:^("G"_(GJ*16+GCNTD+1))) S:^("G"_(GJ*16+GCNTD+1))<0.4!(^("G"_(GJ*16+GCNTD+1))>11.5) ^TMP($J,"GMRK","G"_(430+GCNTD))="P**"
Q
OUTP ;PRINT OUTPUT
S J=-8.7,J(1)=162 D WRTLN^GMVHG3
PAIN ;PRINT PAIN
S J=-9.1,J(1)=1661 D
. S I(1)="" F I=1:1:5 S I(2)=I-1,I(1)=I(1)_"PA"_(1.6*I(2)+0.2)_","_J_";LB"_^TMP($J,"GMRK","G"_(J(1)+I(2)))_"#;"
. W !,I(1) S I(1)="" F I=6:1:10 S I(2)=I-1,I(1)=I(1)_"PA"_(1.6*I(2)+0.2)_","_J_";LB"_^TMP($J,"GMRK","G"_(J(1)+I(2)))_"#;"
. W !,I(1) Q
PTID ;PRINT PATIENT ID
W !,"SD1,277,2,1,4,9,5,1,6,5,7,4;SS;PA-1,-11.3;LB"_^TMP($J,"GMRK","G194")_"#;PA-1,-11.6;LB"_^("G196")_" "_^("G197")_"#;"
W !,"PA-1,-11.9;LB"_^TMP($J,"GMRK","G198")_"#;PA7,-11.9;LB"_^("G200")_"#;PA-1,-12.2;LB"_GMRDIV_"#;PA7,-12.2;LB"_^("G199")_"#;"
W !,"PA-1,-12.5;LB"_GSTRFIN_"#;" Q
GMVHG4 ;HIOFO/YH,FT-HP LASER SF 511 GRAPH - ^TMP DATA ;11/6/01 15:08
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10104 - ^XLFSTR calls (supported)
+5 ;
SETA ;
+1 IF GK="Unavailable"
SET GK="Unavail"
+2 SET (GMRSITE,GMRSITE(1),GMRSITE(2),GMRINF,GMRVJ)=""
+3 IF GK'=""
Begin DoDot:1
+4 SET GMRSITE(1)=$PIECE($GET(^TMP($JOB,"GMRVG",GI,GDT1,GK)),"^")
SET GMRVJ=$PIECE($GET(^(GK)),"^",2)
SET GMRINF=$PIECE($GET(^(GK)),"^",4)
+5 IF GMRSITE(1)'=""
DO SYNOARY^GMVLGQU
End DoDot:1
+6 IF GI="H"
SET ^TMP($JOB,"GMRK","G"_(470+GCNTD))=GK_" "_GMRSITE
SET ^TMP($JOB,"GMRK","G"_(1100+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK*2.54,0,2),1:"")
IF GK>0
SET GMRHT=GK*2.54/100
QUIT
+7 IF GI="PN"
SET ^TMP($JOB,"GMRK","G"_(1660+GCNTD))=GK
+8 IF GI="C"
SET ^TMP($JOB,"GMRK","G"_(1640+GCNTD))=GK_" "_^TMP($JOB,"GMRK","G"_(1640+GCNTD))
QUIT
+9 IF GI="PO2"!(GI="CVP")!(GI="CG")
Begin DoDot:1
+10 IF GI="PO2"
Begin DoDot:2
+11 SET (GMRINF(1),GMRINF(2))=""
IF GMRINF'=""
DO PO2^GMVLGQU(.GMRINF)
+12 SET ^TMP($JOB,"GMRK","G"_(1400+GCNTD))=GK_$SELECT(GMRVJ=1:"*",1:"")
+13 SET ^TMP($JOB,"GMRK","G"_(1430+GCNTD))=GMRINF(1)
+14 SET ^TMP($JOB,"GMRK","G"_(1450+GCNTD))=GMRINF(2)
+15 SET ^TMP($JOB,"GMRK","G"_(1470+GCNTD))=GMRSITE
+16 QUIT
End DoDot:2
+17 IF GI="CVP"
Begin DoDot:2
+18 SET ^TMP($JOB,"GMRK","G"_(1500+GCNTD))=$SELECT(GK>0!(GK<0):$JUSTIFY(GK,0,1),1:GK)_$SELECT(GMRVJ=1:"*",1:"")
+19 SET ^TMP($JOB,"GMRK","G"_(1530+GCNTD))=$SELECT(GK>0!(GK<0)!($EXTRACT(GK)="0"):$JUSTIFY(GK/1.36,0,1),1:"")_$SELECT(GMRVJ=1:"*",1:"")
+20 QUIT
End DoDot:2
+21 IF GI="CG"
Begin DoDot:2
+22 SET ^TMP($JOB,"GMRK","G"_(1550+GCNTD))=GK_GMRSITE
SET ^TMP($JOB,"GMRK","G"_(1620+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK/.3937,0,2),1:"")
+23 QUIT
End DoDot:2
End DoDot:1
QUIT
+24 IF GI="B"
IF GK'=""
SET ^TMP($JOB,"GMRK","G"_(450+GCNTD))=$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)
IF $LENGTH(GMRSITE," ")>3
SET ^TMP($JOB,"GMRK","G"_(1640+GCNTD))=$PIECE(GMRSITE," ")
+25 IF '(GI="T"!(GI="P"))
Begin DoDot:1
+26 SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=GK_$SELECT(GMRVJ=1:"*",1:"")_$SELECT(GI="B":"",1:GMRSITE)
IF GI="W"
SET ^TMP($JOB,"GMRK","G"_(1200+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK/2.2,0,2),1:"")
+27 IF GI="W"
IF GK>0
Begin DoDot:2
+28 SET GMRBMI=""
SET GMRBMI(1)=GDT1
SET GMRBMI(2)=GK
DO CALBMI^GMVBMI(.GMRBMI)
+29 SET ^TMP($JOB,"GMRK","G"_(1300+GCNTD))=GMRBMI
KILL GMRBMI
End DoDot:2
End DoDot:1
QUIT
+30 IF GI="T"
IF GK>0
SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=GK-93
+31 IF GK'=""
IF GI="P"
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
Begin DoDot:1
+32 IF GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL")
Begin DoDot:2
+33 SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=GK-40/10
End DoDot:2
End DoDot:1
+34 SET ^TMP($JOB,"GMRK","G"_(GJ+1*16+GCNTD+1))=GK_$SELECT(GMRVJ=1:"*",1:"")_$SELECT(GI="T":GMRSITE,GI="P"&($LENGTH(GMRSITE," ")>3):" "_$PIECE(GMRSITE," "),1:" ")
+35 IF GI="T"
IF GK>0
SET ^TMP($JOB,"GMRK","G"_(410+GCNTD))=$SELECT(GMRVJ=1:"T*",1:"T")
+36 IF GK'=""
IF GI="P"
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
Begin DoDot:1
+37 IF GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL")
SET ^TMP($JOB,"GMRK","G"_(430+GCNTD))=$SELECT(GMRVJ=1:"P*",1:"P")
+38 SET ^TMP($JOB,"GMRK","G"_(1600+GCNTD))=$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)
End DoDot:1
+39 IF GK>0
IF GI="T"
SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=$SELECT(^("G"_(GJ*16+GCNTD+1))<0.3:0.3,^("G"_(GJ*16+GCNTD+1))>11.6:11.6,1:^("G"_(GJ*16+GCNTD+1)))
IF ^("G"_(GJ*16+GCNTD+1))<0.4!(^("G"_(GJ*16+GCNTD+1))>11.5)
SET ^TMP($JOB,"GMRK","G"_(410+GCNTD))="T**"
+40 IF GK'=""
IF GI="P"
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
Begin DoDot:1
+41 IF GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL")
Begin DoDot:2
+42 SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=$SELECT(^("G"_(GJ*16+GCNTD+1))<0.3:0.3,^("G"_(GJ*16+GCNTD+1))>11.6:11.6,1:^("G"_(GJ*16+GCNTD+1)))
IF ^("G"_(GJ*16+GCNTD+1))<0.4!(^("G"_(GJ*16+GCNTD+1))>11.5)
SET ^TMP($JOB,"GMRK","G"_(430+GCNTD))="P**"
End DoDot:2
End DoDot:1
+43 QUIT
OUTP ;PRINT OUTPUT
+1 SET J=-8.7
SET J(1)=162
DO WRTLN^GMVHG3
PAIN ;PRINT PAIN
+1 SET J=-9.1
SET J(1)=1661
Begin DoDot:1
+2 SET I(1)=""
FOR I=1:1:5
SET I(2)=I-1
SET I(1)=I(1)_"PA"_(1.6*I(2)+0.2)_","_J_";LB"_^TMP($JOB,"GMRK","G"_(J(1)+I(2)))_"#;"
+3 WRITE !,I(1)
SET I(1)=""
FOR I=6:1:10
SET I(2)=I-1
SET I(1)=I(1)_"PA"_(1.6*I(2)+0.2)_","_J_";LB"_^TMP($JOB,"GMRK","G"_(J(1)+I(2)))_"#;"
+4 WRITE !,I(1)
QUIT
End DoDot:1
PTID ;PRINT PATIENT ID
+1 WRITE !,"SD1,277,2,1,4,9,5,1,6,5,7,4;SS;PA-1,-11.3;LB"_^TMP($JOB,"GMRK","G194")_"#;PA-1,-11.6;LB"_^("G196")_" "_^("G197")_"#;"
+2 WRITE !,"PA-1,-11.9;LB"_^TMP($JOB,"GMRK","G198")_"#;PA7,-11.9;LB"_^("G200")_"#;PA-1,-12.2;LB"_GMRDIV_"#;PA7,-12.2;LB"_^("G199")_"#;"
+3 WRITE !,"PA-1,-12.5;LB"_GSTRFIN_"#;"
QUIT