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

APCLBV11.m

Go to the documentation of this file.
APCLBV11 ; IHS/CMI/LAB - continuation of APCLV1 ;
 ;;2.0;IHS PCC SUITE;**21**;MAY 14, 2009;Build 34
1 ;EP
 I $Y>(IOSL-9) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 S APCLCHMP=$O(^AUTNINS("B","CHAMPUS",0))
 I 'APCLCHMP S APCLCHMP=$O(^AUTNINS("B","TRICARE",0))
 D HD^APCLBV1
 Q:'$D(^AUPNPAT(DFN,11))
 S X=$P(^AUPNPAT(DFN,11),U,11)
 W !?8,APCLCOPN(X)
 I ($P(^AUTTBEN(X,0),U,2)="04"!($P(^AUTTBEN(X,0),U,2)="31")),APCLCHMP]"" D PRVT1
 D VISIT^APCLBV1
 Q
PRVT1 ;
 Q:APCLCHMP=""
 S Y=$O(^AUPNPRVT("AB",APCLCHMP,DFN,0)) Q:Y=""
 S APCLX=^AUPNPRVT(DFN,11,Y,0) W ?40,"Sponsor: ",$P(APCLX,U,4),?65,"SSN: " S X=$P(APCLX,U,2) W $E(X,1,3),"-",$E(X,4,5),"-",$E(X,6,9)
 Q
2 ;EP
 I $Y>(IOSL-9) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 D HD^APCLBV1
 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
 S APCLMEDN=$$GETMCR^AGUTL(DFN)_$S($P(^AUPNMCR(DFN,0),U,4)]"":$P(^AUTTMCS($P(^(0),U,4),0),U),1:"")  ;IHS/CMI/LAB
 S APCLVAL=$S(APCLRNUM=2:"A",1:"B")
 W !?8,"Medicare Name: ",APCLMN,?56,"DOB: ",DOB
 S APCLMDFN=0 F  S APCLMDFN=$O(^AUPNMCR(DFN,11,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN!($D(APCLQUIT))  I $D(^AUPNMCR(DFN,11,APCLMDFN,0)) S APCLREC=^(0) D 22
 D VISIT^APCLBV1
 Q
22 ;
 Q:APCLVAL'[$P(^AUPNMCR(DFN,11,APCLMDFN,0),U,3)
 Q:$P(^AUPNMCR(DFN,11,APCLMDFN,0),U)>APCLED
 I $P(^AUPNMCR(DFN,11,APCLMDFN,0),U,2)]"",$P(^(0),U,2)<APCLSD Q
 I $Y>(IOSL-5) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 W !?8,"Coverage:",?19,$P(APCLREC,U,3) S Y=$P(APCLREC,U) D:Y]"" DD^%DT W ?23,"Beg. Date: ",?34,Y S Y=$P(APCLREC,U,2) D:Y]"" DD^%DT W ?49,"End. Date: ",?61,Y,!?8,"Medicare #: ",APCLMEDN,!
 Q
3 ;
 D 2
 Q
4 ;ENTRY POINT
 I $Y>(IOSL-7) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 D HD^APCLBV1
 S APCLMDFN=0 F  S APCLMDFN=$O(^AUPNMCD("B",DFN,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN!($D(APCLQUIT))  S APCLREC=^AUPNMCD(APCLMDFN,0) D 42
 Q:$D(APCLQUIT)
 W !
 D VISIT^APCLBV1
 Q
42 ;
 Q:'$D(^AUPNMCD(APCLMDFN,11))
 S (APCLNDFN,APCLGOT)=0 F  S APCLNDFN=$O(^AUPNMCD(APCLMDFN,11,APCLNDFN)) Q:APCLNDFN'=+APCLNDFN!($D(APCLQUIT))  S APCLNREC=^AUPNMCD(APCLMDFN,11,APCLNDFN,0) D 43
 Q
 ;
43 ;
 Q:APCLNDFN>APCLED
 I $P(APCLNREC,U,2)]"",$P(APCLNREC,U,2)<APCLSD Q
 S APCLGOT=APCLGOT+1
 G:APCLGOT>1 431
 I $Y>(IOSL-9) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 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 !?8,"(MCD)  ",APCLMN,?61,APCLMDOB
 W !?8,"Medicaid #: ",$P(APCLREC,U,3),?50,"State: ",$S($P(APCLREC,U,4)="":"",1:$P(^DIC(5,$P(APCLREC,U,4),0),U))
 W !?8,"Name/Insured: ",$P(APCLREC,U,5),?50,"Sex of Insured: ",$P(APCLREC,U,7)
431 I $Y>(IOSL-6) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 W !?8,"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
5 ;ENTRY POINT
 I $Y>(IOSL-7) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 D HD^APCLBV1
 S APCLMDFN=0 F  S APCLMDFN=$O(^AUPNPRVT(DFN,11,APCLMDFN)) Q:APCLMDFN'=+APCLMDFN!($D(APCLQUIT))  I $D(^AUPNPRVT(DFN,11,APCLMDFN,0)) S APCLREC=^AUPNPRVT(DFN,11,APCLMDFN,0) D 52
 Q:$D(APCLQUIT)
 D VISIT^APCLBV1
 Q
52 ;
 Q:$P(APCLREC,U,6)=""
 Q:$P(APCLREC,U,6)>APCLED
 I $P(APCLREC,U,7)]"",$P(APCLREC,U,7)<APCLSD Q
53 ;
 I $Y>(IOSL-9) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 W !?8,"INSURER:  ",$P(^AUTNINS($P(APCLREC,U),0),U)
 W !?8,"POLICY #: ",$S($P($G(^AUPNPRVT(DFN,11,APCLMDFN,2)),U,1)]"":$P(^AUPNPRVT(DFN,11,APCLMDFN,2),U,1),$P(APCLREC,U,8):$P(^AUPN3PPH($P(APCLREC,U,8),0),U,4),1:$P(APCLREC,U,2)),?47,"COVERAGE TYPE: ",$P(APCLREC,U,3)
 W !?8,"INSURED:  ",$P(APCLREC,U,4),?47,"REL:  ",$S($P(APCLREC,U,5)]"":$P(^AUTTRLSH($P(APCLREC,U,5),0),U),1:"")
 W !?8,"ELIG BEG DATE:  " S Y=$P(APCLREC,U,6) D:Y]"" DD^%DT W Y,?47,"ELIG END DATE:  " S Y=$P(APCLREC,U,7) D:Y]"" DD^%DT W Y
 W !
 Q
6 ;ENTRY POINT
 I $Y>(IOSL-9) D HEAD^APCLBV1 Q:$D(APCLQUIT)
 D HD^APCLBV1
 Q:$D(APCLQUIT)
 W !
 D VISIT^APCLBV1
 Q