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

ADEPME.m

Go to the documentation of this file.
ADEPME ; IHS/HQT/MJL - MEDICAID ELIGIBLES PT 1 ;08:33 PM  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;;APRIL 1999
INIT ;
 ;------->GET DATE RANGE
 D DATE G:Y<0 END
 ;------->DEVICE
ASKDEV ;FHL 9/9/98 S %ZIS="Q" D ^%ZIS G END:POP I $D(IO("Q")) K IO("Q") D QUE W:$D(ZTSK) !,"REQUEST QUEUED." G END
 S %ZIS="Q" D ^%ZIS G END:POP I $D(IO("Q")) K IO("Q") D QUE W:$D(ZTQUEUED) !,"REQUEST QUEUED." G END
ZTM ;EP
 ;------->$O THRU ADEPCD("AC" (TASKMAN ENTRY)
 D PROC
 ;------->PRINT
 D ^ADEPME1
 I $D(ZTQUEUED) S ZTREQ="@"
 K ^ADEUTL("ADEPME",$J) ;^ADEUTL is a transient report global
 ;------->END
END K ADEAGE,ADEBD,ADEBDT,ADEDAT,ADEDFN,ADEDOB,ADEED,ADEFAC,ADELIN,ADEMDFN,ADENAM,ADEND,ADENOD,ADENUM,ADEPAG,ADEPAT,ADEPRV,J
 Q
QUE S ZTRTN="ZTM^ADEPME",ZTDESC="DENTAL MEDICAID ELIGIBLE REPORT"
 F J="ADEBD","ADEED" S ZTSAVE(J)=""
 D ^%ZTLOAD Q
DATE S U="^",%DT="AE",%DT(0)=-DT,%DT("A")="SELECT BEGINNING DATE: " D ^%DT K %DT
 Q:Y<0
 S ADEBD=Y,%DT="AE",%DT(0)=ADEBD,%DT("A")="SELECT ENDING DATE: " D ^%DT K %DT
 G:X="^" DATE Q:Y<0  S ADEED=Y I ADEED>DT W " ??",*7 G DATE
 Q
PROC S ADEBD=ADEBD-1
 K ^ADEUTL("ADEPME",$J)
 I '$D(IO("S")),$P(IOST,"-")="C" W !,"Please wait while I scan the records..."
 F J=0:0 S ADEBD=$O(^ADEPCD("AC",ADEBD)) Q:'ADEBD!(ADEBD>ADEED)  S ADEDAT=$E(ADEBD,4,5)_"-"_$E(ADEBD,6,7)_"-"_$E(ADEBD,2,3) D P1
 Q
P1 S ADEDFN=0 F J=0:0 S ADEDFN=$O(^ADEPCD("AC",ADEBD,ADEDFN)) Q:'ADEDFN  D P3
 Q
P3 Q:'$D(^ADEPCD(ADEDFN,0))
 S ADENOD=^ADEPCD(ADEDFN,0)
 Q:$P(ADENOD,U,9)'="d"
 S ADEPAT=$P(ADENOD,U)
 S ADEPRV=$P(ADENOD,U,4)
 Q:'ADEPRV  Q:'$D(^DIC(16,ADEPRV,0))
 S ADEPRV=$P(^DIC(16,ADEPRV,0),U)
 Q:'$D(^AUPNMCD("B",ADEPAT))
 S ADEMDFN=$O(^AUPNMCD("B",ADEPAT,0))
 Q:'ADEMDFN  Q:'$D(^AUPNMCD(ADEMDFN,0))
 S ADENUM=$P(^AUPNMCD(ADEMDFN,0),U,3) S:ADENUM']"" ADENUM="<Missing>"
 Q:'$D(^DPT(ADEPAT,0))
 S ADENOD=^DPT(ADEPAT,0),ADENAM=$P(ADENOD,U),ADEDOB=$P(ADENOD,U,3)
 Q:'ADEDOB
 S X1=DT,X2=ADEDOB D ^%DTC Q:X<1
 ;beginning Y2K fix
 ;S ADEAGE=X\364.25
 S ADEAGE=X\365.25  ;Y2000
 ;end Y2K fix block
 S ADEAGE=$S(ADEAGE<19:"0-18 YRS",(ADEAGE>18)&(ADEAGE<22):"19-21 YRS",ADEAGE>21:"22+ YRS",1:"") Q:ADEAGE=""
 ;***FUTURE VERSION: CALL LOCAL ELIGIBLE SERVICES TABLE HERE
 S ^ADEUTL("ADEPME",$J,ADEAGE,ADENAM,ADEDFN)=ADEDAT_U_ADENUM_U_ADEPRV
 Q