source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNCMR5.m@ 847

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

initial load of FOIAVistA 6/30/08 version

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