VistA-WorldVistAEHR/r/MEDICINE-MC/MCBPFTP4.m

16 lines
1.0 KiB
Mathematica

MCBPFTP4 ;WISC/TJK,ALG-PFT BRIEF REPORT-ABGS ;5/15/92 15:32
;;2.3;Medicine;;09/13/1996
ABG K HEAD1 G SPEC:'$D(^MCAR(700,MCARGDA,6)),SPEC:'$D(^(6,0))
W !! X MCFF Q:$D(MCOUT) W "BLOOD GASES",$E(MCDOT,1,69) X MCFF Q:$D(MCOUT)
ABG0 W !! X MCFF Q:$D(MCOUT) W "STUDY TYPE",?20,"pH ",?40,"pCO2",?60,"pO2" X MCFF
Q:$D(MCOUT) W !,?3,"(NORMAL)",?16,"7.36-7.44",?40,"36-44",?60,"80-100",! X MCFF Q:$D(MCOUT) S MCX=0
ABG1 S MCX=$O(^MCAR(700,MCARGDA,6,MCX)) G SPEC:MCX'?1N.N S MCREC=^(MCX,0),TYPE=$P(MCREC,U)
S MCTYPEP=$S(TYPE="R":"ROOM AIR",TYPE="O":"100% O2 STUDY",TYPE="X":"POST EXERCISE",1:"SUPPLEMENTAL O2 STUDY")
S PH=$P(MCREC,U,3),PACO2=$P(MCREC,U,4),PAO2=$P(MCREC,U,5),FIO2=$P(MCREC,U,8)
S (PAAO2,QSQT)=0 G ABG2:FIO2="" S PAAO2=($P(MCPFT0,U,7)-47)*FIO2-(PACO2/.8)-PAO2 S:PAAO2<0 PAAO2=0
ABG2 W !,$E(MCTYPEP,1,13),?17,$J(PH,6,3),?38,$J(PACO2,5,1),?58,$J(PAO2,5,1)
S:TYPE="R" MCIAO2=PAO2
X MCFF Q:$D(MCOUT) W:$P(MCREC,U,10)'="" !,"(NOTES): ",$P(MCREC,U,10) X MCFF Q:$D(MCOUT) G ABG1
SPEC K HB,PH,PACO2,PAO2,O2HB,COHB,FIO2,MHB,PAAO2,QSQT,CAO2,CVO2
G ^MCBPFTP7