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

NURACE0.m

Go to the documentation of this file.
NURACE0 ;HIRMFO/RM-PATIENT CLASSIFICATION DRIVER ;4/15/88
 ;;4.0;NURSING SERVICE;**3**;Apr 25, 1997
EN1 ; ENTRY FROM ROUTINES NURACEW1 or NURACEW
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
 S CLASSREV=0 G SELT1
EN2 ; ENTRY FROM OPTION NURAPC-REVIND OR ROUTINE NURACEW
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
 S CLASSREV=1
SELT1 ; SET USER NAME
 S IOP=ION D QUIT,^%ZIS W @IOF S U="^" K IOP
 S NURSUSER=$P(^VA(200,DUZ,0),"^",1)
SELTLOP ;ENTER STAFF DATA
 S NURSNSW=0,NURSCKSW=0,NOREVSW=0,NURSRTSW=0,NASK=1
 I $D(NURSTABL) G:TABLSW=1 KILL S X="`"_+NURSTABL(TCNT),TABLSW=1,NASK=0
 S DIC(0)="EMZQ",NACT=1 D EN5^NURSCUTL G KILL:DFN'>0 D ^NURSAPCH
 I NURSX'="LEAVE"&(NURSX'="AWOL")&(NURSX'="OTH. FAC.") G AROUND
STAT W !!," THIS PATIENT IS ",$S(NURSX="LEAVE":"ON "_NURSX,NURSX="AWOL":NURSX,NURSX="OTH. FAC.":"IN ANOTHER FACILITY",1:""),", DO YOU STILL WISH TO CLASSIFY"
 S %=2 D YN^DICN
 G KILL:%=-1,SELTLOP:%=2,AROUND:%=1
 W !!," ANSWER YES OR NO " G STAT
AROUND D 1^VADPT S NURSNAM=VADM(1),SSN=VA("PID")
 S NURSRMBD=VAIN(5)
 S NAX=^NURSF(214,DFN,0)
 S NURSWARD=$S($D(NAX):$P(NAX,U,3),1:"")
 S NURSBS=$S($D(NAX):$P(NAX,U,4),1:"")
 D EN6^NURSCUTL S PADMDT=$P(VAIN(7),U),PADMDT=$S(PADMDT'="":$E(PADMDT,4,5)_"/"_$E(PADMDT,6,7)_"/"_$E(PADMDT,2,3),1:"")
STARTIT ;CONTINUE CLASSIFICATION
 I NURSBS=""!(NURSWARD="") W $C(7),!!," BAD LOCATION/BED SECTION DATA-CANNOT CLASSIFY " G KILL
 S NURSBSF=$S($D(^NURSF(213.3,NURSBS,0)):$P(^(0),U,1),1:"")
 I NURSBS=8!(NURSBS=6)!(NURSBS=10) W !!,$C(7),"CANNOT CLASSIFY ",NURSBSF," PATIENTS " G KILL
 S NURSCLAS("CL")=1 D EN2^NURSCUTL
A I NURSCLAS'>0 S (CLASSX,CONFIGX,USERX,FACTX,COMMENTX,USENO,FACTORS,DATEX)="" G STARTREV
 S NCX=$S($D(^NURSA(214.6,NURSCLAS,0)):^(0),1:""),NURSBS1=$P(NCX,"^",9)
 I NURSBS1="" W $C(7),"****BAD PREVIOUS CLASSIFICATION DATA CANNOT PROCESS THIS PATIENT****" Q
 I NURSBS'=NURSBS1 S (CLASSX,CONFIGX,USERX,FACTX,COMMENTX,USENO,FACTORS,DATEX)="",CLASSREV=0 G STARTREV
 S DATEX=$P(NCX,"^",1),CLASSX=$P(NCX,"^",3),CONFIGX=$P(NCX,"^",5)
 S:CONFIGX="C" CONFIGX="COMPUTER" S:CONFIGX="U" CONFIGX="USER"
 S FACTX="",FACTORS=$P(NCX,"^",4),USENO=$P(NCX,"^",6),COMMENTX=$P(NCX,"^",7),USERX=$P(^VA(200,USENO,0),"^",1)
 I FACTORS'="N/A" F I=1:1:$L(FACTORS) S:I=1 FACTX=$E(FACTORS,1) S:I'=1 FACTX=FACTX_","_$E(FACTORS,I)
 E  S FACTX="N/A"
STARTREV ; SET VARIABLES IF REVIEWING PATIENT RECORD
 D EN1^NURACE7
 G SELTLOP
CHKJOB ;
 ; if acuity job did not run print warning, but do not stop user from
 ; classifying patients
 I $S('$D(^DIC(213.9,1,"DATE")):1,$P(^("DATE"),"^")'=DT:1,'$P(^("DATE"),"^",2):1,1:0) W !! D EN3^NURACE8
 Q
KILL ;KILL CLASSREV VARIABLE
 K CLASSREV
QUIT ;KILL LOCAL VARIABLES
 K %DT,ABORTSW,CAT,CHANGESW,NURSBS1,CK,CLASSX,COMMENTX,CONFIGX,DA,DATEX,DIC,DFN,NURS8SW,NURSCLAS,CHKVAR,FACT,FACTORS,FACTX,FCK,NURS5SW,NURS4SW,I,J,NOREVSW,REENTSW,NURSRVDT,NURSRTSW,NURSREV,NEWREV,NACT,NAX,NCX,NRX,NURSX,NURS11SW,TX,VAROOT
 K NS1,NURSA,NURSTRAN,NURSOLDC,NASK,FACT1 D KVAR^VADPT K VA
 K NURS9SW,NURSADM,NURSCKSW,NURSTCLS,NURMDSW,NWFCTSW,NXT,NURS1SW,OUTSW,PADMDT,NURSNAM,SSN,PREV,REVDATE,REVIEWER,REVNO,SAVEX,NURS7SW,NURS6SW,NURS10SW,NURS3SW,NURS13SW,NURSUSER,USENO,USERX,NURSBS,XCLAS,NURSWARD,NURSRMBD,NURSBSF,%,NPWARD
 Q