source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVVS2.m@ 1042

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

initial load of WorldVistAEHR

File size: 3.9 KB
RevLine 
[613]1GMRVVS2 ;HIRMFO/YH-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 2 ;7/15/97
2 ;;4.0;Vitals/Measurements;**1**;Apr 25, 1997
3IO ;PRINT INTAKE/OUTPUT SECTION OF VITAL SIGNS-I/O SHEET
4 K ^TMP($J,"XI"),^TMP($J,"XO")
5 F NN=1:1:GN(1)+1 S GMRI="XI"_NN K GMRLINE(GMRI)
6 F NN=1:1:GN(2)+1 S GMRI="XO"_NN K GMRLINE(GMRI)
7 S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 S GMRNM=GMRNM+1 Q:GMRNM>10 S GDT=+$E(GMRDT,1,7) D
8 . F NN=1:1:GN(1)+1 S GMRI="XI"_NN I $D(^TMP($J,"GMR",GMRI,GDT)) D
9 . . S GMRYDT=$O(^TMP($J,"GMR",GMRI,GDT,0)) I GMRYDT>0 S ^TMP($J,"XI",NN,GDT,GMRYDT)="",GMRLINE(GMRI)=GMRX1
10 . F NN=1:1:GN(2)+1 S GMRI="XO"_NN I $D(^TMP($J,"GMR",GMRI,GDT)) D
11 . . S GMRYDT=$O(^TMP($J,"GMR",GMRI,GDT,0)) I GMRYDT>0 S ^TMP($J,"XO",NN,GDT,GMRYDT)="",GMRLINE(GMRI)=GMRX1
12 S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 S GMRNM=GMRNM+1 Q:GMRNM>10 S GDT=+$E(GMRDT,1,7) D SETDATA
13 I IOSL<($Y+6) D FOOTER,HEADER,DATES W !,?15,"|",?16,GMRX
14 W !,"Intake(24 Hr)(cc)",?20,"|",GMRX F NN=1:1:GN(1)+1 S GMRI="XI"_NN I $D(GMRLINE(GMRI)) D
15 .I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES S GMRI=GMRI(1) W !,?20,"|",?21,GMRX
16 .W !,?3,$S(NN=1:"IV",NN=2:"BLOOD",NN=3:"P NUTRI",NN=(GN(1)+1):"TOTAL",NN>3&(NN<(GN(1)+1)):$E($P(^GMRD(126.56,+$O(^GMRD(126.56,"C",NN-3,0)),0),"^"),1,6),1:" "),?10,"|",GMRLINE(GMRI)
17 I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES S GMRI=GMRI(1) W !,?10,"|",?11,GMRX
18 W !,"Output(24 Hr)(cc)",?20,"|",GMRX
19 F NN=1:1:GN(2)+1 S GI="XO"_NN I $D(GMRLINE(GI)) D
20 .I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES W !,?20,"|",?21,GMRX S GMRI=GMRI(1)
21 .W !,?3,$S(NN<(GN(2)+1):$E($P(^GMRD(126.58,+$O(^GMRD(126.58,"C",NN,0)),0),"^"),1,6),NN=(GN(2)+1):"TOTAL",1:" "),?10,"|",GMRLINE(GI)
22 Q
23SETDATA ; FILL GMRLINE WITH I/O DATA AND WRITE GMRLINE
24 F GMRI="XI","XO" S GMRY=0 F S GMRY=$O(^TMP($J,GMRI,GMRY)) Q:GMRY'>0 D
25 . I $D(^TMP($J,GMRI,GMRY,GDT)) S GDATA=$O(^TMP($J,GMRI,GMRY,GDT,0)) S:GDATA>0 $P(GMRLINE(GMRI_GMRY),"|",GMRNM)=$J(GDATA,8) K ^TMP($J,"GMR",GMRI_GMRY,GDT),^TMP($J,GMRI,GMRY,GDT,GDATA)
26 Q
27FOOTER ;PRINT VITAL SIGNS-I/O SHEET FOOTER
28 W ! W:GMRNAM'="" ?$X-3,$E(GMRNAM,1,35) W:SSN'="" " "_SSN W:GMRBTH'="" " "_GMRBTH W:GMRAGE'="" " "_GMRAGE_" YRS" W:GMRSEX'="" " "_GMRSEX
29 W ?95,"MEDICAL RECORD" W !,"Unit: "_$S(GMRWARD(1)'="":GMRWARD(1),1:" ")," "_"Room: "_$S($P(VAIN(5),"^")'="":$P($P(VAIN(5),"^"),"-",1,2),1:" "),?95,"VITAL FLOW SHEET"
30 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
31 W !,"Division: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),?55,"Page "_GMRPGC,?95,"VAF 10-7987 VICE SF 511",!
32 W GSTRFIN Q
33DATES ;PRINT DATE/TIME COLUMNS FOR VITAL SIGNS-I/O SHEET
34 W ?18,$$REPEAT^XLFSTR("_",109),!,?6,"Date/Time",?17,"|" S GMRLINE=GMRX1,GMRJ=0 F GMRI=1:1:10 S GMRJ=$O(^TMP($J,"GMRDT",GMRJ)) Q:GMRJ'>0 S GMRDT=$E(GMRJ,4,5)_"/"_$E(GMRJ,6,7)_"/"_$E(GMRJ,2,3),$P(GMRLINE,"|",GMRI)=GMRDT_" "
35 W ?18,GMRLINE,! S GMRLINE=GMRX1,GMRJ=0 F GMRI=1:1:10 S GMRJ=$O(^TMP($J,"GMRDT",GMRJ)) Q:GMRJ'>0 S:+$P(GMRJ,".",2)>0 GMRDT=$E($P(GMRJ,".",2)_"0000000",1,4),$P(GMRLINE,"|",GMRI)=$E($E(GMRDT,1,2)_":"_$E(GMRDT,3,4)_" ",1,10)
36 W ?17,"|",?18,GMRLINE
37 Q
38HEADER ;PRINT HEADER FOR VITAL SIGNS-I/O SHEET
39 W:'($E(IOST)'="C"&'GFLAG) @IOF S GFLAG=1,GMRPGC=GMRPGC+1
40 W !,?116,"PAGE ",GMRPGC,!
41 Q
42BP ;
43 S GMR("B")=$O(^TMP($J,"GMR","B",GMRDT,"")) Q:GMR("B")=""
44 I GMR("B")'>0,GMR("B")'="" S $P(GMRLINE("B"),"|",GMRNM)=$E(GMR("B")_" ",1,10),$P(GMRLINE("B1"),"|",GMRNM)=" ",$P(GMRLINE("B2"),"|",GMRNM)=" " Q
45 S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)="" S:GMR("B")'="" GMRSITE(1)=$P(^TMP($J,"GMR","B",GMRDT,GMR("B")),"^"),GMRVJ=$P(^(GMR("B")),"^",2),GMRINF=$P(^(GMR("B")),"^",4)
46 I GMRSITE(1)'="" S GI="B" D SYNOARY^GMRVLGQU
47 S $P(GMRLINE("B"),"|",GMRNM)=$E($P(GMR("B"),"/",1,2)_" ",1,10)
48 S $P(GMRLINE("B1"),"|",GMRNM)=$E($P(GMR("B"),"/",3)_" "_$S($L(GMRSITE," ")>3:$P(GMRSITE," "),1:"")_" ",1,10)
49 S $P(GMRLINE("B2"),"|",GMRNM)=$E($S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
50 Q
Note: See TracBrowser for help on using the repository browser.