ABME5QTY ; IHS/ASDST/DMJ - 837 QTY Segment
;;2.6;IHS Third Party Billing System;**6**;NOV 12, 2009
;Transaction Set Header
;
EP(X) ;EP
;x=qualifier
K ABMREC("QTY"),ABMR("QTY")
S ABMEIC=X
S ABME("RTYPE")="QTY"
D LOOP
K ABME,ABM
Q
LOOP ;LOOP HERE
F I=10:10:50 D
.D @I
.I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),ABME("RTYPE"),I)) D @(^(I))
.I $G(ABMREC("QTY"))'="" S ABMREC("QTY")=ABMREC("QTY")_"*"
.S ABMREC("QTY")=$G(ABMREC("QTY"))_ABMR("QTY",I)
Q
10 ;segment
S ABMR("QTY",10)="QTY"
Q
20 ;QTY01 - Quantity Qualifier
S ABMR("QTY",20)=ABMEIC
Q
30 ;QTY02 - Quantity
S ABMR("QTY",30)=""
I ABMEIC="NA" S ABMR("QTY",30)=$P(ABMB6,"^",6)
I ABMEIC="CA" S ABMR("QTY",30)=$P(ABMB7,"^",3)
I ABMEIC="PT" S ABMR("QTY",30)=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),12)),U,18)
Q
40 ;QTY03 - Composite Unit of Measure
S ABMR("QTY",40)=""
Q:ABMEIC="PT"
S ABMR("QTY",40)="DA"
Q
50 ;QTY04 - Free-Form Message
S ABMR("QTY",50)=""
Q
ABME5QTY ; IHS/ASDST/DMJ - 837 QTY Segment
+1 ;;2.6;IHS Third Party Billing System;**6**;NOV 12, 2009
+2 ;Transaction Set Header
+3 ;
EP(X) ;EP
+1 ;x=qualifier
+2 KILL ABMREC("QTY"),ABMR("QTY")
+3 SET ABMEIC=X
+4 SET ABME("RTYPE")="QTY"
+5 DO LOOP
+6 KILL ABME,ABM
+7 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")),ABME("RTYPE"),I))
DO @(^(I))
+4 IF $GET(ABMREC("QTY"))'=""
SET ABMREC("QTY")=ABMREC("QTY")_"*"
+5 SET ABMREC("QTY")=$GET(ABMREC("QTY"))_ABMR("QTY",I)
End DoDot:1
+6 QUIT
10 ;segment
+1 SET ABMR("QTY",10)="QTY"
+2 QUIT
20 ;QTY01 - Quantity Qualifier
+1 SET ABMR("QTY",20)=ABMEIC
+2 QUIT
30 ;QTY02 - Quantity
+1 SET ABMR("QTY",30)=""
+2 IF ABMEIC="NA"
SET ABMR("QTY",30)=$PIECE(ABMB6,"^",6)
+3 IF ABMEIC="CA"
SET ABMR("QTY",30)=$PIECE(ABMB7,"^",3)
+4 IF ABMEIC="PT"
SET ABMR("QTY",30)=$PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),12)),U,18)
+5 QUIT
40 ;QTY03 - Composite Unit of Measure
+1 SET ABMR("QTY",40)=""
+2 IF ABMEIC="PT"
QUIT
+3 SET ABMR("QTY",40)="DA"
+4 QUIT
50 ;QTY04 - Free-Form Message
+1 SET ABMR("QTY",50)=""
+2 QUIT