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

NURCYED0.m

Go to the documentation of this file.
NURCYED0 ;HIRMFO/YH,FT-PATIENT INTAKE/OUTPUT ENTER/EDIT ;9/16/96  14:31
 ;;4.0;NURSING SERVICE;;Apr 25, 1997
EN1 ;CALL TO EDIT PATIENT OUTPUT
 S X="GMRYED1" X ^%ZOSF("TEST") Q:'$T  S (GNUROP,NUROP)=1 D EDIT,Q Q
EN2 ;CALL TO EDIT INTAKE
 S X="GMRYED1" X ^%ZOSF("TEST") Q:'$T  S (GNUROP,NUROP)=2 D EDIT,Q Q
EN3 ;IV AND IV MAINTENANCE
 S X="GMRYED1" X ^%ZOSF("TEST") Q:'$T  S (GNUROP,NUROP)=3 D EDIT,Q Q
EDIT ;
 S (NURQUIT,NURQUIT(1))=0 D WARDPAT^NURCVUT0 Q:NURQUIT!(NUREDB["S"&'$D(NRMBD))  D SETUTIL I '$D(^TMP($J)) W:"Ss"[NUREDB !,"*** NO PATIENTS REGISTERED IN THESE ROOMS",! Q
 S NURRM="" F  S NURRM=$O(^TMP($J,NURRM)) Q:NURRM=""!NURQUIT  S NBED="" F  S NBED=$O(^TMP($J,NURRM,NBED)) Q:NBED=""!NURQUIT  S NURNAM="" F  S NURNAM=$O(^TMP($J,NURRM,NBED,NURNAM)) Q:NURNAM=""!NURQUIT  D EDTPT
 Q
EDTPT ;
 S DFN=0 F  S DFN=$O(^TMP($J,NURRM,NBED,NURNAM,DFN)) Q:DFN'>0!NURQUIT  D CHECK Q:DA'>0  D:"Pp"'[NUREDB ASKOK Q:NURQUIT  D EDIT2
 Q
EDIT2 I 'NURQUIT(1) S GMROUT=0 D 1^VADPT S GMRHLOC=0 I $D(^DIC(42,+$P(VAIN(4),"^"),44)) S GMRHLOC=+$P(^(44),"^")
 I 'NURQUIT(1) W:GMRHLOC'>0 !,"HOSPITAL LOCATION NOT AVAILABLE",! D:GMRHLOC>0 OUTPUT^GMRYED1:GNUROP=1,INPUT^GMRYED1:GNUROP=2,LIST^GMRYED3:GNUROP=3 S (GMROUT,NURQUIT)=0 S:"Pp"[NUREDB NURQUIT=1
 Q
ASKOK ;  LOOPING THROUGH NAMES
 S NURQUIT(1)=0 W !,NURNAM,?$X+10,$S(NURRM="  BLANK":"    ",1:NURRM)_"-"_$S(NBED="  BLANK":"   ",1:NBED_"  ") S %=1 D YN^DICN I %=1!(%=-1) S:%=-1 NURQUIT=1 Q
 I '% W $C(7),!,?4,"ANSWER 'YES' or 'NO'" G ASKOK
ASL W !,"Do you wish to stop looping through names?" S %=1 D YN^DICN W ! I %=1!(%=-1) S NURQUIT=1 Q
 I '% W $C(7),!,?4,"ANSWER 'YES' or 'NO'" G ASL
 S NURQUIT(1)=1
 Q
SETUTIL ; SET ARRAY OF PATIENTS
 K ^TMP($J) I "Pp"[NUREDB S NURWARD=$S($D(^NURSF(214,DFN,0)):$P(^(0),"^",3),1:"") D WRDST
 I "SsUu"[NUREDB F DFN=0:0 S DFN=$O(^NURSF(214,"AF","A",NURWARD,DFN)) Q:DFN'>0  D WRDST
 Q
WRDST ; SET UTILITY FOR PATIENTS ON WARD
 W:$E(IOST)="C" "." D 1^VADPT
 Q:"Ss"[NUREDB&($S(VAIN(5)="":1,1:'$D(NRMBD($P($P(VAIN(5),"^"),"-",1,2)))))!(VADM(1)="")
 S ^TMP($J,$S($P($P(VAIN(5),"^"),"-")'="":$P($P(VAIN(5),"^"),"-"),1:"  BLANK"),$S($P($P(VAIN(5),"^"),"-",2)'="":$P($P(VAIN(5),"^"),"-",2),1:"  BLANK"),VADM(1),DFN)=""
 Q
DATE ; CALL TO SET AND GMRVIDT (WHEN THE VITALS WERE TAKEN)
 ; ALSO RETURNS NURQUIT=1 IF TIMEOUT OR UPARROW OUT.
 S X="^",%DT("A")="ENTER DATE (TIME Required) VITALS WERE TAKEN: ",%DT="XAPETR",%DT(0)="-NOW" D ^%DT K %DT
 I Y<0!(X="^") S NURQUIT=1 Q
 S GMRVIDT=Y
 Q
Q ;
 D KVAR^VADPT K NURP,NURX,NRMBD,NURI,NURLEN,NURRMST,GMRQUAL,GMRHLOC,DA,GNUROP,ND1,NDA,NORM,NPWARD,NURQUIT,NUREDB,NURSX,NURSY,NURWARD,NURWLO,NWLOC,POP,VA,DFN,GMROUT,NURHLO,NURRM,GDA,NURNAM,NBED,NUROP,NUROUT,X,Y
 Q
CHECK I '$D(^GMR(126,0)) S ^GMR(126,0)="PATIENT I/O FILE^126P^0^0"
 S X=DFN,DIC(0)="Z",DIC="^GMR(126,",D="B" D MIX^DIC1 S:Y>0 DA=+$P(Y,"^") G:Y>0 NEXT K DD S (DINUM,X)=DFN,DIC(0)="L",DLAYGO=126 D FILE^DICN S DA=+$P(Y,"^")
NEXT K DIC,DDLAYGO,DO,DD Q