ABMDE3X ; IHS/ASDST/DMJ - Edit Page 3 - ERROR CHK ;
;;2.6;IHS 3P BILLING SYSTEM;**6,8,10,13,14**;NOV 12, 2009;Build 238
;
; 03/10/04 V2.5 Patch 5 - 837 Modifications - Added errror code 192 for imprecise accident dates
; IHS/SD/SDR - v2.5 p5 - 5/17/2004 - Added code to check for error 193
; IHS/SD/SDR - v2.5 p6 - 7/16/04 - Modified code for 193; added code for 201 and 202
; IHS/SD/SDR - v2.5 p8 - IM15677 - Modified to only display error 193 when export mode is 837
; IHS/SD/SDR - v2.5 p8 - IM12246/IM17548 - Added code for 199 and 200
; IHS/SD/SDR - v2.5 p9 - IM19291 - Error 215 added for Supervising Provider UPIN
; IHS/SD/SDR - v2.5 p9 - IM16729 - Correction ot taxonomy lookup (<SUBSCRIPT>ABMDE3X+29^ABMDE3X
; IHS/SD/SDR - v2.5 p9 - IM18516 - Delayed Reason Code
; IHS/SD/SDR - v2.5 p11 - NPI
; IHS/SD/SDR -v2.5 p12 - IM23474 - Added warning if clinic is ER and admitting DX is missing
; IHS/SD/SDR - abm*2.6*6 - 5010 - Added warning 238 if both disability dates aren't populated
;IHS/SD/SDR - 2.6*13 - Added check for new export mode 35
;IHS/SD/SDR - 2.6*14 - ICD10 - admit dx error checks (245 and 246) if wrong code set is used.
;
; Rel of info, Assign of Benefits
D QUES^ABMDE3:'$D(ABM("QU"))
I $D(ABM("QU",1)),$D(^ABMDCLM(DUZ(2),ABMP("CDFN"),7)),$P(^(7),U,4)'="Y" S ABME(58)=""
I $D(ABM("QU",2)),$D(^ABMDCLM(DUZ(2),ABMP("CDFN"),7)),$P(^(7),U,5)'="Y" S ABME(59)=""
;start new abm*2.6*14 ICD10 admit dx
I $D(ABM("QU",24)) D
.Q:(+$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9)=0) ;no admit dx
.I ((ABMP("ICD10")>ABMP("VDT"))&($P($$DX^ABMCVAPI($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9),ABMP("VDT")),U,20)=30)) S ABME(245)="" ;should be ICD9, but is ICD10
.I ((ABMP("ICD10")<ABMP("VDT"))&($P($$DX^ABMCVAPI($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9),ABMP("VDT")),U,20)'=30)) S ABME(246)="" ;should be ICD10, but is ICD9
;end new ICD10 admit dx
; Having a date of accident and accident type determine Accident Related
I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,3) D
.I ($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,3)=5)&($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,2)=""!($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,4)="")!($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,16)="")) S ABME(19)="" ;abm*2.6*10 HEAT72979
.I +$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,2),$E($P(^(8),U,2),6,7)="00" S ABME(192)=""
I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,8)'="" D
.;I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23) D ;abm*2.6*8 5010
.I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=31)!(ABMP("EXP")=32)!(ABMP("EXP")=33) D ;abm*2.6*8 5010
..I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,11)'="",(($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,13)="")&($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,14)="")&($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,15)="")) S ABME(193)=""
..I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,13)'="" D ;Person class
...I $G(^ABMPTAX("AUSC",$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,13)))="" S ABME(201)=""
..I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,14)'="" D ;Provider Class
...S ABMPTAX=$P($G(^DIC(7,$P(^ABMDCLM(DUZ(2),ABMP("CDFN"),8),U,14),9999999)),U)
...I $G(ABMPTAX)="" S ABME(202)=""
...I $G(ABMPTAX),$G(^ABMPTAX("A7",ABMPTAX))="" S ABME(202)=""
.;I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=27)!(ABMP("EXP")=28)!(ABMP("EXP")=29) D ;abm*2.6*8 5010
.;I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=27)!(ABMP("EXP")=28)!(ABMP("EXP")=29)!(ABMP("EXP")=31)!(ABMP("EXP")=32)!(ABMP("EXP")=33) D ;abm*2.6*8 5010 ;abm*2.6*13 export mode 35
.I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=27)!(ABMP("EXP")=28)!(ABMP("EXP")=29)!(ABMP("EXP")=31)!(ABMP("EXP")=32)!(ABMP("EXP")=33)!(ABMP("EXP")=35) D ;abm*2.6*8 5010 ;abm*2.6*13 export mode 35
..S ABMNPIU=$$NPIUSAGE^ABMUTLF(ABMP("LDFN"),ABMP("INS"))
..I ABMNPIU="N"!(ABMNPIU="B"),$D(ABM("QU",12)),($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,17)="") S ABME(223)="" ;Ref prv NPI missing
..I ABMNPIU="N"!(ABMNPIU="B"),$D(ABM("QU",25)),($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,12)'=""),($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,25)="") S ABME(224)="" ;sup prv NPI missing
S ABMLABT=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,0)) ;check for lab charges
I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,8)="",(+ABMLABT>0),(ABMP("EXP")=22!(ABMP("EXP")=23)) S ABME(199)=""
I ($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,22)="")&($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,23)="") D
.I ABMP("EXP")'=3,(ABMP("EXP")'=14),(ABMP("EXP")'=22),(ABMP("EXP")'=23),(ABMP("EXP")'=25) Q
.I +ABMLABT>0 S ABME(200)=""
S ABMNPIU=$$NPIUSAGE^ABMUTLF(ABMP("LDFN"),ABMP("INS"))
I ABMNPIU'="N",($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,12)'=""),($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,24)=""),("^3^14^15^22"[ABMP("EXP")) S ABME(215)=""
I $P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,16)'="" D
.I $P($G(^ABMDCODE($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,16),0)),U)=11 S ABME(198)=""
.I '$D(^ABMDCLM(DUZ(2),ABMP("CDFN"),61,0)) S ABME(214)="" ;no remarks to go w/delayed reason code
I $P($G(^DIC(40.7,ABMP("CLN"),0)),U)="EMERGENCY MEDICINE",($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9)="") S ABME(230)=""
;start new code abm*2.6*6 5010
S ABMP("DISSTDT")=$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),7)),U,15)
S ABMP("DISENDDT")=$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),7)),U,16)
I $G(ABMP("DISSTDT"))'=""&($G(ABMP("DISENDDT"))="") S ABME(238)=""
I $G(ABMP("DISSTDT"))=""&($G(ABMP("DISENDDT"))'="") S ABME(238)=""
;end new code 5010
;
XIT Q
ERR D ABMDE3X
S ABME("TITL")="PAGE 3 - QUESTIONS"
G XIT
ABMDE3X ; IHS/ASDST/DMJ - Edit Page 3 - ERROR CHK ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**6,8,10,13,14**;NOV 12, 2009;Build 238
+2 ;
+3 ; 03/10/04 V2.5 Patch 5 - 837 Modifications - Added errror code 192 for imprecise accident dates
+4 ; IHS/SD/SDR - v2.5 p5 - 5/17/2004 - Added code to check for error 193
+5 ; IHS/SD/SDR - v2.5 p6 - 7/16/04 - Modified code for 193; added code for 201 and 202
+6 ; IHS/SD/SDR - v2.5 p8 - IM15677 - Modified to only display error 193 when export mode is 837
+7 ; IHS/SD/SDR - v2.5 p8 - IM12246/IM17548 - Added code for 199 and 200
+8 ; IHS/SD/SDR - v2.5 p9 - IM19291 - Error 215 added for Supervising Provider UPIN
+9 ; IHS/SD/SDR - v2.5 p9 - IM16729 - Correction ot taxonomy lookup (<SUBSCRIPT>ABMDE3X+29^ABMDE3X
+10 ; IHS/SD/SDR - v2.5 p9 - IM18516 - Delayed Reason Code
+11 ; IHS/SD/SDR - v2.5 p11 - NPI
+12 ; IHS/SD/SDR -v2.5 p12 - IM23474 - Added warning if clinic is ER and admitting DX is missing
+13 ; IHS/SD/SDR - abm*2.6*6 - 5010 - Added warning 238 if both disability dates aren't populated
+14 ;IHS/SD/SDR - 2.6*13 - Added check for new export mode 35
+15 ;IHS/SD/SDR - 2.6*14 - ICD10 - admit dx error checks (245 and 246) if wrong code set is used.
+16 ;
+17 ; Rel of info, Assign of Benefits
+18 IF '$DATA(ABM("QU"))
DO QUES^ABMDE3
+19 IF $DATA(ABM("QU",1))
IF $DATA(^ABMDCLM(DUZ(2),ABMP("CDFN"),7))
IF $PIECE(^(7),U,4)'="Y"
SET ABME(58)=""
+20 IF $DATA(ABM("QU",2))
IF $DATA(^ABMDCLM(DUZ(2),ABMP("CDFN"),7))
IF $PIECE(^(7),U,5)'="Y"
SET ABME(59)=""
+21 ;start new abm*2.6*14 ICD10 admit dx
+22 IF $DATA(ABM("QU",24))
Begin DoDot:1
+23 ;no admit dx
IF (+$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9)=0)
QUIT
+24 ;should be ICD9, but is ICD10
IF ((ABMP("ICD10")>ABMP("VDT"))&($PIECE($$DX^ABMCVAPI($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9),ABMP("VDT")),U,20)=30))
SET ABME(245)=""
+25 ;should be ICD10, but is ICD9
IF ((ABMP("ICD10")<ABMP("VDT"))&($PIECE($$DX^ABMCVAPI($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9),ABMP("VDT")),U,20)'=30))
SET ABME(246)=""
End DoDot:1
+26 ;end new ICD10 admit dx
+27 ; Having a date of accident and accident type determine Accident Related
+28 IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,3)
Begin DoDot:1
+29 ;abm*2.6*10 HEAT72979
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,3)=5)&($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,2)=""!($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,4)="")!($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,16)=""))
SET ABME(19)=""
+30 IF +$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,2)
IF $EXTRACT($PIECE(^(8),U,2),6,7)="00"
SET ABME(192)=""
End DoDot:1
+31 IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,8)'=""
Begin DoDot:1
+32 ;I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23) D ;abm*2.6*8 5010
+33 ;abm*2.6*8 5010
IF ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=31)!(ABMP("EXP")=32)!(ABMP("EXP")=33)
Begin DoDot:2
+34 IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,11)'=""
IF (($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,13)="")&($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,14)="")&($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,15)=""))
SET ABME(193)=""
+35 ;Person class
IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,13)'=""
Begin DoDot:3
+36 IF $GET(^ABMPTAX("AUSC",$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,13)))=""
SET ABME(201)=""
End DoDot:3
+37 ;Provider Class
IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,14)'=""
Begin DoDot:3
+38 SET ABMPTAX=$PIECE($GET(^DIC(7,$PIECE(^ABMDCLM(DUZ(2),ABMP("CDFN"),8),U,14),9999999)),U)
+39 IF $GET(ABMPTAX)=""
SET ABME(202)=""
+40 IF $GET(ABMPTAX)
IF $GET(^ABMPTAX("A7",ABMPTAX))=""
SET ABME(202)=""
End DoDot:3
End DoDot:2
+41 ;I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=27)!(ABMP("EXP")=28)!(ABMP("EXP")=29) D ;abm*2.6*8 5010
+42 ;I ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=27)!(ABMP("EXP")=28)!(ABMP("EXP")=29)!(ABMP("EXP")=31)!(ABMP("EXP")=32)!(ABMP("EXP")=33) D ;abm*2.6*8 5010 ;abm*2.6*13 export mode 35
+43 ;abm*2.6*8 5010 ;abm*2.6*13 export mode 35
IF ABMP("EXP")=21!(ABMP("EXP")=22)!(ABMP("EXP")=23)!(ABMP("EXP")=27)!(ABMP("EXP")=28)!(ABMP("EXP")=29)!(ABMP("EXP")=31)!(ABMP("EXP")=32)!(ABMP("EXP")=33)!(ABMP("EXP")=35)
Begin DoDot:2
+44 SET ABMNPIU=$$NPIUSAGE^ABMUTLF(ABMP("LDFN"),ABMP("INS"))
+45 ;Ref prv NPI missing
IF ABMNPIU="N"!(ABMNPIU="B")
IF $DATA(ABM("QU",12))
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,17)="")
SET ABME(223)=""
+46 ;sup prv NPI missing
IF ABMNPIU="N"!(ABMNPIU="B")
IF $DATA(ABM("QU",25))
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,12)'="")
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,25)="")
SET ABME(224)=""
End DoDot:2
End DoDot:1
+47 ;check for lab charges
SET ABMLABT=$ORDER(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,0))
+48 IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U,8)=""
IF (+ABMLABT>0)
IF (ABMP("EXP")=22!(ABMP("EXP")=23))
SET ABME(199)=""
+49 IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,22)="")&($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,23)="")
Begin DoDot:1
+50 IF ABMP("EXP")'=3
IF (ABMP("EXP")'=14)
IF (ABMP("EXP")'=22)
IF (ABMP("EXP")'=23)
IF (ABMP("EXP")'=25)
QUIT
+51 IF +ABMLABT>0
SET ABME(200)=""
End DoDot:1
+52 SET ABMNPIU=$$NPIUSAGE^ABMUTLF(ABMP("LDFN"),ABMP("INS"))
+53 IF ABMNPIU'="N"
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,12)'="")
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,24)="")
IF ("^3^14^15^22"[ABMP("EXP"))
SET ABME(215)=""
+54 IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,16)'=""
Begin DoDot:1
+55 IF $PIECE($GET(^ABMDCODE($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),9)),U,16),0)),U)=11
SET ABME(198)=""
+56 ;no remarks to go w/delayed reason code
IF '$DATA(^ABMDCLM(DUZ(2),ABMP("CDFN"),61,0))
SET ABME(214)=""
End DoDot:1
+57 IF $PIECE($GET(^DIC(40.7,ABMP("CLN"),0)),U)="EMERGENCY MEDICINE"
IF ($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),5)),U,9)="")
SET ABME(230)=""
+58 ;start new code abm*2.6*6 5010
+59 SET ABMP("DISSTDT")=$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),7)),U,15)
+60 SET ABMP("DISENDDT")=$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),7)),U,16)
+61 IF $GET(ABMP("DISSTDT"))'=""&($GET(ABMP("DISENDDT"))="")
SET ABME(238)=""
+62 IF $GET(ABMP("DISSTDT"))=""&($GET(ABMP("DISENDDT"))'="")
SET ABME(238)=""
+63 ;end new code 5010
+64 ;
XIT QUIT
ERR DO ABMDE3X
+1 SET ABME("TITL")="PAGE 3 - QUESTIONS"
+2 GOTO XIT