RMPRPIXE ;HINCIO/ODJ-FILE 661.7 API ;3/8/01
;;3.0;PROSTHETICS;**61**;Feb 09, 1996
Q
;
; NEXT - is used to get the next (or previous) record keys
; from an input set of keys, on file 661.7, using a
; specified cross-reference and key level.
; The following cross-references are currently supported...
;
; XHDS - HCPCS, Date&Time and Sequence
; XSHIDS - Station, HCPCS, Item, Date&Time and Sequence
; XSLHIDS - Station, Location, HCPCS, Item,
; Date&Time and Sequence
;
; Inputs:
; RMPR - an array of key values which define a record.
; The specification of this array is dependent on which
; cross-reference is entered (see below)
; RMPRXREF - The cross-reference used to order on (see above)
; RMPRLEV - The level of traversal. This is also dependent on
; which cross-reference is used (see below)
; RMPRT - Direction of traversal: 1 - Next (ascending)
; -1 - Previous (descending)
; RMPROLD - This is a copy of RMPR prior to changing RMPR values
; RMPREOF - End Of File flag: 1 - End Of File, 0 - not end of file
;
; XHDS x-ref:
; RMPR("HCPCS")
; RMPR("DATE&TIME")
; RMPR("SEQUENCE")
; RMPR("IEN")
; Set RMPRLEV to...
; "HCPCS" - HCPCS
; "DATE&TIME" - DATE&TIME
; "SEQUENCE" - SEQUENCE
; "" - All records
;
; XSHIDS x-ref:
; RMPR("STATION")
; RMPR("HCPCS")
; RMPR("ITEM")
; RMPR("DATE&TIME")
; RMPR("SEQUENCE")
; Set RMPRLEV to...
; "STATION"
; "HCPCS"
; "ITEM"
; "DATE&TIME"
; "SEQUENCE"
; ""
NEXT(RMPR,RMPRXREF,RMPRLEV,RMPRT,RMPROLD,RMPREOF) ;
N RMPRRET,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7
I $G(RMPRT)'=-1 S RMPRT=1
S RMPRRET=0,RMPREOF=0
;
; HCPCS, Date&Time, Sequence X-ref
I RMPRXREF="XHDS" D G NEXTX
. S RMPRK1=$G(RMPR("HCPCS"))
. S RMPRK2=$G(RMPR("DATE&TIME"))
. S RMPRK3=$G(RMPR("SEQUENCE"))
. S RMPRK4=$G(RMPR("IEN"))
. I RMPRLEV="HCPCS" D Q:RMPREOF
.. S RMPRK1=$O(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
.. I RMPRK1="" S RMPREOF=1 K RMPROLD Q
.. S (RMPRK2,RMPRK3,RMPRK4)=""
.. Q
. I RMPRLEV="DATE&TIME",RMPRK1'="" D
.. S RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
.. I RMPRK2="" S RMPREOF=1
.. S (RMPRK3,RMPRK4)=""
.. Q
. I RMPRLEV="SEQUENCE",RMPRK2'="" D
.. S RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
.. I RMPRK3="" S RMPREOF=1
.. S RMPRK4=""
.. Q
. I RMPRLEV="",RMPRK3'="" D
.. S RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
.. I RMPRK4="" S RMPREOF=1
.. Q
. K RMPROLD
. I RMPREOF D
.. I RMPRK4="" S:RMPRK3'="" RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
.. I RMPRK3="" S:RMPRK2'="" RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
.. I RMPRK2="" S:RMPRK1'="" RMPRK1=$O(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT) S:RMPRK1="" RMPREOF=1
.. Q
. I RMPRK1="",RMPREOF Q
. S RMPREOF=0
. M RMPROLD=RMPR
. I RMPRK1="" S RMPRK1=$O(^RMPR(661.7,RMPRXREF,""),RMPRT)
. Q:RMPRK1=""
. I RMPRK2="" S RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,""),RMPRT)
. Q:RMPRK2=""
. I RMPRK3="" S RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,""),RMPRT)
. Q:RMPRK3=""
. I RMPRK4="" S RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,""),RMPRT)
. S RMPR("HCPCS")=RMPRK1
. S RMPR("DATE&TIME")=RMPRK2
. S RMPR("SEQUENCE")=RMPRK3
. S RMPR("IEN")=RMPRK4
. Q
;
; Station, HCPCS, Item, Date&Time, Sequence X-ref.
I RMPRXREF="XSHIDS" D G NEXTX
. S (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6)=""
. S RMPRK1=$G(RMPR("STATION"))
. S:RMPRK1'="" RMPRK2=$G(RMPR("HCPCS"))
. S:RMPRK2'="" RMPRK3=$G(RMPR("ITEM"))
. S:RMPRK3'="" RMPRK4=$G(RMPR("DATE&TIME"))
. S:RMPRK4'="" RMPRK5=$G(RMPR("SEQUENCE"))
. S:RMPRK5'="" RMPRK6=$G(RMPR("IEN"))
. I RMPRLEV="STATION" D Q:RMPREOF
.. S RMPRK1=$O(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
.. I RMPRK1="" S RMPREOF=1 K RMPROLD Q
.. S (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6)=""
.. Q
. I RMPRLEV="HCPCS",RMPRK1'="" D
.. S RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
.. I RMPRK2="" S RMPREOF=1
.. S (RMPRK3,RMPRK4,RMPRK5,RMPRK6)=""
.. Q
. I RMPRLEV="ITEM",RMPRK2'="" D
.. S RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
.. I RMPRK3="" S RMPREOF=1
.. S (RMPRK4,RMPRK5,RMPRK6)=""
.. Q
. I RMPRLEV="DATE&TIME",RMPRK3'="" D
.. S RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
.. I RMPRK4="" S RMPREOF=1
.. S (RMPRK5,RMPRK6)=""
.. Q
. I RMPRLEV="SEQUENCE",RMPRK4'="" D
.. S RMPRK5=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
.. I RMPRK5="" S RMPREOF=1
.. S RMPRK6=""
.. Q
. I RMPRLEV="",RMPRK5'="" D
.. S RMPRK6=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6),RMPRT)
.. I RMPRK6="" S RMPREOF=1
.. Q
. K RMPROLD
. I RMPREOF D
.. I RMPRK6="" S:RMPRK5'="" RMPRK5=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
.. I RMPRK5="" S:RMPRK4'="" RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
.. I RMPRK4="" S:RMPRK3'="" RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
.. I RMPRK3="" S:RMPRK2'="" RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
.. I RMPRK2="" S:RMPRK1'="" RMPRK1=$O(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT) S:RMPRK1="" RMPREOF=1
.. Q
. I RMPRK1="",RMPREOF Q
. S RMPREOF=0
. M RMPROLD=RMPR
. I RMPRK1="" S RMPRK1=$O(^RMPR(661.7,RMPRXREF,""),RMPRT) I RMPRK1="" S RMPREOF=1 Q
. I RMPRK2="" S RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,""),RMPRT) I RMPRK2="" S RMPREOF=1 Q
. I RMPRK3="" S RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,""),RMPRT) I RMPRK3="" S RMPREOF=1 Q
. I RMPRK4="" S RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,""),RMPRT) I RMPRK4="" S RMPREOF=1 Q
. I RMPRK5="" S RMPRK5=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,""),RMPRT) I RMPRK5="" S RMPREOF=1 Q
. I RMPRK6="" S RMPRK6=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,""),RMPRT) I RMPRK6="" S RMPREOF=1 Q
. S RMPR("STATION")=RMPRK1
. S RMPR("HCPCS")=RMPRK2
. S RMPR("ITEM")=RMPRK3
. S RMPR("DATE&TIME")=RMPRK4
. S RMPR("SEQUENCE")=RMPRK5
. S RMPR("IEN")=RMPRK6
. Q
;
; Station, Location, HCPCS, Item, Date&Time, Sequence
I RMPRXREF="XSLHIDS" D G NEXTX
. S (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
. S RMPRK1=$G(RMPR("STATION"))
. S:RMPRK1'="" RMPRK2=$G(RMPR("LOCATION"))
. S:RMPRK2'="" RMPRK3=$G(RMPR("HCPCS"))
. S:RMPRK3'="" RMPRK4=$G(RMPR("ITEM"))
. S:RMPRK4'="" RMPRK5=$G(RMPR("DATE&TIME"))
. S:RMPRK5'="" RMPRK6=$G(RMPR("SEQUENCE"))
. S:RMPRK6'="" RMPRK7=$G(RMPR("IEN"))
. I RMPRLEV="STATION" D Q:RMPREOF
.. S RMPRK1=$O(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
.. I RMPRK1="" S RMPREOF=1 K RMPROLD Q
.. S (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
.. Q
. I RMPRLEV="LOCATION",RMPRK1'="" D
.. S RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
.. I RMPRK2="" S RMPREOF=1
.. S (RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
.. Q
. I RMPRLEV="HCPCS",RMPRK2'="" D
.. S RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
.. I RMPRK3="" S RMPREOF=1
.. S (RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
.. Q
. I RMPRLEV="ITEM",RMPRK3'="" D
.. S RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
.. I RMPRK4="" S RMPREOF=1
.. S (RMPRK5,RMPRK6,RMPRK7)=""
.. Q
. I RMPRLEV="DATE&TIME",RMPRK4'="" D
.. S RMPRK5=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
.. I RMPRK5="" S RMPREOF=1
.. S (RMPRK6,RMPRK7)=""
.. Q
. I RMPRLEV="SEQUENCE",RMPRK5'="" D
.. S RMPRK6=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6),RMPRT)
.. I RMPRK6="" S RMPREOF=1
.. S RMPRK7=""
.. Q
. I RMPRLEV="",RMPRK6'="" D
.. S RMPRK7=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7),RMPRT)
.. I RMPRK7="" S RMPREOF=1
.. Q
. K RMPROLD
. I RMPREOF D
.. I RMPRK7="" S:RMPRK6'="" RMPRK6=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6),RMPRT)
.. I RMPRK6="" S:RMPRK5'="" RMPRK5=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
.. I RMPRK5="" S:RMPRK4'="" RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
.. I RMPRK4="" S:RMPRK3'="" RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
.. I RMPRK3="" S:RMPRK2'="" RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
.. I RMPRK2="" S:RMPRK1'="" RMPRK1=$O(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT) S:RMPRK1="" RMPREOF=1
.. Q
. I RMPRK1="",RMPREOF Q
. S RMPREOF=0
. M RMPROLD=RMPR
. I RMPRK1="" S RMPRK1=$O(^RMPR(661.7,RMPRXREF,""),RMPRT) I RMPRK1="" S RMPREOF=1 Q
. I RMPRK2="" S RMPRK2=$O(^RMPR(661.7,RMPRXREF,RMPRK1,""),RMPRT) I RMPRK2="" S RMPREOF=1 Q
. I RMPRK3="" S RMPRK3=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,""),RMPRT) I RMPRK3="" S RMPREOF=1 Q
. I RMPRK4="" S RMPRK4=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,""),RMPRT) I RMPRK4="" S RMPREOF=1 Q
. I RMPRK5="" S RMPRK5=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,""),RMPRT) I RMPRK5="" S RMPREOF=1 Q
. I RMPRK6="" S RMPRK6=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,""),RMPRT) I RMPRK6="" S RMPREOF=1 Q
. I RMPRK7="" S RMPRK7=$O(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,""),RMPRT) I RMPRK7="" S RMPREOF=1 Q
. S RMPR("STATION")=RMPRK1
. S RMPR("LOCATION")=RMPRK2
. S RMPR("HCPCS")=RMPRK3
. S RMPR("ITEM")=RMPRK4
. S RMPR("DATE&TIME")=RMPRK5
. S RMPR("SEQUENCE")=RMPRK6
. S RMPR("IEN")=RMPRK7
. Q
NEXTX Q RMPRRET
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPRPIXE 9693 printed Oct 16, 2024@18:37:21 Page 2
RMPRPIXE ;HINCIO/ODJ-FILE 661.7 API ;3/8/01
+1 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
+2 QUIT
+3 ;
+4 ; NEXT - is used to get the next (or previous) record keys
+5 ; from an input set of keys, on file 661.7, using a
+6 ; specified cross-reference and key level.
+7 ; The following cross-references are currently supported...
+8 ;
+9 ; XHDS - HCPCS, Date&Time and Sequence
+10 ; XSHIDS - Station, HCPCS, Item, Date&Time and Sequence
+11 ; XSLHIDS - Station, Location, HCPCS, Item,
+12 ; Date&Time and Sequence
+13 ;
+14 ; Inputs:
+15 ; RMPR - an array of key values which define a record.
+16 ; The specification of this array is dependent on which
+17 ; cross-reference is entered (see below)
+18 ; RMPRXREF - The cross-reference used to order on (see above)
+19 ; RMPRLEV - The level of traversal. This is also dependent on
+20 ; which cross-reference is used (see below)
+21 ; RMPRT - Direction of traversal: 1 - Next (ascending)
+22 ; -1 - Previous (descending)
+23 ; RMPROLD - This is a copy of RMPR prior to changing RMPR values
+24 ; RMPREOF - End Of File flag: 1 - End Of File, 0 - not end of file
+25 ;
+26 ; XHDS x-ref:
+27 ; RMPR("HCPCS")
+28 ; RMPR("DATE&TIME")
+29 ; RMPR("SEQUENCE")
+30 ; RMPR("IEN")
+31 ; Set RMPRLEV to...
+32 ; "HCPCS" - HCPCS
+33 ; "DATE&TIME" - DATE&TIME
+34 ; "SEQUENCE" - SEQUENCE
+35 ; "" - All records
+36 ;
+37 ; XSHIDS x-ref:
+38 ; RMPR("STATION")
+39 ; RMPR("HCPCS")
+40 ; RMPR("ITEM")
+41 ; RMPR("DATE&TIME")
+42 ; RMPR("SEQUENCE")
+43 ; Set RMPRLEV to...
+44 ; "STATION"
+45 ; "HCPCS"
+46 ; "ITEM"
+47 ; "DATE&TIME"
+48 ; "SEQUENCE"
+49 ; ""
NEXT(RMPR,RMPRXREF,RMPRLEV,RMPRT,RMPROLD,RMPREOF) ;
+1 NEW RMPRRET,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7
+2 IF $GET(RMPRT)'=-1
SET RMPRT=1
+3 SET RMPRRET=0
SET RMPREOF=0
+4 ;
+5 ; HCPCS, Date&Time, Sequence X-ref
+6 IF RMPRXREF="XHDS"
Begin DoDot:1
+7 SET RMPRK1=$GET(RMPR("HCPCS"))
+8 SET RMPRK2=$GET(RMPR("DATE&TIME"))
+9 SET RMPRK3=$GET(RMPR("SEQUENCE"))
+10 SET RMPRK4=$GET(RMPR("IEN"))
+11 IF RMPRLEV="HCPCS"
Begin DoDot:2
+12 SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
+13 IF RMPRK1=""
SET RMPREOF=1
KILL RMPROLD
QUIT
+14 SET (RMPRK2,RMPRK3,RMPRK4)=""
+15 QUIT
End DoDot:2
if RMPREOF
QUIT
+16 IF RMPRLEV="DATE&TIME"
IF RMPRK1'=""
Begin DoDot:2
+17 SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
+18 IF RMPRK2=""
SET RMPREOF=1
+19 SET (RMPRK3,RMPRK4)=""
+20 QUIT
End DoDot:2
+21 IF RMPRLEV="SEQUENCE"
IF RMPRK2'=""
Begin DoDot:2
+22 SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
+23 IF RMPRK3=""
SET RMPREOF=1
+24 SET RMPRK4=""
+25 QUIT
End DoDot:2
+26 IF RMPRLEV=""
IF RMPRK3'=""
Begin DoDot:2
+27 SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
+28 IF RMPRK4=""
SET RMPREOF=1
+29 QUIT
End DoDot:2
+30 KILL RMPROLD
+31 IF RMPREOF
Begin DoDot:2
+32 IF RMPRK4=""
if RMPRK3'=""
SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
+33 IF RMPRK3=""
if RMPRK2'=""
SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
+34 IF RMPRK2=""
if RMPRK1'=""
SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
if RMPRK1=""
SET RMPREOF=1
+35 QUIT
End DoDot:2
+36 IF RMPRK1=""
IF RMPREOF
QUIT
+37 SET RMPREOF=0
+38 MERGE RMPROLD=RMPR
+39 IF RMPRK1=""
SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,""),RMPRT)
+40 if RMPRK1=""
QUIT
+41 IF RMPRK2=""
SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,""),RMPRT)
+42 if RMPRK2=""
QUIT
+43 IF RMPRK3=""
SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,""),RMPRT)
+44 if RMPRK3=""
QUIT
+45 IF RMPRK4=""
SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,""),RMPRT)
+46 SET RMPR("HCPCS")=RMPRK1
+47 SET RMPR("DATE&TIME")=RMPRK2
+48 SET RMPR("SEQUENCE")=RMPRK3
+49 SET RMPR("IEN")=RMPRK4
+50 QUIT
End DoDot:1
GOTO NEXTX
+51 ;
+52 ; Station, HCPCS, Item, Date&Time, Sequence X-ref.
+53 IF RMPRXREF="XSHIDS"
Begin DoDot:1
+54 SET (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6)=""
+55 SET RMPRK1=$GET(RMPR("STATION"))
+56 if RMPRK1'=""
SET RMPRK2=$GET(RMPR("HCPCS"))
+57 if RMPRK2'=""
SET RMPRK3=$GET(RMPR("ITEM"))
+58 if RMPRK3'=""
SET RMPRK4=$GET(RMPR("DATE&TIME"))
+59 if RMPRK4'=""
SET RMPRK5=$GET(RMPR("SEQUENCE"))
+60 if RMPRK5'=""
SET RMPRK6=$GET(RMPR("IEN"))
+61 IF RMPRLEV="STATION"
Begin DoDot:2
+62 SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
+63 IF RMPRK1=""
SET RMPREOF=1
KILL RMPROLD
QUIT
+64 SET (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6)=""
+65 QUIT
End DoDot:2
if RMPREOF
QUIT
+66 IF RMPRLEV="HCPCS"
IF RMPRK1'=""
Begin DoDot:2
+67 SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
+68 IF RMPRK2=""
SET RMPREOF=1
+69 SET (RMPRK3,RMPRK4,RMPRK5,RMPRK6)=""
+70 QUIT
End DoDot:2
+71 IF RMPRLEV="ITEM"
IF RMPRK2'=""
Begin DoDot:2
+72 SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
+73 IF RMPRK3=""
SET RMPREOF=1
+74 SET (RMPRK4,RMPRK5,RMPRK6)=""
+75 QUIT
End DoDot:2
+76 IF RMPRLEV="DATE&TIME"
IF RMPRK3'=""
Begin DoDot:2
+77 SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
+78 IF RMPRK4=""
SET RMPREOF=1
+79 SET (RMPRK5,RMPRK6)=""
+80 QUIT
End DoDot:2
+81 IF RMPRLEV="SEQUENCE"
IF RMPRK4'=""
Begin DoDot:2
+82 SET RMPRK5=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
+83 IF RMPRK5=""
SET RMPREOF=1
+84 SET RMPRK6=""
+85 QUIT
End DoDot:2
+86 IF RMPRLEV=""
IF RMPRK5'=""
Begin DoDot:2
+87 SET RMPRK6=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6),RMPRT)
+88 IF RMPRK6=""
SET RMPREOF=1
+89 QUIT
End DoDot:2
+90 KILL RMPROLD
+91 IF RMPREOF
Begin DoDot:2
+92 IF RMPRK6=""
if RMPRK5'=""
SET RMPRK5=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
+93 IF RMPRK5=""
if RMPRK4'=""
SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
+94 IF RMPRK4=""
if RMPRK3'=""
SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
+95 IF RMPRK3=""
if RMPRK2'=""
SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
+96 IF RMPRK2=""
if RMPRK1'=""
SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
if RMPRK1=""
SET RMPREOF=1
+97 QUIT
End DoDot:2
+98 IF RMPRK1=""
IF RMPREOF
QUIT
+99 SET RMPREOF=0
+100 MERGE RMPROLD=RMPR
+101 IF RMPRK1=""
SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,""),RMPRT)
IF RMPRK1=""
SET RMPREOF=1
QUIT
+102 IF RMPRK2=""
SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,""),RMPRT)
IF RMPRK2=""
SET RMPREOF=1
QUIT
+103 IF RMPRK3=""
SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,""),RMPRT)
IF RMPRK3=""
SET RMPREOF=1
QUIT
+104 IF RMPRK4=""
SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,""),RMPRT)
IF RMPRK4=""
SET RMPREOF=1
QUIT
+105 IF RMPRK5=""
SET RMPRK5=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,""),RMPRT)
IF RMPRK5=""
SET RMPREOF=1
QUIT
+106 IF RMPRK6=""
SET RMPRK6=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,""),RMPRT)
IF RMPRK6=""
SET RMPREOF=1
QUIT
+107 SET RMPR("STATION")=RMPRK1
+108 SET RMPR("HCPCS")=RMPRK2
+109 SET RMPR("ITEM")=RMPRK3
+110 SET RMPR("DATE&TIME")=RMPRK4
+111 SET RMPR("SEQUENCE")=RMPRK5
+112 SET RMPR("IEN")=RMPRK6
+113 QUIT
End DoDot:1
GOTO NEXTX
+114 ;
+115 ; Station, Location, HCPCS, Item, Date&Time, Sequence
+116 IF RMPRXREF="XSLHIDS"
Begin DoDot:1
+117 SET (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
+118 SET RMPRK1=$GET(RMPR("STATION"))
+119 if RMPRK1'=""
SET RMPRK2=$GET(RMPR("LOCATION"))
+120 if RMPRK2'=""
SET RMPRK3=$GET(RMPR("HCPCS"))
+121 if RMPRK3'=""
SET RMPRK4=$GET(RMPR("ITEM"))
+122 if RMPRK4'=""
SET RMPRK5=$GET(RMPR("DATE&TIME"))
+123 if RMPRK5'=""
SET RMPRK6=$GET(RMPR("SEQUENCE"))
+124 if RMPRK6'=""
SET RMPRK7=$GET(RMPR("IEN"))
+125 IF RMPRLEV="STATION"
Begin DoDot:2
+126 SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
+127 IF RMPRK1=""
SET RMPREOF=1
KILL RMPROLD
QUIT
+128 SET (RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
+129 QUIT
End DoDot:2
if RMPREOF
QUIT
+130 IF RMPRLEV="LOCATION"
IF RMPRK1'=""
Begin DoDot:2
+131 SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
+132 IF RMPRK2=""
SET RMPREOF=1
+133 SET (RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
+134 QUIT
End DoDot:2
+135 IF RMPRLEV="HCPCS"
IF RMPRK2'=""
Begin DoDot:2
+136 SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
+137 IF RMPRK3=""
SET RMPREOF=1
+138 SET (RMPRK4,RMPRK5,RMPRK6,RMPRK7)=""
+139 QUIT
End DoDot:2
+140 IF RMPRLEV="ITEM"
IF RMPRK3'=""
Begin DoDot:2
+141 SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
+142 IF RMPRK4=""
SET RMPREOF=1
+143 SET (RMPRK5,RMPRK6,RMPRK7)=""
+144 QUIT
End DoDot:2
+145 IF RMPRLEV="DATE&TIME"
IF RMPRK4'=""
Begin DoDot:2
+146 SET RMPRK5=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
+147 IF RMPRK5=""
SET RMPREOF=1
+148 SET (RMPRK6,RMPRK7)=""
+149 QUIT
End DoDot:2
+150 IF RMPRLEV="SEQUENCE"
IF RMPRK5'=""
Begin DoDot:2
+151 SET RMPRK6=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6),RMPRT)
+152 IF RMPRK6=""
SET RMPREOF=1
+153 SET RMPRK7=""
+154 QUIT
End DoDot:2
+155 IF RMPRLEV=""
IF RMPRK6'=""
Begin DoDot:2
+156 SET RMPRK7=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,RMPRK7),RMPRT)
+157 IF RMPRK7=""
SET RMPREOF=1
+158 QUIT
End DoDot:2
+159 KILL RMPROLD
+160 IF RMPREOF
Begin DoDot:2
+161 IF RMPRK7=""
if RMPRK6'=""
SET RMPRK6=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6),RMPRT)
+162 IF RMPRK6=""
if RMPRK5'=""
SET RMPRK5=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5),RMPRT)
+163 IF RMPRK5=""
if RMPRK4'=""
SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4),RMPRT)
+164 IF RMPRK4=""
if RMPRK3'=""
SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3),RMPRT)
+165 IF RMPRK3=""
if RMPRK2'=""
SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2),RMPRT)
+166 IF RMPRK2=""
if RMPRK1'=""
SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1),RMPRT)
if RMPRK1=""
SET RMPREOF=1
+167 QUIT
End DoDot:2
+168 IF RMPRK1=""
IF RMPREOF
QUIT
+169 SET RMPREOF=0
+170 MERGE RMPROLD=RMPR
+171 IF RMPRK1=""
SET RMPRK1=$ORDER(^RMPR(661.7,RMPRXREF,""),RMPRT)
IF RMPRK1=""
SET RMPREOF=1
QUIT
+172 IF RMPRK2=""
SET RMPRK2=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,""),RMPRT)
IF RMPRK2=""
SET RMPREOF=1
QUIT
+173 IF RMPRK3=""
SET RMPRK3=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,""),RMPRT)
IF RMPRK3=""
SET RMPREOF=1
QUIT
+174 IF RMPRK4=""
SET RMPRK4=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,""),RMPRT)
IF RMPRK4=""
SET RMPREOF=1
QUIT
+175 IF RMPRK5=""
SET RMPRK5=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,""),RMPRT)
IF RMPRK5=""
SET RMPREOF=1
QUIT
+176 IF RMPRK6=""
SET RMPRK6=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,""),RMPRT)
IF RMPRK6=""
SET RMPREOF=1
QUIT
+177 IF RMPRK7=""
SET RMPRK7=$ORDER(^RMPR(661.7,RMPRXREF,RMPRK1,RMPRK2,RMPRK3,RMPRK4,RMPRK5,RMPRK6,""),RMPRT)
IF RMPRK7=""
SET RMPREOF=1
QUIT
+178 SET RMPR("STATION")=RMPRK1
+179 SET RMPR("LOCATION")=RMPRK2
+180 SET RMPR("HCPCS")=RMPRK3
+181 SET RMPR("ITEM")=RMPRK4
+182 SET RMPR("DATE&TIME")=RMPRK5
+183 SET RMPR("SEQUENCE")=RMPRK6
+184 SET RMPR("IEN")=RMPRK7
+185 QUIT
End DoDot:1
GOTO NEXTX
NEXTX QUIT RMPRRET