ABME3HA0 ; IHS/ASDST/SDR - HCFA-1500 NSF 3.01 RECORD HA0 (Claim Root Segment) ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
;
START ;START HERE
K ABMREC(64)
D SET^ABMERUTL
D LOOP
K ABM,ABME,ABMRV
Q
LOOP ;LOOP HERE
F I=10:10:50 D
.D @I
.I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),64,I)) D @(^(I))
.D ADD
S ABMEF("LINE")=ABMREC(64)
D WRITE^ABMEF20
Q
ADD ;ADD TO RECORD
I '$G(ABMP("NOFMT")) S ABMREC(64)=$G(ABMREC(64))_ABMR(64,I)
Q
10 ;1-3 Record type
S ABMR(64,10)="HA0"
Q
20 ;4-5 Sequence
S ABMR(64,20)=1
S ABMR(64,20)=$$FMT^ABMERUTL(ABMR(64,20),"2NR")
Q
30 ;6-22 Patient Control Number
S ABMR(64,30)=ABMP("PCN")
S ABMR(64,30)=$$FMT^ABMERUTL(ABMR(64,30),17)
Q
40 ;23-39 Line Item Control Number
S ABMR(64,40)=""
S ABMR(64,40)=$$FMT^ABMERUTL(ABMR(64,40),17)
Q
50 ;40-320 Extra Narrative Data
S ABMR(64,50)=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),10)),U)
S ABMR(64,50)=$$FMT^ABMERUTL(ABMR(64,50),281)
Q
EX(ABMX,ABMY,ABMZ) ;EXTRINSIC FUNCTION HERE
;X=data element, 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(64,ABMX)
I $D(ABMP("FMT")) S ABMP("FMT")=1
K ABMR(64,ABMX),ABME,ABMX,ABMY,ABMZ,ABM
Q Y
ABME3HA0 ; IHS/ASDST/SDR - HCFA-1500 NSF 3.01 RECORD HA0 (Claim Root Segment) ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ;
START ;START HERE
+1 KILL ABMREC(64)
+2 DO SET^ABMERUTL
+3 DO LOOP
+4 KILL ABM,ABME,ABMRV
+5 QUIT
LOOP ;LOOP HERE
+1 FOR I=10:10:50
Begin DoDot:1
+2 DO @I
+3 IF $DATA(^ABMEXLM("AA",+$GET(ABMP("INS")),+$GET(ABMP("EXP")),64,I))
DO @(^(I))
+4 DO ADD
End DoDot:1
+5 SET ABMEF("LINE")=ABMREC(64)
+6 DO WRITE^ABMEF20
+7 QUIT
ADD ;ADD TO RECORD
+1 IF '$GET(ABMP("NOFMT"))
SET ABMREC(64)=$GET(ABMREC(64))_ABMR(64,I)
+2 QUIT
10 ;1-3 Record type
+1 SET ABMR(64,10)="HA0"
+2 QUIT
20 ;4-5 Sequence
+1 SET ABMR(64,20)=1
+2 SET ABMR(64,20)=$$FMT^ABMERUTL(ABMR(64,20),"2NR")
+3 QUIT
30 ;6-22 Patient Control Number
+1 SET ABMR(64,30)=ABMP("PCN")
+2 SET ABMR(64,30)=$$FMT^ABMERUTL(ABMR(64,30),17)
+3 QUIT
40 ;23-39 Line Item Control Number
+1 SET ABMR(64,40)=""
+2 SET ABMR(64,40)=$$FMT^ABMERUTL(ABMR(64,40),17)
+3 QUIT
50 ;40-320 Extra Narrative Data
+1 SET ABMR(64,50)=$PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),10)),U)
+2 SET ABMR(64,50)=$$FMT^ABMERUTL(ABMR(64,50),281)
+3 QUIT
EX(ABMX,ABMY,ABMZ) ;EXTRINSIC FUNCTION HERE
+1 ;X=data element, Y=bill internal entry number
+2 SET ABMP("BDFN")=ABMY
DO SET^ABMERUTL
+3 IF '$GET(ABMP("NOFMT"))
SET ABMP("FMT")=0
+4 DO @ABMX
+5 SET Y=ABMR(64,ABMX)
+6 IF $DATA(ABMP("FMT"))
SET ABMP("FMT")=1
+7 KILL ABMR(64,ABMX),ABME,ABMX,ABMY,ABMZ,ABM
+8 QUIT Y