source: FOIAVistA/tag/r/SURGERY-SR/SROKEY1.m@ 1312

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1SROKEY1 ;B'HAM ISC/MAM - REMOVE KEY RESTRICTIONS ; 9 JAN 1992
2 ;;3.0; Surgery ;;24 Jun 93
3 W @IOF,!,"Remove 'PERSON' field restrictions: ",! S SRSOUT=0 K DIC,DA,DO S DIC=1,DIC(0)="QEAMZ",DIC("A")="Select File: " D ^DIC K DIC I Y<0 S SRSOUT=1 G END
4 S SRFILE=Y,DI=+Y,N=0 D DI^DIU I Y<0 S SRSOUT=1 G END
5 S SRFILE=DI,SRFIELD=+Y,SRENTRY=DI_","_SRFIELD
6 I '$O(^SRP("B",SRENTRY,0)) W !!,"There are no restrictions currently applied to this field.",!!,"Press RETURN to continue " R X:DTIME G END
7 S SRP=$O(^SRP("B",SRENTRY,0))
8 I '$O(^SRP(SRP,1,0)) W !!,"There are no keys restricting entries in this field.",!!,"Press RETURN to continue " R X:DTIME G END
9 W @IOF,!,"Current Restrictions for this Field: ",!
10 S (CNT,KEY)=0 F S KEY=$O(^SRP(SRP,1,KEY)) Q:'KEY S CNT=CNT+1,SRKEY(CNT)=$P(^SRP(SRP,1,KEY,0),"^")_"^"_KEY W !,?2,CNT_".",?5,$P(SRKEY(CNT),"^")
11 I '$D(SRKEY(2)) S NUMBER=1 D ONE G END
12REMOVE W !!,"Do you want to remove one of these keys ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRYN="N" Q
13 S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
14 I "YyNn"'[SRYN W !!,"Enter 'YES' if you want to remove one of the keys currently used to restrict",!,"entries in this field. Enter 'NO' if you do not want to remove any existing",!,"keys." D RET G:SRSOUT END G REMOVE
15 S FLAG=0 I "Yy"[SRYN D TAKEY G:SRSOUT END S FLAG=1
16END D ^SRSKILL W @IOF
17 Q
18TAKEY ; remove security keys
19 W !!,"Select Number or 'ALL': " R NUMBER:DTIME I '$T!("^"[NUMBER) S SRSOUT=1 Q
20 I '$D(SRKEY(NUMBER)),NUMBER'="ALL" W !!,"Select the number corresponding to the key you want to remove, or enter 'ALL'",!,"to remove all keys." G TAKEY
21 I NUMBER="ALL" W !!,"Removing all restrictions..." H 2 S NUMBER=0 F S NUMBER=$O(SRKEY(NUMBER)) Q:'NUMBER D DIK
22 I '$O(SRKEY(0)) Q
23DIK S DA=$P(SRKEY(NUMBER),"^",2),DA(1)=SRP,DIK="^SRP("_SRP_",1," D ^DIK K DA,DIK,SRKEY(NUMBER)
24 Q
25RET W !!,"Press RETURN to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1
26 Q
27ONE ; only one key
28 W !!,"Do you want to remove the "_$P(SRKEY(1),"^")_" key ? YES// " R SRYN:DTIME I '$T!(SRYN["^") Q
29 S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
30 I "YyNn"'[SRYN W !!,"Enter 'YES' to remove this key, eliminating all restrictions on this field, or",!,"'NO' to leave the restriction in place." G ONE
31 I "Yy"[SRYN S NUMBER=1 D DIK
32 Q
Note: See TracBrowser for help on using the repository browser.