source: FOIAVistA/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAWORD.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 1.7 KB
Line 
1GMRAWORD ;HIRMFO/YMP,RM,WAA- WORD DATA TO HISTORICAL STORAGE ;12/1/95 13:45
2 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
3WORD(GMRAPA,COMM,WID) ; PASS THE DATA TO AN ARRAY
4 ; Input variables:
5 ; GMRAPA = Reaction IEN in 120.8
6 ; COMM = Kind of comment to display
7 ; O is Originator
8 ; V is Verifier
9 ; E is Entered in Error
10 ; ARRAY = Merge arrat for the text
11 ; WID = Width of the array
12 N GMRAYY,GMRACNT,Y,DIWL
13 S GMRACNT=1
14 F GMRAYY=1:1:$L(COMM) K ^UTILITY($J,"W") D
15 .D DISP1(GMRAPA,$E(COMM,GMRAYY),WID) Q:'$D(DIWL)
16 .I $D(^UTILITY($J,"W",DIWL)) S ^TMP($J,"GMRAWORD",GMRACNT)=$S($E(COMM,GMRAYY)="E":"ENTERED IN ERROR",$E(COMM,GMRAYY)="V":"VERIFIER",$E(COMM,GMRAYY)="O":"OBSERVER",1:"")_" COMMENTS: ",GMRACNT=GMRACNT+1
17 .S Y=0 F S Y=$O(^UTILITY($J,"W",DIWL,Y)) Q:Y<1 S ^TMP($J,"GMRAWORD",GMRACNT)=$G(^UTILITY($J,"W",DIWL,Y,0)),GMRACNT=GMRACNT+1
18 .Q
19 Q
20DISP1(GMRAPA,GMRAKIND,WID) ;Display comments and reaction for a reaction
21 ; Input variables:
22 ; GMRAPA = Reaction IEN in 120.8
23 ; GMRAKIND = Kind of comment to display
24 ; O is Originator
25 ; V is Verifier
26 ; E is Entered in Error
27 ; WID = Width of the array
28 I '$D(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND)) Q
29 S GMRAX=0 F S GMRAX=$O(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND,GMRAX)) Q:GMRAX<1 D Q:GMRAOUT
30 .S GMRAY=$P(^GMR(120.8,GMRAPA,26,GMRAX,0),U),GMRAZ=$P(^(0),U,2)
31 .D BLD
32 .Q
33 Q
34BLD ; BUILD THE DATA
35 N GMRAT,GMRAZN S (GMRAZN,GMRAT)=""
36 I '$D(^GMR(120.8,GMRAPA,26,GMRAX,2,0)) Q
37 S DIWL=0,DIWR=WID,DIWF=""
38 K ^UTILITY($J,"W",DIWL)
39 S GMRAXX=0 F S GMRAXX=$O(^GMR(120.8,GMRAPA,26,GMRAX,2,GMRAXX)) Q:GMRAXX<1 S X=^(GMRAXX,0) D ^DIWP
40 Q
Note: See TracBrowser for help on using the repository browser.