source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAOR9.m@ 823

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

initial load of WorldVistAEHR

File size: 1.9 KB
RevLine 
[613]1GMRAOR9 ;HIRMFO/RM,WAA,FPT-Stuff Drug Ingredients/Classes ;7/21/96 16:31
2 ;;4.0;Adverse Reaction Tracking;**4,13**;Mar 29, 1996
3 ; <Copied from GMRAPES1>
4EN1 ; Auto stuff Ingredients and VA Drug Classes
5 ; GMRAING() will have all the ingredients for the reaction
6 ; GMRADRCL() will have all the drug classes for the reaction.
7 ;
8 K GMRADRCL,GMRAING
9 ; If the Reactant is a Drug Ingredient
10 I GMRAAR[50.416 S GMRAING(+GMRAAR)="" G STING
11 ;If the Reactant is a Drug Class
12 I GMRAAR[50.605 S GMRADRCL(+GMRAAR)=""
13 ;If the Reactant is an entry in the GMR ALLERGY file
14 I GMRAAR[120.82 D
15 .S Y=0 F S Y=$O(^GMRD(120.82,+GMRAAR,"ING",Y)) Q:Y'>0 I $D(^GMRD(120.82,+GMRAAR,"ING",Y,0)),+^(0)>0 S GMRAING(+^(0))=""
16 .S Y=0 F S Y=$O(^GMRD(120.82,+GMRAAR,"CLASS",Y)) Q:Y'>0 I $D(^GMRD(120.82,+GMRAAR,"CLASS",Y,0)),+^(0)>0 S GMRADRCL(+^(0))=""
17 .Q
18 I GMRAAR["PSDRUG" D
19 .N PSODA
20 .S PSODA=+GMRAAR K ^TMP("PSO",$J) D ^PSONGR F Y=0:0 S Y=$O(^TMP("PSO",$J,Y)) Q:Y'>0 S GMRAING(Y)=""
21 .N GMRAX,GMRAY
22 .S GMRAX=$P($G(^PSDRUG(+GMRAAR,"ND")),U,6) S:GMRAX>0 GMRADRCL(GMRAX)="" Q
23 .S GMRAX=$P($G(^PSDRUG(+GMRAAR,0)),U,2) Q:GMRAX=""
24 .S GMRAY=$O(^PS(50.605,"B",GMRAX,"")) S:GMRAY>0 GMRADRCL(GMRAY)=""
25 .Q
26 I GMRAAR["PSNDF" D
27 .N PSNDA
28 .S PSNDA=+GMRAAR K ^TMP("PSN",$J) D ^PSNNGR F Y=0:0 S Y=$O(^TMP("PSN",$J,Y)) Q:Y'>0 S GMRAING(Y)=""
29 .; all classes for NDF entry returned in GMRADRCL
30 .N CLASS
31 .S CLASS=$$CLIST^PSNAPIS(+GMRAAR,.GMRADRCL)
32 K ^TMP("PSO",$J),^TMP("PSN",$J),PSODA,PSNID
33STING ;Stuffing Drug Ing & VA Drug Classes into file 120.8
34 I $D(GMRAING) D
35 .S DA(1)=+GMRAPA,DIC="^GMR(120.8,"_+GMRAPA_",2,",DLAYGO=120.8,DIC(0)="L",DIC("P")="120.802PA"
36 .F X=0:0 S X=$O(GMRAING(X)) Q:X'>0 I '$D(^GMR(120.8,GMRAPA,2,"B",X)) K DD,DO,DINUM D FILE^DICN
37 .K DIC,DLAYGO
38 .Q
39 I $D(GMRADRCL) D
40 .S DA(1)=+GMRAPA,DIC="^GMR(120.8,"_+GMRAPA_",3,",DIC(0)="L",DIC("P")="120.803PA"
41 .F X=0:0 S X=$O(GMRADRCL(X)) Q:X'>0 I '$D(^GMR(120.8,GMRAPA,3,"B",X)) K DD,DO,DINUM D FILE^DICN
42 .K DIC
43 .Q
44 K GMRADRCL,GMRAING
45 Q
Note: See TracBrowser for help on using the repository browser.