22 lines
1.3 KiB
Mathematica
22 lines
1.3 KiB
Mathematica
|
GMRADGMV ;HIRMFO/RM-ALLERGY PT. MOVEMENT EVENTS ; 7/24/91
|
||
|
;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
|
||
|
EN1 ; CALLED FROM GMRADGPM MARK CHART PROTOCOL
|
||
|
Q:DGPMP'=""!($P(DGPMA,"^",2)'=1)!'$O(^GMR(120.8,"B",DFN,0))
|
||
|
S ZTDTH=$H,ZTDESC="Fire Bulletin to Mark Patient Allergy DFN="_DFN,ZTRTN="EN2^GMRADGMV",ZTIO="",ZTSAVE("DFN")="",ZTSAVE("DGPMA")="" D ^%ZTLOAD K ZTSK
|
||
|
Q
|
||
|
EN2 ; FIRE BULLETINS FOR ACTIVE PATIENT ALLERGIES
|
||
|
S GMRANAM=$P($G(^DPT(DFN,0)),"^"),GMRALOC=$P($G(^(.1)),"^"),GMRAMOV=+$G(^(.102)),GMRAWLOC=$P($G(^DGPM(+GMRAMOV,0)),"^",6),GMRAHLOC=+$G(^DIC(42,+GMRAWLOC,44)) G:'GMRAHLOC Q2
|
||
|
D PID^VADPT6 S GMRAVIP=VA("PID") D KVAR^VADPT K VA
|
||
|
S (GMRAPA,GMRAPA2)=0 F S GMRAPA=$O(^GMR(120.8,"B",DFN,GMRAPA)) Q:GMRAPA'>0 D
|
||
|
.S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0))
|
||
|
.I $P(GMRAPA(0),"^",12),'+$G(^GMR(120.8,GMRAPA,"ER")),'$O(^GMR(120.8,GMRAPA,13,"B",+DGPMA-.0001)) D
|
||
|
..S GMRAPA2=GMRAPA2+1,GMRAPA2(GMRAPA2)=$P(GMRAPA(0),U,2)
|
||
|
..S GMRAPA2(GMRAPA2)=GMRAPA2(GMRAPA2)_U_$S($P(GMRAPA(0),U,14)="A":"Allergy",$P(GMRAPA(0),U,14)="P":"Adverse Reaction",$P(GMRAPA(0),U,14)="U":"Unknown",1:"")
|
||
|
..Q
|
||
|
.Q
|
||
|
;This routine is to send one message with all of the patient's allergies
|
||
|
D SITE^GMRAUTL S GMRASITE(0)=$G(^GMRD(120.84,GMRASITE,0))
|
||
|
I GMRAPA2,$P(GMRASITE(0),U,10) D BULLT^GMRASEN2
|
||
|
Q2 K DFN,DGPMA,GMRAHLOC,GMRALOC,GMRAMOV,GMRANAM,GMRAPA,GMRAPA2,GMRAWLOC,GMRASITE S ZTREQ="@"
|
||
|
Q
|