ABMRSPI1 ; IHS/SD/SDR - Claims Identified as Potential Split Billing Report;
;;2.6;IHS 3P BILLING SYSTEM;**22**;NOV 12, 2009;Build 418
;IHS/SD/SDR 2.6*22 HEAT335246 - New routine
;
Q
VISIT ;EP
S ABMSDT=ABMY("DT",1)-.5
S ABMEDT=ABMY("DT",2)+.999999
F S ABMSDT=$O(^ABMDCLM(DUZ(2),"AD",ABMSDT)) Q:'ABMSDT!(ABMSDT>ABMEDT) D
.S ABMP("CDFN")=0
.F S ABMP("CDFN")=$O(^ABMDCLM(DUZ(2),"AD",ABMSDT,ABMP("CDFN"))) Q:'ABMP("CDFN") D
..D DATA
Q
APPROVAL ;EP
S ABMSDT=ABMY("DT",1)-.5
S ABMEDT=ABMY("DT",2)+.999999
F S ABMSDT=$O(^ABMDBILL(DUZ(2),"AP",ABMSDT)) Q:'ABMSDT!(ABMSDT>ABMEDT) D
.S ABMP("BDFN")=0
.F S ABMP("BDFN")=$O(^ABMDBILL(DUZ(2),"AP",ABMSDT,ABMP("BDFN"))) Q:'ABMP("BDFN") D
..I +$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U)=0 Q ;no bill number, bad x-ref entry
..S ABMP("CDFN")=+$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U)
..D DATA
Q
DATA ;EP
S ABMAINS=$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,8) ;active insurer
I ABMAINS="" Q ;no active insurer
I '$D(ABMY("INS",ABMAINS)) Q ;not selected insurer
I ABMY("DT")="V" S ABMCS=$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,4) ;claim status
I ABMY("DT")="A" S ABMCS=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,4) ;bill status
I ABMY("STA")'[ABMCS Q ;not selected claim status
I $G(ABMY("SPLIT"))="A","^S^A^"[("^"_$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,22)_"^") Q ;if auto is selected we only want the original claims to show up; this is for option STIN
S ABMVSTCK=0 ;check for H or I service category
D DATA2
Q:ABMVSTCK=1 ;H or I service category
S ABMVFILE=""
F S ABMVFILE=$O(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE)) Q:$G(ABMVFILE)="" D Q:ABMVMULT=1
.I +$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE))>1 S ABMVMULT=1 Q
.I +$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE))=1 S ABMVMULT=ABMVMULT+.5
I ABMVMULT=1 D ;multiple entries were found in requested files
.S ABMP("VLOC")=$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3) ;visit loc
.S ABMP("VTYP")=$P($G(^ABMDVTYP($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,7),0)),U) ;visit type name
.I +$G(^TMP("ABM-SPIN-DATA",$J,ABMP("VLOC"),ABMP("VTYP"),ABMP("CDFN")))=1 Q ;already counted this claim
.S ^TMP("ABM-SPIN-DATA",$J,ABMP("VLOC"),ABMP("VTYP"),ABMP("CDFN"))=1
.I $G(ABMY("RTYP"))=2 D ;statistical
..;visit loc short name
..S ABMP("VLOC")=$S($P($G(^AUTTLOC($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2)'="":$P($G(^AUTTLOC($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2),1:$P($G(^DIC(4,$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U))
..S ^TMP("ABM-SPIN",$J,ABMP("VLOC"),ABMP("VTYP"))=+$G(^TMP("ABM-SPIN",$J,ABMP("VLOC"),ABMP("VTYP")))+1
.I $G(ABMY("RTYP"))=1 D ;brief
..;claim status^split status^patient^HRN^active insurer^claim number^visit date^clinic
..;claim status
..I ABMY("DT")="V" S ABMPREC=$S(ABMCS="F":"FAB",ABMCS="E":"EDT",ABMCS="O":"ROL",ABMCS="C":"COM",ABMCS="P":"PEN",ABMCS="U":"UNB",ABMCS="X":"CLO",1:"")
..I ABMY("DT")="A" S ABMPREC=$S(ABMCS="A":"APP",ABMCS="B":"BLD",ABMCS="C":"COM",ABMCS="X":"CAN",1:"")
..S ABMSSTAT=$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,22) ;split status
..S ABMPREC=ABMPREC_U_ABMSSTAT
..S ABMPREC=ABMPREC_U_$P($G(^DPT($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U),0)),U) ;patient name
..S ABMPREC=ABMPREC_U_$P($G(^AUPNPAT($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U),41,ABMP("VLOC"),0)),U,2)_U_$P($G(^AUTNINS(ABMAINS,0)),U)_U_ABMP("CDFN")_U_ABMSDT ;HRN, active insurer, claim#, visit date
..S ABMPREC=ABMPREC_U_+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8D"))_U_+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8E"))_U_+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8F"))_U_+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8H")) ;page counts
..;visit loc short name
..S ABMP("VLOC")=$S($P($G(^AUTTLOC($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2)'="":$P($G(^AUTTLOC($P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2),1:$P($G(^DIC(4,$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U))
..S ^TMP("ABM-SPIN",$J,ABMP("VLOC"),ABMP("VTYP"),ABMSDT,ABMP("CDFN"))=ABMPREC
..I ABMSSTAT'="S" S ^TMP("ABM-SPIN-CNT",$J)=+$G(^TMP("ABM-SPIN-CNT",$J))+1
Q
DATA2 ;EP
;now loop thru visits on claim and see if there are multiple charges on the selected pages
S ABMP("VDFN")=0
S ABMVMULT=0
F S ABMP("VDFN")=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),11,ABMP("VDFN"))) Q:'ABMP("VDFN") D
.S ^TMP("ABM-SPIN",$J,"VSTS",ABMP("VDFN"))=$P($G(^AUPNVSIT(ABMP("VDFN"),0)),U,7) ;list of visits with service category
.I "^H^I^"[("^"_$P($G(^AUPNVSIT(ABMP("VDFN"),0)),U,7)_"^") S ABMVSTCK=1 ;check if service category is H or I
.I ((ABMY("PGS")["8D")!(ABMY("PGS")["8Z")) D CHECK("^AUPNVMED","8D") ;meds - 8D
.I ((ABMY("PGS")["8E")!(ABMY("PGS")["8Z")) D CHECK("^AUPNVLAB","8E"),CHECK("^AUPNVMIC","8E"),CHECK("^AUPNVPTH","8E"),CHECK("^AUPNVBB","8E"),CHECK("^AUPNVCYT","8E") ;lab - 8E
.I ((ABMY("PGS")["8F")!(ABMY("PGS")["8Z")) D CHECK("^AUPNVRAD","8F") ;rad - 8F
.D CHECK2 ;checks V CPT entries and if that page was selected by user as one to report on, since V CPT could have anything
Q
;
CHECK(VFILE,ABMVFILE) ;EP - VFILE is the V file global name
;This subrtn goes thru the visits in the V file and check for multiple entries in that file
N L,T,L11,L12,COLDATE,ORDPROV,CPTSTR,CPT,MODIFIER,FILEN
S L=0
F S L=$O(@VFILE@("AD",ABMP("VDFN"),L)) Q:'L D
.;T first piece is test, S is site
.S T=$G(@VFILE@(+L,0)) Q:'T
.I VFILE["VLAB"&($P($G(^AUPNVLAB(+L,14)),U,2)="") Q ;skip entries that don't have CPT - BILLABLE ITEM populated
.S ^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE)=+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE))+1
.S ABMP("VDETAIL",ABMVFILE,VFILE,+L)=""
.I VFILE["VLAB"&($L($P($G(^AUPNVLAB(+L,14)),U,2),";")>1) D ;there is more than 1 CPT on a lab
..F S=2:1:$L($P($G(^AUPNVLAB(+L,14)),U,2),";") S ^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE)=+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),ABMVFILE))+1,ABMP("VDETAIL",ABMVFILE,VFILE,+L)=""
Q
CHECK2 ;EP
S ABMVIEN=0
F S ABMVIEN=$O(^AUPNVCPT("AD",ABMP("VDFN"),ABMVIEN)) Q:'ABMVIEN D
.S ABMCPT=$P($G(^ICPT($P($G(^AUPNVCPT(ABMVIEN,0)),U),0)),U) ;CPT
.S ABMVFILE="8H" ;default
.I (((ABMCPT<100)!(ABMCPT?.5N1.6A.5N)!($L(ABMCPT)=6))&((ABMY("PGS")["8H")!(ABMY("PGS")["8Z"))) S ^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8H")=+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8H"))+1,ABMVFILE="8H"
.I (((ABMCPT>79999)&(ABMCPT<90000))&((ABMY("PGS")["8E")!(ABMY("PGS")["8Z"))) S ^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8E")=+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8E"))+1,ABMVFILE="8E"
.I (((ABMCPT>69999)&(ABMCPT<80000))&((ABMY("PGS")["8F")!(ABMY("PGS")["8Z"))) S ^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8F")=+$G(^TMP("ABM-SPIN",$J,"VLST",ABMP("CDFN"),"8F"))+1,ABMVFILE="8F"
.I (ABMCPT>89999) S ABMVFILE="8A"
.S ABMP("VDETAIL",ABMVFILE,"^AUPNVCPT",ABMVIEN)=""
Q
ABMRSPI1 ; IHS/SD/SDR - Claims Identified as Potential Split Billing Report;
+1 ;;2.6;IHS 3P BILLING SYSTEM;**22**;NOV 12, 2009;Build 418
+2 ;IHS/SD/SDR 2.6*22 HEAT335246 - New routine
+3 ;
+4 QUIT
VISIT ;EP
+1 SET ABMSDT=ABMY("DT",1)-.5
+2 SET ABMEDT=ABMY("DT",2)+.999999
+3 FOR
SET ABMSDT=$ORDER(^ABMDCLM(DUZ(2),"AD",ABMSDT))
IF 'ABMSDT!(ABMSDT>ABMEDT)
QUIT
Begin DoDot:1
+4 SET ABMP("CDFN")=0
+5 FOR
SET ABMP("CDFN")=$ORDER(^ABMDCLM(DUZ(2),"AD",ABMSDT,ABMP("CDFN")))
IF 'ABMP("CDFN")
QUIT
Begin DoDot:2
+6 DO DATA
End DoDot:2
End DoDot:1
+7 QUIT
APPROVAL ;EP
+1 SET ABMSDT=ABMY("DT",1)-.5
+2 SET ABMEDT=ABMY("DT",2)+.999999
+3 FOR
SET ABMSDT=$ORDER(^ABMDBILL(DUZ(2),"AP",ABMSDT))
IF 'ABMSDT!(ABMSDT>ABMEDT)
QUIT
Begin DoDot:1
+4 SET ABMP("BDFN")=0
+5 FOR
SET ABMP("BDFN")=$ORDER(^ABMDBILL(DUZ(2),"AP",ABMSDT,ABMP("BDFN")))
IF 'ABMP("BDFN")
QUIT
Begin DoDot:2
+6 ;no bill number, bad x-ref entry
IF +$PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U)=0
QUIT
+7 SET ABMP("CDFN")=+$PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U)
+8 DO DATA
End DoDot:2
End DoDot:1
+9 QUIT
DATA ;EP
+1 ;active insurer
SET ABMAINS=$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,8)
+2 ;no active insurer
IF ABMAINS=""
QUIT
+3 ;not selected insurer
IF '$DATA(ABMY("INS",ABMAINS))
QUIT
+4 ;claim status
IF ABMY("DT")="V"
SET ABMCS=$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,4)
+5 ;bill status
IF ABMY("DT")="A"
SET ABMCS=$PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,4)
+6 ;not selected claim status
IF ABMY("STA")'[ABMCS
QUIT
+7 ;if auto is selected we only want the original claims to show up; this is for option STIN
IF $GET(ABMY("SPLIT"))="A"
IF "^S^A^"[("^"_$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,22)_"^")
QUIT
+8 ;check for H or I service category
SET ABMVSTCK=0
+9 DO DATA2
+10 ;H or I service category
IF ABMVSTCK=1
QUIT
+11 SET ABMVFILE=""
+12 FOR
SET ABMVFILE=$ORDER(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE))
IF $GET(ABMVFILE)=""
QUIT
Begin DoDot:1
+13 IF +$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE))>1
SET ABMVMULT=1
QUIT
+14 IF +$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE))=1
SET ABMVMULT=ABMVMULT+.5
End DoDot:1
IF ABMVMULT=1
QUIT
+15 ;multiple entries were found in requested files
IF ABMVMULT=1
Begin DoDot:1
+16 ;visit loc
SET ABMP("VLOC")=$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3)
+17 ;visit type name
SET ABMP("VTYP")=$PIECE($GET(^ABMDVTYP($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,7),0)),U)
+18 ;already counted this claim
IF +$GET(^TMP("ABM-SPIN-DATA",$JOB,ABMP("VLOC"),ABMP("VTYP"),ABMP("CDFN")))=1
QUIT
+19 SET ^TMP("ABM-SPIN-DATA",$JOB,ABMP("VLOC"),ABMP("VTYP"),ABMP("CDFN"))=1
+20 ;statistical
IF $GET(ABMY("RTYP"))=2
Begin DoDot:2
+21 ;visit loc short name
+22 SET ABMP("VLOC")=$SELECT($PIECE($GET(^AUTTLOC($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2)'="":$PIECE($GET(^AUTTLOC($PIECE(...
... $GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2),1:$PIECE($GET(^DIC(4,$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U))
+23 SET ^TMP("ABM-SPIN",$JOB,ABMP("VLOC"),ABMP("VTYP"))=+$GET(^TMP("ABM-SPIN",$JOB,ABMP("VLOC"),ABMP("VTYP")))+1
End DoDot:2
+24 ;brief
IF $GET(ABMY("RTYP"))=1
Begin DoDot:2
+25 ;claim status^split status^patient^HRN^active insurer^claim number^visit date^clinic
+26 ;claim status
+27 IF ABMY("DT")="V"
SET ABMPREC=$SELECT(ABMCS="F":"FAB",ABMCS="E":"EDT",ABMCS="O":"ROL",ABMCS="C":"COM",ABMCS="P":"PEN",ABMCS="U":"UNB",ABMCS="X":"CLO",1:"")
+28 IF ABMY("DT")="A"
SET ABMPREC=$SELECT(ABMCS="A":"APP",ABMCS="B":"BLD",ABMCS="C":"COM",ABMCS="X":"CAN",1:"")
+29 ;split status
SET ABMSSTAT=$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,22)
+30 SET ABMPREC=ABMPREC_U_ABMSSTAT
+31 ;patient name
SET ABMPREC=ABMPREC_U_$PIECE($GET(^DPT($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U),0)),U)
+32 ;HRN, active insurer, claim#, visit date
SET ABMPREC=ABMPREC_U_$PIECE($GET(^AUPNPAT($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U),41,ABMP("VLOC"),0)),U,2)_U_$PIECE($GET(^AUTNINS(ABMAINS,0)),U)_U_ABMP("CDFN")_U_ABMSDT
+33 ;page counts
SET ABMPREC=ABMPREC_U_+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8D"))_U_+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8E"))_U_+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8F"))_U_+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP
("CDFN"),"8H"))
+34 ;visit loc short name
+35 SET ABMP("VLOC")=$SELECT($PIECE($GET(^AUTTLOC($PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2)'="":$PIECE($GET(^AUTTLOC($PIECE(...
... $GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U,2),1:$PIECE($GET(^DIC(4,$PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),0)),U,3),0)),U))
+36 SET ^TMP("ABM-SPIN",$JOB,ABMP("VLOC"),ABMP("VTYP"),ABMSDT,ABMP("CDFN"))=ABMPREC
+37 IF ABMSSTAT'="S"
SET ^TMP("ABM-SPIN-CNT",$JOB)=+$GET(^TMP("ABM-SPIN-CNT",$JOB))+1
End DoDot:2
End DoDot:1
+38 QUIT
DATA2 ;EP
+1 ;now loop thru visits on claim and see if there are multiple charges on the selected pages
+2 SET ABMP("VDFN")=0
+3 SET ABMVMULT=0
+4 FOR
SET ABMP("VDFN")=$ORDER(^ABMDCLM(DUZ(2),ABMP("CDFN"),11,ABMP("VDFN")))
IF 'ABMP("VDFN")
QUIT
Begin DoDot:1
+5 ;list of visits with service category
SET ^TMP("ABM-SPIN",$JOB,"VSTS",ABMP("VDFN"))=$PIECE($GET(^AUPNVSIT(ABMP("VDFN"),0)),U,7)
+6 ;check if service category is H or I
IF "^H^I^"[("^"_$PIECE($GET(^AUPNVSIT(ABMP("VDFN"),0)),U,7)_"^")
SET ABMVSTCK=1
+7 ;meds - 8D
IF ((ABMY("PGS")["8D")!(ABMY("PGS")["8Z"))
DO CHECK("^AUPNVMED","8D")
+8 ;lab - 8E
IF ((ABMY("PGS")["8E")!(ABMY("PGS")["8Z"))
DO CHECK("^AUPNVLAB","8E")
DO CHECK("^AUPNVMIC","8E")
DO CHECK("^AUPNVPTH","8E")
DO CHECK("^AUPNVBB","8E")
DO CHECK("^AUPNVCYT","8E")
+9 ;rad - 8F
IF ((ABMY("PGS")["8F")!(ABMY("PGS")["8Z"))
DO CHECK("^AUPNVRAD","8F")
+10 ;checks V CPT entries and if that page was selected by user as one to report on, since V CPT could have anything
DO CHECK2
End DoDot:1
+11 QUIT
+12 ;
CHECK(VFILE,ABMVFILE) ;EP - VFILE is the V file global name
+1 ;This subrtn goes thru the visits in the V file and check for multiple entries in that file
+2 NEW L,T,L11,L12,COLDATE,ORDPROV,CPTSTR,CPT,MODIFIER,FILEN
+3 SET L=0
+4 FOR
SET L=$ORDER(@VFILE@("AD",ABMP("VDFN"),L))
IF 'L
QUIT
Begin DoDot:1
+5 ;T first piece is test, S is site
+6 SET T=$GET(@VFILE@(+L,0))
IF 'T
QUIT
+7 ;skip entries that don't have CPT - BILLABLE ITEM populated
IF VFILE["VLAB"&($PIECE($GET(^AUPNVLAB(+L,14)),U,2)="")
QUIT
+8 SET ^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE)=+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE))+1
+9 SET ABMP("VDETAIL",ABMVFILE,VFILE,+L)=""
+10 ;there is more than 1 CPT on a lab
IF VFILE["VLAB"&($LENGTH($PIECE($GET(^AUPNVLAB(+L,14)),U,2),";")>1)
Begin DoDot:2
+11 FOR S=2:1:$LENGTH($PIECE($GET(^AUPNVLAB(+L,14)),U,2),";")
SET ^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE)=+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),ABMVFILE))+1
SET ABMP("VDETAIL",ABMVFILE,VFILE,+L)=""
End DoDot:2
End DoDot:1
+12 QUIT
CHECK2 ;EP
+1 SET ABMVIEN=0
+2 FOR
SET ABMVIEN=$ORDER(^AUPNVCPT("AD",ABMP("VDFN"),ABMVIEN))
IF 'ABMVIEN
QUIT
Begin DoDot:1
+3 ;CPT
SET ABMCPT=$PIECE($GET(^ICPT($PIECE($GET(^AUPNVCPT(ABMVIEN,0)),U),0)),U)
+4 ;default
SET ABMVFILE="8H"
+5 IF (((ABMCPT<100)!(ABMCPT?.5N1.6A.5N)!($LENGTH(ABMCPT)=6))&((ABMY("PGS")["8H")!(ABMY("PGS")["8Z")))
SET ^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8H")=+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8H"))+1
SET ABMVFILE="8H"
+6 IF (((ABMCPT>79999)&(ABMCPT<90000))&((ABMY("PGS")["8E")!(ABMY("PGS")["8Z")))
SET ^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8E")=+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8E"))+1
SET ABMVFILE="8E"
+7 IF (((ABMCPT>69999)&(ABMCPT<80000))&((ABMY("PGS")["8F")!(ABMY("PGS")["8Z")))
SET ^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8F")=+$GET(^TMP("ABM-SPIN",$JOB,"VLST",ABMP("CDFN"),"8F"))+1
SET ABMVFILE="8F"
+8 IF (ABMCPT>89999)
SET ABMVFILE="8A"
+9 SET ABMP("VDETAIL",ABMVFILE,"^AUPNVCPT",ABMVIEN)=""
End DoDot:1
+10 QUIT