SDCOU2 ;ALB/RMO - Utilities Cont. - Check Out;16 MAR 1993 1:00 pm
;;5.3;Scheduling;**1015**;Aug 13, 1993;Build 21
;
EXOE(E) ;Determine if Encounter is Exempt from Outpatient Classifications
; Input -- E Outpatient Encounter IEN
; Output -- 1=Yes and 0=No
N E0,Y
S E0=$G(^SCE(+E,0)) G EXOEQ:E0']""
I $$EX(+$P(E0,"^",3),+E0) D
.S Y=1
.I $P(E0,"^",8)=1,$P($G(^SC(+$P(E0,"^",4),0)),"^",18),'$$EX(+$P(^(0),"^",18),+E0) S Y=0
EXOEQ Q +$G(Y)
;
EX(C,D) ;Determine if Clinic Stop Code is Exempt from Outpatient Classifications
; Input -- C Clinic Stop Code file IEN
; D Date/Time (Optional- default today@2359)
; Output -- 1=Yes and 0=No
N E,S,Y
S D=$S($G(D)>0:D,1:DT) S:'$P(D,".",2) D=D_.2359
S S=+$P($G(^DIC(40.7,+C,0)),"^",2)
S E=+$O(^SD(409.45,"B",S,0))
I $D(^SD(409.45,E,"E",+$O(^(+$O(^SD(409.45,E,"E","AID",-D)),0)),0)),$P($G(^(0)),"^",2) S Y=1
Q +$G(Y)
SDCOU2 ;ALB/RMO - Utilities Cont. - Check Out;16 MAR 1993 1:00 pm
+1 ;;5.3;Scheduling;**1015**;Aug 13, 1993;Build 21
+2 ;
EXOE(E) ;Determine if Encounter is Exempt from Outpatient Classifications
+1 ; Input -- E Outpatient Encounter IEN
+2 ; Output -- 1=Yes and 0=No
+3 NEW E0,Y
+4 SET E0=$GET(^SCE(+E,0))
IF E0']""
GOTO EXOEQ
+5 IF $$EX(+$PIECE(E0,"^",3),+E0)
Begin DoDot:1
+6 SET Y=1
+7 IF $PIECE(E0,"^",8)=1
IF $PIECE($GET(^SC(+$PIECE(E0,"^",4),0)),"^",18)
IF '$$EX(+$PIECE(^(0),"^",18),+E0)
SET Y=0
End DoDot:1
EXOEQ QUIT +$GET(Y)
+1 ;
EX(C,D) ;Determine if Clinic Stop Code is Exempt from Outpatient Classifications
+1 ; Input -- C Clinic Stop Code file IEN
+2 ; D Date/Time (Optional- default today@2359)
+3 ; Output -- 1=Yes and 0=No
+4 NEW E,S,Y
+5 SET D=$SELECT($GET(D)>0:D,1:DT)
IF '$PIECE(D,".",2)
SET D=D_.2359
+6 SET S=+$PIECE($GET(^DIC(40.7,+C,0)),"^",2)
+7 SET E=+$ORDER(^SD(409.45,"B",S,0))
+8 IF $DATA(^SD(409.45,E,"E",+$ORDER(^(+$ORDER(^SD(409.45,E,"E","AID",-D)),0)),0))
IF $PIECE($GET(^(0)),"^",2)
SET Y=1
+9 QUIT +$GET(Y)