FHWMAS ; HISC/REL - Process MAS Events ;2/1/95 08:53
;;5.5;DIETETICS;;Jan 28, 2005
S FHMAS3=0
S FHZ115="P"_DFN D ADD^FHOMDPA I FHDFN="" Q
F FHMAS1=0:0 S FHMAS1=$O(^UTILITY("DGPM",$J,FHMAS1)) Q:FHMAS1=""!(FHMAS1>3) D:'FHMAS3 A0 F FHMAS2=0:0 S FHMAS2=$O(^UTILITY("DGPM",$J,FHMAS1,FHMAS2)) Q:FHMAS2="" S FHNEW=$G(^(FHMAS2,"A")),FHOLD=$G(^("P")) D A1
K A0,ADM,FHWF,WARD,FHMAS1,FHMAS2,FHMAS3,FHNEW,FHOLD,X Q
A0 S FHMAS3=1 Q
A1 I FHNEW="" G DEL
; New/Edit actions
S ADM=$P(FHNEW,"^",14) Q:'ADM
I FHMAS1=1 Q:$P(FHNEW,"^",17) G ^FHWADM
I FHMAS1=2 G ^FHWTRN
G ^FHWDIS
DEL ; Delete actions
S ADM=$P(FHOLD,"^",14) Q:'ADM
I FHMAS1=1 G ^FHWDIS
I FHMAS1=2 G ^FHWTRN
G ^FHWDISD
FHWMAS ; HISC/REL - Process MAS Events ;2/1/95 08:53
+1 ;;5.5;DIETETICS;;Jan 28, 2005
+2 SET FHMAS3=0
+3 SET FHZ115="P"_DFN
DO ADD^FHOMDPA
IF FHDFN=""
QUIT
+4 FOR FHMAS1=0:0
SET FHMAS1=$ORDER(^UTILITY("DGPM",$JOB,FHMAS1))
IF FHMAS1=""!(FHMAS1>3)
QUIT
IF 'FHMAS3
DO A0
FOR FHMAS2=0:0
SET FHMAS2=$ORDER(^UTILITY("DGPM",$JOB,FHMAS1,FHMAS2))
IF FHMAS2=""
QUIT
SET FHNEW=$GET(^(FHMAS2,"A"))
SET FHOLD=$GET(^("P"))
DO A1
+5 KILL A0,ADM,FHWF,WARD,FHMAS1,FHMAS2,FHMAS3,FHNEW,FHOLD,X
QUIT
A0 SET FHMAS3=1
QUIT
A1 IF FHNEW=""
GOTO DEL
+1 ; New/Edit actions
+2 SET ADM=$PIECE(FHNEW,"^",14)
IF 'ADM
QUIT
+3 IF FHMAS1=1
IF $PIECE(FHNEW,"^",17)
QUIT
GOTO ^FHWADM
+4 IF FHMAS1=2
GOTO ^FHWTRN
+5 GOTO ^FHWDIS
DEL ; Delete actions
+1 SET ADM=$PIECE(FHOLD,"^",14)
IF 'ADM
QUIT
+2 IF FHMAS1=1
GOTO ^FHWDIS
+3 IF FHMAS1=2
GOTO ^FHWTRN
+4 GOTO ^FHWDISD