source: BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/m/BMXADOS1.m@ 1625

Last change on this file since 1625 was 1209, checked in by Sam Habiel, 13 years ago

BMXMON fix; updated all routines to v 2.31

File size: 2.6 KB
Line 
1BMXADOS1 ; IHS/CIHA/GIS - UPDATE THE BMX ADO SCHEMA FILE GUI VERSION ;
2 ;;2.31;BMX;;Jul 25, 2011
3 ; RPC CALLS
4 ;
5 ;
6 ;
7DISP(OUT) ; TEMP DISPLAY
8 N I,X
9 S I=0 W !
10 F S I=$O(@OUT@(I)) Q:'I S X=@OUT@(I) S X=$TR(X,$C(30),"}") S X=$TR(X,$C(31),"{") W !,X
11 Q
12 ;
13SCHEMA(NAME) ; GIVEN SCHEMA NAME, RETURN THE IEN
14 N IEN
15 S IEN=$O(^BMXADO("B",NAME,0))
16 Q IEN
17 ;
18FILE ; RETURN A LIST OF FILES
19 N OUT,%,SIEN
20 S SIEN=$$SCHEMA("FILEMAN FILES")
21 D SS^BMXADO(.OUT,SIEN,"","B~B~C~")
22 D DISP(OUT) R %:$G(DTIME,60)
23 K ^TMP("BMX ADO",$J)
24 Q
25 ;
26SF ; RETURN A LIST OF SUBFILES
27 N OUT,%,SIEN
28 S SIEN=$$SCHEMA("SUBFILES")
29 D SS^BMXADO(.OUT,SIEN,"","~~~~~SFIT~BMXADOS1~2~")
30 D DISP(OUT) R %:$G(DTIME,60)
31 K ^TMP("BMX ADO",$J)
32 Q
33 ;
34FLD ; RETURN LIST OF FIELDS FOR A FILE OR SUBFILE
35 N OUT,%,SIEN
36 S SIEN=$$SCHEMA("FIELDS")
37 D SS^BMXADO(.OUT,SIEN,"","~~~~~FLDIT~BMXADOS1~2~")
38 D DISP(OUT) R %:$G(DTIME,60)
39 K ^TMP("BMX ADO",$J)
40 Q
41 ;
42SCH ; RETURN A LIST OF SCHEMAS
43 N OUT,%,SIEN
44 S SIEN=$$SCHEMA("SCHEMAS")
45 D SS^BMXADO(.OUT,SIEN,"","B~~~")
46 D DISP(OUT) R %:$G(DTIME,60)
47 K ^TMP("BMX ADO",$J)
48 Q
49 ;
50SD ; RETURN THE SCHEMA DEFINITION
51 N OUT,%,SIEN
52 S SIEN=$$SCHEMA("SCHEMA DEFINITION")
53 D SS^BMXADO(.OUT,SIEN,"52,","~~~")
54 D DISP(OUT) R %:$G(DTIME,60)
55 K ^TMP("BMX ADO",$J)
56 Q
57 ;
58FLDIT(PARAM,IENS,MAX,OUT,TOT) ; CUSTOM ITERATOR TO DISPLAY FIELDS
59 N SFARR,CNT,DEL,NUM,NAME,DDT,DLEN,DHDR,DRO,DKEY,DNA,X,Y
60 D FLIST^BMXADOS(.SFARR,PARAM)
61 S CNT=0,DEL=" ["
62 F S CNT=$O(SFARR(CNT)) Q:'CNT D
63 . S X=SFARR(CNT) I '$L(X) Q
64 . S NAME=$P(X,DEL)
65 . ; F Q:$E(NAME)'=" " S NAME=$E(NAME,2,999)
66 . I '$L(NAME) Q
67 . S NUM=+$P(X,DEL,2) I 'NUM Q
68 . S TOT=TOT+1
69 . S Y=$$FDEF^BMXADOS(PARAM,NUM) I '$L(Y) Q ; ""
70 . S DDT=$E(Y),DLEN=+$E(Y,2,6),DHDR=$E(Y,7,99)
71 . S DRO="NO" S DKEY="NO" S DNA="YES"
72 . S ^TMP("BMX ADO",$J,TOT)=NUM_U_NAME_U_DDT_U_DLEN_U_DHDR_U_DRO_U_DKEY_U_DNA_$C(30)
73 Q ""
74 ;
75FNIT(PARAM,IENS,MAX,OUT,TOT) ; CUSTOM ITERATOR TO DISPLAY FILE OR SUBFILE NAME GIVEN FILE NUMBER
76 N NUM,NAME
77 S NUM=+PARAM
78 S NAME=""
79 Q:'$D(^DD(NUM,0,"NM")) ""
80 S NAME=$O(^DD(NUM,0,"NM",0))
81 S TOT=TOT+1
82 S ^TMP("BMX ADO",$J,TOT)=NUM_U_NAME_$C(30)
83 Q ""
84 ;
85SFIT(PARAM,IENS,MAX,OUT,TOT) ; CUSTOM ITERATOR TO DISPLAY SUBFILES
86 N SFARR,CNT,DEL,NUM,NAME
87 D SC^BMXADOS(.SFARR,PARAM)
88 S CNT=0,DEL=" ("
89 F S CNT=$O(SFARR(CNT)) Q:'CNT D
90 . S X=SFARR(CNT) I '$L(X) Q
91 . S NAME=$P(X,DEL)
92 . ; F Q:$E(NAME)'=" " S NAME=$E(NAME,2,999)
93 . I '$L(NAME) Q
94 . S NUM=+$P(X,DEL,2) I 'NUM Q
95 . S TOT=TOT+1
96 . S ^TMP("BMX ADO",$J,TOT)=NUM_U_NAME_$C(30)
97 Q ""
98 ;
99SFT(FNAME) ; TRIGGER "YES" TO INDICATE THAT A SUBFILE IS PRESENT WITHIN A FILE
100 I '$L($G(FNAME)) Q ""
101 N FIEN
102 S FIEN=$O(^DIC("B",FNAME,0))
103 I 'FIEN Q ""
104 I '$O(^DD(FIEN,"SB",0)) Q ""
105 Q "+"
106 ;
Note: See TracBrowser for help on using the repository browser.