VistA-WorldVistAEHR/r/NURSING_SERVICE-NUR/NURCES2.m

80 lines
4.8 KiB
Mathematica
Raw Permalink Normal View History

2009-11-29 13:37:14 -05:00
NURCES2 ;HIRMFO/YH-END OF SHIFT REPORT PART 3 - ITEMIZED I/O DATA ;7/15/97
;;4.0;NURSING SERVICE;**2,24**;Apr 25, 1997
SETARRY ;SET DATA IN ^TMP($J,"GMRY", FOR EACH PATIENT
S (GDCIV,GQ,GQT,GMROUT)=0,GRPT=10 I '$D(^GMR(126,"B",DFN)) Q
S GSAVEH=0,DA(1)=$O(^GMR(126,"B",DFN,0)) K ^TMP($J,"GMRY")
F II="IN","OUT" D SAVE^GMRYRP2
D SAVEIV^GMRYRP2,IVM
D REPORT1^GMRYRP3 S NURTLTI=$S('$D(GTOTLI):"",1:GTOTLI),NURTLTO=$S('$D(GTOTLO):"",1:GTOTLO) D SETIV K GRPT,GSAVE Q
SETIV ;SET IV TEXT
D IV^NURCES3,IVTUBE
Q
IVM ;SET IV MAINTENANCE IN ^TMP($J,"GMRY"
Q:'$D(^GMR(126,DFN,"IVM","B"))
S GSITE="" F S GSITE=$O(^GMR(126,DA(1),"IVM","B",GSITE)) Q:GSITE="" S DA=$O(^(GSITE,0)) Q:DA'>0 D SCARE
Q
SCARE ;
Q:'$D(^GMR(126,DA(1),"IVM",DA,1,"B"))
S GSTRT=0 F S GSTRT=$O(^GMR(126,DA(1),"IVM",DA,1,"B",GSTRT)) Q:GSTRT'>0 S GMRINDT=GSTRT,GDAY=0 D NEXT^GMRYRP1 I '(GMRINDT<GMRSTRT!(GMRINDT>GMRFIN)) D SETSIFT^GMRYRP2 D
. S GDA=0 F S GDA=$O(^GMR(126,DA(1),"IVM",DA,1,"B",GSTRT,GDA)) Q:GDA'>0 D SETUT
Q
SETUT ;
S GSITE(GSITE)="" D FINDCA^GMRYCATH(.GSITE)
S GPORT=+$P($G(^GMR(126,DA(1),"IVM",DA,1,GDA,0)),"^",7),GPORT=$S($D(^GMR(126,DFN,"IV",GPORT,3)):$P(^(3),"^"),1:"")
S ^TMP($J,"GMRY",$P(GMRINDT,"."),GSHIFT,"IV",GMRINDT,GSTRT,"Z",GDA,1)=$P(^GMR(126,DA(1),"IVM",DA,1,GDA,0),"^",1,5)_"^"_$P(^(0),"^",6)_"^"_GSITE_"^"_GSITE(GSITE)_"^"_GPORT Q
IVTUBE ;OBTAIN LAST TUBING CHANGED
D SELSITE^GMRYMNT Q:'$D(GMRXY) K NURTUBE S N=0 F S N=$O(GMRXY(N)) Q:N'>0 D TUBING
K GDA,GYES,GCT,GDATA,GDT,GIVDT,GMRXY,GSITE,GST Q
TUBING S GSITE="",NURTUBE=0 F S GSITE=$O(GMRXY(N,GSITE)) Q:GSITE="" I GCT(GSITE)>0 S GYES=0,GDA=$S('$D(^GMR(126,DFN,"IVM","B",GSITE)):"",1:$O(^GMR(126,DFN,"IVM","B",GSITE,0))) D:GDA>0 CHANGED
Q
CHANGED ;
S GDA(1)=0 F S GDA(1)=$O(^GMR(126,DFN,"IVM",GDA,1,"C",GDA(1))) Q:GDA(1)'>0!GYES S GDA(2)=0 F S GDA(2)=$O(^GMR(126,DFN,"IVM",GDA,1,"C",GDA(1),GDA(2))) Q:GDA(2)'>0!GYES D CHANGED1
Q
CHANGED1 ;
I $D(^GMR(126,DFN,"IVM",GDA,1,GDA(2),0)),$P(^(0),"^",3)["Y" S NURTUBE(GSITE)=$P(^(0),"^"),GYES=1,NURTUBE=NURTUBE+1
Q
HEADER ; PRINTING OF HEADING ROUTINE
I $E(IOST)="C",NURSW1 W !,$C(7),"Enter <RET> to continue " R X:DTIME I '$T!(X="^") S NURQUIT=1 Q
S Y=(GMRFIN+.0001)_"00"
S NURPAGE=NURPAGE+1,NURSW1=1 W:NURPAGE>1 @IOF
W !,NURDT,?20,"END-OF-SHIFT REPORT",?40,"UNIT: ",NPWARD W ?$S(NOPT=1:90,NOPT=2:55,1:55),"TOUR: "_+$E($P(GMRSTRT,".",2),1,2)_":"_$E($P(GMRSTRT,".",2)_"00",3,4)_"-"_+$E($P(Y,".",2),1,2)_":",$E($P(Y,".",2),3,4)
W ?$S(NOPT=1:118,NOPT=2:72,1:72),"PAGE:",NURPAGE
W !,"ROOM-BED/NAME/SSN/",?25,"|ADMITTING DX/ |PT |LATEST VITALS" W:NOPT=1 ?68,"|PATIENT PROBLEMS"
W !,"SPECIALTY/DIET/ALLERGIES",?25,"|DATE/MDs",?42,"|CAT|" W:NOPT=1 ?68,"|",!,NURX,! W:NOPT=2 !,$E(NURX,1,79),!
Q
PTDATA ;
S NPT(1)=$S($P(VAIN(5),"^")'="":$P(VAIN(5),"^"),1:"")
S NPT(2)=$S(N1'=" BLANK":$E(N1,1,17),1:""),NPT(3)=NSSN,NPT=3 D FITLINE^NURCES5("Specialty: "_$P($G(VAIN(3)),"^",2),25,.NPT)
I GFH D FITLINE^NURCES5(NDIET,25,.NPT)
D ALLERGY^NURCES4
S NCL(1)=$S($D(NURCAT):NURCAT,1:"") S NADM=0 D INP^VADPT D FITLINE^NURCES5(VAIN(9),16,.NADM)
S Y=$P(VAIN(7),"^") S:Y'="" NADM=NADM+1,NADM(NADM)=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3) S Y=$P(Y,".",2) S:Y'="" NADM(NADM)=NADM(NADM)_"@"_$E(Y_"00",1,2) S Y=$E(Y,3,4) S:Y'="" NADM(NADM)=NADM(NADM)_":"_$E(Y_"0",1,2)
S NADM=NADM+1,NADM(NADM)=$P(VADM(4),"^")_" yrs. "_$S($P(VADM(5),"^",2)'="":$P(VADM(5),"^",2),1:" ")
I $P($G(VAIN(11)),"^",2)'="" D K G
. S G=0,NADM=NADM+1,NADM(NADM)=$P(VAIN(11),"^",2),G=$O(^VA(200,"B",NADM(NADM),0)),NADM=NADM+1,NADM(NADM)=" (A)"
. I G>0,$D(^VA(200,G,.13)) S G(1)=$P($G(^(.13)),"^",7),G(2)=$P($G(^(.13)),"^",8) D
. . I G(1)'="" S NADM=NADM+1,NADM(NADM)=G(1) D
. . . I $L(G(1))>11 S NADM=NADM+1,NADM(NADM)=" (V)"
. . . E S NADM(NADM)=NADM(NADM)_" (V)"
. . I G(2)'="" S NADM=NADM+1,NADM(NADM)=G(2) D
. . . I $L(G(2))>11 S NADM=NADM+1,NADM(NADM)=" (D)"
. . . E S NADM(NADM)=NADM(NADM)_" (D)"
I $P($G(VAIN(2)),"^",2)'="" D K G
. S G=0,NADM=NADM+1,NADM(NADM)=$P(VAIN(2),"^",2),G=$O(^VA(200,"B",NADM(NADM),0)),NADM=NADM+1,NADM(NADM)=" (P)"
. I G>0,$D(^VA(200,G,.13)) S G(1)=$P($G(^(.13)),"^",7),G(2)=$P($G(^(.13)),"^",8) D
. . I G(1)'="" S NADM=NADM+1,NADM(NADM)=G(1) D
. . . I $L(G(1))>11 S NADM=NADM+1,NADM(NADM)=" (V)"
. . . E S NADM(NADM)=NADM(NADM)_" (V)"
. . I G(2)'="" S NADM=NADM+1,NADM(NADM)=G(2) D
. . . I $L(G(2))>11 S NADM=NADM+1,NADM(NADM)=" (D)"
. . . E S NADM(NADM)=NADM(NADM)_" (D)"
S NVM(1)="" D VM^NURCES1 I GPACK,$D(NURTLTI) S:NURTLTI>0 NADM=NADM+1,NADM(NADM)="Intake: "_NURTLTI
I GPACK,$D(NURTLTO) S:NURTLTO>0 NADM=NADM+1,NADM(NADM)="Output: "_NURTLTO
K NURTLTI,NURTLTO Q
PRINT2 I $D(NPT(NN)),(NPT(NN)'="") W $E(NPT(NN),1,25)
W ?25,"|" I $D(NADM(NN)),(NADM(NN)'="") W $E(NADM(NN),1,16)
W ?42,"|" I $D(NCL(NN)),(NCL(NN)'="") W NCL(NN)
W ?46,"|" I $D(NVM(NN)),(NVM(NN)'="") W NVM(NN)
I NOPT=1 W ?68,"|" I $D(NPR(NN)),(NPR(NN)'="") W NPR(NN)
W ! Q