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

ABMDF28Q.m

Go to the documentation of this file.
  1. ABMDF28Q ; IHS/SD/SDR - PRINT UB-04 ;
  1. ;;2.6;IHS Third Party Billing;**27**;NOV 12, 2009;Build 486
  1. ;IHS/SD/SDR 2.6*27 CR8897 Split from ABMDF28Y.
  1. ;
  1. K I,J,L
  1. S I=0
  1. S ABMFND=0
  1. F S I=$O(ABMRV(I)) Q:'I D Q:ABMFND=1
  1. .S J=-1
  1. .F S J=$O(ABMRV(I,J)) Q:($G(J)="") D Q:ABMFND=1
  1. ..I J="T1015" D K ABMRV(I,J)
  1. ...S L=0
  1. ...F S L=$O(ABMRV(I,J,L)) Q:'L D
  1. ....I $P($G(^ABMDVTYP(ABMP("VTYP"),0)),U)["EPSDT",(+$P($G(ABMRV(I,J,L)),U,2)=0) D
  1. ....;S $P(ABMRV(I,J,L),U,9)="OUTPATIENT CLINIC" ;abm*2.6*27 IHS/SD/SDR CR8897
  1. ....I (($$RCID^ABMUTLP(ABMP("INS"))'["61044")&(ABMP("VTYP")'=142)&(ABMP("BTYP")'=731)) S $P(ABMRV(I,J,L),U,9)="OUTPATIENT CLINIC" ;abm*2.6*27 IHS/SD/SDR CR8897
  1. ....S:J'="ZZTOT" ABMRV("ZZTOT")=ABMRV("ZZTOT")+$P(ABMRV(I,J,L),U,6)
  1. ....;Grand tot noncov'd chgs
  1. ....S:J'="ZZTOT" ABMRV("NCTOT")=ABMRV("NCTOT")+$P(ABMRV(I,J,L),U,7)
  1. ....;if not itemized bill & not done, accumulate tots
  1. ....I 'ABMITMZ,J'="ZZTOT" D
  1. .....S $P(ABMRV(I,"ZZTOT",1),U)=I ;IEN to REV CODE
  1. .....S:$D(ABMP("CPT")) $P(ABMRV(I,"ZZTOT",1),"^",2)=ABMP("CPT") ;CPT code
  1. .....N K
  1. .....;Accumulate tots per rev code
  1. .....F K=5:1:7 S $P(ABMRV(I,"ZZTOT",1),U,K)=$P(ABMRV(I,"ZZTOT",1),U,K)+$P(ABMRV(I,J,L),U,K)
  1. .....S $P(ABMRV(I,"ZZTOT",1),U,8)=$P(ABMRV(I,J,L),U,8) ;unit chg
  1. .....S $P(ABMRV(I,"ZZTOT",1),U,3)=$P(ABMRV(I,J,L),U,3)
  1. ....I 'ABMITMZ,J'="ZZTOT" Q
  1. ....I ABMITMZ,J="ZZTOT" Q ;If itemized & done, Q
  1. ....W !
  1. ....S ABMCTR=ABMCTR+1 ;Cnt items
  1. ....;S ABMDE=$$GETREV^ABMDUTL(I)_"^^4R" ;Rev code ;abm*2.6*23 HEAT347035
  1. ....S ABMDE=$S(($P(ABMRV(I,J,L),U)'=0):$$GETREV^ABMDUTL($P(ABMRV(I,J,L),U)),1:"")_"^^4R" ;Rev code ;abm*2.6*23 HEAT347035
  1. ....I L["." S ABMDE=""
  1. ....;I $$RCID^ABMERUTL(ABMP("INS"))'=61004!((ABMP("VDT")>3100630)&($P($G(^AUTNINS(ABMP("INS"),0)),U)="EAPC")) D WRT^ABMDF28W ;#42 ;abm*2.6*4 HEAT12271 ;abm*2.6*21 HEAT268438
  1. ....;I $$RCID^ABMERUTL(ABMP("INS"))'["61044"!((ABMP("VDT")>3100630)&($P($G(^AUTNINS(ABMP("INS"),0)),U)="EAPC")) D WRT^ABMDF28W ;#42 ;abm*2.6*21 HEAT268438 ;abm*2.6*23 HEAT347035
  1. ....;I (+$P(ABMRV(I,J,L),U,6)'=0) D WRT^ABMDF28W ;abm*2.6*23 IHS/SD/SDR HEAT347035 ;abm*2.6*27 IHS/SD/SDR CR8897
  1. ....;start new abm*2.6*27 IHS/SD/SDR CR8897
  1. ....I (($$RCID^ABMUTLP(ABMP("INS")))["61044") D
  1. .....I $P(ABMRV(I,J,L),U)=0 Q ;don't do anything if there's no rev code
  1. .....I ((ABMPOS=1)&((ABMP("BTYP")=731)!(ABMP("VTYP")'=142))) S ABMDE=$$GETREV^ABMDUTL($P(ABMRV(I,J,L),U))_"^^4"
  1. .....I '($D(ABMP("FLAT"))&(+$P(ABMRV(I,J,L),U,6)'=0)) S ABMDE=$$GETREV^ABMDUTL($P(ABMRV(I,J,L),U))_"^^4"
  1. .....I (ABMPOS'=1)&(ABMP("BTYP")'=731)&(ABMP("VTYP")'=142) S ABMDE="^^4"
  1. .....I +$G(ABMDIAL)=1 S ABMDE="^^4"
  1. .....D WRT^ABMDF28W
  1. ....I ($$RCID^ABMERUTL(ABMP("INS"))'["61044") D WRT^ABMDF28W
  1. ....;end new abm*2.6*27 IHS/SD/SDR CR8897
  1. ....I ((ABMP("VDT")>3100630)&($P($G(^AUTNINS(ABMP("INS"),0)),U)="EAPC")) D WRT^ABMDF28W ;#42 ;abm*2.6*21 HEAT268438 ;abm*2.6*23 HEAT347035
  1. ....;If desc is blank, get it from vtyp in INS file
  1. ....I $P(ABMRV(I,J,L),U,9)="" D
  1. .....S ABMDE=$P($G(^ABMNINS(DUZ(2),ABMP("INS"),1,ABMP("VTYP"),0)),U,9)
  1. .....;S:ABMDE="" ABMDE=$P($G(^AUTTREVN(I,0)),U,2) ;std abbrev ;abm*2.6*23 HEAT347035
  1. .....S:ABMDE="" ABMDE=$P($G(^AUTTREVN($P(ABMRV(I,J,L),U),0)),U,2) ;std abbrev ;abm*2.6*23 HEAT347035
  1. .....S ABMDE=ABMDE_"^5^24" ;Desc
  1. .....I (($$RCID^ABMUTLP(ABMP("INS"))["61044")&(+$P(ABMRV(I,J,L),U,6)=0)) S ABMDE="^^5^24" ;don't print description for Medi-Cal when charge amt is 0 ;abm*2.6*23 HEAT347035
  1. .....D WRT^ABMDF28W ;#43
  1. ....I $P(ABMRV(I,J,L),U,9)'="" D ;if desc, use it
  1. .....S ABMDE=$P(ABMRV(I,J,L),U,9)_"^5^24" ;Desc
  1. .....I ((+$G(ABMDIAL)=1)&(($$RCID^ABMUTLP(ABMP("INS")))["61044")) S ABMDE="MAINTENANCE DIALYSIS WITH^5^25" ;abm*2.6*21 HEAT240744
  1. .....I (($$RCID^ABMUTLP(ABMP("INS"))["61044")&(+$P(ABMRV(I,J,L),U,6)=0)) S ABMDE="^^5^24" ;don't print description for Medi-Cal when charge amt is 0 ;abm*2.6*23 HEAT347035
  1. .....D WRT^ABMDF28W ;#43
  1. ....;
  1. ....; HCPCS/rates--#44
  1. ....S ABMMODL=$S($P(ABMRV(I,J,L),U,3)]"":$P(ABMRV(I,J,L),U,3),1:"")
  1. ....S ABMMODL=ABMMODL_$S($P(ABMRV(I,J,L),U,4)]"":$P(ABMRV(I,J,L),U,4),1:"")
  1. ....S ABMMODL=ABMMODL_$S($P(ABMRV(I,J,L),U,12)]"":$P(ABMRV(I,J,L),U,12),1:"")
  1. ....S ABMDE=$S($L($P(ABMRV(I,J,L),U,2))>3:$P(ABMRV(I,J,L),U,2)_ABMMODL_"^30^14",$P(ABMRV(I,J,L),U,8)&(+$P(ABMRV(I,J,L),U,2)'=0):$J($P(ABMRV(I,J,L),U,8),1,2)_"^30^14R",+ABMMODL:$J(ABMMODL,1,2)_"^30^14",1:"")
  1. ....;make 2-digit CPT print for Medi-Cal
  1. ....;I $$RCID^ABMUTLP(ABMP("INS"))["61044" D ;abm*2.6*23 HEAT347035 ;abm*2.6*27 IHS/SD/SDR CR8897
  1. ....S ABMCAFLG=0 ;abm*2.6*27 IHS/SD/SDR CR8897
  1. ....I $$RCID^ABMUTLP(ABMP("INS"))["61044" D I ABMCAFLG=1 Q ;abm*2.6*27 IHS/SD/SDR CR8897
  1. .....I (ABMP("BTYP")=731)&(ABMP("VTYP")=142) S ABMCAFLG=1 D 23PRT^ABMDF28S ;abm*2.6*27 IHS/SD/SDR CR8897
  1. .....S ABMDE=$S($P(ABMRV(I,J,L),U,2)'="":$P(ABMRV(I,J,L),U,2)_ABMMODL_"^30^14",$P(ABMRV(I,J,L),U,8)&(+$P(ABMRV(I,J,L),U,2)'=0):$J($P(ABMRV(I,J,L),U,8),1,2)_"^30^14R",+ABMMODL:$J(ABMMODL,1,2)_"^30^14",1:"") ;abm*2.6*23 HEAT347035
  1. .....;I (ABMP("BTYP")=731)&(ABMITMZ)&(+$G(ABMCPTM)=0) S ABMDE="^30^14" ;abm*2.6*27 IHS/SD/AML CR8897
  1. ....I $P($G(ABMRV(I,J,L)),U,14)'="",($P($G(^ABMNINS(DUZ(2),ABMP("INS"),1,ABMP("VTYP"),0)),U,24)="Y") S ABMDE="RX"_$P(ABMRV(I,J,L),U,14)_"^30^9"
  1. ....I ABMDE=""&($D(ABMP("FLAT"))!((I>99)&(I<250))) S ABMDE=$J($S($D(ABMP("FLAT")):$P(ABMP("FLAT"),U),1:$P(ABMRV(I,J,L),U,8)),1,2)_"^30^14" ;def flat rate
  1. ....I $$RCID^ABMERUTL(ABMP("INS"))=99999&(ABMP("VTYP")=997) S ABMDE=$S(ABMCTR=1:$J($P(ABMP("FLAT"),U),1,2),1:"")_"^30^14" ;abm*2.6*20 HEAT262141
  1. ....D WRT^ABMDF28W
  1. ....S ABMDE=$$MDY^ABMDUTL($P(ABMRV(I,J,L),U,10))_"^45^6" ;DOS
  1. ....D WRT^ABMDF28W ;#45
  1. ....S ABMDE=$P(ABMRV(I,J,L),U,5)_"^52^7R" ;Tot units/item
  1. ....D WRT^ABMDF28W ;#46
  1. ....S ABMDE=$FN($P(ABMRV(I,J,L),U,6),"T",2)
  1. ....S ABMDE=$TR(ABMDE,".")_"^61^9R" ;Tot chg per item
  1. ....I L["." S ABMDE=""
  1. ....D WRT^ABMDF28W ;#47
  1. ....S ABMDE=$FN($P(ABMRV(I,J,L),U,7),"T",2)
  1. ....I +ABMDE D
  1. .....S ABMDE=$TR(ABMDE,".")_"^71^9R" ;Tot noncover chgs/item
  1. .....D WRT^ABMDF28W ;#48
  1. ....;start old abm*2.6*27 IHS/SD/SDR CR8897
  1. ....;I $G(ABMRV(I,J,L,1))'="" D Z6004PRT^ABMDF28S ;abm*2.6*21 HEAT240744
  1. ....;I $G(ABMRV(I,J,L,1))'="" D 23PRT^ABMDF28S ;abm*2.6*27 IHS/SD/AML CR8897
  1. ....;end old start new abm*2.6*27 IHS/SD/SDR CR8897
  1. ....I ($$RCID^ABMUTLP(ABMP("INS"))["61044") D
  1. .....I (($P(ABMRV(I,J,L),U,2)="Z6004")&($G(ABMRV(I,J,L,1))'="")&(ABMP("VTYP")'=142)) D Z6004PRT^ABMDF28S
  1. .....;I (ABMP("BTYP")=731)&(ABMP("VTYP")=142) D 23PRT^ABMDF28S
  1. ....;
  1. ....I ($$RCID^ABMUTLP(ABMP("INS"))["61044")&(+$G(ABMITMZ)) D
  1. .....I ((ABMPOS=1)&(ABMP("BTYP")=731)&(ABMP("VTYP")'=142)) D CALYRTC^ABMDF28S
  1. ....;end new abm*2.6*27 IHS/SD/SDR CR8897
  1. ...S ABMFND=1
  1. ;end new HEAT117086