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

GMRYRP3.m

Go to the documentation of this file.
GMRYRP3 ;HIRMFO/YH-PATIENT INTAKE/OUTPUT REPORT HEADING ;3/27/97
 ;;4.0;Intake/Output;;Apr 25, 1997
REPORT1 ;
 I 'GQT S GMRX="",$P(GMRX,"-",IOM)="" D TITLE
 S GOP=$S(GRPT=1:"D H1",GRPT>1&(GRPT<5):"D H2",GRPT=5!(GRPT=10):"D H3",1:"") Q:GOP=""  X GOP
 Q
 I GQT&(GRPT=1) D FOOTER
 I GQT,'GQ,$E(IOST)="C",(GRPT=1!(GRPT=4)) W "Press return to continue or ^ to quit " R X:DTIME I '$T!("^"=X) S GMROUT=1 Q
 S GQ=0 W:'($E(IOST)'="C"&'GPC) @IOF
 S GQT=1,GPC=GPC+1 S GG=$S(GRPT=1:23,1:20) W !,?GG,"PATIENT INTAKE/OUTPUT SUMMARY",$S(GRPT=2:" (CURRENT)",GRPT=3:" (PREVIOUS DAY)",GRPT=4:" (48 HRS)",1:"  ") K GG
 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
 S GFACI=$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:"")
 W !,GMRDT1 W:GRPT=1!(GRPT=4) " - "_GMRDT2 W:GRPT>1&(GRPT<5) " WARD: ",GMRWARD(1)_$S(GFACI'="":" - "_GFACI,1:"") K GFACI W ?70,"PAGE: ",GPC,! W GLN(1),!,GLN(2),!,GLN(3)
 W !,$E(GMRX,1,GMRCOL),! Q
BODY ;
 I '$D(^TMP($J,"GMRY")) W:GRPT<5 !,"     NO DATA FOR THIS PERIOD",!! S GQT=1 Q
 D INITOT,INISHFT,SHFTP,DAYP S (GRNDIP,GRNDOP)="" D SUM^GMRYRP4
 Q
INITOT ;
 F II=1:1:GN(1) S GTOTIN(II)=0
 F II=1:1:GN(2) S GTOTOUT(II)=0
 Q
INISHFT ;
 F II=1:1:GN(1) S GIN(II)=0
 F II=1:1:GN(2) S GOUT(II)=0
 Q
 W GMRNAM W:SSN'="" ?17,SSN W:GMRBTH'="" ?32,GMRBTH W:GMRAGE'="" ?42,"(",GMRAGE," YRS)" W:GMRSEX'="" ?53,GMRSEX
 W !,"UNIT: " W:GMRWARD(1)'="" ?7,GMRWARD(1) W ?33,"RM/BED: " W:GMRBED'="" ?41,GMRBED W !
 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
 W "DIVISION: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),!
 Q
TITLE ;CREATE HEADER FOR I/O SUMMARY REPORT,GTYPI(TYPE)=ORDER,GTYP(O)=ORDER
 S GBLNK="",$P(GBLNK," ",80)="",GN(1)=3,GN(2)=0,GLN(1)="INPUT"_$E(GBLNK,1,12),GLN(2)="IV   |BLOOD|PARNT|",GLN(3)="FLUID|PRDCT|NUTRI|",GLN(4)=$E(GBLNK,1,16)
 F GNN=0:0 S GNN=$O(^GMRD(126.56,"C",GNN)) Q:GNN'>0  D
 .S GNN(1)=$O(^GMRD(126.56,"C",GNN,0)) Q:GNN(1)'>0  S GN(1)=GN(1)+1,GLN(1)=GLN(1)_"      ",GLN(2)=GLN(2)_"     |",GLN(3)=GLN(3)_$E($P(^GMRD(126.56,GNN(1),0),"^")_GBLNK,1,5)_"|",GTYPI(GNN(1))=GN(1)
 S GLN(4)=$E(GBLNK,1,GN(1)*6-1)_"|",GLN(1)=GLN(1)_"|OUTPUT"
 F GNN=0:0 S GNN=$O(^GMRD(126.58,"C",GNN)) Q:GNN'>0  S GNN(1)=$O(^GMRD(126.58,"C",GNN,0)) Q:GNN(1)'>0  S GN(2)=GN(2)+1,GLN(2)=GLN(2)_"     |",GLN(3)=GLN(3)_$E($P(^GMRD(126.58,GNN(1),0),"^")_GBLNK,1,5)_"|",GTYPO(GNN(1))=GN(2)
 S GLN(5)="" F GNN=1:1:(GN(1)+GN(2)) S GLN(5)=GLN(5)_"    0|"
 Q
H1 ;I/O SUMMARY BY PT
 D HEADER Q:GMROUT  S GQT=1 D BODY D:'GMROUT FOOTER I $E(IOST)="C"&'GMROUT W "Press return to continue " R X:DTIME S:'$T!(X["^") GMROUT=1 Q
 Q
H2 ;I/O SUMMARY
 S:GRPT=4 GQ=1 D:('GQT!($E(IOST)="C"))!(GQT&($E(IOST)'="C")&(($Y+5)>IOSL)) HEADER Q:GMROUT  W !,"RM/BED : ",GMRBED,?20,GMRNAM,?40,SSN,! D BODY
 I $E(IOST)="C"&'GMROUT W "Return to continue or ^ to quit " R X:DTIME S:'$T!(X["^") GMROUT=1 Q
 Q
H3 ;SF511 REPORT
 D BODY Q
BLANK F X=1:1 W ! Q:IOSL<($Y+$S($E(IOST)="P":4,1:5))
 Q
SHFTP ;FIELD TO SAVE '+' CODE FOR SHIFT TOTAL
 F II=1:1:GN(1) S GSIP(II)=""
 F II=1:1:GN(2) S GSOP(II)=""
 Q
DAYP ;FIELD TO SAVE '+' CODE FOR DAY TOTAL
 F II=1:1:GN(1) S GDIP(II)=""
 F II=1:1:GN(2) S GDOP(II)=""
 Q