ABME5SV5 ; IHS/ASDST/DMJ - 837 SV5 Segment
;;2.6;IHS Third Party Billing System;**6**;NOV 12, 2009
;Transaction Set Header
;
EP ;EP
K ABMREC("SV5"),ABMR("SV5")
S ABME("RTYPE")="SV5"
D LOOP
K ABME
Q
LOOP ;LOOP HERE
F I=10:10:80 D
.D @I
.I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),ABME("RTYPE"),I)) D @(^(I))
.I $G(ABMREC("SV5"))'="" S ABMREC("SV5")=ABMREC("SV5")_"*"
.S ABMREC("SV5")=$G(ABMREC("SV5"))_ABMR("SV5",I)
Q
10 ;segment
S ABMR("SV5",10)="SV5"
Q
20 ;SV501 - Composite Medical Procedure Identifier
;SV501-1 Product Service ID Qualifier
;SV501-2 Product Service ID (Procedure Code)
I $P(ABMRV(ABMI,ABMJ,ABMK),U,2)'="" D
.S ABMR("SV5",20)="HC"
.S $P(ABMR("SV5",20),":",2)=$P(ABMRV(ABMI,ABMJ,ABMK),U,2)
Q
30 ;SV502 - Unit or Basis for Measurement Code
S ABMR("SV5",30)="DA"
Q
40 ;SV503 - Quantity
S ABMR("SV5",40)=+$P(ABMRV(ABMI,ABMJ,ABMK),U,33)
Q
50 ;SV504 - Monetary Amount (DME Rental Price)
S ABMR("SV5",50)=+$P(ABMRV(ABMI,ABMJ,ABMK),U,34)
Q
60 ;SV505 - Monetary Amount (DME Purchase Price)
S ABMR("SV5",60)=+$P(ABMRV(ABMI,ABMJ,ABMK),U,35)
Q
70 ;SV506 - Frequency Code
S ABMR("SV5",70)=+$P(ABMRV(ABMI,ABMJ,ABMK),U,36)
Q
80 ;SV507 - Prognosis Code
S ABMR("SV5",80)=""
Q
ABME5SV5 ; IHS/ASDST/DMJ - 837 SV5 Segment
+1 ;;2.6;IHS Third Party Billing System;**6**;NOV 12, 2009
+2 ;Transaction Set Header
+3 ;
EP ;EP
+1 KILL ABMREC("SV5"),ABMR("SV5")
+2 SET ABME("RTYPE")="SV5"
+3 DO LOOP
+4 KILL ABME
+5 QUIT
LOOP ;LOOP HERE
+1 FOR I=10:10:80
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("SV5"))'=""
SET ABMREC("SV5")=ABMREC("SV5")_"*"
+5 SET ABMREC("SV5")=$GET(ABMREC("SV5"))_ABMR("SV5",I)
End DoDot:1
+6 QUIT
10 ;segment
+1 SET ABMR("SV5",10)="SV5"
+2 QUIT
20 ;SV501 - Composite Medical Procedure Identifier
+1 ;SV501-1 Product Service ID Qualifier
+2 ;SV501-2 Product Service ID (Procedure Code)
+3 IF $PIECE(ABMRV(ABMI,ABMJ,ABMK),U,2)'=""
Begin DoDot:1
+4 SET ABMR("SV5",20)="HC"
+5 SET $PIECE(ABMR("SV5",20),":",2)=$PIECE(ABMRV(ABMI,ABMJ,ABMK),U,2)
End DoDot:1
+6 QUIT
30 ;SV502 - Unit or Basis for Measurement Code
+1 SET ABMR("SV5",30)="DA"
+2 QUIT
40 ;SV503 - Quantity
+1 SET ABMR("SV5",40)=+$PIECE(ABMRV(ABMI,ABMJ,ABMK),U,33)
+2 QUIT
50 ;SV504 - Monetary Amount (DME Rental Price)
+1 SET ABMR("SV5",50)=+$PIECE(ABMRV(ABMI,ABMJ,ABMK),U,34)
+2 QUIT
60 ;SV505 - Monetary Amount (DME Purchase Price)
+1 SET ABMR("SV5",60)=+$PIECE(ABMRV(ABMI,ABMJ,ABMK),U,35)
+2 QUIT
70 ;SV506 - Frequency Code
+1 SET ABMR("SV5",70)=+$PIECE(ABMRV(ABMI,ABMJ,ABMK),U,36)
+2 QUIT
80 ;SV507 - Prognosis Code
+1 SET ABMR("SV5",80)=""
+2 QUIT