source: FOIAVistA/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAPT.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 3.0 KB
Line 
1GMRAPT ;HIRMFO/WAA-P&T COMMITTEE COMPLETION SYSTEM ;12/1/95 14:45
2 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
3EN1 ; Entry for ENTER/EDIT P&T COMMITTEE DATA option
4 D MAIN
5 D EXIT
6 Q
7MAIN ;MAIN STARTING POINT
8 S GMRAOUT=0,GMRALAGO=1 D EN1^GMRAU85 G:GMRAPA1<1 EXIT1
9 S GMRAPA=0 D ^GMRADSP7
10 ;v=New line
11 I $P(GMRAPA(0),U,20)'["D" W !,"YOU CAN ONLY EDIT OBSERVED DRUG REACTIONS",! Q
12 ;V=Old line
13 ;I $P(GMRAPA(0),U,20)'["D"!($P(GMRAPA(0),U,6)'="o") W !,"YOU CAN ONLY EDIT OBSERVED DRUG REACTIONS",! Q
14REP1 W @IOF,!,"P&T Report Completion"
15 D
16 .N DIE,DA,DR D
17 .S DIE="^GMR(120.85,"
18 .S DA=GMRAPA1,DIE("NO^")="OUTOK"
19 .S DR="23T;24T;25T;26T;26.1T;31.1;S:X'=""y"" Y=""@1"";27;@1"
20 .D ^DIE
21 .Q
22 I $D(Y) S GMRAOUT=1
23 I 'GMRAOUT,$P($G(^GMR(120.85,GMRAPA1,"PTC1")),U,10)="y" W @IOF D PN^GMRAPT I GMRAOUT D
24 .S GMRAOUT=0
25 .Q
26 K X,Y
27 Q:GMRAOUT
28 D
29 .N DIE,DA,DR
30 .S DIE="^GMR(120.85,"
31 .S DA=GMRAPA1,DIE("NO^")="OUTOK"
32 .;S DR="31.2;S:X'=""y"" Y=""@2"";28;S:'X Y=""@2"";29;@2;31.3;S:X'=""y"" Y=""@3"";30;@3"
33 .S DR="31.2;S:X'=""y"" Y=""@2"";28;S:'X Y=""@2"";29;@2"
34 .D ^DIE
35 .Q
36 I $D(Y) S GMRAOUT=1
37 Q:GMRAOUT
38 W ! D DISP,EDIT Q:GMRAOUT
39 D UNLOCK^GMRAUTL(120.85,GMRAPA1)
40 G EN1
41 Q
42DISP ;DISPLAY AND EDIT COMMENTS
43 S GMRAOUT=0
44 I '$O(^GMR(120.85,GMRAPA1,"PTC2",0)) Q
45 W !,"P&T COMMITTEE ADDENDUM COMMENTS:"
46 S GMRAX=0 F S GMRAX=$O(^GMR(120.85,GMRAPA1,"PTC2",GMRAX)) Q:GMRAX<1 D Q:GMRAOUT
47 .S GMRAY=$P(^GMR(120.85,GMRAPA1,"PTC2",GMRAX,0),U)
48 .D PRINT
49 .Q
50 Q
51PN ;ENTER PROGRESS NOTE FOR A MedWATCH REPORT
52 D EN1^GMRAPET0($P(GMRAPA(0),U),GMRAPA,"M",.GMRAOUT)
53 D ; Execute the event point for this reaction
54 .Q:'$D(GMRAPA) S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0)) Q:GMRAPA(0)=""
55 .Q:'$D(GMRAPA1) S GMRAPA1(0)=$G(^GMR(120.85,GMRAPA1,0)) Q:GMRAPA1(0)=""
56 .N OROLD,DFN S DFN=$P(GMRAPA(0),U)
57 .D INP^VADPT S X=$O(^ORD(101,"B","GMRA MEDWATCH DATA COMPLETE",0))_";ORD(101," D EN^XQOR:X K VAIN,X
58 .Q
59 Q
60PRINT ;PRINT OUT THE DATA
61 W !!,"Date: ",$$DATE^GMRAUTL1(GMRAY)
62 I '$D(^GMR(120.85,GMRAPA1,"PTC2",GMRAX,1,0)) Q
63 S DIWL=5,DIWR=75,DIWF=""
64 K ^UTILITY($J,"W",DIWL)
65 S GMRAXX=0 F S GMRAXX=$O(^GMR(120.85,GMRAPA1,"PTC2",GMRAX,1,GMRAXX)) Q:GMRAXX<1 S X=^(GMRAXX,0) D ^DIWP
66 S GMRAXX=0 F S GMRAXX=$O(^UTILITY($J,"W",DIWL,GMRAXX)) Q:GMRAXX<1 D:$Y>(IOSL-3) HEAD Q:GMRAOUT W !,?5,^UTILITY($J,"W",DIWL,GMRAXX,0)
67 Q
68HEAD ;
69 W !,"Press RETURN to continue or ""^"" to stop display or ""^^"" to QUIT: "
70 R X:DTIME S:'$T X="^^" S GMRAOUT=$S(X="^^":2,X="^":1,1:0) I "^^"[X K X W @IOF Q
71 W !,"ENTER 'RETURN' TO CONTINUE '^' TO STOP LISTING OR '^^' TO QUIT",$C(7)
72 G HEAD
73 Q
74EDIT ;EDIT PT COMMENTS
75 Q:GMRAOUT=2
76 S GMRAOUT=0
77 I '$D(^GMR(120.85,GMRAPA1,"PTC2",0)) S ^(0)="^120.85315D^^"
78 D NOW^%DTC S DIC="^GMR(120.85,"_GMRAPA1_",""PTC2"",",DLAYGO=120.85,DA(1)=GMRAPA1,DIC(0)="L",X=% K DD,DO,DINUM D FILE^DICN K DLAYGO G EXIT:+Y'>0
79 S DA=+Y,DIE=DIC,DR="1" K DIC D ^DIE S:$D(Y) GMRAOUT=1
80 I '$O(^GMR(120.85,DA(1),"PTC2",DA,1,0)) S DIK=DIE D ^DIK
81 Q
82EXIT ; EXIT OF ROUTINE
83 D:$D(GMRAPA1) UNLOCK^GMRAUTL(120.85,GMRAPA1)
84EXIT1 ;EXIT IF NOT LOCKED
85 K ^TMP($J),^TMP("GMRA",$J)
86 D KILL^XUSCLEAN
87 Q
Note: See TracBrowser for help on using the repository browser.