source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPED0.m@ 1581

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

initial load of WorldVistAEHR

File size: 4.2 KB
RevLine 
[613]1GMRAPED0 ;HIRMFO/RM,WAA-VERIFIER EDIT OF DRUG A/AR ;8/1/03 09:23
2 ;;4.0;Adverse Reaction Tracking;**17**;Mar 29, 1996
3EN1 ; ENTRY TO EDIT INFO SPECIFIC TO DRUG A/AR FOR VERIFIER
4 K GMRAINGR,GMRACLAS
5 I '$D(^XUSEC("GMRA-ALLERGY VERIFY",DUZ)) G Q1
6 S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0)) G:GMRAPA(0)="" Q1
7 F GMRAINGR=0:0 S GMRAINGR=$O(^GMR(120.8,GMRAPA,2,GMRAINGR)) Q:GMRAINGR'>0 S X=$S($D(^GMR(120.8,GMRAPA,2,GMRAINGR,0)):^(0),1:"") I +X>0 S Y=$S($D(^PS(50.416,+X,0)):^(0),1:"") I $P(Y,U)'="" S GMRAINGR($P(Y,U),+X)=Y
8 F GMRACLAS=0:0 S GMRACLAS=$O(^GMR(120.8,GMRAPA,3,GMRACLAS)) Q:GMRACLAS'>0 S X=$S($D(^GMR(120.8,GMRAPA,3,GMRACLAS,0)):^(0),1:"") I +X>0 S Y=$S($D(^PS(50.605,+X,0)):^(0),1:"") I $P(Y,U)'="" S GMRACLAS($P(Y,U),+X)=Y
9 S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0))
10 W @IOF
11 W !,"CAUSATIVE AGENT: ",$P(GMRAPA(0),U,2)
12 W !?11,"TYPE: ",$$OUTTYPE^GMRAUTL($P(GMRAPA(0),U,20))
13 W !?4,"INGREDIENTS: " S Y="",GMRAPRSW=0 F S Y=$O(GMRAINGR(Y)) Q:Y="" F X=0:0 S X=$O(GMRAINGR(Y,X)) Q:X'>0 W:GMRAPRSW ! W ?17,Y S:'GMRAPRSW GMRAPRSW=1
14 W !,"VA DRUG CLASSES: "
15 S Y="",GMRAPRSW=0 F S Y=$O(GMRACLAS(Y)) Q:Y="" F X=0:0 S X=$O(GMRACLAS(Y,X)) Q:X'>0 W:GMRAPRSW ! W ?17,Y," - ",$P(GMRACLAS(Y,X),U,2) S:'GMRAPRSW GMRAPRSW=1
16 W !," OBS/HIST: ",$S($P(GMRAPA(0),U,6)="o":"OBSERVED",$P(GMRAPA(0),U,6)="h":"HISTORICAL",1:"")
17 D ;Sign/Symptoms
18 .N GMRAVFY
19 .S GMRAVFY=1
20 .D EN1^GMRADSP3
21 .Q
22 W !," MECHANISM: ",$S($P(GMRAPA(0),U,14)="A":"ALLERGY",$P(GMRAPA(0),U,14)="P":"PHARMACOLOGIC",$P(GMRAPA(0),U,14)="U":"UNKNOWN",1:"")
23YNED W !!,"Would you like to edit any of this data" S %=0 D YN^DICN I '% W !?4,$C(7),"ANSWER YES IF YOU WISH TO CHANGE ANY OF THE DATA ABOVE, ELSE ANSWER NO." G YNED
24 S:%=-1 GMRAOUT=1 G Q1:%=2!GMRAOUT
25 D EN1^GMRAPED3 G:GMRAOUT Q1 I GMRAAR'="" S DIE="^GMR(120.8,",DA=GMRAPA,DR=".02////^S X=GMRAAR(0);1////^S X=GMRAAR"_$S($D(GMRAAR("O")):";3.1////"_GMRAAR("O"),1:"") D ^DIE
26 S GMRAPA(0)=$G(^GMR(120.8,+GMRAPA,0))
27 S GMRAEN=GMRAPA_";GMR(120.8," D INPTYPE^GMRAUTL(GMRAEN) G Q1:GMRAOUT
28 S DA=GMRAPA,DIE="^GMR(120.8,",DR="2" D ^DIE S:$D(Y) GMRAOUT=1 G Q1:GMRAOUT
29 S GMRAPA(0)=$G(^GMR(120.8,+GMRAPA,0))
30 D DRGCLS^GMRAPED1
31 I 'GMRAOUT F K Y D Q:GMRAOUT!('$D(Y))
32 .S GMRAPA(0)=$S($D(^GMR(120.8,GMRAPA,0)):^(0),1:"")
33 .S DR="6(O)bserved or (H)istorical Allergy/Adverse Reaction",DIE="^GMR(120.8,",DA=GMRAPA D ^DIE
34 .I $D(Y) S GMRAOUT=1 Q
35 .S GMRANEW(0)=$S($D(^GMR(120.8,GMRAPA,0)):^(0),1:"")
36 .I $P(GMRANEW(0),"^",6)="" W $C(7)," Required??" S Y="" Q
37 .Q:$P(GMRANEW(0),"^",6)=$P(GMRAPA(0),"^",6)
38 .I $P(GMRAPA(0),"^",6)'=$P(GMRANEW(0),"^",6) D Q
39 ..W !!,"You cannot change the type of reaction. If this is incorrect",!,"please exit and mark this entry as entered-in-error and then re-enter",!,"the correct information.",!
40 ..S DIE="^GMR(120.8,",DR="6////"_$P(GMRAPA(0),"^",6),DA=GMRAPA D ^DIE S Y="" Q
41 ..Q
42 .Q
43 I 'GMRAOUT D EN1^GMRAPER2(GMRAPA,"120.8",.GMRAOUT)
44 I 'GMRAOUT D MECH Q:GMRAOUT
45 S GMRAPA(0)=$S($D(^GMR(120.8,GMRAPA,0)):^(0),1:"")
46 S GMRAOUT=0 G EN1
47Q1 ;Exit
48 K GMRAEN,X,GMRAAR
49 K DA,DIE,DR
50 Q
51MECH ;Mechanism for ADRs
52 F W !!,?5,"Choose one of the following:",! D Q:GMRAOUT!('$D(Y))
53 .F GMRAMEC="A - ALLERGY","P - PHARMACOLOGICAL","U - UNKNOWN" W !,?20,GMRAMEC
54 .W ! S DIE="^GMR(120.8,",DA=GMRAPA,DR=17 D ^DIE
55 .S:$D(Y) GMRAOUT=1
56 .Q
57 Q
58HELP ; HELP FOR A/AR LOOKUP
59 W !!?4,"Would you like to see a list of:",!?6,"1 Local Allergies (Food/Drug/Other)",!?6,"2 Drug Classes",!?6,"3 Drug Ingredients",!?6,"4 National Drugs",!?6,"5 Local Drugs"
60 R !?4,"Select a number (1-5):",X:DTIME S:'$T X="^^" I "^^"[X S:X="^^"!(X=U) GMRAOUT=1 Q
61 I X\1'=X!(X<1)!(X>5) W !?7,$C(7),"ANSWER WITH THE NUMBER (1-5) OF THE SELECTION FOR",!?7,"WHICH YOU WISH TO SEE MORE HELP." G HELP
62 S DIC=$S(X=1:120.82,X=2:50.605,X=3:50.416,X=4:50.6,1:50) D HLPLK
63 G HELP
64HLPLK ; LOOKUP ON FILE IN DIC
65 S DIC(0)="E",X="??" S:DIC=50.416 D="P" S:DIC=50.605 DIC("W")="W ?10,$P(^(0),U,2)",DIC(0)="SE",D="C" D ^DIC:DIC'=50.605&(DIC'=50.416),IX^DIC:DIC=50.605!(DIC=50.416)
66 Q
67DIC ; VALIDATE LOOKUP FOR A/AR
68 S:$D(DTOUT) X="^^" I X="^^" S GMRAOUT=1 Q
69 S:$D(DUOUT) Y=0 Q:+Y'>0
70YNOK W !?3,X," OK" S %=1 D YN^DICN S:%=-1 GMRAOUT=1,Y=-1 S:%=2 Y=-1 I % W ! Q
71 W !?5,$C(7),"ANSWER YES IF THIS IS THE CORRECT ALLERGY/ADVERSE REACTION,",!?5,"ELSE ANSWER NO."
72 G YNOK
73HEAD ; Header for reactions
74 W @IOF
75 W !,"Reactions: (cont.) "
76 Q
Note: See TracBrowser for help on using the repository browser.