[645] | 1 | BMXPO ; IHS/CMI/MAW - Populate appcontext with all namespaced RPC's ;
|
---|
[931] | 2 | ;;2.2;BMX;;Sep 07, 2010
|
---|
[645] | 3 | ;
|
---|
| 4 | ;
|
---|
| 5 | MAIN ;EP - this is the main routine driver
|
---|
| 6 | N BMXQFLG
|
---|
| 7 | D ASK
|
---|
| 8 | I $G(BMXQFLG) D XIT Q
|
---|
| 9 | ;D CLEAN(BMXAPP)
|
---|
| 10 | D POP(BMXAPP,BMXNS)
|
---|
| 11 | D XIT
|
---|
| 12 | Q
|
---|
| 13 | ;
|
---|
| 14 | GUIEP(RETVAL,BMXSTR) ;EP - gui entry point
|
---|
| 15 | N P,BMXAPP,BMXNS
|
---|
| 16 | S P="|"
|
---|
| 17 | S BMXGUI=1
|
---|
| 18 | S BMXAPP=$P(BMXSTR,P)
|
---|
| 19 | S BMXNS=$P(BMXSTR,P,2)
|
---|
| 20 | K ^BMXTMP($J)
|
---|
| 21 | S RETVAL="^BMXTMP("_$J_")"
|
---|
| 22 | S ^BMXTMP($J,0)="T00250DATA"_$C(30)
|
---|
| 23 | ;D CLEAN(BMXAPP)
|
---|
| 24 | D POP(BMXAPP,BMXNS)
|
---|
| 25 | D XIT
|
---|
| 26 | Q
|
---|
| 27 | ;
|
---|
| 28 | ASK ;-- ask the name of the OPTION to populate
|
---|
| 29 | W !
|
---|
| 30 | S DIC=19,DIC(0)="AEMQZ",DIC("A")="Populate which Application Context: "
|
---|
| 31 | D ^DIC
|
---|
| 32 | I '$G(Y) S BMXQFLG=1 Q
|
---|
| 33 | S BMXAPP=+Y
|
---|
| 34 | W !
|
---|
| 35 | K DIC
|
---|
| 36 | S DIR(0)="F^1:3",DIR("A")="Populate RPC's from which Namespace: "
|
---|
| 37 | D ^DIR
|
---|
| 38 | I $D(DIRUT) S BMXQFLG=1 Q
|
---|
| 39 | S BMXNS=$G(Y)
|
---|
| 40 | Q
|
---|
| 41 | ;
|
---|
| 42 | CLEAN(APP) ;-- clean out the RPC multiple first
|
---|
| 43 | S DA(1)=APP
|
---|
| 44 | S DIK="^DIC(19,"_DA(1)_","_"""RPC"""_","
|
---|
| 45 | N BMXDA
|
---|
| 46 | S BMXDA=0 F S BDMDA=$O(^DIC(19,APP,"RPC",BMXDA)) Q:'BMXDA D
|
---|
| 47 | . S DA=BMXDA
|
---|
| 48 | . D ^DIK
|
---|
| 49 | K ^DIC(19,APP,"RPC","B")
|
---|
| 50 | Q
|
---|
| 51 | ;
|
---|
| 52 | POP(APP,NS) ;populate the app context with RPC's
|
---|
| 53 | I '$G(BMXGUI) W !,"Populating Application Context"
|
---|
| 54 | N BMXDA
|
---|
| 55 | S BMXDA=NS
|
---|
| 56 | F S BMXDA=$O(^XWB(8994,"B",BMXDA)) Q:BMXDA=""!($E(BMXDA,1,3)'=NS) D
|
---|
| 57 | . N BMXIEN
|
---|
| 58 | . S BMXIEN=0 F S BMXIEN=$O(^XWB(8994,"B",BMXDA,BMXIEN)) Q:'BMXIEN D
|
---|
| 59 | .. Q:$O(^DIC(19,APP,"RPC","B",BMXIEN,0))
|
---|
| 60 | .. N BDMIENS,BDMFDA,BDMERR
|
---|
| 61 | .. S BDMIENS(1)=APP
|
---|
| 62 | .. S BDMIENS="+2,"_APP_","
|
---|
| 63 | .. S BDMFDA(19.05,BDMIENS,.01)=BMXIEN
|
---|
| 64 | .. D UPDATE^DIE("","BDMFDA","BDMIENS","BDMERR(1)")
|
---|
| 65 | .. I '$G(BMXGUI) W "."
|
---|
| 66 | Q
|
---|
| 67 | ;
|
---|
| 68 | XIT ;-- clean vars
|
---|
| 69 | D EN^XBVK("BMX")
|
---|
| 70 | Q
|
---|
| 71 | ;
|
---|