ABME3DA0 ; IHS/ASDST/DMJ - HCFA-1500 NSF 3.01 EMC RECORD DA0 (Third Party Payor) ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
; IHS/ASDS/DMJ - V2.4 P7 - 9/6/01 NOIS HQW-0701-100066
; This is a new routine related to Medicare Part B.
;
START ;START HERE
K ABMREC(30),ABMREC(31),ABMREC(32),ABME,ABM
K ABMP("SET")
D SET^ABMERUTL,LOOP ; get insurer data
K ABME,ABM
Q
;
LOOP ;FIRST LOOP
; Loop thru INS priorities
S ABME("S#")=0
F S ABME("S#")=$O(ABMP("INS",ABME("S#"))) Q:'ABME("S#") D
.S ABME("INS")=+ABMP("INS",ABME("S#")) ; Insurer IEN
.S ABME("INSIEN")=$P(ABMP("INS",ABME("S#")),"^",3) ; IEN to insurer multiple
.S ABME("RTYPE")=30 ; record type
.K ABMR(30),ABMR(31),ABMR(32)
.D ISET^ABMERINS ; set INS priority
.D LOOP2 ; Get data
.D S90^ABMERUTL ; Add 1 to record type counts (electronic)
.D ^ABME3DA1
Q
;
LOOP2 ;LOOP HERE
F I=10:10:320 D
.D @I
.I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),30,I)) D @(^(I))
.I '$G(ABMP("NOFMT")) S ABMREC(30,ABME("S#"))=$G(ABMREC(30,ABME("S#")))_ABMR(30,I)
Q
10 ;1-3 Record ID
S ABMR(30,10)="DA0"
Q
20 ;4-5 Sequence #
S ABMR(30,20)=ABME("S#")
S ABMR(30,20)=$$FMT^ABMERUTL(ABMR(30,20),"2NR")
Q
30 ;6-22 Patient Control Number
S ABMR(30,30)=ABMP("PCN")
S ABMR(30,30)=$$FMT^ABMERUTL(ABMR(30,30),17)
Q
40 ;23-23 Claim Filing Indicator
S ABMR(30,40)="I"
S:ABME("INS")=ABMP("INS") ABMR(30,40)="P"
Q
50 ;24-24 Source of Pay
S ABME("SOP")=$$SOP1^ABMERUTL(ABME("INS"))
S ABMR(30,50)=ABME("SOP")
Q
60 ;25-26 Insurance Type Code
I ABME("SOP")="C" D
.S ABMR(30,60)=" "
.I ABME("S#")=1 S ABMR(30,60)="MP"
I ABME("SOP")'="C" D
.S ABMR(30,60)="IP"
Q
70 ;27-31 Payor Organization ID
S ABMR(30,70)=$$RCID^ABMERUTL(ABME("INS"))
Q
80 ;32-35 Payor Claim Office #
S ABMR(30,80)=""
S ABMR(30,80)=$$FMT^ABMERUTL(ABMR(30,80),4)
Q
90 ;36-68 Payor Name
S ABMR(30,90)=$P(^AUTNINS(ABME("INS"),0),U)
S ABMR(30,90)=$$FMT^ABMERUTL(ABMR(30,90),33)
Q
100 ;69-88 Group #
S ABMR(30,100)=$P($G(^AUTNEGRP(+$G(ABME("GRP")),0)),"^",2)
S:ABMR(30,100)="" ABMR(30,100)="NONE"
S ABMR(30,100)=$$FMT^ABMERUTL(ABMR(30,100),20)
Q
110 ;89-121 Group Name
S ABMR(30,110)=$G(ABM(9000003.1,+$G(ABME("PH")),.06,"E"))
S ABMR(30,110)=$$FMT^ABMERUTL(ABMR(30,110),33)
Q
120 ;122-122 PPO/HMO Ind
S ABMR(30,120)=" "
Q
130 ;123-137 PPO ID
S ABMR(30,130)=""
S ABMR(30,130)=$$FMT^ABMERUTL(ABMR(30,130),15)
Q
140 ;138-152 Prior Authorization #
S ABME("FLD")=.58
D DIQ1
S ABMR(30,140)=$G(ABM(9002274.4,ABMP("BDFN"),.58,"E"))
S ABMR(30,140)=$$FMT^ABMERUTL(ABMR(30,140),15)
Q
150 ;153-153 Assign of Benefits
S ABME("FLD")=.75
D DIQ1
S ABMR(30,150)=ABM(9002274.4,ABMP("BDFN"),.75,"I")
S:ABMR(30,150)="" ABMR(30,150)="N"
S ABMR(30,150)=$$FMT^ABMERUTL(ABMR(30,150),1)
Q
160 ;154-154 Patient Signature Source
S ABME("FLD")=.74
D DIQ1
S ABMR(30,160)=$G(ABM(9002274.4,ABMP("BDFN"),.74,"I"))
S:ABMR(30,160)="" ABMR(30,160)="N"
I ABMR(30,160)="Y" S ABMR(30,160)="S"
I ABMR(30,160)="S",ABMR(30,150)="Y" S ABMR(30,160)="B"
I ABMR(30,150)="N",ABMR(30,160)="N" S ABMR(30,160)="P"
I ABMR(30,150)="Y",ABMR(30,160)="N" S ABMR(30,160)="M"
Q
170 ;155-156 Patient's Relationship to Insured
I '$G(ABME("PH")) S ABMR(30,170)="01"
I $G(ABME("PH")) S ABMR(30,170)=ABME("REL")
S ABMR(30,170)=$$FMT^ABMERUTL(ABMR(30,170),"2NR")
Q
180 ;157-181 Insured ID #
S ABMR(30,180)=$G(ABME("ID#"))
S ABMR(30,180)=$$FMT^ABMERUTL(ABMR(30,180),25)
Q
190 ;182-201 Insured Last Name
S ABMR(30,190)=$P(ABME("PHNM"),",",1)
S ABMR(30,190)=$$FMT^ABMERUTL(ABMR(30,190),20)
Q
200 ;202-213 Insured First Name
S ABMR(30,200)=$P(ABME("PHNM"),",",2)
S ABMR(30,200)=$P(ABMR(30,200)," ",1)
S ABMR(30,200)=$$FMT^ABMERUTL(ABMR(30,200),12)
Q
210 ;214-214 Insured MI
S ABMR(30,210)=$P(ABME("PHNM"),",",2)
S ABMR(30,210)=$P(ABMR(30,210)," ",2)
S ABMR(30,210)=$E(ABMR(30,210))
S ABMR(30,210)=$$FMT^ABMERUTL(ABMR(30,210),1)
Q
220 ;215-217 Insured Generation
S ABMR(30,220)=$P(ABME("PHNM"),",",2)
S ABMR(30,220)=$P(ABMR(30,220)," ",3)
S ABMR(30,220)=$$FMT^ABMERUTL(ABMR(30,220),3)
Q
230 ;218-218 Insured Sex
S ABMR(30,230)=$G(ABME("PHSEX"))
S ABMR(30,230)=$$FMT^ABMERUTL(ABMR(30,230),1)
Q
240 ;219-226 Insured DOB
S ABMR(30,240)=$G(ABME("DOB"))
S ABMR(30,240)=$$Y2KD2^ABMDUTL(ABMR(30,240))
S ABMR(30,240)=$$FMT^ABMERUTL(ABMR(30,240),8)
Q
250 ;227-227 Insured Employment Status Code
S ABMR(30,250)=""
I $G(ABME("PPP")) D ; of patient
.S ABME("FLD")=.21
.D DIQ3
.S ABMR(30,250)=$G(ABM(9000001,ABME("PPP"),.21,"I"))
.Q
I ABMR(30,250)="",$G(ABME("PH")) D ; of policy holder
.S ABME("FLD")=.15
.D DIQ2
.S ABMR(30,250)=$G(ABM(9000003.1,+ABME("PH"),.15,"I"))
.Q
S ABMR(30,250)=$$FMT^ABMERUTL(ABMR(30,250),1)
Q
260 ;228-228 Supplemental Ins Ind
S ABMR(30,260)=""
S ABMR(30,260)=$$FMT^ABMERUTL(ABMR(30,260),1)
Q
270 ;229-235 Insurance Location ID
S ABMR(30,270)=""
S ABMR(30,270)=$$FMT^ABMERUTL(ABMR(30,270),7)
Q
280 ;236-260 Medicaid ID #
S ABMR(30,280)=$G(ABME("MCD#"))
S ABMR(30,280)=$$FMT^ABMERUTL(ABMR(30,280),25)
Q
290 ;261-285 Supplemental Patient ID Number
S ABMR(30,290)=""
S ABMR(30,290)=$$FMT^ABMERUTL(ABMR(30,290),25)
Q
300 ;286-286 Assignment for 4081 Claim Indicator
S ABMR(30,300)=""
S ABMR(30,300)=$$FMT^ABMERUTL(ABMR(30,300),1)
Q
310 ;287-287 Coordination of Benefits Routing Indicator
S ABMR(30,310)=""
S ABMR(30,310)=$$FMT^ABMERUTL(ABMR(30,310),1)
Q
320 ;288-320 Filler
S ABMR(30,320)=""
S ABMR(30,320)=$$FMT^ABMERUTL(ABMR(30,320),33)
Q
DIQ1 ;PULL BILL DATA VIA DIQ1
Q:$D(ABM(9002274.4,ABMP("BDFN"),ABME("FLD")))
N I
S DIQ="ABM("
S DIQ(0)="EI"
S DIC="^ABMDBILL(DUZ(2),"
S DA=ABMP("BDFN")
S DR=".58;.66;.67;.68;.73;.74;.75;.99"
D EN^DIQ1
K DIQ
Q
;
DIQ2 ;POLICY HOLDER INFORMATION
Q:'$G(ABME("PH"))
Q:$D(ABM(9000003.1,ABME("PH"),ABME("FLD")))
N I
S DIQ="ABM("
S DIQ(0)="EI"
S DIC="^AUPN3PPH("
S DA=ABME("PH")
S DR=".02;.15"
D EN^DIQ1
K DIQ
Q
;
DIQ3 ;PATIENT IS INSURED
Q:$D(ABM(9000001,ABMP("PDFN"),ABME("FLD")))
N I
S DIQ="ABM("
S DIQ(0)="EI"
S DIC="^AUPNPAT("
S DA=ABMP("PDFN")
S DR=".21"
D EN^DIQ1
K DIQ
Q
;
EX(ABMX,ABMY,ABMZ) ;EXTRINSIC FUNCTION HERE
;
; INPUT: ABMX = data element
; Y = bill internal entry number
; ABMZ = insurer
;
; OUTPUT: Y = bill internal entry number
;
S ABMP("BDFN")=ABMY
D SET^ABMERUTL
S ABME("INS")=ABMZ
I '$D(^ABMDBILL(DUZ(2),ABMP("BDFN"),13,"B",ABME("INS"))) S Y="" Q Y
S ABME("S#")=0
D ISET^ABMERINS
I '$G(ABMP("NOFMT")) S ABMP("FMT")=0
D @ABMX
S Y=ABMR(30,ABMX)
I $D(ABMP("FMT")) S ABMP("FMT")=1
K ABMR(30,ABMX),ABMX,ABMY,ABMZ,ABME,ABM
Q Y
ABME3DA0 ; IHS/ASDST/DMJ - HCFA-1500 NSF 3.01 EMC RECORD DA0 (Third Party Payor) ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ; IHS/ASDS/DMJ - V2.4 P7 - 9/6/01 NOIS HQW-0701-100066
+4 ; This is a new routine related to Medicare Part B.
+5 ;
START ;START HERE
+1 KILL ABMREC(30),ABMREC(31),ABMREC(32),ABME,ABM
+2 KILL ABMP("SET")
+3 ; get insurer data
DO SET^ABMERUTL
DO LOOP
+4 KILL ABME,ABM
+5 QUIT
+6 ;
LOOP ;FIRST LOOP
+1 ; Loop thru INS priorities
+2 SET ABME("S#")=0
+3 FOR
SET ABME("S#")=$ORDER(ABMP("INS",ABME("S#")))
IF 'ABME("S#")
QUIT
Begin DoDot:1
+4 ; Insurer IEN
SET ABME("INS")=+ABMP("INS",ABME("S#"))
+5 ; IEN to insurer multiple
SET ABME("INSIEN")=$PIECE(ABMP("INS",ABME("S#")),"^",3)
+6 ; record type
SET ABME("RTYPE")=30
+7 KILL ABMR(30),ABMR(31),ABMR(32)
+8 ; set INS priority
DO ISET^ABMERINS
+9 ; Get data
DO LOOP2
+10 ; Add 1 to record type counts (electronic)
DO S90^ABMERUTL
+11 DO ^ABME3DA1
End DoDot:1
+12 QUIT
+13 ;
LOOP2 ;LOOP HERE
+1 FOR I=10:10:320
Begin DoDot:1
+2 DO @I
+3 IF $DATA(^ABMEXLM("AA",+$GET(ABMP("INS")),+$GET(ABMP("EXP")),30,I))
DO @(^(I))
+4 IF '$GET(ABMP("NOFMT"))
SET ABMREC(30,ABME("S#"))=$GET(ABMREC(30,ABME("S#")))_ABMR(30,I)
End DoDot:1
+5 QUIT
10 ;1-3 Record ID
+1 SET ABMR(30,10)="DA0"
+2 QUIT
20 ;4-5 Sequence #
+1 SET ABMR(30,20)=ABME("S#")
+2 SET ABMR(30,20)=$$FMT^ABMERUTL(ABMR(30,20),"2NR")
+3 QUIT
30 ;6-22 Patient Control Number
+1 SET ABMR(30,30)=ABMP("PCN")
+2 SET ABMR(30,30)=$$FMT^ABMERUTL(ABMR(30,30),17)
+3 QUIT
40 ;23-23 Claim Filing Indicator
+1 SET ABMR(30,40)="I"
+2 IF ABME("INS")=ABMP("INS")
SET ABMR(30,40)="P"
+3 QUIT
50 ;24-24 Source of Pay
+1 SET ABME("SOP")=$$SOP1^ABMERUTL(ABME("INS"))
+2 SET ABMR(30,50)=ABME("SOP")
+3 QUIT
60 ;25-26 Insurance Type Code
+1 IF ABME("SOP")="C"
Begin DoDot:1
+2 SET ABMR(30,60)=" "
+3 IF ABME("S#")=1
SET ABMR(30,60)="MP"
End DoDot:1
+4 IF ABME("SOP")'="C"
Begin DoDot:1
+5 SET ABMR(30,60)="IP"
End DoDot:1
+6 QUIT
70 ;27-31 Payor Organization ID
+1 SET ABMR(30,70)=$$RCID^ABMERUTL(ABME("INS"))
+2 QUIT
80 ;32-35 Payor Claim Office #
+1 SET ABMR(30,80)=""
+2 SET ABMR(30,80)=$$FMT^ABMERUTL(ABMR(30,80),4)
+3 QUIT
90 ;36-68 Payor Name
+1 SET ABMR(30,90)=$PIECE(^AUTNINS(ABME("INS"),0),U)
+2 SET ABMR(30,90)=$$FMT^ABMERUTL(ABMR(30,90),33)
+3 QUIT
100 ;69-88 Group #
+1 SET ABMR(30,100)=$PIECE($GET(^AUTNEGRP(+$GET(ABME("GRP")),0)),"^",2)
+2 IF ABMR(30,100)=""
SET ABMR(30,100)="NONE"
+3 SET ABMR(30,100)=$$FMT^ABMERUTL(ABMR(30,100),20)
+4 QUIT
110 ;89-121 Group Name
+1 SET ABMR(30,110)=$GET(ABM(9000003.1,+$GET(ABME("PH")),.06,"E"))
+2 SET ABMR(30,110)=$$FMT^ABMERUTL(ABMR(30,110),33)
+3 QUIT
120 ;122-122 PPO/HMO Ind
+1 SET ABMR(30,120)=" "
+2 QUIT
130 ;123-137 PPO ID
+1 SET ABMR(30,130)=""
+2 SET ABMR(30,130)=$$FMT^ABMERUTL(ABMR(30,130),15)
+3 QUIT
140 ;138-152 Prior Authorization #
+1 SET ABME("FLD")=.58
+2 DO DIQ1
+3 SET ABMR(30,140)=$GET(ABM(9002274.4,ABMP("BDFN"),.58,"E"))
+4 SET ABMR(30,140)=$$FMT^ABMERUTL(ABMR(30,140),15)
+5 QUIT
150 ;153-153 Assign of Benefits
+1 SET ABME("FLD")=.75
+2 DO DIQ1
+3 SET ABMR(30,150)=ABM(9002274.4,ABMP("BDFN"),.75,"I")
+4 IF ABMR(30,150)=""
SET ABMR(30,150)="N"
+5 SET ABMR(30,150)=$$FMT^ABMERUTL(ABMR(30,150),1)
+6 QUIT
160 ;154-154 Patient Signature Source
+1 SET ABME("FLD")=.74
+2 DO DIQ1
+3 SET ABMR(30,160)=$GET(ABM(9002274.4,ABMP("BDFN"),.74,"I"))
+4 IF ABMR(30,160)=""
SET ABMR(30,160)="N"
+5 IF ABMR(30,160)="Y"
SET ABMR(30,160)="S"
+6 IF ABMR(30,160)="S"
IF ABMR(30,150)="Y"
SET ABMR(30,160)="B"
+7 IF ABMR(30,150)="N"
IF ABMR(30,160)="N"
SET ABMR(30,160)="P"
+8 IF ABMR(30,150)="Y"
IF ABMR(30,160)="N"
SET ABMR(30,160)="M"
+9 QUIT
170 ;155-156 Patient's Relationship to Insured
+1 IF '$GET(ABME("PH"))
SET ABMR(30,170)="01"
+2 IF $GET(ABME("PH"))
SET ABMR(30,170)=ABME("REL")
+3 SET ABMR(30,170)=$$FMT^ABMERUTL(ABMR(30,170),"2NR")
+4 QUIT
180 ;157-181 Insured ID #
+1 SET ABMR(30,180)=$GET(ABME("ID#"))
+2 SET ABMR(30,180)=$$FMT^ABMERUTL(ABMR(30,180),25)
+3 QUIT
190 ;182-201 Insured Last Name
+1 SET ABMR(30,190)=$PIECE(ABME("PHNM"),",",1)
+2 SET ABMR(30,190)=$$FMT^ABMERUTL(ABMR(30,190),20)
+3 QUIT
200 ;202-213 Insured First Name
+1 SET ABMR(30,200)=$PIECE(ABME("PHNM"),",",2)
+2 SET ABMR(30,200)=$PIECE(ABMR(30,200)," ",1)
+3 SET ABMR(30,200)=$$FMT^ABMERUTL(ABMR(30,200),12)
+4 QUIT
210 ;214-214 Insured MI
+1 SET ABMR(30,210)=$PIECE(ABME("PHNM"),",",2)
+2 SET ABMR(30,210)=$PIECE(ABMR(30,210)," ",2)
+3 SET ABMR(30,210)=$EXTRACT(ABMR(30,210))
+4 SET ABMR(30,210)=$$FMT^ABMERUTL(ABMR(30,210),1)
+5 QUIT
220 ;215-217 Insured Generation
+1 SET ABMR(30,220)=$PIECE(ABME("PHNM"),",",2)
+2 SET ABMR(30,220)=$PIECE(ABMR(30,220)," ",3)
+3 SET ABMR(30,220)=$$FMT^ABMERUTL(ABMR(30,220),3)
+4 QUIT
230 ;218-218 Insured Sex
+1 SET ABMR(30,230)=$GET(ABME("PHSEX"))
+2 SET ABMR(30,230)=$$FMT^ABMERUTL(ABMR(30,230),1)
+3 QUIT
240 ;219-226 Insured DOB
+1 SET ABMR(30,240)=$GET(ABME("DOB"))
+2 SET ABMR(30,240)=$$Y2KD2^ABMDUTL(ABMR(30,240))
+3 SET ABMR(30,240)=$$FMT^ABMERUTL(ABMR(30,240),8)
+4 QUIT
250 ;227-227 Insured Employment Status Code
+1 SET ABMR(30,250)=""
+2 ; of patient
IF $GET(ABME("PPP"))
Begin DoDot:1
+3 SET ABME("FLD")=.21
+4 DO DIQ3
+5 SET ABMR(30,250)=$GET(ABM(9000001,ABME("PPP"),.21,"I"))
+6 QUIT
End DoDot:1
+7 ; of policy holder
IF ABMR(30,250)=""
IF $GET(ABME("PH"))
Begin DoDot:1
+8 SET ABME("FLD")=.15
+9 DO DIQ2
+10 SET ABMR(30,250)=$GET(ABM(9000003.1,+ABME("PH"),.15,"I"))
+11 QUIT
End DoDot:1
+12 SET ABMR(30,250)=$$FMT^ABMERUTL(ABMR(30,250),1)
+13 QUIT
260 ;228-228 Supplemental Ins Ind
+1 SET ABMR(30,260)=""
+2 SET ABMR(30,260)=$$FMT^ABMERUTL(ABMR(30,260),1)
+3 QUIT
270 ;229-235 Insurance Location ID
+1 SET ABMR(30,270)=""
+2 SET ABMR(30,270)=$$FMT^ABMERUTL(ABMR(30,270),7)
+3 QUIT
280 ;236-260 Medicaid ID #
+1 SET ABMR(30,280)=$GET(ABME("MCD#"))
+2 SET ABMR(30,280)=$$FMT^ABMERUTL(ABMR(30,280),25)
+3 QUIT
290 ;261-285 Supplemental Patient ID Number
+1 SET ABMR(30,290)=""
+2 SET ABMR(30,290)=$$FMT^ABMERUTL(ABMR(30,290),25)
+3 QUIT
300 ;286-286 Assignment for 4081 Claim Indicator
+1 SET ABMR(30,300)=""
+2 SET ABMR(30,300)=$$FMT^ABMERUTL(ABMR(30,300),1)
+3 QUIT
310 ;287-287 Coordination of Benefits Routing Indicator
+1 SET ABMR(30,310)=""
+2 SET ABMR(30,310)=$$FMT^ABMERUTL(ABMR(30,310),1)
+3 QUIT
320 ;288-320 Filler
+1 SET ABMR(30,320)=""
+2 SET ABMR(30,320)=$$FMT^ABMERUTL(ABMR(30,320),33)
+3 QUIT
DIQ1 ;PULL BILL DATA VIA DIQ1
+1 IF $DATA(ABM(9002274.4,ABMP("BDFN"),ABME("FLD")))
QUIT
+2 NEW I
+3 SET DIQ="ABM("
+4 SET DIQ(0)="EI"
+5 SET DIC="^ABMDBILL(DUZ(2),"
+6 SET DA=ABMP("BDFN")
+7 SET DR=".58;.66;.67;.68;.73;.74;.75;.99"
+8 DO EN^DIQ1
+9 KILL DIQ
+10 QUIT
+11 ;
DIQ2 ;POLICY HOLDER INFORMATION
+1 IF '$GET(ABME("PH"))
QUIT
+2 IF $DATA(ABM(9000003.1,ABME("PH"),ABME("FLD")))
QUIT
+3 NEW I
+4 SET DIQ="ABM("
+5 SET DIQ(0)="EI"
+6 SET DIC="^AUPN3PPH("
+7 SET DA=ABME("PH")
+8 SET DR=".02;.15"
+9 DO EN^DIQ1
+10 KILL DIQ
+11 QUIT
+12 ;
DIQ3 ;PATIENT IS INSURED
+1 IF $DATA(ABM(9000001,ABMP("PDFN"),ABME("FLD")))
QUIT
+2 NEW I
+3 SET DIQ="ABM("
+4 SET DIQ(0)="EI"
+5 SET DIC="^AUPNPAT("
+6 SET DA=ABMP("PDFN")
+7 SET DR=".21"
+8 DO EN^DIQ1
+9 KILL DIQ
+10 QUIT
+11 ;
EX(ABMX,ABMY,ABMZ) ;EXTRINSIC FUNCTION HERE
+1 ;
+2 ; INPUT: ABMX = data element
+3 ; Y = bill internal entry number
+4 ; ABMZ = insurer
+5 ;
+6 ; OUTPUT: Y = bill internal entry number
+7 ;
+8 SET ABMP("BDFN")=ABMY
+9 DO SET^ABMERUTL
+10 SET ABME("INS")=ABMZ
+11 IF '$DATA(^ABMDBILL(DUZ(2),ABMP("BDFN"),13,"B",ABME("INS")))
SET Y=""
QUIT Y
+12 SET ABME("S#")=0
+13 DO ISET^ABMERINS
+14 IF '$GET(ABMP("NOFMT"))
SET ABMP("FMT")=0
+15 DO @ABMX
+16 SET Y=ABMR(30,ABMX)
+17 IF $DATA(ABMP("FMT"))
SET ABMP("FMT")=1
+18 KILL ABMR(30,ABMX),ABMX,ABMY,ABMZ,ABME,ABM
+19 QUIT Y