RMPRPIXI ;HINCIO/ODJ - FILE 661.7 APIs ;3/8/01
;;3.0;PROSTHETICS;**61**;Feb 09, 1996
Q
;
; Get Total Quantity On Hand at the HCPC level
QOHH(RMPRHCPC,RMPRSTN,RMPRQOH) ;
N RMPRERR,RMPR,RMPROLD,RMPREOF,RMPRIN
S RMPRERR=0
S RMPRQOH("QUANTITY")=""
S RMPRQOH("VALUE")=""
;I RMPRSTN="*" G QOHHS ; for all stations
;
; Sum over all HCPCS items for single station
S RMPR("STATION")=RMPRSTN
S RMPR("HCPCS")=RMPRHCPC
QOHH1 S RMPRERR=$$NEXT^RMPRPIXE(.RMPR,"XSHIDS","",1,.RMPROLD,.RMPREOF)
I RMPRERR G QOHHX
I RMPREOF G QOHHX
I RMPROLD("HCPCS")'=RMPR("HCPCS") G QOHHX
K RMPRIN M RMPRIN=RMPR
S RMPRERR=$$GET^RMPRPIX7(.RMPRIN)
I RMPRERR G QOHHX
S RMPRQOH("QUANTITY")=RMPRIN("QUANTITY")+RMPRQOH("QUANTITY")
S RMPRQOH("VALUE")=RMPRIN("VALUE")+RMPRQOH("VALUE")
G QOHH1
QOHHX Q RMPRERR
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPRPIXI 817 printed Dec 13, 2024@02:36:45 Page 2
RMPRPIXI ;HINCIO/ODJ - FILE 661.7 APIs ;3/8/01
+1 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
+2 QUIT
+3 ;
+4 ; Get Total Quantity On Hand at the HCPC level
QOHH(RMPRHCPC,RMPRSTN,RMPRQOH) ;
+1 NEW RMPRERR,RMPR,RMPROLD,RMPREOF,RMPRIN
+2 SET RMPRERR=0
+3 SET RMPRQOH("QUANTITY")=""
+4 SET RMPRQOH("VALUE")=""
+5 ;I RMPRSTN="*" G QOHHS ; for all stations
+6 ;
+7 ; Sum over all HCPCS items for single station
+8 SET RMPR("STATION")=RMPRSTN
+9 SET RMPR("HCPCS")=RMPRHCPC
QOHH1 SET RMPRERR=$$NEXT^RMPRPIXE(.RMPR,"XSHIDS","",1,.RMPROLD,.RMPREOF)
+1 IF RMPRERR
GOTO QOHHX
+2 IF RMPREOF
GOTO QOHHX
+3 IF RMPROLD("HCPCS")'=RMPR("HCPCS")
GOTO QOHHX
+4 KILL RMPRIN
MERGE RMPRIN=RMPR
+5 SET RMPRERR=$$GET^RMPRPIX7(.RMPRIN)
+6 IF RMPRERR
GOTO QOHHX
+7 SET RMPRQOH("QUANTITY")=RMPRIN("QUANTITY")+RMPRQOH("QUANTITY")
+8 SET RMPRQOH("VALUE")=RMPRIN("VALUE")+RMPRQOH("VALUE")
+9 GOTO QOHH1
QOHHX QUIT RMPRERR