GMVSC1 ;HOIFO/YH,FT-CUMULATIVE V/M - CONTINUED ;5/21/07
;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
;
; This routine uses the following IAs:
; #4290 - ^PXRMINDX global (controlled)
; #10061 - ^VADPT calls (supported)
;
EN1 ; ENTRY TO PRINT REPORT FROM TASKMAN {called from GMVSC0}
N GMVCLIO
K ^TMP($J,"GMRV"),GMRVDT
S (GMRVHT,GMROUT,GMRDATE(0))=0
F GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN" S GMRVITY=$O(^GMRD(120.51,"C",GMRVTY,0)) I GMRVITY>0 D SETAR1,SETAR
I $O(^TMP($J,"GMRV",0))'>0 W !,"THERE IS NO DATA FOR THIS REPORT" G QT
S GMRDATE=9999999
F S GMRDATE=$O(GMRVDT(GMRDATE),-1) Q:GMRDATE'>0!GMROUT I $D(^TMP($J,"GMRV",GMRDATE)) D PRT Q:GMROUT
QT ;
I IOSL'<($Y+10) F X=1:1 W ! Q:IOSL<($Y+10)
I 'GMROUT W ! D FOOTER^GMVSC0
K ^TMP($J,"GMRV"),^TMP($J,"OTHR"),GOTHR,GMRV,GMRVDT
Q
Q ; KILL VARIABLES
K ^TMP($J)
K GMRZZ,GMRVARY
K GMRVER,GDATA,GMRST,GERROR,GERST,GBED,GWARD,DFN,GX,GMR1ST,GMRDAT,GMRDATE,GMRDSH,GMRDT,GMRLN,GMRPDT,GMRSP,GMRVDA,GMRVITY,GMRX,GMRY,GMRVTY,GMRSITE,GMRVX,POP,DIPGM,%T,GMRQUAL,GMROUT,GMRPG,GFLAG
D KVAR^VADPT K VA
D ^%ZISC ;???
Q
SETAR ; get clio records
K GMVCLIO
S GMRDT=GMRVSDT-.000001
F S GMRDT=$O(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT)) Q:GMRDT'>0!(GMRDT>GMRVFDT) S GMRDATE=GMRDT D SETND
Q
SETAR1 ; PXRMINDX index doesn't have entered-in-error records, so use AA x-ref
N GMRVSDT1,GMRVFDT1
K GMVCLIO
S GMRDT=9999999-GMRVFDT,GMRVSDT1=9999999-GMRVSDT
S GMRDT=GMRDT-.000001,GMRVSDT1=GMRVSDT1+.000001
F S GMRDT=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRDT)) Q:GMRDT'>0!(GMRDT>GMRVSDT1) D SETND1
Q
SETND ;
S GMRVDA=0
F S GMRVDA=$O(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT,GMRVDA)) Q:GMRVDA="" D
.Q:GMRVDA=+GMRVDA ;already got it SETND1
.I GMRVDA'=+GMRVDA D
..D CLIO^GMVUTL(.GMVCLIO,GMRVDA)
..S GMVCLIO(0)=$G(GMVCLIO(0)),GMVCLIO(2)=$G(GMVCLIO(2)),GMVCLIO(5)=$G(GMVCLIO(5))
..I GMVCLIO(0)=""!($P(GMVCLIO(0),U,8)="") Q
..D SETUT
..Q
.Q
Q
SETND1 ;
S GMRVDA=0
F S GMRVDA=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRDT,GMRVDA)) Q:GMRVDA="" D
.D F1205^GMVUTL(.GMVCLIO,GMRVDA,1)
.S GMVCLIO(0)=$G(GMVCLIO(0)),GMVCLIO(2)=$G(GMVCLIO(2)),GMVCLIO(5)=$G(GMVCLIO(5))
.I GMVCLIO(0)=""!($P(GMVCLIO(0),U,8)="") Q
.S GMRDATE=$P(GMVCLIO(0),U,1)
.D SETUT
.Q
Q
SETUT ;
S ^TMP($J,"GMRV",+$E(GMRDATE,1,12),GMRVTY,GMRVDA)=$S($P(GMVCLIO(2),U,1)'=1:0,1:+$P(GMVCLIO(2),U,1))_"|"_GMVCLIO(0)_"|"_GMVCLIO(5)
S GMRVDT(+$E(GMRDATE,1,12))=""
Q
PRT ;PRINT V/M BY DATE/TIME
D:IOSL<($Y+9) HDR^GMVSC2 Q:GMROUT
S Y=GMRDATE X ^DD("DD") I $P(GMRDATE,".")'=GMRDATE(0) W !,$E(GMRDATE,4,5)_"/"_$E(GMRDATE,6,7)_"/"_$E(GMRDATE,2,3) S GMRDATE(0)=$P(GMRDATE,".")
D:IOSL<($Y+9) HDR^GMVSC2 Q:GMROUT W !,$P($P(Y,"@",2),":",1,2)
I $D(^TMP($J,"GMRV",GMRDATE)) D
.K GMRLN,GERROR F GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN" S GPRT(GMRVTY)=0 I $D(^TMP($J,"GMRV",GMRDATE,GMRVTY)) S GMRVDA="" F S GMRVDA=$O(^TMP($J,"GMRV",GMRDATE,GMRVTY,GMRVDA)) Q:$L(GMRVDA)'>0!GMROUT D SETLN^GMVSC2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVSC1 3039 printed Nov 22, 2024@17:10:02 Page 2
GMVSC1 ;HOIFO/YH,FT-CUMULATIVE V/M - CONTINUED ;5/21/07
+1 ;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #4290 - ^PXRMINDX global (controlled)
+5 ; #10061 - ^VADPT calls (supported)
+6 ;
EN1 ; ENTRY TO PRINT REPORT FROM TASKMAN {called from GMVSC0}
+1 NEW GMVCLIO
+2 KILL ^TMP($JOB,"GMRV"),GMRVDT
+3 SET (GMRVHT,GMROUT,GMRDATE(0))=0
+4 FOR GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN"
SET GMRVITY=$ORDER(^GMRD(120.51,"C",GMRVTY,0))
IF GMRVITY>0
DO SETAR1
DO SETAR
+5 IF $ORDER(^TMP($JOB,"GMRV",0))'>0
WRITE !,"THERE IS NO DATA FOR THIS REPORT"
GOTO QT
+6 SET GMRDATE=9999999
+7 FOR
SET GMRDATE=$ORDER(GMRVDT(GMRDATE),-1)
if GMRDATE'>0!GMROUT
QUIT
IF $DATA(^TMP($JOB,"GMRV",GMRDATE))
DO PRT
if GMROUT
QUIT
QT ;
+1 IF IOSL'<($Y+10)
FOR X=1:1
WRITE !
if IOSL<($Y+10)
QUIT
+2 IF 'GMROUT
WRITE !
DO FOOTER^GMVSC0
+3 KILL ^TMP($JOB,"GMRV"),^TMP($JOB,"OTHR"),GOTHR,GMRV,GMRVDT
+4 QUIT
Q ; KILL VARIABLES
+1 KILL ^TMP($JOB)
+2 KILL GMRZZ,GMRVARY
+3 KILL GMRVER,GDATA,GMRST,GERROR,GERST,GBED,GWARD,DFN,GX,GMR1ST,GMRDAT,GMRDATE,GMRDSH,GMRDT,GMRLN,GMRPDT,GMRSP,GMRVDA,GMRVITY,GMRX,GMRY,GMRVTY,GMRSITE,GMRVX,POP,DIPGM,%T,GMRQUAL,GMROUT,GMRPG,GFLAG
+4 DO KVAR^VADPT
KILL VA
+5 ;???
DO ^%ZISC
+6 QUIT
SETAR ; get clio records
+1 KILL GMVCLIO
+2 SET GMRDT=GMRVSDT-.000001
+3 FOR
SET GMRDT=$ORDER(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT))
if GMRDT'>0!(GMRDT>GMRVFDT)
QUIT
SET GMRDATE=GMRDT
DO SETND
+4 QUIT
SETAR1 ; PXRMINDX index doesn't have entered-in-error records, so use AA x-ref
+1 NEW GMRVSDT1,GMRVFDT1
+2 KILL GMVCLIO
+3 SET GMRDT=9999999-GMRVFDT
SET GMRVSDT1=9999999-GMRVSDT
+4 SET GMRDT=GMRDT-.000001
SET GMRVSDT1=GMRVSDT1+.000001
+5 FOR
SET GMRDT=$ORDER(^GMR(120.5,"AA",DFN,GMRVITY,GMRDT))
if GMRDT'>0!(GMRDT>GMRVSDT1)
QUIT
DO SETND1
+6 QUIT
SETND ;
+1 SET GMRVDA=0
+2 FOR
SET GMRVDA=$ORDER(^PXRMINDX(120.5,"PI",DFN,GMRVITY,GMRDT,GMRVDA))
if GMRVDA=""
QUIT
Begin DoDot:1
+3 ;already got it SETND1
if GMRVDA=+GMRVDA
QUIT
+4 IF GMRVDA'=+GMRVDA
Begin DoDot:2
+5 DO CLIO^GMVUTL(.GMVCLIO,GMRVDA)
+6 SET GMVCLIO(0)=$GET(GMVCLIO(0))
SET GMVCLIO(2)=$GET(GMVCLIO(2))
SET GMVCLIO(5)=$GET(GMVCLIO(5))
+7 IF GMVCLIO(0)=""!($PIECE(GMVCLIO(0),U,8)="")
QUIT
+8 DO SETUT
+9 QUIT
End DoDot:2
+10 QUIT
End DoDot:1
+11 QUIT
SETND1 ;
+1 SET GMRVDA=0
+2 FOR
SET GMRVDA=$ORDER(^GMR(120.5,"AA",DFN,GMRVITY,GMRDT,GMRVDA))
if GMRVDA=""
QUIT
Begin DoDot:1
+3 DO F1205^GMVUTL(.GMVCLIO,GMRVDA,1)
+4 SET GMVCLIO(0)=$GET(GMVCLIO(0))
SET GMVCLIO(2)=$GET(GMVCLIO(2))
SET GMVCLIO(5)=$GET(GMVCLIO(5))
+5 IF GMVCLIO(0)=""!($PIECE(GMVCLIO(0),U,8)="")
QUIT
+6 SET GMRDATE=$PIECE(GMVCLIO(0),U,1)
+7 DO SETUT
+8 QUIT
End DoDot:1
+9 QUIT
SETUT ;
+1 SET ^TMP($JOB,"GMRV",+$EXTRACT(GMRDATE,1,12),GMRVTY,GMRVDA)=$SELECT($PIECE(GMVCLIO(2),U,1)'=1:0,1:+$PIECE(GMVCLIO(2),U,1))_"|"_GMVCLIO(0)_"|"_GMVCLIO(5)
+2 SET GMRVDT(+$EXTRACT(GMRDATE,1,12))=""
+3 QUIT
PRT ;PRINT V/M BY DATE/TIME
+1 if IOSL<($Y+9)
DO HDR^GMVSC2
if GMROUT
QUIT
+2 SET Y=GMRDATE
XECUTE ^DD("DD")
IF $PIECE(GMRDATE,".")'=GMRDATE(0)
WRITE !,$EXTRACT(GMRDATE,4,5)_"/"_$EXTRACT(GMRDATE,6,7)_"/"_$EXTRACT(GMRDATE,2,3)
SET GMRDATE(0)=$PIECE(GMRDATE,".")
+3 if IOSL<($Y+9)
DO HDR^GMVSC2
if GMROUT
QUIT
WRITE !,$PIECE($PIECE(Y,"@",2),":",1,2)
+4 IF $DATA(^TMP($JOB,"GMRV",GMRDATE))
Begin DoDot:1
+5 KILL GMRLN,GERROR
FOR GMRVTY="T","P","R","BP","HT","WT","CVP","CG","PO2","PN"
SET GPRT(GMRVTY)=0
IF $DATA(^TMP($JOB,"GMRV",GMRDATE,GMRVTY))
SET GMRVDA=""
FOR
SET GMRVDA=$ORDER(^TMP($JOB,"GMRV",GMRDATE,GMRVTY,GMRVDA))
if $LENGTH(GMRVDA)'>0!GMROUT
QUIT
DO SETLN^GMVSC2
End DoDot:1
+6 QUIT