1 | GMRAPEM1 ;HIRMFO/YMP,RM,WAA-CHANGE OF OBSERVED DATA TO HISTORICAL STORAGE ;12/1/95 13:45
|
---|
2 | ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
|
---|
3 | ENDING ;Display and edit the word processing field for a patient reaction.
|
---|
4 | W @IOF,! D DISP,EDIT G EXIT
|
---|
5 | Q
|
---|
6 | OUTPUT ;Display the word processing field for a patient.
|
---|
7 | D DISP G EXIT
|
---|
8 | Q
|
---|
9 | DISP S GMRAOUT=0
|
---|
10 | F GMRAYY="O","V","E" D DISP1(GMRAPA,GMRAYY,.GMRAOUT) Q:GMRAOUT
|
---|
11 | Q
|
---|
12 | DISP1(GMRAPA,GMRAKIND,GMRAOUT) ;Display comments and reaction for a reaction
|
---|
13 | ; Input variables:
|
---|
14 | ; GMRAPA = Reaction IEN in 120.8
|
---|
15 | ; GMRAKIND = Kind of comment to display
|
---|
16 | ; O is Originator
|
---|
17 | ; V is Verifier
|
---|
18 | ; E is Entered in Error
|
---|
19 | ; GMRAOUT = Escape variable
|
---|
20 | I '$D(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND)) Q
|
---|
21 | W !!,?5,$S(GMRAKIND="O":"ORIGINATOR",GMRAKIND="V":"VERIFIER",GMRAKIND="E":"ENTERED IN ERROR",1:"")
|
---|
22 | W !,?6,"COMMENTS:"
|
---|
23 | S GMRAX=0 F S GMRAX=$O(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND,GMRAX)) Q:GMRAX<1 D Q:GMRAOUT
|
---|
24 | .S GMRAY=$P(^GMR(120.8,GMRAPA,26,GMRAX,0),U),GMRAZ=$P(^(0),U,2)
|
---|
25 | .D PRINT
|
---|
26 | .Q
|
---|
27 | Q
|
---|
28 | PRINT ;PRINT OUT THE DATA
|
---|
29 | N GMRAT,GMRAZN S (GMRAZN,GMRAT)=""
|
---|
30 | S:GMRAZ'="" GMRAZN=$P($G(^VA(200,GMRAZ,0)),U)
|
---|
31 | S:GMRAZ'="" GMRAT=$P($G(^VA(200,GMRAZ,0)),U,9)
|
---|
32 | S:GMRAT'="" GMRAT=$P($G(^DIC(3.1,GMRAT,0)),U)
|
---|
33 | W !,?10,"Date: ",$$FMTE^XLFDT(GMRAY,1),?52,"User: ",GMRAZN
|
---|
34 | W !,?51,"Title: ",GMRAT
|
---|
35 | I '$D(^GMR(120.8,GMRAPA,26,GMRAX,2,0)) Q
|
---|
36 | S DIWL=16,DIWR=75,DIWF=""
|
---|
37 | K ^UTILITY($J,"W",DIWL)
|
---|
38 | S GMRAXX=0 F S GMRAXX=$O(^GMR(120.8,GMRAPA,26,GMRAX,2,GMRAXX)) Q:GMRAXX<1 S X=^(GMRAXX,0) D ^DIWP
|
---|
39 | S GMRAXX=0 F S GMRAXX=$O(^UTILITY($J,"W",DIWL,GMRAXX)) Q:GMRAXX<1 D:($Y+3)>IOSL HEAD Q:GMRAOUT W !,?16,^UTILITY($J,"W",DIWL,GMRAXX,0)
|
---|
40 | W !
|
---|
41 | Q
|
---|
42 | HEAD ;print a header
|
---|
43 | D EOP^GMRADSP3
|
---|
44 | Q
|
---|
45 | EDIT ;Edit the word processing field.
|
---|
46 | Q:GMRAOUT=2 S:'$D(GMRAVCM) GMRAVCM="O"
|
---|
47 | S GMRAOUT=0 N GMRA
|
---|
48 | I '$D(^GMR(120.8,GMRAPA,26,0)) S ^(0)="^120.826D^^"
|
---|
49 | D NOW^%DTC S DIC="^GMR(120.8,"_GMRAPA_",26,",DA(1)=GMRAPA,DLAYGO=120.8,DIC(0)="L",X=% K DD,DO,DINUM D FILE^DICN K DLAYGO G EXIT:+Y'>0
|
---|
50 | K DR S DA=+Y,DIE=DIC,DR="1////"_DUZ_";1.5////"_GMRAVCM_";2" K DIC D ^DIE
|
---|
51 | I '$O(^GMR(120.8,DA(1),26,DA,2,0)) S DIK=DIE D ^DIK
|
---|
52 | EXIT ;Exit point.
|
---|
53 | K GMRAVCM
|
---|
54 | Q
|
---|