ABPADETC ; DETAILED CLAIM DISPLAY; [ 07/25/91 7:34 AM ]
;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
;;MODIFICATION OF COMPILED TEMPLATE: ABPA/DETAILED/CLAIM/DISPLAY
K DIPTDFN S DIPTDFN=$O(^DIPT("B","ABPA/DETAILED/CLAIM/DISPLAY",""))
I +DIPTDFN'>0 K DIPTDFN Q
Q:$D(^DIPT(+DIPTDFN,"DXS"))=0 D ^%AUCLS S DC=1 K DXS G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^TMP($J,1))#2,^(1)?1U1P1E.E X ^(1)
Q
DT I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1
I $D(DXS)<9 F X=0:0 S X=$O(^DIPT(+DIPTDFN,"DXS",X)) Q:'X S Y=$O(^(X,"")) F X=X:0 Q:Y="" S DXS(X,Y)=^(Y),Y=$O(^(Y))
I $D(DXS(2,9))=1 D
.S DXS(2,9)=$P(DXS(2,9),"X=X_Y_"")""")
.S DXS(2,9)=DXS(2,9)_"X=X_$S(Y]"""":Y,1:""NO SSN ON FILE"")_"")"""
W ?0 W "==============================================================================="
D N:$X>0 Q:'DN W ?0 S X=DT S X=X S:X X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) K DIP K:DN Y W X
S X=ABPATLE,X=$J("",$S($D(DIWR)+$D(DIWL)=2:DIWR-DIWL+1,$D(IOM):IOM,1:80)-$L(X)\2-$X)_X K DIP K:DN Y W X
D N:$X>71 Q:'DN W ?71 W "Page:"
D N:$X>77 Q:'DN W ?77 S X=$S($D(DC)#2:DC,1:"") K DIP K:DN Y W $E(X,1,2)
D N:$X>0 Q:'DN W ?0 X DXS(1,9.2) S X=$E($P(X,".",2)_"0000",1,4),%=X>1159 S:X>1259 X=X-1200 S X=X\100_":"_$E(X#100+100,2,3)_" "_$E("AP",%+1)_"M" K DIP K:DN Y W X
S X="*** CLAIM DETAIL DISPLAY ***",X=$J("",$S($D(DIWR)+$D(DIWL)=2:DIWR-DIWL+1,$D(IOM):IOM,1:80)-$L(X)\2-$X)_X K DIP K:DN Y W X
D N:$X>0 Q:'DN W ?0 W "==============================================================================="
F Y=0:0 Q:$Y>5 W !
D N:$X>9 Q:'DN W ?16 W "Patient Name:"
D N:$X>31 Q:'DN W ?31 X DXS(2,9) K DIP K:DN Y W X
F Y=0:0 Q:$Y>6 W !
D N:$X>9 Q:'DN W ?20 W "Facility:"
S X=$S($D(^ABPVAO(D0,0)):^(0),1:"") D N:$X>31 Q:'DN W ?31 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^AUTTLOC(Y,0))#2:$P(^(0),U,1),1:Y) S Y=$S(Y="":Y,$D(^DIC(4,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
F Y=0:0 Q:$Y>7 W !
D N:$X>8 Q:'DN W ?8 W "Health Record Number:"
D N:$X>31 Q:'DN W ?31,$E($P(X,U,3),1,10)
F Y=0:0 Q:$Y>8 W !
S I(1)=1,J(1)=9002270.21 F D1=0:0 Q:$N(^ABPVAO(D0,1,D1))'>0 X:$D(DSC(9002270.21)) DSC(9002270.21) S D1=ABPAC1-1,D1=$N(^(D1)) Q:D1'>0 D:$X>0 T Q:'DN D A1 S D1=999999999
G A1R
A1 ;
F Y=0:0 Q:$Y>8 W !
D N:$X>9 Q:'DN W ?13 W "Date of Service:"
D N:$X>31 Q:'DN W ?31 S DIP(1)=$S($D(^ABPVAO(D0,1,D1,0)):^(0),1:"") S X=$P(DIP(1),U,1) S:X X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) K DIP K:DN Y W X
F Y=0:0 Q:$Y>9 W !
S DXS(3,"A")="ADJUSTMENT",DXS(3,"D")="DENTAL"
S DXS(3,"I")="INPATIENT (HOSPITAL ONLY)",DXS(3,"O")="OUTPATIENT"
S DXS(3,"P")="INPATIENT (PHYSICIAN ONLY)"
D N:$X>9 Q:'DN W ?18 W "Visit Type:"
S X=$S($D(^ABPVAO(D0,1,D1,0)):^(0),1:"") D N:$X>31 Q:'DN W ?31 S Y=$P(X,U,4) W:Y]"" $S($D(DXS(3,Y)):DXS(3,Y),1:Y)
F Y=0:0 Q:$Y>10 W !
D N:$X>9 Q:'DN W ?14 W "Days or Visits:"
D N:$X>31 Q:'DN W ?31,$E($P(X,U,5),1,10)
F Y=0:0 Q:$Y>11 W !
D N:$X>9 Q:'DN W ?11 W "Insurance Company:"
D N:$X>31 Q:'DN W ?31 S Y=$P(X,U,6) S Y=$S(Y="":Y,$D(^AUTNINS(Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
F Y=0:0 Q:$Y>12 W !
D N:$X>9 Q:'DN W ?8 W "Policy Holder's Name:"
D N:$X>31 Q:'DN W ?31,$E($P(X,U,8),1,30)
F Y=0:0 Q:$Y>13 W !
D N:$X>9 Q:'DN W ?15 W "Policy Number:"
D N:$X>31 Q:'DN W ?31,$E($P(X,U,9),1,15)
F Y=0:0 Q:$Y>14 W !
D N:$X>9 Q:'DN W ?17 W "Bill Amount:"
S XSAV=X,X=$P(X,U,7) D COMMA^%DTC F I=0:0 Q:$E(X,1)'=" " S X=$E(X,2,99)
D N:$X>31 Q:'DN W ?31,X S X=XSAV K XSAV
D T Q:'DN D N W ?0 W "==============================================================================="
D N:$X>0 Q:'DN W ?0 W "Bill Transmitted:"
W ?18 S DIP(1)=$S($D(^ABPVAO(D0,1,D1,0)):^(0),1:"") S X=$P(DIP(1),U,12) S:X X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) K:DN Y W X
S DIP=^ABPVAO(D0,1,D1,0) W " Bill ID: ",$P(DIP,"^",2)
W ?47,"Current Status: ",$P(DIP(1),U,17) S DIP=$P(DIP(1),U,17)
W $S(DIP="O":"PEN",DIP="PA":"AYMENTS APPLIED",DIP="C":"LOSED",1:"???")
K DIP D N:$X>0 Q:'DN W ?0 W "==============================================================================="
Q
A1R ;
K Y,DXS I $D(ABPA("CDEL"))=0 D PAUSE^ABPAMAIN
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
ABPADETC ; DETAILED CLAIM DISPLAY; [ 07/25/91 7:34 AM ]
+1 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
+2 ;;MODIFICATION OF COMPILED TEMPLATE: ABPA/DETAILED/CLAIM/DISPLAY
+3 KILL DIPTDFN
SET DIPTDFN=$ORDER(^DIPT("B","ABPA/DETAILED/CLAIM/DISPLAY",""))
+4 IF +DIPTDFN'>0
KILL DIPTDFN
QUIT
+5 IF $DATA(^DIPT(+DIPTDFN,"DXS"))=0
QUIT
DO ^%AUCLS
SET DC=1
KILL DXS
GOTO BEGIN
N WRITE !
T IF $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^TMP($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 QUIT
DT IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
IF Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
IF Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+1 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 IF '$DATA(DN)
SET DN=1
+2 IF $DATA(DXS)<9
FOR X=0:0
SET X=$ORDER(^DIPT(+DIPTDFN,"DXS",X))
IF 'X
QUIT
SET Y=$ORDER(^(X,""))
FOR X=X:0
IF Y=""
QUIT
SET DXS(X,Y)=^(Y)
SET Y=$ORDER(^(Y))
+3 IF $DATA(DXS(2,9))=1
Begin DoDot:1
+4 SET DXS(2,9)=$PIECE(DXS(2,9),"X=X_Y_"")""")
+5 SET DXS(2,9)=DXS(2,9)_"X=X_$S(Y]"""":Y,1:""NO SSN ON FILE"")_"")"""
End DoDot:1
+6 WRITE ?0
WRITE "==============================================================================="
+7 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
SET X=DT
SET X=X
IF X
SET X=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3)
KILL DIP
IF DN
KILL Y
WRITE X
+8 SET X=ABPATLE
SET X=$JUSTIFY("",$SELECT($DATA(DIWR)+$DATA(DIWL)=2:DIWR-DIWL+1,$DATA(IOM):IOM,1:80)-$LENGTH(X)\2-$X)_X
KILL DIP
IF DN
KILL Y
WRITE X
+9 IF $X>71
DO N
IF 'DN
QUIT
WRITE ?71
WRITE "Page:"
+10 IF $X>77
DO N
IF 'DN
QUIT
WRITE ?77
SET X=$SELECT($DATA(DC)#2:DC,1:"")
KILL DIP
IF DN
KILL Y
WRITE $EXTRACT(X,1,2)
+11 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
XECUTE DXS(1,9.2)
SET X=$EXTRACT($PIECE(X,".",2)_"0000",1,4)
SET %=X>1159
IF X>1259
SET X=X-1200
SET X=X\100_":"_$EXTRACT(X#100+100,2,3)_" "_$EXTRACT("AP",%+1)_"M"
KILL DIP
IF DN
KILL Y
WRITE X
+12 SET X="*** CLAIM DETAIL DISPLAY ***"
SET X=$JUSTIFY("",$SELECT($DATA(DIWR)+$DATA(DIWL)=2:DIWR-DIWL+1,$DATA(IOM):IOM,1:80)-$LENGTH(X)\2-$X)_X
KILL DIP
IF DN
KILL Y
WRITE X
+13 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "==============================================================================="
+14 FOR Y=0:0
IF $Y>5
QUIT
WRITE !
+15 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?16
WRITE "Patient Name:"
+16 IF $X>31
DO N
IF 'DN
QUIT
WRITE ?31
XECUTE DXS(2,9)
KILL DIP
IF DN
KILL Y
WRITE X
+17 FOR Y=0:0
IF $Y>6
QUIT
WRITE !
+18 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?20
WRITE "Facility:"
+19 SET X=$SELECT($DATA(^ABPVAO(D0,0)):^(0),1:"")
IF $X>31
DO N
IF 'DN
QUIT
WRITE ?31
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTLOC(Y,0))#2:$PIECE(^(0),U,1),1:Y)
SET Y=$SELECT(Y="":Y,$DATA(^DIC(4,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,30)
+20 FOR Y=0:0
IF $Y>7
QUIT
WRITE !
+21 IF $X>8
DO N
IF 'DN
QUIT
WRITE ?8
WRITE "Health Record Number:"
+22 IF $X>31
DO N
IF 'DN
QUIT
WRITE ?31,$EXTRACT($PIECE(X,U,3),1,10)
+23 FOR Y=0:0
IF $Y>8
QUIT
WRITE !
+24 SET I(1)=1
SET J(1)=9002270.21
FOR D1=0:0