source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAMCB1.m@ 1679

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1GMRAMCB1 ;HIRMFO/WAA-MARK CHART & ID BAND FIELD EDIT PART 2 ;7/23/97 09:39
2 ;;4.0;Adverse Reaction Tracking;**8**;Mar 29, 1996
3GETAL ; GET PATIENT AND ALLERGY
4 S GMRANS="",DFN=-1,DIC="^DPT(",DIC(0)="AEQM",DIC("A")="Select Patient: " D ^DIC Q:+Y'>0 K DIC,DLAYGO S DFN=+Y
5 L +^GMR(120.8,"B",DFN):0 I '$T W !,"THIS DATA IS CURRENTLY BEING EDITED, TRY LATER." G GETAL
6 D DEM^VADPT S GMRANAM=VADM(1) D INP^VADPT S:'+VAIN(4) GMRALOC="" I +VAIN(4) S GMRAHLOC=+$G(^DIC(42,+VAIN(4),44)),GMRALOC=$P(VAIN(4),U,2)
7 D PID^VADPT6 S GMRAVIP=VA("PID") D KVAR^VADPT K VA
8 D HLP12085^GMRAU851(DFN,"'+$G(^GMR(120.8,+GMRAX,""ER""))") Q:GMRAOUT
9 K GMRAX,GMRALL
10ALL1 W ! S GMRADEL=0
11 K DIR S DIR(0)="FAO^1:60",DIR("A")="Select "_$S('$D(GMRALL):"CAUSATIVE AGENT: ",1:"another CAUSATIVE AGENT: ")
12 S DIR("?",1)=" ENTER THE CAUSATIVE AGENT YOU WISH TO INDICATE HAS"
13 S DIR("?",2)=" HAD ITS ID BAND OR CHART MARKED.",DIR("?")=" ENTER ?? TO SEE LIST OF ALL CAUSATIVE AGENT YOU HAVE SELECTED OR CAN SELECT.",DIR("??")="^D HELP^GMRAMCB"
14 D ^DIR K DIR
15 I $D(DTOUT)!($D(DUOUT))!($D(DIROUT)) K X,Y S GMRAOUT=1 Q
16 Q:Y="" S X=Y K Y I $$UP^XLFSTR(X)="ALL" D ALLSEL Q:GMRAOUT G:'$D(X) ALL1
17 I X["-" S GMRADEL=1,X=$P(X,"-",2)
18 S GMRAX=X,X=$P($G(^DPT(DFN,0)),"^")
19 K DIC S DIC="^GMR(120.8,",DIC(0)="EZQ",DIC("W")="W "" "",$P($G(^(0)),U,2)"
20 S DIC("S")="I $P(^(0),U)=DFN,$P($$UP^XLFSTR($P(^(0),U,2)),$$UP^XLFSTR(GMRAX))="""",$P(^(0),U,2)'="""",'+$G(^GMR(120.8,+Y,""ER""))"
21 D ^DIC K DIC I Y<1 G ALL1
22 S GMRAPA=+Y,GMRAPA(0)=$S($D(^GMR(120.8,GMRAPA,0)):^(0),1:"")
23 I GMRAPA(0)="" S GMRADEL=0 G ALL1
24 I GMRADEL D G ALL1
25 .I '$D(GMRALL(GMRAPA)) W !," YOU HAVE NOT SELECTED THAT CAUSATIVE AGENT." S GMRADEL=0 Q
26 .K GMRALL(GMRAPA) S GMRADEL=0
27 .Q
28 I $D(GMRALL(GMRAPA)) W !," YOU HAVE ALREADY SELECTED THAT CAUSATIVE AGENT",$C(7) G ALL1
29 S GMRALL(GMRAPA)="" G ALL1
30ALLSEL ;THIS WILL ALLOW THE USER TO SELECT ALL ALLERGY
31 S GMRATMP=X F S %=1 W !,"Do you want to select all the patient's CAUSATIVE AGENTS" D YN^DICN S:%<0 %=2,GMRAOUT=1 Q:% W !?4,"ENTER YES OR NO IF YOU WANT ALL THE PATIENT'S CAUSATIVE AGENTS"
32 S X=GMRATMP K GMRATMP Q:%'=1 S X=0 F S X=$O(^GMR(120.8,"B",DFN,X)) Q:X<1 D
33 .Q:$D(^GMR(120.8,X,"ER")) Q:$P(^GMR(120.8,X,0),U,2)=""
34 .S GMRALL(X)="" Q
35 K X
36 Q
37SCREEN W !,"Press <CR> to continue or ^ to stop: " R GMRANS:DTIME S:'$T GMRANS="^^" I "^^"'[GMRANS W !?4,$C(7),"ENTER <CR> TO CONTINUE LISTING OR ^ TO EXIT LISTING" G SCREEN
38 D FF Q
39FF ;
40 W #
41 Q
Note: See TracBrowser for help on using the repository browser.