source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRADSP0.m@ 701

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1GMRADSP0 ;HIRMFO/WAA-DISPLAY ALLERGY ;9/6/95 11:06
2 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
3EN1(GMRAL) ; This routine will print all the reaction in the GMRAL array
4 ; for the given DFN.
5 ; Input variables:
6 ; GMRAL = An array of all the patient allergies.
7 ;
8 K ^TMP($J,"GMRALST")
9 N GMRATYPE,GMRALN,GMRANAME,GMRAPA
10 I $D(XRTL) D T0^%ZOSV ; START RT
11 S GMRAOUT=0,GMRAOSOF=1
12 I $D(XRT0) S XRTN=$T(+0) D T1^%ZOSV ; STOP RT
13 ;sort list builder subroutine
14 ;This subroutine builds the a ^TMP array in the following format:
15 ; ^TMP($J,"GMRALST",type,name,ien)=""
16 I GMRAL S GMRAPA=0 F S GMRAPA=$O(GMRAL(GMRAPA)) Q:GMRAPA<1 D
17 .Q:+$G(^GMR(120.8,GMRAPA,"ER")) ;Check for E/E
18 .S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0)) Q:GMRAPA(0)=""
19 .S ^TMP($J,"GMRALST",$P(GMRAPA(0),U,20),$P(GMRAPA(0),U,2),GMRAPA)=""
20 .Q
21ALLTYP ;Loop through the list created by the sort subroutine and print.
22 D HEAD^GMRADSP8
23 S GMRATYPE="" F S GMRATYPE=$O(^TMP($J,"GMRALST",GMRATYPE)) Q:GMRATYPE="" D Q:GMRAOUT
24 .S GMRANAME="" F S GMRANAME=$O(^TMP($J,"GMRALST",GMRATYPE,GMRANAME)) Q:GMRANAME="" D Q:GMRAOUT
25 .. S GMRAPA=0 F S GMRAPA=$O(^TMP($J,"GMRALST",GMRATYPE,GMRANAME,GMRAPA)) Q:GMRAPA<1 D Q:GMRAOUT
26 ...N GMALN
27 ...D DISBLD^GMRADSP1(GMRAPA,.GMALN)
28 ...D DISPLAY^GMRADSP8(.GMALN) Q:GMRAOUT
29 ...Q
30 ..Q
31 .Q
32 S:GMRAOUT GMRAOUT=2-GMRAOUT
33 Q
34EXIT ;Exit
35 K ^TMP($J,"GMRALST")
36 S:GMRAOUT GMRAOUT=2-GMRAOUT
37 Q
Note: See TracBrowser for help on using the repository browser.