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

APCLBRH1.m

Go to the documentation of this file.
APCLBRH1 ; IHS/CMI/LAB - PRINT MCR,MCD OR PI HOLDERS ;
 ;;2.0;IHS PCC SUITE;**21**;MAY 14, 2009;Build 34
START ;
 S APCL80D="-------------------------------------------------------------------------------"
 S APCLPG=0 D HEAD
 S APCLPN=0 K APCLQ
 F  S APCLPN=$O(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN)) Q:APCLPN=""!($D(APCLQ))  D DFN
 G:$D(APCLQ) DONE
 I $Y>(IOSL-6) D HEAD G:$D(APCLQ) DONE
 W !!?10,"TOTAL NUMBER OF ",APCLTITL,":  ",APCLTOT,!
DONE D DONE^APCLOSUT
 K ^XTMP("APCLBRH",APCLJOB,APCLBT)
 Q
DFN ;
 S DFN="" F  S DFN=$O(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN)) Q:DFN=""!($D(APCLQ))  D @APCLPROC
 Q
MCRA ;
 I $Y>(IOSL-6) D HEAD Q:$D(APCLQ)
 S (DOB,Y)=$P(^DPT(DFN,0),U,3) I DOB]"" D DD^%DT S DOB=Y
 S APCLHRN=$P(^AUPNPAT(DFN,41,APCLSU,0),U,2)
 S APCLMN=$S($D(^AUPNMCR(DFN,21)):$P(^AUPNMCR(DFN,21),U),1:"")
 S APCLMDOB=$S($D(^AUPNMCR(DFN,21)):$P(^AUPNMCR(DFN,21),U,2),1:"") I APCLMDOB]"" S Y=APCLMDOB D DD^%DT S APCLMDOB=Y
 ;S APCLMEDN=$P(^AUPNMCR(DFN,0),U,3)_$S($P(^(0),U,4)]"":$P(^AUTTMCS($P(^(0),U,4),0),U),1:"")  ;IHS/CMI/LAB PATCH 21 NMCI
 S APCLMEDN=$$GETMCR^AGUTL(DFN)  ;IHS/CMI/LAB PATCH 21 NMCI
 W !,"(REG) ",APCLPN,?36,$J(APCLHRN,6),?49,APCLMEDN,?64,DOB
 W !,"(MCR) ",APCLMN,?64,APCLMDOB
 S APCLMDFN=0 F  S APCLMDFN=$O(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN!($D(APCLQ))  I $D(^AUPNMCR(DFN,11,APCLMDFN,0)) S APCLR=^(0) D MCRA2
 W !,APCL80D
 Q
MCRA2 ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQ)
 W !?19,$P(APCLR,U,3) S Y=$P(APCLR,U) D:Y]"" DD^%DT W ?32,Y S Y=$P(APCLR,U,2) D:Y]"" DD^%DT W ?50,Y
 Q
PI ;
 I $Y>(IOSL-9) D HEAD Q:$D(APCLQ)
 S (DOB,Y)=$P(^DPT(DFN,0),U,3) I DOB]"" D DD^%DT S DOB=Y
 S APCLHRN=$P(^AUPNPAT(DFN,41,APCLSU,0),U,2)
 W !,APCLPN,?40,APCLHRN,?56,DOB
 S APCLMDFN=0 F  S APCLMDFN=$O(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN!($D(APCLQ))  S APCLR=^AUPNPRVT(DFN,11,APCLMDFN,0) D PI2
 W !,APCL80D
 Q
PI2 ;
 I $Y>(IOSL-7) D HEAD Q:$D(APCLQ)
 W !,"   INSURER:  ",$P(^AUTNINS($P(APCLR,U),0),U)
 W !,"   POLICY #: ",$S($P($G(^AUPNPRVT(DFN,11,APCLMDFN,2)),U,1)]"":$P(^AUPNPRVT(DFN,11,APCLMDFN,2),U,1),$P(APCLR,U,8):$P(^AUPN3PPH($P(APCLR,U,8),0),U,4),1:$P(APCLR,U,2)),?47,"COVERAGE TYPE: ",$P(APCLR,U,3)
 W !,"   INSURED:  ",$P(APCLR,U,4),?47,"REL:  ",$S($P(APCLR,U,5)]"":$P(^AUTTRLSH($P(APCLR,U,5),0),U),1:"")
 W !,"   ELIG BEG DATE:  " S Y=$P(APCLR,U,6) D:Y]"" DD^%DT W Y,?47,"ELIG END DATE:  " S Y=$P(APCLR,U,7) D:Y]"" DD^%DT W Y
 Q
