ABMDE8E ; IHS/ASDST/DMJ - Page 8 - LABORATORY ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
; IHS/DSD/LSL - 09/01/98 - Patch 2 - NOIS NDA-0898-180038
; 0.00 charges on HCFA because version 2.0 does not assume
; 1 for units. Modify code to set units to 1 if not
; already defined.
;
; IHS/SD/SDR - V2.5 P2 - 5/9/02 - NOIS HQW-0302-100190
; Modified to display 2nd and 3rd modifiers as well as units
; IHS/SD/SDR - V2.5 P8 - IM10618
; Prompt/display provider
; IHS/SD/SDR - v2.5 p9 - IM16660
; 4-digit revenue codes
; IHS/SD/SDR - v2.5 p9 - task 1
; Use new service line provider multiple
; IHS/SD/SDR - v2.5 p10 - IM19843
; Added new prompt SERVICE TO DATE/TIME
; IHS/SD/SDR - v2.5 p11 - NPI
;
; IHS/SD/SDR - v2.6 CSV
;
DISP K ABMZ S ABMZ("TITL")="LABORATORY SERVICES",ABMZ("PG")="8E"
I $D(ABMP("DDL")),$Y>(IOSL-9) D PAUSE^ABMDE1 G:$D(DUOUT)!$D(DTOUT)!$D(DIROUT) XIT I 1
E D SUM^ABMDE1
;
D E^ABMDE8X
FEE S ABMZ("CAT")=17
S ABMZ("SUB")=37
D MODE^ABMDE8X
S:((^ABMDEXP(ABMMODE(5),0)["HCFA")!(^ABMDEXP(ABMMODE(5),0)["CMS")) ABMZ("DIAG")=";.09"
S ABMZ("DR")=";W !;.05//"_$S($P(^ABMDCLM(DUZ(2),ABMP("CDFN"),7),U)'=$P(^(7),U,2):$$SDT^ABMDUTL(ABMP("VDT")),1:"/"_ABMP("VDT"))
S ABMZ("DR")=ABMZ("DR")_";W !;.12//"_$S($P(^ABMDCLM(DUZ(2),ABMP("CDFN"),7),U)'=$P(^(7),U,2):$$SDT^ABMDUTL(ABMP("VDT")),1:"/"_ABMP("VDT"))_";.03//1"
S ABMZ("CHRG")=";W !;.04",ABMZ("ITEM")="Laboratory (CPT Code)"
S ABMZ("DIC")="^ICPT(",ABMZ("X")="X",ABMZ("TOTL")=0
I ^ABMDEXP(ABMMODE(5),0)["UB" S ABMZ("REVN")=";W !;.02//300"
D HD G LOOP
HD W !?5,"REVN",?60,"UNIT",?71,"TOTAL"
W !?5,"CODE",?10," CPT - LABORATORY SERVICES",?59,"CHARGE",?66,"QTY",?71,"CHARGE"
W !?5,"====",?10,"===============================================",?59,"======",?66,"===",?70,"========="
Q
LOOP S (ABMZ("LNUM"),ABMZ("NUM"),ABMZ(1),ABM)=0 F ABM("I")=1:1 S ABM=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM)) Q:'ABM S ABM("X")=ABM,ABMZ("NUM")=ABM("I") D PC1
S ABMZ("MOD")=.06_U_5_U_.07_U_.08
I $D(ABMP(638)),$P($G(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U)>0 S ABMZ("OUTLAB")=$P(^(8),U)
I ABMZ("NUM")>0 W !?69,"==========",!?69,$J("$"_($FN(ABMZ("TOTL"),",",2)),10)
I +$O(ABME(0)) S ABME("CONT")="" D ^ABMDERR K ABME("CONT")
G XIT
;
PC1 S ABM("X0")=^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM("X"),0),ABM("X")=$P(^(0),U)
S ABMZ("UNIT")=$P(ABM("X0"),U,3)
S:'+ABMZ("UNIT") ABMZ("UNIT")=1
S ABMZ("MOD")=""
F ABM("M")=6,7,8 S:$P(ABM("X0"),U,ABM("M"))]"" ABMZ("MOD")=ABMZ("MOD")_"-"_$P(ABM("X0"),U,ABM("M")) I $P(ABM("X0"),U,ABM("M"))=90 S ABME(172)=""
S ABMZ(ABM("I"))=$P($$CPT^ABMCVAPI($P(ABM("X0"),U),ABMP("VDT")),U,2)_U_ABM_U_$P(ABM("X0"),U,2,7) ;CSV-c
EOP I $Y>(IOSL-5) D PAUSE^ABMDE1,HD
W !,"[",ABM("I"),"]"
I $P(ABM("X0"),"^",5) D
.W ?5,"CHARGE DATE: "
.W $$CDT^ABMDUTL($P(ABM("X0"),U,5))
.I $P(ABM("X0"),U,12)'="",($P(ABM("X0"),U,12)'=$P(ABM("X0"),U,5)) W "-",$$CDT^ABMDUTL($P(ABM("X0"),U,12))
.S ABMRPRV=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P","C","D",0))
.S:ABMRPRV="" ABMRPRV=$O(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P","C","R",0))
.I ABMRPRV'="" D ;rendering provider on line item
..W " ("_$P($G(^VA(200,$P(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P",ABMRPRV,0),U),0)),U)_"-"_$P(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P",ABMRPRV,0),U,2)_")"
.W !
W ?5,$$GETREV^ABMDUTL($P(ABM("X0"),U,2))
W ?10,$P(ABMZ(ABM("I")),U) W:ABMZ("MOD")]"" ABMZ("MOD")
K ABMU S ABMU(1)="?59"_U_$J($P(ABM("X0"),U,4),6,2)
S ABMU(2)="?66"_U_$J(ABMZ("UNIT"),2)
S ABMU(3)="?70"_U_$J($FN((ABMZ("UNIT")*$P(ABM("X0"),U,4)),",",2),9)
S ABMZ("TOTL")=(ABMZ("UNIT")*$P(ABM("X0"),U,4))+ABMZ("TOTL")
I $P(^ABMDPARM(DUZ(2),1,0),U,14)'="Y" S ABMU("TXT")=$P($$CPT^ABMCVAPI($P(ABM("X0"),U),ABMP("VDT")),U,3) ;CSV-c
;start CSV-c
E D
.S ABMU("TXT")=""
.K ABMZCPTD
.D IHSCPTD^ABMCVAPI($P(ABM("X0"),U),"ABMZCPTD","",ABMP("VDT"))
.S ABM("CP")=0
.F S ABM("CP")=$O(ABMZCPTD(ABM("CP"))) Q:(+ABM("CP")=0) D
..Q:($G(ABMZCPTD(ABM("CP")))="")
..S ABMU("TXT")=ABMU("TXT")_ABMZCPTD(ABM("CP"))_" "
;end CSV-c
S ABMU("RM")=58,ABMU("LM")=16+$L(ABMZ("MOD")) S:ABMZ("MOD")]"" ABMU("TAB")=3+$L(ABMZ("MOD")) D ^ABMDWRAP
Q
;
XIT K ABM,ABMMODE
Q
ABMDE8E ; IHS/ASDST/DMJ - Page 8 - LABORATORY ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ; IHS/DSD/LSL - 09/01/98 - Patch 2 - NOIS NDA-0898-180038
+4 ; 0.00 charges on HCFA because version 2.0 does not assume
+5 ; 1 for units. Modify code to set units to 1 if not
+6 ; already defined.
+7 ;
+8 ; IHS/SD/SDR - V2.5 P2 - 5/9/02 - NOIS HQW-0302-100190
+9 ; Modified to display 2nd and 3rd modifiers as well as units
+10 ; IHS/SD/SDR - V2.5 P8 - IM10618
+11 ; Prompt/display provider
+12 ; IHS/SD/SDR - v2.5 p9 - IM16660
+13 ; 4-digit revenue codes
+14 ; IHS/SD/SDR - v2.5 p9 - task 1
+15 ; Use new service line provider multiple
+16 ; IHS/SD/SDR - v2.5 p10 - IM19843
+17 ; Added new prompt SERVICE TO DATE/TIME
+18 ; IHS/SD/SDR - v2.5 p11 - NPI
+19 ;
+20 ; IHS/SD/SDR - v2.6 CSV
+21 ;
DISP KILL ABMZ
SET ABMZ("TITL")="LABORATORY SERVICES"
SET ABMZ("PG")="8E"
+1 IF $DATA(ABMP("DDL"))
IF $Y>(IOSL-9)
DO PAUSE^ABMDE1
IF $DATA(DUOUT)!$DATA(DTOUT)!$DATA(DIROUT)
GOTO XIT
IF 1
+2 IF '$TEST
DO SUM^ABMDE1
+3 ;
+4 DO E^ABMDE8X
FEE SET ABMZ("CAT")=17
+1 SET ABMZ("SUB")=37
+2 DO MODE^ABMDE8X
+3 IF ((^ABMDEXP(ABMMODE(5),0)["HCFA")!(^ABMDEXP(ABMMODE(5),0)["CMS"))
SET ABMZ("DIAG")=";.09"
+4 SET ABMZ("DR")=";W !;.05//"_$SELECT($PIECE(^ABMDCLM(DUZ(2),ABMP("CDFN"),7),U)'=$PIECE(^(7),U,2):$$SDT^ABMDUTL(ABMP("VDT")),1:"/"_ABMP("VDT"))
+5 SET ABMZ("DR")=ABMZ("DR")_";W !;.12//"_$SELECT($PIECE(^ABMDCLM(DUZ(2),ABMP("CDFN"),7),U)'=$PIECE(^(7),U,2):$$SDT^ABMDUTL(ABMP("VDT")),1:"/"_ABMP("VDT"))_";.03//1"
+6 SET ABMZ("CHRG")=";W !;.04"
SET ABMZ("ITEM")="Laboratory (CPT Code)"
+7 SET ABMZ("DIC")="^ICPT("
SET ABMZ("X")="X"
SET ABMZ("TOTL")=0
+8 IF ^ABMDEXP(ABMMODE(5),0)["UB"
SET ABMZ("REVN")=";W !;.02//300"
+9 DO HD
GOTO LOOP
HD WRITE !?5,"REVN",?60,"UNIT",?71,"TOTAL"
+1 WRITE !?5,"CODE",?10," CPT - LABORATORY SERVICES",?59,"CHARGE",?66,"QTY",?71,"CHARGE"
+2 WRITE !?5,"====",?10,"===============================================",?59,"======",?66,"===",?70,"========="
+3 QUIT
LOOP SET (ABMZ("LNUM"),ABMZ("NUM"),ABMZ(1),ABM)=0
FOR ABM("I")=1:1
SET ABM=$ORDER(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM))
IF 'ABM
QUIT
SET ABM("X")=ABM
SET ABMZ("NUM")=ABM("I")
DO PC1
+1 SET ABMZ("MOD")=.06_U_5_U_.07_U_.08
+2 IF $DATA(ABMP(638))
IF $PIECE($GET(^ABMDCLM(DUZ(2),ABMP("CDFN"),8)),U)>0
SET ABMZ("OUTLAB")=$PIECE(^(8),U)
+3 IF ABMZ("NUM")>0
WRITE !?69,"==========",!?69,$JUSTIFY("$"_($FNUMBER(ABMZ("TOTL"),",",2)),10)
+4 IF +$ORDER(ABME(0))
SET ABME("CONT")=""
DO ^ABMDERR
KILL ABME("CONT")
+5 GOTO XIT
+6 ;
PC1 SET ABM("X0")=^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM("X"),0)
SET ABM("X")=$PIECE(^(0),U)
+1 SET ABMZ("UNIT")=$PIECE(ABM("X0"),U,3)
+2 IF '+ABMZ("UNIT")
SET ABMZ("UNIT")=1
+3 SET ABMZ("MOD")=""
+4 FOR ABM("M")=6,7,8
IF $PIECE(ABM("X0"),U,ABM("M"))]""
SET ABMZ("MOD")=ABMZ("MOD")_"-"_$PIECE(ABM("X0"),U,ABM("M"))
IF $PIECE(ABM("X0"),U,ABM("M"))=90
SET ABME(172)=""
+5 ;CSV-c
SET ABMZ(ABM("I"))=$PIECE($$CPT^ABMCVAPI($PIECE(ABM("X0"),U),ABMP("VDT")),U,2)_U_ABM_U_$PIECE(ABM("X0"),U,2,7)
EOP IF $Y>(IOSL-5)
DO PAUSE^ABMDE1
DO HD
+1 WRITE !,"[",ABM("I"),"]"
+2 IF $PIECE(ABM("X0"),"^",5)
Begin DoDot:1
+3 WRITE ?5,"CHARGE DATE: "
+4 WRITE $$CDT^ABMDUTL($PIECE(ABM("X0"),U,5))
+5 IF $PIECE(ABM("X0"),U,12)'=""
IF ($PIECE(ABM("X0"),U,12)'=$PIECE(ABM("X0"),U,5))
WRITE "-",$$CDT^ABMDUTL($PIECE(ABM("X0"),U,12))
+6 SET ABMRPRV=$ORDER(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P","C","D",0))
+7 IF ABMRPRV=""
SET ABMRPRV=$ORDER(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P","C","R",0))
+8 ;rendering provider on line item
IF ABMRPRV'=""
Begin DoDot:2
+9 WRITE " ("_$PIECE($GET(^VA(200,$PIECE(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P",ABMRPRV,0),U),0)),U)_"-"_$PIECE(^ABMDCLM(DUZ(2),ABMP("CDFN"),37,ABM,"P",ABMRPRV,0),U,2)_")"
End DoDot:2
+10 WRITE !
End DoDot:1
+11 WRITE ?5,$$GETREV^ABMDUTL($PIECE(ABM("X0"),U,2))
+12 WRITE ?10,$PIECE(ABMZ(ABM("I")),U)
IF ABMZ("MOD")]""
WRITE ABMZ("MOD")
+13 KILL ABMU
SET ABMU(1)="?59"_U_$JUSTIFY($PIECE(ABM("X0"),U,4),6,2)
+14 SET ABMU(2)="?66"_U_$JUSTIFY(ABMZ("UNIT"),2)
+15 SET ABMU(3)="?70"_U_$JUSTIFY($FNUMBER((ABMZ("UNIT")*$PIECE(ABM("X0"),U,4)),",",2),9)
+16 SET ABMZ("TOTL")=(ABMZ("UNIT")*$PIECE(ABM("X0"),U,4))+ABMZ("TOTL")
+17 ;CSV-c
IF $PIECE(^ABMDPARM(DUZ(2),1,0),U,14)'="Y"
SET ABMU("TXT")=$PIECE($$CPT^ABMCVAPI($PIECE(ABM("X0"),U),ABMP("VDT")),U,3)
+18 ;start CSV-c
+19 IF '$TEST
Begin DoDot:1
+20 SET ABMU("TXT")=""
+21 KILL ABMZCPTD
+22 DO IHSCPTD^ABMCVAPI($PIECE(ABM("X0"),U),"ABMZCPTD","",ABMP("VDT"))
+23 SET ABM("CP")=0
+24 FOR
SET ABM("CP")=$ORDER(ABMZCPTD(ABM("CP")))
IF (+ABM("CP")=0)
QUIT
Begin DoDot:2
+25 IF ($GET(ABMZCPTD(ABM("CP")))="")
QUIT
+26 SET ABMU("TXT")=ABMU("TXT")_ABMZCPTD(ABM("CP"))_" "
End DoDot:2
End DoDot:1
+27 ;end CSV-c
+28 SET ABMU("RM")=58
SET ABMU("LM")=16+$LENGTH(ABMZ("MOD"))
IF ABMZ("MOD")]""
SET ABMU("TAB")=3+$LENGTH(ABMZ("MOD"))
DO ^ABMDWRAP
+29 QUIT
+30 ;
XIT KILL ABM,ABMMODE
+1 QUIT