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

GMVSC1.m

Go to the documentation of this file.
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