MHVXRXR ;WAS/GPM - Prescription refill request ; [12/12/07 11:38pm]
;;1.0;My HealtheVet;**2**;Aug 23, 2005;Build 22
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
REQUEST(QRY,ERR,DATAROOT) ; Entry point to request refills
; Walks list of prescriptions calling a pharmacy api AP1^PSOPRA to
; add the prescription to the internet refill request queue in the
; PRESCRIPTION REFILL REQUEST file #52.43. The status of the api
; call is returned in DATAROOT.
;
; Integration Agreements:
; 3768 : AP1^PSOPRA
;
; Input:
; QRY - Query array
; QRY(DFN) - (required) Pointer to PATIENT (#2) file
; DATAROOT - Root of array to hold extract data
;
; Output:
; DATAROOT - Populated data array, includes # of hits
; ERR - Errors during extraction
;
N CNT,RX,PORDERN,ORDERTM,STATUS,DIV,DFN,U
;
D LOG^MHVUL2("MHVXRXR","BEGIN","S","TRACE")
S U="^"
S ERR=0
K @DATAROOT
S DFN=$G(QRY("DFN"))
;
F CNT=1:1 Q:'$D(QRY("RX",CNT)) D
. S RX=$G(QRY("RX",CNT))
. S PORDERN=$P(RX,"^",2)
. S ORDERTM=$P(RX,"^",3)
. S RX=$P(RX,"^")
. S STATUS=$$AP1^PSOPRA(DFN,RX)
. S @DATAROOT@(CNT)=RX_U_STATUS_U_PORDERN_U_ORDERTM
. Q
;
S @DATAROOT=CNT-1
D LOG^MHVUL2("MHVXRXR","END","S","TRACE")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMHVXRXR 1299 printed Dec 13, 2024@02:16:19 Page 2
MHVXRXR ;WAS/GPM - Prescription refill request ; [12/12/07 11:38pm]
+1 ;;1.0;My HealtheVet;**2**;Aug 23, 2005;Build 22
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
REQUEST(QRY,ERR,DATAROOT) ; Entry point to request refills
+1 ; Walks list of prescriptions calling a pharmacy api AP1^PSOPRA to
+2 ; add the prescription to the internet refill request queue in the
+3 ; PRESCRIPTION REFILL REQUEST file #52.43. The status of the api
+4 ; call is returned in DATAROOT.
+5 ;
+6 ; Integration Agreements:
+7 ; 3768 : AP1^PSOPRA
+8 ;
+9 ; Input:
+10 ; QRY - Query array
+11 ; QRY(DFN) - (required) Pointer to PATIENT (#2) file
+12 ; DATAROOT - Root of array to hold extract data
+13 ;
+14 ; Output:
+15 ; DATAROOT - Populated data array, includes # of hits
+16 ; ERR - Errors during extraction
+17 ;
+18 NEW CNT,RX,PORDERN,ORDERTM,STATUS,DIV,DFN,U
+19 ;
+20 DO LOG^MHVUL2("MHVXRXR","BEGIN","S","TRACE")
+21 SET U="^"
+22 SET ERR=0
+23 KILL @DATAROOT
+24 SET DFN=$GET(QRY("DFN"))
+25 ;
+26 FOR CNT=1:1
if '$DATA(QRY("RX",CNT))
QUIT
Begin DoDot:1
+27 SET RX=$GET(QRY("RX",CNT))
+28 SET PORDERN=$PIECE(RX,"^",2)
+29 SET ORDERTM=$PIECE(RX,"^",3)
+30 SET RX=$PIECE(RX,"^")
+31 SET STATUS=$$AP1^PSOPRA(DFN,RX)
+32 SET @DATAROOT@(CNT)=RX_U_STATUS_U_PORDERN_U_ORDERTM
+33 QUIT
End DoDot:1
+34 ;
+35 SET @DATAROOT=CNT-1
+36 DO LOG^MHVUL2("MHVXRXR","END","S","TRACE")
+37 QUIT