source: WorldVistAEHR/trunk/r/MY_HEALTHEVET-MHV/MHVXRXR.m@ 613

Last change on this file since 613 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1MHVXRXR ;WAS/GPM - Prescription refill request ; [12/12/07 11:38pm]
2 ;;1.0;My HealtheVet;**2**;Aug 23, 2005;Build 22
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 Q
6 ;
7REQUEST(QRY,ERR,DATAROOT) ; Entry point to request refills
8 ; Walks list of prescriptions calling a pharmacy api AP1^PSOPRA to
9 ; add the prescription to the internet refill request queue in the
10 ; PRESCRIPTION REFILL REQUEST file #52.43. The status of the api
11 ; call is returned in DATAROOT.
12 ;
13 ; Integration Agreements:
14 ; 3768 : AP1^PSOPRA
15 ;
16 ; Input:
17 ; QRY - Query array
18 ; QRY(DFN) - (required) Pointer to PATIENT (#2) file
19 ; DATAROOT - Root of array to hold extract data
20 ;
21 ; Output:
22 ; DATAROOT - Populated data array, includes # of hits
23 ; ERR - Errors during extraction
24 ;
25 N CNT,RX,PORDERN,ORDERTM,STATUS,DIV,DFN,U
26 ;
27 D LOG^MHVUL2("MHVXRXR","BEGIN","S","TRACE")
28 S U="^"
29 S ERR=0
30 K @DATAROOT
31 S DFN=$G(QRY("DFN"))
32 ;
33 F CNT=1:1 Q:'$D(QRY("RX",CNT)) D
34 . S RX=$G(QRY("RX",CNT))
35 . S PORDERN=$P(RX,"^",2)
36 . S ORDERTM=$P(RX,"^",3)
37 . S RX=$P(RX,"^")
38 . S STATUS=$$AP1^PSOPRA(DFN,RX)
39 . S @DATAROOT@(CNT)=RX_U_STATUS_U_PORDERN_U_ORDERTM
40 . Q
41 ;
42 S @DATAROOT=CNT-1
43 D LOG^MHVUL2("MHVXRXR","END","S","TRACE")
44 Q
Note: See TracBrowser for help on using the repository browser.