ABMER40 ; IHS/ASDST/DMJ - UB92 EMC RECORD 40 (Claim Data) ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;Original;DMJ;08/18/95 10:39 AM
;
; IHS/SD/SDR - v2.5 p11 - NPI
;
START ;START HERE
K ABMR(40),ABMREC(40)
S ABME("RTYPE")=40
D SET^ABMERUTL
S ABME("S#")=1
D LOOP
D S90^ABMERUTL
K ABM
Q
;
LOOP ;LOOP HERE
D ^ABMER40A
F I=180:10:340 D
.D @I
.I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),40,I)) D @(^(I))
.I '$G(ABMP("NOFMT")) S ABMREC(40,ABME("S#"))=$G(ABMREC(40,ABME("S#")))_ABMR(40,I)
Q
;
180 ;Occurrence Code 6 (SOURCE: FILE=9002274.4051, FIELD=.01)
; form locator #33b
D GET51
S ABMR(40,180)=$P($G(ABM(51,6)),U)
S ABMR(40,180)=$$FMT^ABMERUTL(ABMR(40,180),"2")
Q
;
190 ;Occurrence Date 6 (SOURCE: FILE=9002274.4051, FIELD=.02)
; form locator #33b
D GET51
S Y=$P($G(ABM(51,6)),"^",2)
D DFMT^ABMERUTL
S ABMR(40,190)=Y
S ABMR(40,190)=$$FMT^ABMERUTL(ABMR(40,190),"6")
Q
;
200 ;Occurrence Code 7 (SOURCE: FILE=9002274.4051, FIELD=.01)
; form locator #34b
D GET51
S ABMR(40,200)=$P($G(ABM(51,7)),U)
S ABMR(40,200)=$$FMT^ABMERUTL(ABMR(40,200),"2")
Q
;
210 ;Occurrence Date 7 (SOURCE: FILE=9002274.4051, FIELD=.02)
; form locator #34b
D GET51
S Y=$P($G(ABM(51,7)),"^",2)
D DFMT^ABMERUTL
S ABMR(40,210)=Y
S ABMR(40,210)=$$FMT^ABMERUTL(ABMR(40,210),"6")
Q
;
220 ;Occurrence Code 8 (SOURCE: FILE=9002274.4051, FIELD=.01)
; form locator #35b
D GET51
S ABMR(40,220)=$P($G(ABM(51,8)),U)
S ABMR(40,220)=$$FMT^ABMERUTL(ABMR(40,220),"2")
Q
;
230 ;Occurrence Date 8 (SOURCE: FILE=9002274.4051, FIELD=.01)
; form locator #35b
D GET51
S Y=$P($G(ABM(51,8)),"^",2)
D DFMT^ABMERUTL
S ABMR(40,230)=Y
S ABMR(40,230)=$$FMT^ABMERUTL(ABMR(40,230),"6")
Q
;
240 ;Occurrence Code 9 (SOURCE: FILE=9002274.4051, FIELD=.01)
D GET51
S ABMR(40,240)=$P($G(ABM(51,9)),U)
S ABMR(40,240)=$$FMT^ABMERUTL(ABMR(40,240),"2")
Q
;
250 ;Occurrence Date 9 (SOURCE: FILE=9002274.4051, FIELD=.02)
D GET51
S Y=$P($G(ABM(51,9)),"^",2)
D DFMT^ABMERUTL
S ABMR(40,250)=Y
S ABMR(40,250)=$$FMT^ABMERUTL(ABMR(40,250),"6")
Q
;
260 ;Occurrence Code 10 (SOURCE: FILE=9002274.4051, FIELD=.01)
D GET51
S ABMR(40,260)=$P($G(ABM(51,10)),U)
S ABMR(40,260)=$$FMT^ABMERUTL(ABMR(40,260),"2")
Q
;
270 ;Occurrence Date 10 (SOURCE FILE=9002274.4051, FIELD=.02)
D GET51
S Y=$P($G(ABM(51,10)),"^",2)
D DFMT^ABMERUTL
S ABMR(40,270)=Y
S ABMR(40,270)=$$FMT^ABMERUTL(ABMR(40,270),"6")
Q
;
280 ;Occurrence Span Code 1 (SOURCE: FILE=9002274.4057, FIELD=.01)
; form locator #35a
D GET57
S ABMR(40,280)=$P(ABM(57,1),U)
S ABMR(40,280)=$$FMT^ABMERUTL(ABMR(40,280),2)
Q
;
290 ;Occurrence Span From Date 1 (SOURCE: FILE=9002274.4057, FIELD=.02)
; form locator #35a
D GET57
S Y=$P(ABM(57,1),"^",2)
D DFMT^ABMERUTL
S ABMR(40,290)=Y
S ABMR(40,290)=$$FMT^ABMERUTL(ABMR(40,290),"6")
Q
;
300 ;Occurrence Span Through Date 1 (SOURCE: FILE=9002274.4057, FIELD=.03)
; form locator #35a
D GET57
S Y=$P(ABM(57,1),"^",3)
D DFMT^ABMERUTL
S ABMR(40,300)=Y
S ABMR(40,300)=$$FMT^ABMERUTL(ABMR(40,300),"6")
Q
;
310 ;Occurrence Span Code 2 (SOURCE: FILE=9002274.4057, FIELD=.01)
; form locator #36a
D GET57
S ABMR(40,310)=$P(ABM(57,2),U)
S ABMR(40,310)=$$FMT^ABMERUTL(ABMR(40,310),2)
Q
;
320 ;Occurrence Span From Date 2 (SOURCE: FILE=9002274.4057, FIELD=.02)
; form locator #36a
D GET57
S Y=$P(ABM(57,2),"^",2)
D DFMT^ABMERUTL
S ABMR(40,320)=Y
S ABMR(40,320)=$$FMT^ABMERUTL(ABMR(40,320),"6")
Q
;
330 ;Occurrence Span Through Date 2 (SOURCE: FILE=9002274.4057, FIELD=.03)
; form locator #36a
D GET57
S Y=$P(ABM(57,2),"^",3)
D DFMT^ABMERUTL
S ABMR(40,330)=Y
S ABMR(40,330)=$$FMT^ABMERUTL(ABMR(40,330),"6")
Q
;
340 ;Filler (National Use)
S ABMR(40,340)=""
S ABMR(40,340)=$$FMT^ABMERUTL(ABMR(40,340),3)
Q
;
350 ;Occurrence Span Code 3 (SOURCE: FILE=9002274.4057, FIELD=.01)
; form locator #35b
D GET57
S ABMR(40,350)=$P($G(ABM(57,3)),U)
S ABMR(40,350)=$$FMT^ABMERUTL(ABMR(40,350),2)
Q
;
360 ;Occurrence Span From Date 2 (SOURCE: FILE=9002274.4057, FIELD=.02)
; form locator #35b
D GET57
S Y=$P($G(ABM(57,3)),U,2)
D DFMT^ABMERUTL
S ABMR(40,360)=Y
S ABMR(40,360)=$$FMT^ABMERUTL(ABMR(40,360),"6")
Q
;
370 ;Occurrence Span Through Date 2 (SOURCE: FILE=9002274.4057, FIELD=.03)
; form locator #35b
D GET57
S Y=$P($G(ABM(57,3)),U,3)
D DFMT^ABMERUTL
S ABMR(40,370)=Y
S ABMR(40,370)=$$FMT^ABMERUTL(ABMR(40,370),"6")
Q
;
380 ;Occurrence Span Code 2 (SOURCE: FILE=9002274.4057, FIELD=.01)
; form locator #36b
D GET57
S ABMR(40,380)=$P($G(ABM(57,4)),U)
S ABMR(40,380)=$$FMT^ABMERUTL(ABMR(40,380),2)
Q
;
390 ;Occurrence Span From Date 2 (SOURCE: FILE=9002274.4057, FIELD=.02)
; form locator #36b
D GET57
S Y=$P($G(ABM(57,4)),U,2)
D DFMT^ABMERUTL
S ABMR(40,390)=Y
S ABMR(40,390)=$$FMT^ABMERUTL(ABMR(40,390),"6")
Q
;
400 ;Occurrence Span Through Date 2 (SOURCE: FILE=9002274.4057, FIELD=.03)
; form locator #36b
D GET57
S Y=$P($G(ABM(57,4)),U,3)
D DFMT^ABMERUTL
S ABMR(40,400)=Y
S ABMR(40,400)=$$FMT^ABMERUTL(ABMR(40,400),"6")
Q
;
DIQ1 ;PULL POLICY HOLDER 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=".02;.54;.55;.56;.58;.76;.77;.78;.79"
D EN^DIQ1
K DIQ
Q
;
EX(ABMX,ABMY) ;EXTRINSIC FUNCTION HERE
;
; INPUT: ABMX = data element
; Y = bill internal entry number
;
; OUTPUT: Y = bill internal entry number
;
S ABMP("BDFN")=ABMY
D SET^ABMERUTL
I '$G(ABMP("NOFMT")) S ABMP("FMT")=0
D @ABMX
S Y=ABMR(40,ABMX)
I $D(ABMP("FMT")) S ABMP("FMT")=1
K ABMR(40,ABMX),ABME,ABMX,ABMY,ABMZ,ABM
Q Y
;
GET51 ;GET OCCURANCE CODES
Q:$D(ABM(51))
N I
S I=0,CNT=0
F S I=$O(^ABMDBILL(DUZ(2),ABMP("BDFN"),51,I)) Q:'I D
.S CNT=CNT+1
.S ABM(51,CNT)=^ABMDBILL(DUZ(2),ABMP("BDFN"),51,I,0)
.S $P(ABM(51,CNT),U)=$P($G(^ABMDCODE(+ABM(51,CNT),0)),U)
.S:$L(ABM(51,CNT))=1 ABM(51,CNT)="0"_ABM(51,CNT)
F I=1:1:10 I '$D(ABM(51,I)) S ABM(51,I)=""
Q
;
GET57 ;GET OCCURRENCE SPAN CODES
Q:$D(ABM(57))
N I
S I=0,CNT=0
F S I=$O(^ABMDBILL(DUZ(2),ABMP("BDFN"),57,I)) Q:'I D
.S CNT=CNT+1
.S ABM(57,CNT)=^ABMDBILL(DUZ(2),ABMP("BDFN"),57,I,0)
.S $P(ABM(57,CNT),U)=$P($G(^ABMDCODE(+ABM(57,CNT),0)),U)
F I=1,2 I '$D(ABM(57,I)) S ABM(57,I)=""
Q
ABMER40 ; IHS/ASDST/DMJ - UB92 EMC RECORD 40 (Claim Data) ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;Original;DMJ;08/18/95 10:39 AM
+3 ;
+4 ; IHS/SD/SDR - v2.5 p11 - NPI
+5 ;
START ;START HERE
+1 KILL ABMR(40),ABMREC(40)
+2 SET ABME("RTYPE")=40
+3 DO SET^ABMERUTL
+4 SET ABME("S#")=1
+5 DO LOOP
+6 DO S90^ABMERUTL
+7 KILL ABM
+8 QUIT
+9 ;
LOOP ;LOOP HERE
+1 DO ^ABMER40A
+2 FOR I=180:10:340
Begin DoDot:1
+3 DO @I
+4 IF $DATA(^ABMEXLM("AA",+$GET(ABMP("INS")),+$GET(ABMP("EXP")),40,I))
DO @(^(I))
+5 IF '$GET(ABMP("NOFMT"))
SET ABMREC(40,ABME("S#"))=$GET(ABMREC(40,ABME("S#")))_ABMR(40,I)
End DoDot:1
+6 QUIT
+7 ;
180 ;Occurrence Code 6 (SOURCE: FILE=9002274.4051, FIELD=.01)
+1 ; form locator #33b
+2 DO GET51
+3 SET ABMR(40,180)=$PIECE($GET(ABM(51,6)),U)
+4 SET ABMR(40,180)=$$FMT^ABMERUTL(ABMR(40,180),"2")
+5 QUIT
+6 ;
190 ;Occurrence Date 6 (SOURCE: FILE=9002274.4051, FIELD=.02)
+1 ; form locator #33b
+2 DO GET51
+3 SET Y=$PIECE($GET(ABM(51,6)),"^",2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,190)=Y
+6 SET ABMR(40,190)=$$FMT^ABMERUTL(ABMR(40,190),"6")
+7 QUIT
+8 ;
200 ;Occurrence Code 7 (SOURCE: FILE=9002274.4051, FIELD=.01)
+1 ; form locator #34b
+2 DO GET51
+3 SET ABMR(40,200)=$PIECE($GET(ABM(51,7)),U)
+4 SET ABMR(40,200)=$$FMT^ABMERUTL(ABMR(40,200),"2")
+5 QUIT
+6 ;
210 ;Occurrence Date 7 (SOURCE: FILE=9002274.4051, FIELD=.02)
+1 ; form locator #34b
+2 DO GET51
+3 SET Y=$PIECE($GET(ABM(51,7)),"^",2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,210)=Y
+6 SET ABMR(40,210)=$$FMT^ABMERUTL(ABMR(40,210),"6")
+7 QUIT
+8 ;
220 ;Occurrence Code 8 (SOURCE: FILE=9002274.4051, FIELD=.01)
+1 ; form locator #35b
+2 DO GET51
+3 SET ABMR(40,220)=$PIECE($GET(ABM(51,8)),U)
+4 SET ABMR(40,220)=$$FMT^ABMERUTL(ABMR(40,220),"2")
+5 QUIT
+6 ;
230 ;Occurrence Date 8 (SOURCE: FILE=9002274.4051, FIELD=.01)
+1 ; form locator #35b
+2 DO GET51
+3 SET Y=$PIECE($GET(ABM(51,8)),"^",2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,230)=Y
+6 SET ABMR(40,230)=$$FMT^ABMERUTL(ABMR(40,230),"6")
+7 QUIT
+8 ;
240 ;Occurrence Code 9 (SOURCE: FILE=9002274.4051, FIELD=.01)
+1 DO GET51
+2 SET ABMR(40,240)=$PIECE($GET(ABM(51,9)),U)
+3 SET ABMR(40,240)=$$FMT^ABMERUTL(ABMR(40,240),"2")
+4 QUIT
+5 ;
250 ;Occurrence Date 9 (SOURCE: FILE=9002274.4051, FIELD=.02)
+1 DO GET51
+2 SET Y=$PIECE($GET(ABM(51,9)),"^",2)
+3 DO DFMT^ABMERUTL
+4 SET ABMR(40,250)=Y
+5 SET ABMR(40,250)=$$FMT^ABMERUTL(ABMR(40,250),"6")
+6 QUIT
+7 ;
260 ;Occurrence Code 10 (SOURCE: FILE=9002274.4051, FIELD=.01)
+1 DO GET51
+2 SET ABMR(40,260)=$PIECE($GET(ABM(51,10)),U)
+3 SET ABMR(40,260)=$$FMT^ABMERUTL(ABMR(40,260),"2")
+4 QUIT
+5 ;
270 ;Occurrence Date 10 (SOURCE FILE=9002274.4051, FIELD=.02)
+1 DO GET51
+2 SET Y=$PIECE($GET(ABM(51,10)),"^",2)
+3 DO DFMT^ABMERUTL
+4 SET ABMR(40,270)=Y
+5 SET ABMR(40,270)=$$FMT^ABMERUTL(ABMR(40,270),"6")
+6 QUIT
+7 ;
280 ;Occurrence Span Code 1 (SOURCE: FILE=9002274.4057, FIELD=.01)
+1 ; form locator #35a
+2 DO GET57
+3 SET ABMR(40,280)=$PIECE(ABM(57,1),U)
+4 SET ABMR(40,280)=$$FMT^ABMERUTL(ABMR(40,280),2)
+5 QUIT
+6 ;
290 ;Occurrence Span From Date 1 (SOURCE: FILE=9002274.4057, FIELD=.02)
+1 ; form locator #35a
+2 DO GET57
+3 SET Y=$PIECE(ABM(57,1),"^",2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,290)=Y
+6 SET ABMR(40,290)=$$FMT^ABMERUTL(ABMR(40,290),"6")
+7 QUIT
+8 ;
300 ;Occurrence Span Through Date 1 (SOURCE: FILE=9002274.4057, FIELD=.03)
+1 ; form locator #35a
+2 DO GET57
+3 SET Y=$PIECE(ABM(57,1),"^",3)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,300)=Y
+6 SET ABMR(40,300)=$$FMT^ABMERUTL(ABMR(40,300),"6")
+7 QUIT
+8 ;
310 ;Occurrence Span Code 2 (SOURCE: FILE=9002274.4057, FIELD=.01)
+1 ; form locator #36a
+2 DO GET57
+3 SET ABMR(40,310)=$PIECE(ABM(57,2),U)
+4 SET ABMR(40,310)=$$FMT^ABMERUTL(ABMR(40,310),2)
+5 QUIT
+6 ;
320 ;Occurrence Span From Date 2 (SOURCE: FILE=9002274.4057, FIELD=.02)
+1 ; form locator #36a
+2 DO GET57
+3 SET Y=$PIECE(ABM(57,2),"^",2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,320)=Y
+6 SET ABMR(40,320)=$$FMT^ABMERUTL(ABMR(40,320),"6")
+7 QUIT
+8 ;
330 ;Occurrence Span Through Date 2 (SOURCE: FILE=9002274.4057, FIELD=.03)
+1 ; form locator #36a
+2 DO GET57
+3 SET Y=$PIECE(ABM(57,2),"^",3)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,330)=Y
+6 SET ABMR(40,330)=$$FMT^ABMERUTL(ABMR(40,330),"6")
+7 QUIT
+8 ;
340 ;Filler (National Use)
+1 SET ABMR(40,340)=""
+2 SET ABMR(40,340)=$$FMT^ABMERUTL(ABMR(40,340),3)
+3 QUIT
+4 ;
350 ;Occurrence Span Code 3 (SOURCE: FILE=9002274.4057, FIELD=.01)
+1 ; form locator #35b
+2 DO GET57
+3 SET ABMR(40,350)=$PIECE($GET(ABM(57,3)),U)
+4 SET ABMR(40,350)=$$FMT^ABMERUTL(ABMR(40,350),2)
+5 QUIT
+6 ;
360 ;Occurrence Span From Date 2 (SOURCE: FILE=9002274.4057, FIELD=.02)
+1 ; form locator #35b
+2 DO GET57
+3 SET Y=$PIECE($GET(ABM(57,3)),U,2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,360)=Y
+6 SET ABMR(40,360)=$$FMT^ABMERUTL(ABMR(40,360),"6")
+7 QUIT
+8 ;
370 ;Occurrence Span Through Date 2 (SOURCE: FILE=9002274.4057, FIELD=.03)
+1 ; form locator #35b
+2 DO GET57
+3 SET Y=$PIECE($GET(ABM(57,3)),U,3)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,370)=Y
+6 SET ABMR(40,370)=$$FMT^ABMERUTL(ABMR(40,370),"6")
+7 QUIT
+8 ;
380 ;Occurrence Span Code 2 (SOURCE: FILE=9002274.4057, FIELD=.01)
+1 ; form locator #36b
+2 DO GET57
+3 SET ABMR(40,380)=$PIECE($GET(ABM(57,4)),U)
+4 SET ABMR(40,380)=$$FMT^ABMERUTL(ABMR(40,380),2)
+5 QUIT
+6 ;
390 ;Occurrence Span From Date 2 (SOURCE: FILE=9002274.4057, FIELD=.02)
+1 ; form locator #36b
+2 DO GET57
+3 SET Y=$PIECE($GET(ABM(57,4)),U,2)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,390)=Y
+6 SET ABMR(40,390)=$$FMT^ABMERUTL(ABMR(40,390),"6")
+7 QUIT
+8 ;
400 ;Occurrence Span Through Date 2 (SOURCE: FILE=9002274.4057, FIELD=.03)
+1 ; form locator #36b
+2 DO GET57
+3 SET Y=$PIECE($GET(ABM(57,4)),U,3)
+4 DO DFMT^ABMERUTL
+5 SET ABMR(40,400)=Y
+6 SET ABMR(40,400)=$$FMT^ABMERUTL(ABMR(40,400),"6")
+7 QUIT
+8 ;
DIQ1 ;PULL POLICY HOLDER 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=".02;.54;.55;.56;.58;.76;.77;.78;.79"
+8 DO EN^DIQ1
+9 KILL DIQ
+10 QUIT
+11 ;
EX(ABMX,ABMY) ;EXTRINSIC FUNCTION HERE
+1 ;
+2 ; INPUT: ABMX = data element
+3 ; Y = bill internal entry number
+4 ;
+5 ; OUTPUT: Y = bill internal entry number
+6 ;
+7 SET ABMP("BDFN")=ABMY
+8 DO SET^ABMERUTL
+9 IF '$GET(ABMP("NOFMT"))
SET ABMP("FMT")=0
+10 DO @ABMX
+11 SET Y=ABMR(40,ABMX)
+12 IF $DATA(ABMP("FMT"))
SET ABMP("FMT")=1
+13 KILL ABMR(40,ABMX),ABME,ABMX,ABMY,ABMZ,ABM
+14 QUIT Y
+15 ;
GET51 ;GET OCCURANCE CODES
+1 IF $DATA(ABM(51))
QUIT
+2 NEW I
+3 SET I=0
SET CNT=0
+4 FOR
SET I=$ORDER(^ABMDBILL(DUZ(2),ABMP("BDFN"),51,I))
IF 'I
QUIT
Begin DoDot:1
+5 SET CNT=CNT+1
+6 SET ABM(51,CNT)=^ABMDBILL(DUZ(2),ABMP("BDFN"),51,I,0)
+7 SET $PIECE(ABM(51,CNT),U)=$PIECE($GET(^ABMDCODE(+ABM(51,CNT),0)),U)
+8 IF $LENGTH(ABM(51,CNT))=1
SET ABM(51,CNT)="0"_ABM(51,CNT)
End DoDot:1
+9 FOR I=1:1:10
IF '$DATA(ABM(51,I))
SET ABM(51,I)=""
+10 QUIT
+11 ;
GET57 ;GET OCCURRENCE SPAN CODES
+1 IF $DATA(ABM(57))
QUIT
+2 NEW I
+3 SET I=0
SET CNT=0
+4 FOR
SET I=$ORDER(^ABMDBILL(DUZ(2),ABMP("BDFN"),57,I))
IF 'I
QUIT
Begin DoDot:1
+5 SET CNT=CNT+1
+6 SET ABM(57,CNT)=^ABMDBILL(DUZ(2),ABMP("BDFN"),57,I,0)
+7 SET $PIECE(ABM(57,CNT),U)=$PIECE($GET(^ABMDCODE(+ABM(57,CNT),0)),U)
End DoDot:1
+8 FOR I=1,2
IF '$DATA(ABM(57,I))
SET ABM(57,I)=""
+9 QUIT