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

GMRVSC1.m

Go to the documentation of this file.
GMRVSC1 ;HIOFO/YH,FT-CUMULATIVE V/M - CONTINUED ;9/27/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
 N GMVCLIO
 K ^TMP($J,"GMRV"),GMRVDT S GMRVHT=0 S (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 SETAR,SETAR1
 I $O(^TMP($J,"GMRV",0))'>0 W !,"THERE IS NO DATA FOR THIS REPORT" G QT
 F GMRDATE=0:0 S GMRDATE=$O(GMRVDT(GMRDATE)) 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^GMRVSC0
 I $E(IOST)'="P",'GMROUT W "Press return to continue or ""^"" to escape " R X:DTIME S:'$T!(X["^") GMROUT=1
 K ^TMP($J,"GMRV"),^TMP($J,"OTHR"),GOTHR,GMRV,GMRVDT Q
Q ; KILL VARIBLES
 S:$D(ZTQUEUED) ZTREQ="@" K GMRZZ,GMRVARY
 K GMRVER,GDATA,GMRST,GERROR,GERST,^TMP($J),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
 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
 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",GMRDATE,GMRVTY,GMRVDA)=$S($P(GMVCLIO(2),U,1)'=1:0,1:+$P(GMVCLIO(2),U,1))_"|"_GMVCLIO(0)_"|"_GMVCLIO(5)
 S GMRVDT(GMRDATE)=""
 Q
PRT ;PRINT V/M BY DATE/TIME
 D:IOSL<($Y+9) HDR^GMRVSC2 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^GMRVSC2 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 GMRVDA=$O(^TMP($J,"GMRV",GMRDATE,GMRVTY,GMRVDA)) Q:$L(GMRVDA)'>0!GMROUT  D SETLN^GMRVSC2
 Q