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

GMVVS2.m

Go to the documentation of this file.
GMVVS2 ;HIOFO/YH,FT-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 2 ;9/30/02  15:25
 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
 ;
 ; This routine uses the following IAs:
 ;  #1392 - FILE 126.56 references (private)
 ;  #1393 - FILE 126.58 references (private)
 ; #10061 - ^VADPT calls           (supported)
 ; #10104 - ^XLFSTR calls          (supported)
 ;
IO ;PRINT INTAKE/OUTPUT SECTION OF VITAL SIGNS-I/O SHEET
 K ^TMP($J,"XI"),^TMP($J,"XO")
 F NN=1:1:GN(1)+1 S GMRI="XI"_NN K GMRLINE(GMRI)
 F NN=1:1:GN(2)+1 S GMRI="XO"_NN K GMRLINE(GMRI)
 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
 . F NN=1:1:GN(1)+1 S GMRI="XI"_NN I $D(^TMP($J,"GMR",GMRI,GDT)) D
 . . S GMRYDT=$O(^TMP($J,"GMR",GMRI,GDT,0)) I GMRYDT>0 S ^TMP($J,"XI",NN,GDT,GMRYDT)="",GMRLINE(GMRI)=GMRX1
 . F NN=1:1:GN(2)+1 S GMRI="XO"_NN I $D(^TMP($J,"GMR",GMRI,GDT)) D
 . . S GMRYDT=$O(^TMP($J,"GMR",GMRI,GDT,0)) I GMRYDT>0 S ^TMP($J,"XO",NN,GDT,GMRYDT)="",GMRLINE(GMRI)=GMRX1
 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
 I IOSL<($Y+6) D FOOTER,HEADER,DATES W !,?15,"|",?16,GMRX
 W !,"Intake(24 Hr)(cc)",?20,"|",GMRX F NN=1:1:GN(1)+1 S GMRI="XI"_NN I $D(GMRLINE(GMRI)) D
 .I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES S GMRI=GMRI(1) W !,?20,"|",?21,GMRX
 .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)
 I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES S GMRI=GMRI(1) W !,?10,"|",?11,GMRX
 W !,"Output(24 Hr)(cc)",?20,"|",GMRX
 F NN=1:1:GN(2)+1 S GI="XO"_NN I $D(GMRLINE(GI)) D
 .I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES W !,?20,"|",?21,GMRX S GMRI=GMRI(1)
 .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)
 Q
SETDATA ; FILL GMRLINE WITH I/O DATA AND WRITE GMRLINE
 F GMRI="XI","XO" S GMRY=0 F  S GMRY=$O(^TMP($J,GMRI,GMRY)) Q:GMRY'>0  D
 . 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)
 Q
 W ! W:GMRNAM'="" ?$X-3,$E(GMRNAM,1,35) W:SSN'="" "  "_SSN W:GMRBTH'="" "  "_GMRBTH W:GMRAGE'="" "  "_GMRAGE_" YRS" W:GMRSEX'="" "  "_GMRSEX
 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"
 D INP^VADPT S GMRVHLOC=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
 W !,"Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC),?55,"Page "_GMRPGC,?95,"VAF 10-7987 VICE SF 511",!
 W GSTRFIN Q
DATES ;PRINT DATE/TIME COLUMNS FOR VITAL SIGNS-I/O SHEET
 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_"  "
 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)
 W ?17,"|",?18,GMRLINE
 Q
 W:'($E(IOST)'="C"&'GFLAG) @IOF S GFLAG=1,GMRPGC=GMRPGC+1
 W !,?116,"PAGE ",GMRPGC,!
 Q
BP ;
 S GMR("B")=$O(^TMP($J,"GMR","B",GMRDT,"")) Q:GMR("B")=""
 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
 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)
 I GMRSITE(1)'="" S GI="B" D SYNOARY^GMVLGQU
 S $P(GMRLINE("B"),"|",GMRNM)=$E($P(GMR("B"),"/",1,2)_"          ",1,10)
 S $P(GMRLINE("B1"),"|",GMRNM)=$E($P(GMR("B"),"/",3)_" "_$S($L(GMRSITE," ")>3:$P(GMRSITE," "),1:"")_"          ",1,10)
 S $P(GMRLINE("B2"),"|",GMRNM)=$E($S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)_"          ",1,10)
 Q