source: FOIAVistA/tag/r/ENGINEERING-EN/ENPLUTL.m@ 1096

Last change on this file since 1096 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1ENPLUTL ;WISC/SAB-PROJECT PLANNING UTILITIES ;6/8/94
2 ;;7.0;ENGINEERING;**11**;Aug 17, 1993
3 Q
4POSTCL(ENDA,ENAR,ENSKIP) ; Post Text to Communication Log
5 ; ENDA - ien of project in file #6925
6 ; ENAR - closed root of text array (array has positive numbered nodes)
7 ; ENSKIP - optional number of lines to skip before text (defaults to 1)
8 N ENLC,ENWPLC,ENX
9 S ENAR=$S($E(ENAR,$L(ENAR))=")":$E(ENAR,1,$L(ENAR)-1)_",",$E(ENAR,$L(ENAR))'="(":ENAR_"(",1:ENAR)
10 S ENSKIP=$G(ENSKIP) S:ENSKIP'=+ENSKIP\1 ENSKIP=1
11 S ENWPLC=$P($G(^ENG("PROJ",ENDA,80,0)),U,3)
12 F Q:'$D(^ENG("PROJ",ENDA,80,ENWPLC+1,0)) S ENWPLC=ENWPLC+1
13 S ENLC=0
14 I ENSKIP F ENLC=1:1:ENSKIP S ^ENG("PROJ",ENDA,80,ENWPLC+ENLC,0)=" "
15 S ENX="" F S ENX=$O(@(ENAR_"ENX)")) Q:ENX="" D
16 . S ENLC=ENLC+1
17 . S ^ENG("PROJ",ENDA,80,ENWPLC+ENLC,0)=@(ENAR_"ENX)")
18 S ENWPLC=ENWPLC+ENLC
19 S $P(^ENG("PROJ",ENDA,80,0),U,3,5)=ENWPLC_U_ENWPLC_U_$P(DT,".")
20 Q
21LTZ() ; Local TimeZone Extrinsic Variable
22 ; Returns 3 character local timezone
23 N D0,DA,DIC,DIQ,DR,ENDIQ,Y
24 S DA=$O(^XMB(1,0)) Q:'DA ""
25 S DIC=4.3,DIQ="ENDIQ(",DIQ(0)="E",DR=1
26 D EN^DIQ1
27 Q ENDIQ(4.3,DA,1,"E")
28FDT(ENDTI) ; Formatted Date/Time Extrinsic Function
29 ; ENDTI - internal FileMan date
30 ; Returns date/time in mm/dd/yy hh:mm format
31 N ENDTE,ENT
32 S ENT=$P(ENDTI,".",2)_$E("000000",1,6-$L($P(ENDTI,".",2)))
33 S ENDTE=$E(ENDTI,4,5)_"/"_$E(ENDTI,6,7)_"/"_$E(ENDTI,2,3)
34 S ENDTE=ENDTE_" "_$E(ENT,1,2)_":"_$E(ENT,3,4)
35 Q ENDTE
36TZD(ENLTZ,ENRTZ) ; Timezone Difference Extrinsic Function
37 ; ENLTZ - first 3 character timezone (normally local timezone)
38 ; ENRTZ - second 3 character timezone (normally remote timezone)
39 ; Returns difference in hours
40 ; result could be added to remote time to convert it to local time
41 N D0,DA,DIC,DIQ,DR,ENDIQ,ENLTZDA,ENRTZDA,X,Y
42 I '$D(ENLTZ)!'$D(ENRTZ) Q ""
43 S DIC=4.4,DIC(0)="X",X=ENLTZ D ^DIC Q:Y<0 "" S ENLTZDA=+Y
44 S DIC=4.4,DIC(0)="X",X=ENRTZ D ^DIC Q:Y<0 "" S ENRTZDA=+Y
45 S DIC=4.4,DR=2,DIQ="ENDIQ(",DIQ(0)="E"
46 S DA=ENLTZDA D EN^DIQ1
47 S DA=ENRTZDA D EN^DIQ1
48 Q ENDIQ(4.4,ENLTZDA,2,"E")-ENDIQ(4.4,ENRTZDA,2,"E")
49PPDOM ; Determine Domain for project planning transmissions
50 N D0,DA,DIC,DIQ,DR,ENDIQ,X
51 S DA=$O(^DIC(6910,0)),DIC=6910,DIQ="ENDIQ(",DIQ(0)="E",DR=100
52 D EN^DIQ1
53 S ENDOMAIN=$G(ENDIQ(6910,DA,100,"E"))
54 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
55 Q
56 ;ENPLUTL
Note: See TracBrowser for help on using the repository browser.