ANSUD ;IHS/OIRM/DSD/CSC - SELECT DATE/SHIFT/UNIT; [ 02/25/98 10:32 AM ]
;;3.0;NURSING PATIENT ACUITY;;APR 01, 1996
;;SELECT DATE/SHIFT/UNIT
EN ;EP;TO SELECT DATE, SHIFT AND NURSING UNIT
K ANSSH,ANSUN,ANSRB
D DATE
Q:$D(DTOUT)!$D(DUOUT)
D SHIFT
Q:$D(DTOUT)!$D(DUOUT)
D UNIT
Q
DATE ;EP;TO SELECT DATE
I '$D(ANSPAR) S ANSPAR=^ANSD(51,1,0)
I $G(ANSDT)?7N S Y=ANSDT X ^DD("DD") S DIR("B")=Y
D NOW^%DTC ;CSC 10-97
S DIR(0)="DO^:"_X,DIR("A")="Date..........."
D DIR^ANSDIC
Q:$D(DTOUT)!$D(DUOUT)
I $G(Y(0))'="" S ANSDT=Y(0) W " "_ANSDT ;CSC 10-97
I $G(Y)<1 S DUOUT="" Q
S ANSDT=Y
Q
SHIFT ;EP;TO SELECT SHIFT
Q:'$D(ANSPAR)
K ANSSH
S ANSS=$P(ANSPAR,U,5)
S X=$P($T(@ANSS),";;",2)
S DIR(0)="SOA^"_X,DIR("A")="Shift..........: "
S X=$P($T(@ANSS),";;",2),DIR("?")="Choose from: "_$TR(X,":;","- ")
W !
D DIR^ANSDIC
Q:$D(DTOUT)!$D(DUOUT)
I $G(Y)<1 S DUOUT="",ANSSH="" Q ;CSC12-19-96
S ANSSH=+Y
Q
NEWUNIT ;EP;TO ADD NEW NURSING UNITS
K DIC
S DIC(0)="AELMQZ"
UNIT ;EP;TO SELECT NURSING UNIT
Q:'$D(ANSPAR)
K ANSUN
S X=$P(ANSPAR,U,3)
I X,$D(^ANSD(59.1,X,0)) S DIC("B")=$P(^(0),U)
S DIC="^ANSD(59.1,",DIC(0)=$S('$D(DIC(0))#2:"AEMQZ",1:DIC(0)),DIC("A")="Nursing Unit...: "
W !
D DIC^ANSDIC
Q:$D(DTOUT)!$D(DUOUT)
I $G(Y)<1 S DUOUT="" Q
S ANSUN=+Y,ANSUNIT=Y(0)
Q
2 ;;1:DAY;2:NIGHT
3 ;;1:DAY;2:EVENING;3:NIGHT
ANSUD ;IHS/OIRM/DSD/CSC - SELECT DATE/SHIFT/UNIT; [ 02/25/98 10:32 AM ]
+1 ;;3.0;NURSING PATIENT ACUITY;;APR 01, 1996
+2 ;;SELECT DATE/SHIFT/UNIT
EN ;EP;TO SELECT DATE, SHIFT AND NURSING UNIT
+1 KILL ANSSH,ANSUN,ANSRB
+2 DO DATE
+3 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+4 DO SHIFT
+5 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+6 DO UNIT
+7 QUIT
DATE ;EP;TO SELECT DATE
+1 IF '$DATA(ANSPAR)
SET ANSPAR=^ANSD(51,1,0)
+2 IF $GET(ANSDT)?7N
SET Y=ANSDT
XECUTE ^DD("DD")
SET DIR("B")=Y
+3 ;CSC 10-97
DO NOW^%DTC
+4 SET DIR(0)="DO^:"_X
SET DIR("A")="Date..........."
+5 DO DIR^ANSDIC
+6 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+7 ;CSC 10-97
IF $GET(Y(0))'=""
SET ANSDT=Y(0)
WRITE " "_ANSDT
+8 IF $GET(Y)<1
SET DUOUT=""
QUIT
+9 SET ANSDT=Y
+10 QUIT
SHIFT ;EP;TO SELECT SHIFT
+1 IF '$DATA(ANSPAR)
QUIT
+2 KILL ANSSH
+3 SET ANSS=$PIECE(ANSPAR,U,5)
+4 SET X=$PIECE($TEXT(@ANSS),";;",2)
+5 SET DIR(0)="SOA^"_X
SET DIR("A")="Shift..........: "
+6 SET X=$PIECE($TEXT(@ANSS),";;",2)
SET DIR("?")="Choose from: "_$TRANSLATE(X,":;","- ")
+7 WRITE !
+8 DO DIR^ANSDIC
+9 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+10 ;CSC12-19-96
IF $GET(Y)<1
SET DUOUT=""
SET ANSSH=""
QUIT
+11 SET ANSSH=+Y
+12 QUIT
NEWUNIT ;EP;TO ADD NEW NURSING UNITS
+1 KILL DIC
+2 SET DIC(0)="AELMQZ"
UNIT ;EP;TO SELECT NURSING UNIT
+1 IF '$DATA(ANSPAR)
QUIT
+2 KILL ANSUN
+3 SET X=$PIECE(ANSPAR,U,3)
+4 IF X
IF $DATA(^ANSD(59.1,X,0))
SET DIC("B")=$PIECE(^(0),U)
+5 SET DIC="^ANSD(59.1,"
SET DIC(0)=$SELECT('$DATA(DIC(0))#2:"AEMQZ",1:DIC(0))
SET DIC("A")="Nursing Unit...: "
+6 WRITE !
+7 DO DIC^ANSDIC
+8 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+9 IF $GET(Y)<1
SET DUOUT=""
QUIT
+10 SET ANSUN=+Y
SET ANSUNIT=Y(0)
+11 QUIT
2 ;;1:DAY;2:NIGHT
3 ;;1:DAY;2:EVENING;3:NIGHT