MCD ;
 I $Y>(IOSL-8) D HEAD Q:$D(APCLQ)
 S (DOB,Y)=$P(^DPT(DFN,0),U,3) I Y]"" D DD^%DT S DOB=Y
 S APCLHRN=$P(^AUPNPAT(DFN,41,APCLSU,0),U,2)
 W !,"(REG) ",APCLPN,?46,APCLHRN,?61,DOB
 S APCLMDFN=0 F  S APCLMDFN=$O(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN!($D(APCLQ))  S APCLR=^AUPNMCD(APCLMDFN,0) D MCD2
 W !,APCL80D
 Q
MCD2 ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQ)
 S APCLMN=$S($D(^AUPNMCD(APCLMDFN,21)):$P(^AUPNMCD(APCLMDFN,21),U),1:"")
 S APCLMDOB=$S($D(^AUPNMCD(APCLMDFN,21)):$P(^AUPNMCD(APCLMDFN,21),U,2),1:"")
 W !,"(MCD) ",APCLMN,?61,APCLMDOB
 W !,"   MEDICAID #: ",$P(APCLR,U,3),?50,"STATE: ",$S($P(APCLR,U,4)]"":$P(^DIC(5,$P(APCLR,U,4),0),U),1:"")
 W !,"   NAME/INSURED: ",$P(APCLR,U,5),?50,"SEX OF INSURED: ",$P(APCLR,U,7)
 S APCLNDFN=0 F  S APCLNDFN=$O(^XTMP("APCLBRH",APCLJOB,APCLBT,APCLPN,DFN,APCLMDFN,APCLNDFN)) Q:APCLNDFN'=+APCLNDFN!($D(APCLQ))  S APCLNREC=^AUPNMCD(APCLMDFN,11,APCLNDFN,0) D MCD3
 Q
MCD3 ;
 W !,"   ELIG BEG DATE: " S Y=$P(APCLNREC,U) D:Y]"" DD^%DT W ?20,Y,?35,"COVERAGE: ",$P(APCLNREC,U,3),?50,"ELIG END DATE: " S Y=$P(APCLNREC,U,2) D:Y]"" DD^%DT W Y
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQ="" Q
HEAD1 ;
 W:$D(IOF) @IOF S APCLPG=APCLPG+1
 W ?(80-$L($P(^DIC(4,APCLSU,0),U))/2),$P(^DIC(4,APCLSU,0),U),?72,"Page ",APCLPG,!
 S APCLLENG=22+$L(APCLTITL)
 W ?((80-APCLLENG)/2),"REGISTERED PATIENTS -  ",APCLTITL,!
 W ?23,"Actively enrolled as of ",APCLACEY,!
 W !
 D @(APCLPROC_"H")
 W APCL80D
 Q
MCRAH ;
 W !,"         NAME",?36,"CHART #",?49,"MEDICARE #",!,"(TYPE)",?14,"COVERAGE",?32,"ELIG BEG DATE",?49,"ELIG END DATE",?64,"DATE OF BIRTH",!
 Q
PIH W !,"PATIENT NAME",?40,"CHART #",?55,"DATE OF BIRTH",!
 Q
MCDH ;
 W !,"PATIENT NAME",?40,"CHART #",?55,"DATE OF BIRTH",!
 Q