source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRACMR5.m@ 703

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

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1GMRACMR5 ;HIRMFO/WAA-PATIENT NOT ASKED ABOUT ALLERGIES ; 10/1/92
2 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
3IDMARK(DFN,GMRADATE,GMRAIEN) ;
4 ; Find if an IDBAND has been mark for a date range
5 ; Input Variable List
6 ; GMRADATE = The date of the event
7 ; DFN = Patient DFN
8 ; GMRAIEN = IEN for reaction to check
9 ;
10 ; Extrinsic Function Variable List
11 ; GMRAID = Return value of extrinsic function
12 ; 1 means ID Band was marked for this admission.
13 ; 0 means ID Band was not marked.
14 ; GMRADM = Admission Date
15 ; GMRAD = Patient Movement IEN for discharge
16 ; GMRADIS = Discharge Date
17 ; GMRAX = Scratch Variable
18 ; VAINDT = Admission date (used for ADM^VADPT2 call)
19 ; VADMVT = Patient Movement IEN for admission
20 ;
21 N GMRADM,GMRADIS,GMRAD,GMRAID,GMRAX,VAINDT,VADMVT
22 S GMRAID=0
23 S:GMRADATE'="CURRENT" VAINDT=GMRADATE D ADM^VADPT2
24 S GMRADM=$P($G(^DGPM(VADMVT,0)),U) ; ADM MOVEMENT DATE
25 S GMRAD=$P($G(^DGPM(VADMVT,0)),U,17) ; GET DISCHARGE IEN
26 S GMRADIS=$P($G(^DGPM(+GMRAD,0)),U) ; GET DISCHARGE DATE
27 I GMRADIS="" S GMRADIS=$$NOW^XLFDT ; IF NO DISCHARGE DATE SET TO TODAY
28 S GMRAX=$O(^GMR(120.8,GMRAIEN,14,"B",GMRADM)) ; GRAB THE DATE FROM ART
29 I GMRAX'="",GMRAX<GMRADIS S GMRAID=1 ;VERIFY IT IS BETWEEN THE DATES
30 Q GMRAID
Note: See TracBrowser for help on using the repository browser.