Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRAEAB

GMRAEAB.m

Go to the documentation of this file.
GMRAEAB ;HIRMFO/RM-BULLETIN SEND FOR E/E REACTIONS ;12/22/04  08:57
 ;;4.0;Adverse Reaction Tracking;**21**;Mar 29, 1996
EN1 ; SEND BULLETIN TO ALL VERIFIERS/CHART MARK GROUPS
 ; INDICATING A/AR NEEDS UPDATES
 N GMRAGRUP,%
 S GMRANAM="",GMRALOC="",GMRASSN=""
 D VAD^GMRAUTL1($P(GMRAPA(0),U),"",.GMRALOC,.GMRANAM,"",.GMRASSN)
 I GMRALOC'="",+$G(^DIC(42,GMRALOC,44)) S GMRALOC=$P($G(^SC(+$G(^DIC(42,GMRALOC,44)),0)),U)
 I GMRALOC="" S GMRALOC="OUT PATIENT"
 S XMB="GMRA ENTERED IN ERROR"
 ; Build XMB array
 S XMB(1)=GMRANAM ; Patient Name
 S XMB(2)=GMRASSN ; Patient SSN
 S XMB(3)=$P(GMRAPA(0),"^",2) ; Reaction
 S XMB(4)=GMRALOC ; Location
 S XMB(5)=$S($P(GMRAPA(0),U,5)'="":$$GET1^DIQ(200,$P(GMRAPA(0),U,5)_",",".01"),1:"<None>") ;21 Originator
 S XMB(6)=$$GET1^DIQ(200,$P($G(^GMR(120.8,GMRAPA,"ER")),U,3)_",",".01") ;21 Enter in error by
 S XMB(7)=$$FMTE^XLFDT($P($G(^GMR(120.8,GMRAPA,"ER")),U,2),1) ; Enter in error on
 S XMB(9)=$$FMTE^XLFDT($P(GMRAPA(0),U,4)) ;21
 ; Signs/symptoms and comments
 K ^TMP($J,"GMRACOM")
 N GMRAKIND,GMRACNT,GMRAX,GMRASP,GMRADATA,GMRAI,GMRAP ;21
 S GMRACNT=1,GMRASP="                                                                           "
 D EN1^GMRAOR2(GMRAPA,"GMRADATA") ;21
 I $D(GMRADATA("S")) S ^TMP($J,"GMRACOM",GMRACNT)="        Signs/Symptoms: " D  ;21
 .S GMRAI=0,GMRAP=0 F  S GMRAI=$O(GMRADATA("S",GMRAI)) Q:'+GMRAI  D  ;21
 ..I 'GMRAP S ^TMP($J,"GMRACOM",GMRACNT)=^TMP($J,"GMRACOM",GMRACNT)_GMRADATA("S",GMRAI),GMRACNT=GMRACNT+1,GMRAP=1 Q  ;21
 ..S ^TMP($J,"GMRACOM",GMRACNT)=$$REPEAT^XLFSTR(" ",24)_GMRADATA("S",GMRAI),GMRACNT=GMRACNT+1 ;21
 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
 F GMRAKIND="O","V","E" S GMRAX=0 S GMRAX=$O(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND,GMRAX)) I GMRAX>0  D
 .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
 .S GMRAX=0 F  S GMRAX=$O(^GMR(120.8,GMRAPA,26,"AVER",GMRAKIND,GMRAX)) Q:GMRAX<1  D
 ..N GMRAY,GMRAZ
 ..S GMRAY=$P(^GMR(120.8,GMRAPA,26,GMRAX,0),U),GMRAZ=$P(^(0),U,2)
 ..D PRINT Q:GMRAOUT
 ..Q
 .Q
 S XMTEXT="^TMP($J,""GMRACOM"","
 ; Build XMY array
 ;Only send bulletin to verifier groups if reactant still needs to be verified or if it wasn't autoverified
 I '+$P(GMRAPA(0),U,16)!($P(GMRAPA(0),U,18)) F %=1:1:$L($P(GMRAPA(0),"^",20)) D  ;21
 .S GMRAGRUP=$E($P(GMRAPA(0),"^",20),%)
 .S XMY("G.GMRA VERIFY "_$S(GMRAGRUP="D":"DRUG",GMRAGRUP="F":"FOOD",1:"OTHER")_" ALLERGY")=""
 .Q
 S XMY("G.GMRA MARK CHART")=""
 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
 D ^XMB
 K XMB,XMY,XMTEXT,GMRATEXT,^TMP($J,"GMRACOM")
 Q
PRINT ;PRINT OUT THE DATA
 N GMRAT,GMRAZN S (GMRAZN,GMRAT)=""
 S:GMRAZ'="" GMRAZN=$$GET1^DIQ(200,GMRAZ_",",".01") ;21
 S:GMRAZ'="" GMRAT=$$GET1^DIQ(200,GMRAZ_",","8","I") ;21
 S:GMRAT'="" GMRAT=$P($G(^DIC(3.1,GMRAT,0)),U)
 S ^TMP($J,"GMRACOM",GMRACNT)=$E(GMRASP,1,10)_"Date: "_$$FMTE^XLFDT(GMRAY,1)_$E(GMRASP,1,10)_"User: "_GMRAZN,GMRACNT=GMRACNT+1
 S ^TMP($J,"GMRACOM",GMRACNT)=$E(GMRASP,1,47)_"Title: "_GMRAT,GMRACNT=GMRACNT+1
 I '$D(^GMR(120.8,GMRAPA,26,GMRAX,2,0)) Q
 S DIWL=16,DIWR=75,DIWF=""
 K ^UTILITY($J,"W",DIWL)
 S GMRAXX=0 F  S GMRAXX=$O(^GMR(120.8,GMRAPA,26,GMRAX,2,GMRAXX)) Q:GMRAXX<1  S X=^(GMRAXX,0) D ^DIWP
 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
 S ^TMP($J,"GMRACOM",GMRACNT)="   ",GMRACNT=GMRACNT+1
 Q