ENPLUTL ;WISC/SAB-PROJECT PLANNING UTILITIES ;6/8/94
;;7.0;ENGINEERING;**11**;Aug 17, 1993
Q
POSTCL(ENDA,ENAR,ENSKIP) ; Post Text to Communication Log
; ENDA - ien of project in file #6925
; ENAR - closed root of text array (array has positive numbered nodes)
; ENSKIP - optional number of lines to skip before text (defaults to 1)
N ENLC,ENWPLC,ENX
S ENAR=$S($E(ENAR,$L(ENAR))=")":$E(ENAR,1,$L(ENAR)-1)_",",$E(ENAR,$L(ENAR))'="(":ENAR_"(",1:ENAR)
S ENSKIP=$G(ENSKIP) S:ENSKIP'=+ENSKIP\1 ENSKIP=1
S ENWPLC=$P($G(^ENG("PROJ",ENDA,80,0)),U,3)
F Q:'$D(^ENG("PROJ",ENDA,80,ENWPLC+1,0)) S ENWPLC=ENWPLC+1
S ENLC=0
I ENSKIP F ENLC=1:1:ENSKIP S ^ENG("PROJ",ENDA,80,ENWPLC+ENLC,0)=" "
S ENX="" F S ENX=$O(@(ENAR_"ENX)")) Q:ENX="" D
. S ENLC=ENLC+1
. S ^ENG("PROJ",ENDA,80,ENWPLC+ENLC,0)=@(ENAR_"ENX)")
S ENWPLC=ENWPLC+ENLC
S $P(^ENG("PROJ",ENDA,80,0),U,3,5)=ENWPLC_U_ENWPLC_U_$P(DT,".")
Q
LTZ() ; Local TimeZone Extrinsic Variable
; Returns 3 character local timezone
N D0,DA,DIC,DIQ,DR,ENDIQ,Y
S DA=$O(^XMB(1,0)) Q:'DA ""
S DIC=4.3,DIQ="ENDIQ(",DIQ(0)="E",DR=1
D EN^DIQ1
Q ENDIQ(4.3,DA,1,"E")
FDT(ENDTI) ; Formatted Date/Time Extrinsic Function
; ENDTI - internal FileMan date
; Returns date/time in mm/dd/yy hh:mm format
N ENDTE,ENT
S ENT=$P(ENDTI,".",2)_$E("000000",1,6-$L($P(ENDTI,".",2)))
S ENDTE=$E(ENDTI,4,5)_"/"_$E(ENDTI,6,7)_"/"_$E(ENDTI,2,3)
S ENDTE=ENDTE_" "_$E(ENT,1,2)_":"_$E(ENT,3,4)
Q ENDTE
TZD(ENLTZ,ENRTZ) ; Timezone Difference Extrinsic Function
; ENLTZ - first 3 character timezone (normally local timezone)
; ENRTZ - second 3 character timezone (normally remote timezone)
; Returns difference in hours
; result could be added to remote time to convert it to local time
N D0,DA,DIC,DIQ,DR,ENDIQ,ENLTZDA,ENRTZDA,X,Y
I '$D(ENLTZ)!'$D(ENRTZ) Q ""
S DIC=4.4,DIC(0)="X",X=ENLTZ D ^DIC Q:Y<0 "" S ENLTZDA=+Y
S DIC=4.4,DIC(0)="X",X=ENRTZ D ^DIC Q:Y<0 "" S ENRTZDA=+Y
S DIC=4.4,DR=2,DIQ="ENDIQ(",DIQ(0)="E"
S DA=ENLTZDA D EN^DIQ1
S DA=ENRTZDA D EN^DIQ1
Q ENDIQ(4.4,ENLTZDA,2,"E")-ENDIQ(4.4,ENRTZDA,2,"E")
PPDOM ; Determine Domain for project planning transmissions
N D0,DA,DIC,DIQ,DR,ENDIQ,X
S DA=$O(^DIC(6910,0)),DIC=6910,DIQ="ENDIQ(",DIQ(0)="E",DR=100
D EN^DIQ1
S ENDOMAIN=$G(ENDIQ(6910,DA,100,"E"))
I ENDOMAIN']"" W !,"Domain not found in PROJECT PLANNING ROLLUP DOMAIN (#100) field",!,"of the ENG INIT PARAMETERS (#6910) file. Transmission aborted!",!! R "Press RETURN to Continue",X:DTIME
Q
;ENPLUTL
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPLUTL 2522 printed Oct 16, 2024@17:55:54 Page 2
ENPLUTL ;WISC/SAB-PROJECT PLANNING UTILITIES ;6/8/94
+1 ;;7.0;ENGINEERING;**11**;Aug 17, 1993
+2 QUIT
POSTCL(ENDA,ENAR,ENSKIP) ; Post Text to Communication Log
+1 ; ENDA - ien of project in file #6925
+2 ; ENAR - closed root of text array (array has positive numbered nodes)
+3 ; ENSKIP - optional number of lines to skip before text (defaults to 1)
+4 NEW ENLC,ENWPLC,ENX
+5 SET ENAR=$SELECT($EXTRACT(ENAR,$LENGTH(ENAR))=")":$EXTRACT(ENAR,1,$LENGTH(ENAR)-1)_",",$EXTRACT(ENAR,$LENGTH(ENAR))'="(":ENAR_"(",1:ENAR)
+6 SET ENSKIP=$GET(ENSKIP)
if ENSKIP'=+ENSKIP\1
SET ENSKIP=1
+7 SET ENWPLC=$PIECE($GET(^ENG("PROJ",ENDA,80,0)),U,3)
+8 FOR
if '$DATA(^ENG("PROJ",ENDA,80,ENWPLC+1,0))
QUIT
SET ENWPLC=ENWPLC+1
+9 SET ENLC=0
+10 IF ENSKIP
FOR ENLC=1:1:ENSKIP
SET ^ENG("PROJ",ENDA,80,ENWPLC+ENLC,0)=" "
+11 SET ENX=""
FOR
SET ENX=$ORDER(@(ENAR_"ENX)"))
if ENX=""
QUIT
Begin DoDot:1
+12 SET ENLC=ENLC+1
+13 SET ^ENG("PROJ",ENDA,80,ENWPLC+ENLC,0)=@(ENAR_"ENX)")
End DoDot:1
+14 SET ENWPLC=ENWPLC+ENLC
+15 SET $PIECE(^ENG("PROJ",ENDA,80,0),U,3,5)=ENWPLC_U_ENWPLC_U_$PIECE(DT,".")
+16 QUIT
LTZ() ; Local TimeZone Extrinsic Variable
+1 ; Returns 3 character local timezone
+2 NEW D0,DA,DIC,DIQ,DR,ENDIQ,Y
+3 SET DA=$ORDER(^XMB(1,0))
if 'DA
QUIT ""
+4 SET DIC=4.3
SET DIQ="ENDIQ("
SET DIQ(0)="E"
SET DR=1
+5 DO EN^DIQ1
+6 QUIT ENDIQ(4.3,DA,1,"E")
FDT(ENDTI) ; Formatted Date/Time Extrinsic Function
+1 ; ENDTI - internal FileMan date
+2 ; Returns date/time in mm/dd/yy hh:mm format
+3 NEW ENDTE,ENT
+4 SET ENT=$PIECE(ENDTI,".",2)_$EXTRACT("000000",1,6-$LENGTH($PIECE(ENDTI,".",2)))
+5 SET ENDTE=$EXTRACT(ENDTI,4,5)_"/"_$EXTRACT(ENDTI,6,7)_"/"_$EXTRACT(ENDTI,2,3)
+6 SET ENDTE=ENDTE_" "_$EXTRACT(ENT,1,2)_":"_$EXTRACT(ENT,3,4)
+7 QUIT ENDTE
TZD(ENLTZ,ENRTZ) ; Timezone Difference Extrinsic Function
+1 ; ENLTZ - first 3 character timezone (normally local timezone)
+2 ; ENRTZ - second 3 character timezone (normally remote timezone)
+3 ; Returns difference in hours
+4 ; result could be added to remote time to convert it to local time
+5 NEW D0,DA,DIC,DIQ,DR,ENDIQ,ENLTZDA,ENRTZDA,X,Y
+6 IF '$DATA(ENLTZ)!'$DATA(ENRTZ)
QUIT ""
+7 SET DIC=4.4
SET DIC(0)="X"
SET X=ENLTZ
DO ^DIC
if Y<0
QUIT ""
SET ENLTZDA=+Y
+8 SET DIC=4.4
SET DIC(0)="X"
SET X=ENRTZ
DO ^DIC
if Y<0
QUIT ""
SET ENRTZDA=+Y
+9 SET DIC=4.4
SET DR=2
SET DIQ="ENDIQ("
SET DIQ(0)="E"
+10 SET DA=ENLTZDA
DO EN^DIQ1
+11 SET DA=ENRTZDA
DO EN^DIQ1
+12 QUIT ENDIQ(4.4,ENLTZDA,2,"E")-ENDIQ(4.4,ENRTZDA,2,"E")
PPDOM ; Determine Domain for project planning transmissions
+1 NEW D0,DA,DIC,DIQ,DR,ENDIQ,X
+2 SET DA=$ORDER(^DIC(6910,0))
SET DIC=6910
SET DIQ="ENDIQ("
SET DIQ(0)="E"
SET DR=100
+3 DO EN^DIQ1
+4 SET ENDOMAIN=$GET(ENDIQ(6910,DA,100,"E"))
+5 IF ENDOMAIN']""
WRITE !,"Domain not found in PROJECT PLANNING ROLLUP DOMAIN (#100) field",!,"of the ENG INIT PARAMETERS (#6910) file. Transmission aborted!",!!
READ "Press RETURN to Continue",X:DTIME
+6 QUIT
+7 ;ENPLUTL