54 lines
2.1 KiB
Mathematica
54 lines
2.1 KiB
Mathematica
NURACEW ;HIRMFO/RM,MD,FT-CLASSIFY PATIENTS ON A GIVEN WARD ;8/14/96 09:57
|
|
;;4.0;NURSING SERVICE;;Apr 25, 1997
|
|
EN1 ;
|
|
Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
|
|
D QUIT
|
|
S REVSW=0
|
|
G EDIT
|
|
EN2 ; ENTRY FROM OPTION NURAPC-REVWRD
|
|
Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
|
|
D QUIT
|
|
S REVSW=1
|
|
EDIT ; SELECT WARD TO BE SEARCHED
|
|
S DIC="^NURSF(211.4,",DIC("A")="Enter UNIT you want to search: ",DIC(0)="AEQMZ",DIC("S")="I $S('$D(^(""I"")):1,$P(^(""I""),U)'=""I"":1,1:0),$S('$D(^(1)):1,$P(^(1),U)=""A"":1,1:0)"
|
|
D ^DIC K DIC I (X="^")!(+Y'>0) K REVSW Q
|
|
S WARDNAM=+Y,DFN=$O(^NURSF(214,"AF","A",WARDNAM,0))
|
|
; CHECK TO SEE IF ANY PATIENTS REGISTERED ON WARD
|
|
S NPWARD=WARDNAM D EN6^NURSAUTL I DFN="" W !,*7,"**** NO PATIENTS REGISTERED ON WARD ",NPWARD," ****" K WARDNAM,NPWARD,DA,NOPATSW,REVSW,DIC,DIC Q
|
|
K NURSTABL S TCNT=0
|
|
BGNRPT ; VALIDATE EACH PATIENT REGISTERED ON WARD
|
|
S XRMBD="" D 1^VADPT
|
|
S:VAIN(5)'="" XRMBD=VAIN(5)
|
|
S TCNT=TCNT+1,NURSTABL(TCNT)=DFN_"^"_VADM(1),ROOMTABL(TCNT)=XRMBD,NURSCNT=TCNT
|
|
READNXT ; GET NEXT PATIENT
|
|
S DFN=$O(^NURSF(214,"AF","A",WARDNAM,DFN))
|
|
G:DFN="" CHKENTR
|
|
G BGNRPT
|
|
QUIT ;KILL LOCAL VARIABLES
|
|
K X,Y,POP,WARDNAM,DIC,DFN,NOPATSW,I
|
|
Q
|
|
CHKENTR ;ASK TO CLASSIFY ON THE WARD
|
|
D QUIT
|
|
G:('$D(NURSTABL(1))) QUIT2
|
|
W !,"Begin updating patient classifications."
|
|
S TCNT=0
|
|
D SORTTABL^NURACEW1
|
|
CHKCONT ;
|
|
S TCNT=TCNT+1
|
|
G:('$D(NURSTABL(TCNT))) QUIT2
|
|
CHKCONT1 ;
|
|
W !!,$P(NURSTABL(TCNT),"^",2),?$X+10,ROOMTABL(TCNT)," OK? YES// " R NURSX:DTIME
|
|
S:NURSX?1L NURSX=$C($A(NURSX)-32) I (NURSX="^")!('$T) G QUIT2
|
|
I ((NURSX="")!($E(NURSX,1)="Y")) S TABLSW=0 D:REVSW=0 EN1^NURACE0 D:REVSW=1 EN2^NURACE0 G CHKCONT
|
|
G:NURSX?1"N".E CHKCONT2
|
|
W !,"ANSWER YES OR NO" G CHKCONT1
|
|
CHKCONT2 ;
|
|
W !!,"Do you wish to stop looping through names? YES//" R NURSX:DTIME
|
|
S:NURSX?1L NURSX=$C($A(NURSX)-32) I (('$T)!(NURSX="")!($E(NURSX,1)="Y")!(NURSX="^")) G QUIT2
|
|
I NURSX?1"N".E G CHKCONT
|
|
W !,"ANSWER YES OR NO" G CHKCONT2
|
|
QUIT2 ; KILL THE REST OF THE VARIABLES
|
|
I $D(NURSTABL(1)) W !!,?16,"**** ROUTINE FINISHED ****",!!
|
|
K NURSTABL,NURSX,TABLSW,TCNT,XRMBD,REVSW,NURSCNT,NURSY,NURSZ,ROOMTABL,NURSDTSW,NURSWHO,VAROOT
|
|
Q
|