AGGAGE ;VNGT/HS/ALA - Age Function calls ; 21 Apr 2010 9:50 AM
;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
;;
;
AGE(D0,PDATE,QUAL) ;EP
; Description
; This program is copied from the computed AGE field (2,.033) which
; calculates the AGE of a person based on their DOB (date of birth)
; and either the current date (DT) or their DOD (date of death)
;
; It has been modified to use another date passed into this function
; instead of just the previous two dates, DT and DOD.
;
; Input
; D0 - Patient IEN
; PDATE - Other date to compare patient's date of birth with
; QUAL - Include qualifier (YRS, DYS, MOS)
;
; Assumes variables U,DT
;
S PDATE=$G(PDATE,""),QUAL=$G(QUAL,"")
I $P($G(^DPT(D0,0)),U,3)="" Q ""
Q $$AGE^AUPNPAT(D0,PDATE,QUAL)
AGGAGE ;VNGT/HS/ALA - Age Function calls ; 21 Apr 2010 9:50 AM
+1 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
+2 ;;
+3 ;
AGE(D0,PDATE,QUAL) ;EP
+1 ; Description
+2 ; This program is copied from the computed AGE field (2,.033) which
+3 ; calculates the AGE of a person based on their DOB (date of birth)
+4 ; and either the current date (DT) or their DOD (date of death)
+5 ;
+6 ; It has been modified to use another date passed into this function
+7 ; instead of just the previous two dates, DT and DOD.
+8 ;
+9 ; Input
+10 ; D0 - Patient IEN
+11 ; PDATE - Other date to compare patient's date of birth with
+12 ; QUAL - Include qualifier (YRS, DYS, MOS)
+13 ;
+14 ; Assumes variables U,DT
+15 ;
+16 SET PDATE=$GET(PDATE,"")
SET QUAL=$GET(QUAL,"")
+17 IF $PIECE($GET(^DPT(D0,0)),U,3)=""
QUIT ""
+18 QUIT $$AGE^AUPNPAT(D0,PDATE,QUAL)