source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAEAB.m@ 1361

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1GMRAEAB ;HIRMFO/RM-BULLETIN SEND FOR E/E REACTIONS ;12/22/04 08:57
2 ;;4.0;Adverse Reaction Tracking;**21**;Mar 29, 1996
3EN1 ; SEND BULLETIN TO ALL VERIFIERS/CHART MARK GROUPS
4 ; INDICATING A/AR NEEDS UPDATES
5 N GMRAGRUP,%
6 S GMRANAM="",GMRALOC="",GMRASSN=""
7 D VAD^GMRAUTL1($P(GMRAPA(0),U),"",.GMRALOC,.GMRANAM,"",.GMRASSN)
8 I GMRALOC'="",+$G(^DIC(42,GMRALOC,44)) S GMRALOC=$P($G(^SC(+$G(^DIC(42,GMRALOC,44)),0)),U)
9 I GMRALOC="" S GMRALOC="OUT PATIENT"
10 S XMB="GMRA ENTERED IN ERROR"
11 ; Build XMB array
12 S XMB(1)=GMRANAM ; Patient Name
13 S XMB(2)=GMRASSN ; Patient SSN
14 S XMB(3)=$P(GMRAPA(0),"^",2) ; Reaction
15 S XMB(4)=GMRALOC ; Location
16 S XMB(5)=$S($P(GMRAPA(0),U,5)'="":$$GET1^DIQ(200,$P(GMRAPA(0),U,5)_",",".01"),1:"<None>") ;21 Originator
17 S XMB(6)=$$GET1^DIQ(200,$P($G(^GMR(120.8,GMRAPA,"ER")),U,3)_",",".01") ;21 Enter in error by
18 S XMB(7)=$$FMTE^XLFDT($P($G(^GMR(120.8,GMRAPA,"ER")),U,2),1) ; Enter in error on
19 S XMB(9)=$$FMTE^XLFDT($P(GMRAPA(0),U,4)) ;21
20 ; Signs/symptoms and comments
21 K ^TMP($J,"GMRACOM")
22 N GMRAKIND,GMRACNT,GMRAX,GMRASP,GMRADATA,GMRAI,GMRAP ;21
23 S GMRACNT=1,GMRASP=" "
24 D EN1^GMRAOR2(GMRAPA,"GMRADATA") ;21
25 I $D(GMRADATA("S")) S ^TMP($J,"GMRACOM",GMRACNT)=" Signs/Symptoms: " D ;21
26 .S GMRAI=0,GMRAP=0 F S GMRAI=$O(GMRADATA("S",GMRAI)) Q:'+GMRAI D ;21
27 ..I 'GMRAP S ^TMP($J,"GMRACOM",GMRACNT)=^TMP($J,"GMRACOM",GMRACNT)_GMRADATA("S",GMRAI),GMRACNT=GMRACNT+1,GMRAP=1 Q ;21
28 ..S ^TMP($J,"GMRACOM",GMRACNT)=$$REPEAT^XLFSTR(" ",24)_GMRADATA("S",GMRAI),GMRACNT=GMRACNT+1 ;21
29 I $D(^GMR(120.8,GMRAPA,26,"AVER")) S ^TMP($J,"GMRACOM",GMRACNT)="",GMRACNT=GMRACNT+1,^TMP($J,"GMRACOM",GMRACNT)="Comments:",GMRACNT=GMRACNT+1 ;21
30 F GMRAKIND="O","V","E" S GMRAX=0 S GMRAX=$O(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND,GMRAX)) I GMRAX>0 D
31 .S ^TMP($J,"GMRACOM",GMRACNT)=$E(GMRASP,1,5)_$S(GMRAKIND="O":"ORIGINATOR",GMRAKIND="V":"VERIFIER",GMRAKIND="E":"ENTERED IN ERROR",1:""),GMRACNT=GMRACNT+1
32 .S GMRAX=0 F S GMRAX=$O(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND,GMRAX)) Q:GMRAX<1 D
33 ..N GMRAY,GMRAZ
34 ..S GMRAY=$P(^GMR(120.8,GMRAPA,26,GMRAX,0),U),GMRAZ=$P(^(0),U,2)
35 ..D PRINT Q:GMRAOUT
36 ..Q
37 .Q
38 S XMTEXT="^TMP($J,""GMRACOM"","
39 ; Build XMY array
40 ;Only send bulletin to verifier groups if reactant still needs to be verified or if it wasn't autoverified
41 I '+$P(GMRAPA(0),U,16)!($P(GMRAPA(0),U,18)) F %=1:1:$L($P(GMRAPA(0),"^",20)) D ;21
42 .S GMRAGRUP=$E($P(GMRAPA(0),"^",20),%)
43 .S XMY("G.GMRA VERIFY "_$S(GMRAGRUP="D":"DRUG",GMRAGRUP="F":"FOOD",1:"OTHER")_" ALLERGY")=""
44 .Q
45 S XMY("G.GMRA MARK CHART")=""
46 I $P(GMRAPA(0),U,20)["D"&($P(GMRAPA(0),U,6)="o") S XMY("G.GMRA P&T COMMITTEE FDA")="",XMB(8)="and FDA information " ;21
47 D ^XMB
48 K XMB,XMY,XMTEXT,GMRATEXT,^TMP($J,"GMRACOM")
49 Q
50PRINT ;PRINT OUT THE DATA
51 N GMRAT,GMRAZN S (GMRAZN,GMRAT)=""
52 S:GMRAZ'="" GMRAZN=$$GET1^DIQ(200,GMRAZ_",",".01") ;21
53 S:GMRAZ'="" GMRAT=$$GET1^DIQ(200,GMRAZ_",","8","I") ;21
54 S:GMRAT'="" GMRAT=$P($G(^DIC(3.1,GMRAT,0)),U)
55 S ^TMP($J,"GMRACOM",GMRACNT)=$E(GMRASP,1,10)_"Date: "_$$FMTE^XLFDT(GMRAY,1)_$E(GMRASP,1,10)_"User: "_GMRAZN,GMRACNT=GMRACNT+1
56 S ^TMP($J,"GMRACOM",GMRACNT)=$E(GMRASP,1,47)_"Title: "_GMRAT,GMRACNT=GMRACNT+1
57 I '$D(^GMR(120.8,GMRAPA,26,GMRAX,2,0)) Q
58 S DIWL=16,DIWR=75,DIWF=""
59 K ^UTILITY($J,"W",DIWL)
60 S GMRAXX=0 F S GMRAXX=$O(^GMR(120.8,GMRAPA,26,GMRAX,2,GMRAXX)) Q:GMRAXX<1 S X=^(GMRAXX,0) D ^DIWP
61 S GMRAXX=0 F S GMRAXX=$O(^UTILITY($J,"W",DIWL,GMRAXX)) Q:GMRAXX<1 S ^TMP($J,"GMRACOM",GMRACNT)=$E(GMRASP,1,16)_^UTILITY($J,"W",DIWL,GMRAXX,0),GMRACNT=GMRACNT+1
62 S ^TMP($J,"GMRACOM",GMRACNT)=" ",GMRACNT=GMRACNT+1
63 Q
Note: See TracBrowser for help on using the repository browser.