AMHRBV11 ; IHS/CMI/LAB - continuation of AMHV1 ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
5 ;ENTRY POINT
I $Y>(IOSL-7) D HEAD^AMHRBV1 Q:$D(AMHQUIT)
D HD^AMHRBV1
S AMHMDFN=0 F S AMHMDFN=$O(^AUPNPRVT(DFN,11,AMHMDFN)) Q:AMHMDFN'=+AMHMDFN!($D(AMHQUIT)) I $D(^AUPNPRVT(DFN,11,AMHMDFN,0)) S AMHREC=^AUPNPRVT(DFN,11,AMHMDFN,0) D 52
Q:$D(AMHQUIT)
D VISIT^AMHRBV1
Q
52 ;
Q:$P(AMHREC,U,6)=""
Q:$P(AMHREC,U,6)>AMHED
I $P(AMHREC,U,7)]"",$P(AMHREC,U,7)<AMHSD Q
53 ;
I $Y>(IOSL-9) D HEAD^AMHRBV1 Q:$D(AMHQUIT)
W !?8,"INSURER: ",$P(^AUTNINS($P(AMHREC,U),0),U)
W !?8,"POLICY #: ",$P(AMHREC,U,2),?47,"COVERAGE TYPE: ",$P(AMHREC,U,3)
W !?8,"INSURED: ",$P(AMHREC,U,4),?47,"REL: ",$S($P(AMHREC,U,5)]"":$P(^AUTTRLSH($P(AMHREC,U,5),0),U),1:"")
W !?8,"ELIG BEG DATE: " S Y=$P(AMHREC,U,6) D:Y]"" DD^%DT W Y,?47,"ELIG END DATE: " S Y=$P(AMHREC,U,7) D:Y]"" DD^%DT W Y
W !
Q
4 ;ENTRY POINT
I $Y>(IOSL-7) D HEAD^AMHRBV1 Q:$D(AMHQUIT)
D HD^AMHRBV1
S AMHMDFN=0 F S AMHMDFN=$O(^AUPNMCD("B",DFN,AMHMDFN)) Q:AMHMDFN'=+AMHMDFN!($D(AMHQUIT)) S AMHREC=^AUPNMCD(AMHMDFN,0) D 42
Q:$D(AMHQUIT)
W !
D VISIT^AMHRBV1
Q
42 ;
Q:'$D(^AUPNMCD(AMHMDFN,11))
S (AMHNDFN,AMHGOT)=0 F S AMHNDFN=$O(^AUPNMCD(AMHMDFN,11,AMHNDFN)) Q:AMHNDFN'=+AMHNDFN!($D(AMHQUIT)) S AMHNREC=^AUPNMCD(AMHMDFN,11,AMHNDFN,0) D 43
Q
;
43 ;
Q:AMHNDFN>AMHED
I $P(AMHNREC,U,2)]"",$P(AMHNREC,U,2)<AMHSD Q
S AMHGOT=AMHGOT+1
G:AMHGOT>1 431
I $Y>(IOSL-9) D HEAD^AMHRBV1 Q:$D(AMHQUIT)
S AMHMN=$S($D(^AUPNMCD(AMHMDFN,21)):$P(^AUPNMCD(AMHMDFN,21),U),1:"")
S AMHMDOB=$S($D(^AUPNMCD(AMHMDFN,21)):$P(^AUPNMCD(AMHMDFN,21),U,2),1:"")
W !?8,"(MCD) ",AMHMN,?61,AMHMDOB
W !?8,"Medicaid #: ",$P(AMHREC,U,3),?50,"State: ",$S($P(AMHREC,U,4)="":"",1:$P(^DIC(5,$P(AMHREC,U,4),0),U))
W !?8,"Name/Insured: ",$P(AMHREC,U,5),?50,"Sex of Insured: ",$P(AMHREC,U,7)
431 I $Y>(IOSL-6) D HEAD^AMHRBV1 Q:$D(AMHQUIT)
W !?8,"Elig Beg Date: " S Y=$P(AMHNREC,U) D:Y]"" DD^%DT W ?20,Y,?35,"Coverage: ",$P(AMHNREC,U,3),?50,"Elig End Date: " S Y=$P(AMHNREC,U,2) D:Y]"" DD^%DT W Y
Q
6 ;ENTRY POINT
I $Y>(IOSL-9) D HEAD^AMHRBV1 Q:$D(AMHQUIT)
D HD^AMHRBV1
Q:$D(AMHQUIT)
W !
D VISIT^AMHRBV1
Q
AMHRBV11 ; IHS/CMI/LAB - continuation of AMHV1 ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
5 ;ENTRY POINT
+1 IF $Y>(IOSL-7)
DO HEAD^AMHRBV1
IF $DATA(AMHQUIT)
QUIT
+2 DO HD^AMHRBV1
+3 SET AMHMDFN=0
FOR
SET AMHMDFN=$ORDER(^AUPNPRVT(DFN,11,AMHMDFN))
IF AMHMDFN'=+AMHMDFN!($DATA(AMHQUIT))
QUIT
IF $DATA(^AUPNPRVT(DFN,11,AMHMDFN,0))
SET AMHREC=^AUPNPRVT(DFN,11,AMHMDFN,0)
DO 52
+4 IF $DATA(AMHQUIT)
QUIT
+5 DO VISIT^AMHRBV1
+6 QUIT
52 ;
+1 IF $PIECE(AMHREC,U,6)=""
QUIT
+2 IF $PIECE(AMHREC,U,6)>AMHED
QUIT
+3 IF $PIECE(AMHREC,U,7)]""
IF $PIECE(AMHREC,U,7)<AMHSD
QUIT
53 ;
+1 IF $Y>(IOSL-9)
DO HEAD^AMHRBV1
IF $DATA(AMHQUIT)
QUIT
+2 WRITE !?8,"INSURER: ",$PIECE(^AUTNINS($PIECE(AMHREC,U),0),U)
+3 WRITE !?8,"POLICY #: ",$PIECE(AMHREC,U,2),?47,"COVERAGE TYPE: ",$PIECE(AMHREC,U,3)
+4 WRITE !?8,"INSURED: ",$PIECE(AMHREC,U,4),?47,"REL: ",$SELECT($PIECE(AMHREC,U,5)]"":$PIECE(^AUTTRLSH($PIECE(AMHREC,U,5),0),U),1:"")
+5 WRITE !?8,"ELIG BEG DATE: "
SET Y=$PIECE(AMHREC,U,6)
IF Y]""
DO DD^%DT
WRITE Y,?47,"ELIG END DATE: "
SET Y=$PIECE(AMHREC,U,7)
IF Y]""
DO DD^%DT
WRITE Y
+6 WRITE !
+7 QUIT
4 ;ENTRY POINT
+1 IF $Y>(IOSL-7)
DO HEAD^AMHRBV1
IF $DATA(AMHQUIT)
QUIT
+2 DO HD^AMHRBV1
+3 SET AMHMDFN=0
FOR
SET AMHMDFN=$ORDER(^AUPNMCD("B",DFN,AMHMDFN))
IF AMHMDFN'=+AMHMDFN!($DATA(AMHQUIT))
QUIT
SET AMHREC=^AUPNMCD(AMHMDFN,0)
DO 42
+4 IF $DATA(AMHQUIT)
QUIT
+5 WRITE !
+6 DO VISIT^AMHRBV1
+7 QUIT
42 ;
+1 IF '$DATA(^AUPNMCD(AMHMDFN,11))
QUIT
+2 SET (AMHNDFN,AMHGOT)=0
FOR
SET AMHNDFN=$ORDER(^AUPNMCD(AMHMDFN,11,AMHNDFN))
IF AMHNDFN'=+AMHNDFN!($DATA(AMHQUIT))
QUIT
SET AMHNREC=^AUPNMCD(AMHMDFN,11,AMHNDFN,0)
DO 43
+3 QUIT
+4 ;
43 ;
+1 IF AMHNDFN>AMHED
QUIT
+2 IF $PIECE(AMHNREC,U,2)]""
IF $PIECE(AMHNREC,U,2)<AMHSD
QUIT
+3 SET AMHGOT=AMHGOT+1
+4 IF AMHGOT>1
GOTO 431
+5 IF $Y>(IOSL-9)
DO HEAD^AMHRBV1
IF $DATA(AMHQUIT)
QUIT
+6 SET AMHMN=$SELECT($DATA(^AUPNMCD(AMHMDFN,21)):$PIECE(^AUPNMCD(AMHMDFN,21),U),1:"")
+7 SET AMHMDOB=$SELECT($DATA(^AUPNMCD(AMHMDFN,21)):$PIECE(^AUPNMCD(AMHMDFN,21),U,2),1:"")
+8 WRITE !?8,"(MCD) ",AMHMN,?61,AMHMDOB
+9 WRITE !?8,"Medicaid #: ",$PIECE(AMHREC,U,3),?50,"State: ",$SELECT($PIECE(AMHREC,U,4)="":"",1:$PIECE(^DIC(5,$PIECE(AMHREC,U,4),0),U))
+10 WRITE !?8,"Name/Insured: ",$PIECE(AMHREC,U,5),?50,"Sex of Insured: ",$PIECE(AMHREC,U,7)
431 IF $Y>(IOSL-6)
DO HEAD^AMHRBV1
IF $DATA(AMHQUIT)
QUIT
+1 WRITE !?8,"Elig Beg Date: "
SET Y=$PIECE(AMHNREC,U)
IF Y]""
DO DD^%DT
WRITE ?20,Y,?35,"Coverage: ",$PIECE(AMHNREC,U,3),?50,"Elig End Date: "
SET Y=$PIECE(AMHNREC,U,2)
IF Y]""
DO DD^%DT
WRITE Y
+2 QUIT
6 ;ENTRY POINT
+1 IF $Y>(IOSL-9)
DO HEAD^AMHRBV1
IF $DATA(AMHQUIT)
QUIT
+2 DO HD^AMHRBV1
+3 IF $DATA(AMHQUIT)
QUIT
+4 WRITE !
+5 DO VISIT^AMHRBV1
+6 QUIT