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

ABPADETC.m

Go to the documentation of this file.
  1. ABPADETC ; DETAILED CLAIM DISPLAY; [ 07/25/91 7:34 AM ]
  1. ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
  1. ;;MODIFICATION OF COMPILED TEMPLATE: ABPA/DETAILED/CLAIM/DISPLAY
  1. K DIPTDFN S DIPTDFN=$O(^DIPT("B","ABPA/DETAILED/CLAIM/DISPLAY",""))
  1. I +DIPTDFN'>0 K DIPTDFN Q
  1. Q:$D(^DIPT(+DIPTDFN,"DXS"))=0 D ^%AUCLS S DC=1 K DXS G BEGIN
  1. N W !
  1. 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)
  1. Q
  1. 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
  1. W Y Q
  1. M D @DIXX
  1. Q
  1. BEGIN ;
  1. S:'$D(DN) DN=1
  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))
  1. I $D(DXS(2,9))=1 D
  1. .S DXS(2,9)=$P(DXS(2,9),"X=X_Y_"")""")
  1. .S DXS(2,9)=DXS(2,9)_"X=X_$S(Y]"""":Y,1:""NO SSN ON FILE"")_"")"""
  1. W ?0 W "==============================================================================="
  1. 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
  1. 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
  1. D N:$X>71 Q:'DN W ?71 W "Page:"
  1. 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)
  1. 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
  1. 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
  1. D N:$X>0 Q:'DN W ?0 W "==============================================================================="
  1. F Y=0:0 Q:$Y>5 W !
  1. D N:$X>9 Q:'DN W ?16 W "Patient Name:"
  1. D N:$X>31 Q:'DN W ?31 X DXS(2,9) K DIP K:DN Y W X
  1. F Y=0:0 Q:$Y>6 W !
  1. D N:$X>9 Q:'DN W ?20 W "Facility:"
  1. 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)
  1. F Y=0:0 Q:$Y>7 W !
  1. D N:$X>8 Q:'DN W ?8 W "Health Record Number:"
  1. D N:$X>31 Q:'DN W ?31,$E($P(X,U,3),1,10)
  1. F Y=0:0 Q:$Y>8 W !
  1. 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
  1. G A1R
  1. A1 ;
  1. F Y=0:0 Q:$Y>8 W !
  1. D N:$X>9 Q:'DN W ?13 W "Date of Service:"
  1. 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
  1. F Y=0:0 Q:$Y>9 W !
  1. S DXS(3,"A")="ADJUSTMENT",DXS(3,"D")="DENTAL"
  1. S DXS(3,"I")="INPATIENT (HOSPITAL ONLY)",DXS(3,"O")="OUTPATIENT"
  1. S DXS(3,"P")="INPATIENT (PHYSICIAN ONLY)"
  1. D N:$X>9 Q:'DN W ?18 W "Visit Type:"
  1. 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)
  1. F Y=0:0 Q:$Y>10 W !
  1. D N:$X>9 Q:'DN W ?14 W "Days or Visits:"
  1. D N:$X>31 Q:'DN W ?31,$E($P(X,U,5),1,10)
  1. F Y=0:0 Q:$Y>11 W !
  1. D N:$X>9 Q:'DN W ?11 W "Insurance Company:"
  1. 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)
  1. F Y=0:0 Q:$Y>12 W !
  1. D N:$X>9 Q:'DN W ?8 W "Policy Holder's Name:"
  1. D N:$X>31 Q:'DN W ?31,$E($P(X,U,8),1,30)
  1. F Y=0:0 Q:$Y>13 W !
  1. D N:$X>9 Q:'DN W ?15 W "Policy Number:"
  1. D N:$X>31 Q:'DN W ?31,$E($P(X,U,9),1,15)
  1. F Y=0:0 Q:$Y>14 W !
  1. D N:$X>9 Q:'DN W ?17 W "Bill Amount:"
  1. 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)
  1. D N:$X>31 Q:'DN W ?31,X S X=XSAV K XSAV
  1. D T Q:'DN D N W ?0 W "==============================================================================="
  1. D N:$X>0 Q:'DN W ?0 W "Bill Transmitted:"
  1. 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
  1. S DIP=^ABPVAO(D0,1,D1,0) W " Bill ID: ",$P(DIP,"^",2)
  1. W ?47,"Current Status: ",$P(DIP(1),U,17) S DIP=$P(DIP(1),U,17)
  1. W $S(DIP="O":"PEN",DIP="PA":"AYMENTS APPLIED",DIP="C":"LOSED",1:"???")
  1. K DIP D N:$X>0 Q:'DN W ?0 W "==============================================================================="
  1. Q
  1. A1R ;
  1. K Y,DXS I $D(ABPA("CDEL"))=0 D PAUSE^ABPAMAIN
  1. Q
  1. W !,"--------------------------------------------------------------------------------",!!