VistA-WorldVistAEHR/r/ADVERSE_REACTION_TRACKING-G.../GMRAPED1.m

17 lines
1.4 KiB
Mathematica
Raw Permalink Normal View History

2009-11-29 13:37:14 -05:00
GMRAPED1 ;HIRMFO/RM-EDIT DRUG CLASS FIELD ; 10/16/91
;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
DRGCLS ; EDIT VA DRUG CLASS MULTIPLE
S GMRAB=$S($D(^GMR(120.8,GMRAPA,3,0)):$P(^(0),"^",3),1:""),GMRAB=$S($D(^GMR(120.8,GMRAPA,3,+GMRAB,0)):+^(0),1:0),GMRAB=$S($D(^PS(50.605,GMRAB,0)):$P(^(0),"^",2),1:"")
RDCLS W !,"Select VA DRUG CLASS: ",$S(GMRAB'="":GMRAB_"// ",1:"") R X:DTIME S:'$T X="^^" I "^^"[X S:X'="" GMRAOUT=1 Q
I "@"[X W !,"YOU CAN NOT DELETE A VA DRUG CLASS.",$C(7)
S:X?1"?".E X="??" S:'$D(^GMR(120.8,GMRAPA,3,0)) ^(0)="^120.803PA^^" S DA(1)=GMRAPA,DIC="^GMR(120.8,"_GMRAPA_",3,"
S DIC("W")="N X S X=^(0) W ?$X+5,$S($D(^PS(50.605,+X,0)):$P(^(0),U,2),1:""""),@(""$E(""_DIC_Y_"",0),0)"")",DIC(0)="EMZ" K DTOUT,DUOUT D ^DIC K DIC
I +Y'>0 S:$D(DTOUT)!$D(DUOUT) GMRAOUT=1 Q:GMRAOUT G DGDIC
YNLOK W !?4,Y(0,0)," OK" S %=1 D YN^DICN S:%=1 DA=+Y S:%=-1 GMRAOUT=1 Q:GMRAOUT G EDDC:%=1 I '% W !?7,"ANSWER YES IF THIS ENTRY IS OK, ELSE ANSWER NO." G YNLOK
DGDIC S:X?1"?".E X="?" S DIC="^PS(50.605,",DIC(0)="EQMZ",DIC("W")="W ?$X+5,$P(^(0),U,2)" K DTOUT,DUOUT D ^DIC K DIC I +Y'>0 S:$D(DTOUT)!$D(DUOUT) GMRAOUT=1 Q:GMRAOUT G RDCLS
S DA(1)=GMRAPA,DA=$O(^GMR(120.8,GMRAPA,3,"B",+Y,0)) I DA'>0 D S DA=+Y G:DA'>0 RDCLS
.S DIC="^GMR(120.8,"_GMRAPA_",3,",DLAYGO=120.8,DIC(0)="EQL",X=$P(Y(0),"^") D ^DIC K DIC,DLAYGO
.Q
EDDC S DIE="^GMR(120.8,"_GMRAPA_",3,",DR=".01 VA DRUG CLASS" D ^DIE S:$D(Y) GMRAOUT=1 S GMRAB=""
Q:GMRAOUT G RDCLS