Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACDAGRG

ACDAGRG.m

Go to the documentation of this file.
ACDAGRG ;IHS/ADC/EDE/KML - GET AGE RANGE;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;; 01-26-98
 ;; 01-26-98
 ;
 ; Upon entry ACDDOV is the internal FileMan form of the visit date.
 ;
START ;
 NEW ACDDOB,ACDDOVX
 S:'$D(ACDDOV) ACDDOV=DT ;        for non visit related like ^ACDCSD
 S X=ACDDOV D H^%DTC S ACDDOVX=%H
 S X=$P(^DPT(ACDDFNP,0),"^",3) D H^%DTC S ACDDOB=%H
 S ACDAGE=ACDDOVX-ACDDOB\365.25
SETRG ; EP - COMPUTE AGE RANGE
 S ACDAGER=$S(ACDAGE<13:1,ACDAGE<19:2,ACDAGE<25:3,ACDAGE<35:4,ACDAGE<45:5,ACDAGE<55:6,ACDAGE<65:7,ACDAGE<75:8,1:9)
 Q