source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPEL0.m@ 1704

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1GMRAPEL0 ;HIRMFO/YMP,WAA-EDIT LIKELIHOOD ; 8/25/92
2 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
3EN1 ;ENTRY FROM MAIN TO EDIT THE LIKELIHOOD OF REACTION FIELD USING THE FDA
4 ;ALGORITHM
5 Q:$G(GMRASUS)<1
6 Q:GMRAPA1'>0
7 W !!,"DETERMINATION OF LIKELIHOOD OF ALLERGY/ADVERSE REACTION:"
8 S GMRAPA("LIKE")=$P($G(^GMR(120.85,GMRAPA1,3,GMRASUS,"LIKE")),"^",7)
9 I GMRAPA("LIKE")>0 W !?2,"The likelihood of this reaction was previously determined as ",$S(GMRAPA("LIKE")=1:"REMOTE",GMRAPA("LIKE")=2:"POSSIBLE",GMRAPA("LIKE")=3:"PROBABLE",GMRAPA("LIKE")=4:"HIGHLY PROBABLE",1:""),"."
10YNED W !,?2,"Would you like to enter/edit Likelihood" S %=2 D YN^DICN S:%=-1 GMRAOUT=1 G:%=2!GMRAOUT EXIT
11 I '% W !?5,$C(7),"ANSWER YES IF YOU WISH TO CHANGE THIS LIKELIHOOD, ELSE ANSWER NO." G YNED
12QUEST1 S GMRALIKB=$S($D(^GMR(120.85,GMRAPA1,3,GMRASUS,"LIKE")):$P(^("LIKE"),"^",1,6),1:""),GMRALIKA=""
13 W !?2,"Does the event have a reasonable temporal association with use of drug"
14 S %=$F("yn",$P(GMRALIKB,"^"))-1 D YN^DICN D:%=0 HELP G:%=0 QUEST1 S:%=-1 GMRAOUT=1 G:GMRAOUT EXIT
15 I %=2 S GMRAFDA=1,$P(GMRALIKA,"^")="n" G SETTING
16 E S $P(GMRALIKA,"^")="y"
17QUEST2 W !?2,"Was there a dechallenge from the drug"
18 S %=$F("yn",$P(GMRALIKB,"^",2))-1 D YN^DICN D:%=0 HELP G:%=0 QUEST2 S:%=-1 GMRAOUT=1 G:GMRAOUT EXIT
19 I %=2 S GMRAFDA=2,$P(GMRALIKA,"^",2)="n" G SETTING
20 E S $P(GMRALIKA,"^",2)="y"
21QUEST3 W !?2,"Did the observed event abate upon dechallenge"
22 S %=$F("yn",$P(GMRALIKB,"^",3))-1 D YN^DICN D:%=0 HELP G:%=0 QUEST3 S:%=-1 GMRAOUT=1 G:GMRAOUT EXIT
23 I %=2 S GMRAFDA=2,$P(GMRALIKA,"^",3)="n" G SETTING
24 E S $P(GMRALIKA,"^",3)="y"
25QUEST4 W !?2,"Was there a rechallenge"
26 S %=$F("yn",$P(GMRALIKB,"^",4))-1 D YN^DICN D:%=0 HELP G:%=0 QUEST4 S:%=-1 GMRAOUT=1 G:GMRAOUT EXIT
27 I %=2 S $P(GMRALIKA,"^",4)="n" G LAST
28 E S $P(GMRALIKA,"^",4)="y"
29QUEST5 W !?2,"Did the reaction or event reappear upon rechallenge"
30 S %=$F("yn",$P(GMRALIKB,"^",6))-1 D YN^DICN D:%=0 HELP G:%=0 QUEST5 S:%=-1 GMRAOUT=1 G:GMRAOUT EXIT
31 I %=2 S GMRAFDA=2,$P(GMRALIKA,"^",6)="n" G SETTING
32 S GMRAFDA=4,$P(GMRALIKA,"^",6)="y" G SETTING
33LAST W !?2,"Could the event be due to an existing clinical condition"
34 S %=$F("yn",$P(GMRALIKB,"^",5))-1 D YN^DICN D:%=0 HELP G:%=0 LAST S:%=-1 GMRAOUT=1 G:GMRAOUT EXIT
35 I %=2 S GMRAFDA=3,$P(GMRALIKA,"^",5)="n"
36 S:%'=2 GMRAFDA=2,$P(GMRALIKA,"^",5)="y"
37SETTING ;
38 W !,"THE LIKELIHOOD IS DETERMINED AS ",$S(GMRAFDA=1:"REMOTE",GMRAFDA=2:"POSSIBLE",GMRAFDA=3:"PROBABLE",GMRAFDA=4:"HIGHLY PROBABLE",1:""),":"
39 W !,"IS THAT OK" S %=1 D YN^DICN G:%=2 QUEST1
40 I '% W !?4,$C(7),"Answer Yes if this is correct, else answer No." G SETTING
41 S DIE="^GMR(120.85,"_GMRAPA1_",3,",DA(1)=GMRAPA1,DA=GMRASUS,DR="" F X=11:1:16 S DR=DR_$S($P(GMRALIKB,"^",X-10)'="":$S(DR'="":";",1:"")_X_"///@",1:"")
42 D ^DIE
43 F X=11:1:16 S DR=DR_$S($P(GMRALIKA,"^",X-10)'="":$S(DR'="":";",1:"")_X_"///"_$P(GMRALIKA,"^",X-10),1:"")
44 D ^DIE
45 S DIE="^GMR(120.85,"_GMRAPA1_",3,",DA(1)=GMRAPA1,DA=GMRASUS,DR="17///"_GMRAFDA D ^DIE
46 G EXIT
47HELP ;
48 W !?5,$C(7),"ENTER YES IF THIS QUESTION IS TRUE, ELSE ANSWER NO."
49 Q
50EXIT K %,DA,DIE,DR,GMRAFDA,GMRALIKA,GMRALIKB,X
51 Q
Note: See TracBrowser for help on using the repository browser.