source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYRP3.m@ 1720

Last change on this file since 1720 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1GMRYRP3 ;HIRMFO/YH-PATIENT INTAKE/OUTPUT REPORT HEADING ;3/27/97
2 ;;4.0;Intake/Output;;Apr 25, 1997
3REPORT1 ;
4 I 'GQT S GMRX="",$P(GMRX,"-",IOM)="" D TITLE
5 S GOP=$S(GRPT=1:"D H1",GRPT>1&(GRPT<5):"D H2",GRPT=5!(GRPT=10):"D H3",1:"") Q:GOP="" X GOP
6 Q
7HEADER ;
8 I GQT&(GRPT=1) D FOOTER
9 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
10 S GQ=0 W:'($E(IOST)'="C"&'GPC) @IOF
11 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
12 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
13 S GFACI=$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:"")
14 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)
15 W !,$E(GMRX,1,GMRCOL),! Q
16BODY ;
17 I '$D(^TMP($J,"GMRY")) W:GRPT<5 !," NO DATA FOR THIS PERIOD",!! S GQT=1 Q
18 D INITOT,INISHFT,SHFTP,DAYP S (GRNDIP,GRNDOP)="" D SUM^GMRYRP4
19 Q
20INITOT ;
21 F II=1:1:GN(1) S GTOTIN(II)=0
22 F II=1:1:GN(2) S GTOTOUT(II)=0
23 Q
24INISHFT ;
25 F II=1:1:GN(1) S GIN(II)=0
26 F II=1:1:GN(2) S GOUT(II)=0
27 Q
28FOOTER ;
29 W GMRNAM W:SSN'="" ?17,SSN W:GMRBTH'="" ?32,GMRBTH W:GMRAGE'="" ?42,"(",GMRAGE," YRS)" W:GMRSEX'="" ?53,GMRSEX
30 W !,"UNIT: " W:GMRWARD(1)'="" ?7,GMRWARD(1) W ?33,"RM/BED: " W:GMRBED'="" ?41,GMRBED W !
31 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
32 W "DIVISION: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),!
33 Q
34TITLE ;CREATE HEADER FOR I/O SUMMARY REPORT,GTYPI(TYPE)=ORDER,GTYP(O)=ORDER
35 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)
36 F GNN=0:0 S GNN=$O(^GMRD(126.56,"C",GNN)) Q:GNN'>0 D
37 .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)
38 S GLN(4)=$E(GBLNK,1,GN(1)*6-1)_"|",GLN(1)=GLN(1)_"|OUTPUT"
39 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)
40 S GLN(5)="" F GNN=1:1:(GN(1)+GN(2)) S GLN(5)=GLN(5)_" 0|"
41 Q
42H1 ;I/O SUMMARY BY PT
43 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
44 Q
45H2 ;I/O SUMMARY
46 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
47 I $E(IOST)="C"&'GMROUT W "Return to continue or ^ to quit " R X:DTIME S:'$T!(X["^") GMROUT=1 Q
48 Q
49H3 ;SF511 REPORT
50 D BODY Q
51BLANK F X=1:1 W ! Q:IOSL<($Y+$S($E(IOST)="P":4,1:5))
52 Q
53SHFTP ;FIELD TO SAVE '+' CODE FOR SHIFT TOTAL
54 F II=1:1:GN(1) S GSIP(II)=""
55 F II=1:1:GN(2) S GSOP(II)=""
56 Q
57DAYP ;FIELD TO SAVE '+' CODE FOR DAY TOTAL
58 F II=1:1:GN(1) S GDIP(II)=""
59 F II=1:1:GN(2) S GDOP(II)=""
60 Q
Note: See TracBrowser for help on using the repository browser.