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

GMVLPO0.m

Go to the documentation of this file.
GMVLPO0 ;HIOFO/YH,FT-DOT MATRIX OXIMETRY/RESP. GRAPH - DATA ARRAY ;11/6/01  15:43
 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
 ;
 ; This routine uses the following IAs:
 ; #10061 - ^VADPT calls           (supported)
 ; #10104 - ^XLFSTR calls          (supported)
 ;
EN1 ;ENTRY POINT FROM GMVSR0 TO PRINT PO2/RESP. GRAPH FOR LINE PRINTER
 S GMROUT=0 K ^TMP($J,"GMRVG"),^TMP($J,"GMRK"),^TMP($J,"GDT"),^TMP($J,"GTNM")
 D DEM^VADPT,INP^VADPT S GMRBTH=$P(VADM(3),"^",2),GMRNAM=VADM(1)
 S GSTART1=(9999999-GMRFIN)-.0001,GEND1=9999999-GMRSTRT
 F GTYPE="PO2","R","P" D SETT^GMVHPO0
 F GMRK="PO2","R","P" D GMRDT
 K GMRVD F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0  D PULSE
 F GMRDT=0:0 S GMRDT=$O(GMRVD(GMRDT)) Q:GMRDT'>0  K ^TMP($J,"GMRDT",GMRDT)
 S (GMRTNM,GMRI)=0 I $D(^TMP($J,"GMRDT")) F  S GMRI=$O(^TMP($J,"GMRDT",GMRI)) Q:GMRI'>0  S GMRTNM=GMRTNM+1
 U IO D GRAPH
Q1 K Z,GSOL,GIVDT,GMRHLOC,GMRVJ,GDATA,GDT,GEN,GEND1,GI,GJ,GK,GMRVX,GSTART1,GTNM,GTYP,GTYPE,GX,I,GMRVD D KVAR^VADPT K VA,VAROOT
 K GMRRMBD,GAGE,GCNT,GDOB,GCNTB,GCNTD,GCNTP,GCNTR,GCNTT,GCNTT1,GCNTI,GCNTO,GDT1,GCNTPD,GCNTTD,GCNTW,GPG,GPGS,GTYPE1,GCNTB3,GDTA,XDT,XIO,XX,^TMP($J,"GMRK"),^TMP($J,"GMR"),^TMP($J,"GDT"),^TMP($J,"GMRVG")
 K GLPRNTR,GMRESP,GMRPO2,GMRR,GMRRHI,GMRRLO,GMRROFF,GMRY,GP,GR,GMRQUAL,GLINE,^TMP($J,"GTNM") Q
GRAPH ;
 S:'$D(GFLAG) GFLAG=0 S GMRPGC=0,GMRX1="" F X=1:1:10 S GMRX1=GMRX1_"          "_"|"
 S (GMRX,GMRX2)=GMRX1 F X=1:1:10 S $P(GMRX,"|",X)="__________",$P(GMRX2,"|",X)="----------"
 S GMRPG=$S(GMRTNM=0:1,1:GMRTNM\10+$S(GMRTNM#10>0:1,1:0)) F GMRPGS=1:1:GMRPG S GMRPO2=105.666,GMRPO2(1)=100,GMRESP=45.666,GMRESP(1)=40,GMRY=9 D PAGE Q:GMROUT  ;PO2 AND RESPIRATION VALUES WHEN $Y=1
 Q
PAGE ;
 K GMRQUAL W:'($E(IOST)'="C"&'GFLAG) @IOF S GFLAG=1,GMRPGC=GMRPGC+1 W !
 I '$D(^TMP($J,"GMRVG")) W !!!!!!!!,?5,"THERE  IS  NO  DATA  FOR  THIS  REPORT" X "F Y=$Y:1:(IOSL-6) W !" D FOOTER^GMVLPO2 Q
 W ! D DATES^GMVVS2 W !," Pulse Ox. Resp.",?17,"|",?18,GMRX
 F GMRI=0:0 Q:$Y>61  W ! D SETHD^GMVLPO1 W ?8,GMRHDR10,?16,$S(GMR3:"-",1:" "),?17,"|" D DATAPRT^GMVLPO1
 W !,?17,"|",GMRX2 F GMRI="R","PO2","OX1","OX2","OX3","P","P1" S GMRLINE(GMRI)=GMRX1
 S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0  S GMRNM=GMRNM+1 Q:GMRNM>10  F GMRI="PO2","R","P" D:$D(^TMP($J,"GMRVG",GMRI,GMRDT)) STLNP^GMVLPO2
 F GMRI="R","PO2","OX1","OX2","OX3","P","P1" D
 .S G=$S(GMRI="R":"Respiration",GMRI="PO2":"Pulse Ox.",GMRI="OX1":"  L/Min",GMRI="OX2":"  %",GMRI="OX3":"  Method",GMRI="P":"Pulse",1:"")
 . W !,G,?17,"|",GMRLINE(GMRI)
 I 'GMROUT W !,?17,$$REPEAT^XLFSTR("-",111)
 W !,"R: Respiration     POx: Pulse Oximetry     * - Abnormal value     ** - Abnormal value off of graph"
 W ! I $D(GMRQUAL) S GLPRNTR=1 D LEGEND^GMVLGQU F I=1:1:5 W !,GLINE(I)
 I IOSL'<($Y+10) F X=1:1 W ! Q:IOSL<($Y+10)
 D FOOTER^GMVLPO2 S GMRDT="" F GMRNM=1:1:10 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0  K ^TMP($J,"GMRDT",GMRDT)
 K GG,GI,GMRVJ,GSYNO Q
GMRDT S GMRTNM(GMRK)=0 F GMRI=0:0 S GMRI=$O(^TMP($J,"GMRVG",GMRK,GMRI)) Q:GMRI'>0  S GMRJ="" F X=0:0 S GMRJ=$O(^TMP($J,"GMRVG",GMRK,GMRI,GMRJ)) Q:GMRJ=""  S GMRTNM(GMRK)=GMRTNM(GMRK)+1 S:GMRK'="XI1" ^TMP($J,"GMRDT",GMRI)=""
 Q
PULSE ; Process Apical, Brachial, and Radial Pulses
 N GMRP,GMRVPS,GMRVPO,GMRVR
 S GMRP=$O(^TMP($J,"GMRVG","P",GMRDT,"")) Q:GMRP=""
 S GMRVPS=$P($G(^TMP($J,"GMRVG","P",GMRDT,GMRP)),"^",1)
 I GMRVPS'["APICAL",(GMRVPS'["RADIAL"),(GMRVPS'["BRACHIAL") S GMRVD(GMRDT)=""
 S GMRVPO=$O(^TMP($J,"GMRVG","PO2",GMRDT,""))
 S GMRVR=$O(^TMP($J,"GMRVG","R",GMRDT,""))
 I GMRVPO="",(GMRVR="") Q
 K GMRVD(GMRDT)
 Q