source: FOIAVistA/tag/r/ENGINEERING-EN/ENUTL.m@ 1746

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1ENUTL ;(WIRMFO)/DH-Engineering Utilities ;1.12.98
2 ;;7.0;ENGINEERING;**35,42,48**;Aug 17, 1993
3 ;
4GETEQ ; Lookup equipment file entries allowing searches by user
5 ; specified x-refs
6 ; Called from ENEQ2, ENEQ4, ENEQLT,ENEQNX5, ENEQPMR4, ENEQRP1, ENEQRP6,
7 ; ENEQTD, ENLBL3, ENWO1
8 ; DIC("S") may be passed, but is not required or returned
9 ; Output => Y as per ^DIC
10 ;
11 N D,X,ENX,ENI
12 S DIC="^ENG(6914,"
13EQA ; Ask for input
14 R !,"Select EQUIPMENT ENTRY #: ",ENX:DTIME I '$T!(ENX="")!($E(ENX)="^") S Y=-1 G EQX
15 I $E(ENX,3)="." D I $G(D)]"" S X=$E(ENX,4,99),DIC(0)="QE" D IX^DIC G EQR
16 . S ENI=$E(ENX,1,2) I "^EC^LI^LO^MA^MF^MO^SN^"'[(U_ENI_U) Q
17 . S D=$S(ENI="EC":"G",ENI="LI":"L",ENI="LO":"D",ENI="MA":"K",ENI="MF":"H",ENI="MO":"EC",ENI="SN":"FC",1:"") I D="" Q
18 . I "EC^FC"[D D EQCOMP
19 S X=ENX I $E(X)="?" D
20 . W !," 'EC.value' => equipment whose EQUIP. CATEGORY starts with 'value'"
21 . W !," 'LI.value' => equipment whose LOCAL ID starts with 'value'"
22 . W !," 'LO.value' => equipment whose LOCATION starts with 'value'"
23 . W !," 'MA.value' => equipment whose MANUFACTURER starts with 'value'"
24 . W !," 'MF.value' => equipment whose MFGR. EQUIP. NAME starts with 'value'"
25 . W !," 'MO.value' => equipment whose MODEL starts with 'value'"
26 . W !," 'SN.value' => equipment whose SERIAL NUMBER starts with 'value'"
27 S DIC(0)="QEM" D ^DIC
28EQR ; Result of ^DIC call
29 G:Y'>0 EQA
30EQX ; Design EXIT
31 K DIC
32 Q
33 ;
34EQCOMP ; Compress local var X
35 Q:$G(X)']""
36 S X=$$UP^XLFSTR(X)
37 S X=$TR(X," ""~!@#$%^&*()_+|-=\[];',./{}:<>?`","")
38 Q
39 ;
40ZIS ; Get BOLD and UNBOLD sequences
41 ; Set to NULL if printer (bolding in hard copy would be nice,
42 ; but the Device Files are too messy for it to work well)
43 I $E(IOST,1,2)'="C-" S (IOINLOW,IOINHI)="" Q
44 N X S X="IOINLOW;IOINHI;IOINORM" D ENDR^%ZISS
45 I IOINLOW="",IOINORM]"" S IOINLOW=IOINORM
46 Q
47 ;
48EOM(ENDT) ;End of Month Extrinsic Function
49 ; ENDT - Date (internal format)
50 ; Returns - Date for end of month (internal format)
51 I "^01^03^05^07^08^10^12^"[(U_$E(ENDT,4,5)_U) S ENDT=$E(ENDT,1,5)_"31"
52 I "^04^06^09^11^"[(U_$E(ENDT,4,5)_U) S ENDT=$E(ENDT,1,5)_"30"
53 I "02"=$E(ENDT,4,5) N YEAR,LEAP D
54 . S YEAR=$E(ENDT,1,3)+1700,LEAP=$S('(YEAR#400):1,'(YEAR#4)&(YEAR#100):1,1:0)
55 . S ENDT=$E(ENDT,1,5)_$S(LEAP:"29",1:"28")
56 Q ENDT
57 ;
58 ;ENUTL
Note: See TracBrowser for help on using the repository browser.