1 | PPPPDA1 ;ALB/DMB - PHARMACY DATA ALERT ROUTINE ; 3/2/92
|
---|
2 | ;;V1.0;PHARMACY PRESCRIPTION PRACTICE;**10**;APR 7,1995
|
---|
3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | PDA(PATDFN) ; Pharmacy Data Alert Call
|
---|
6 | ;
|
---|
7 | ; This function determines if the patient has been to other hospitals
|
---|
8 | ; and whether there is any prescription information in the PDX
|
---|
9 | ; data file for the patient. If there is data, the user is given the
|
---|
10 | ; option of viewing it.
|
---|
11 | ;
|
---|
12 | ; Parameters: PATDFN - The patient DFN from the patient file.
|
---|
13 | ;
|
---|
14 | ; Return: 0 - Normal Termination
|
---|
15 | ; -9001 - Input Parameter Format Error
|
---|
16 | ; -9003 - Invalid Patient DFN
|
---|
17 | ;
|
---|
18 | N PARMERR,LKUPERR,XTRCTERR,ALRTIGND,ERR,TARRY,TMP,X,Y
|
---|
19 | ; New DA because XQORM2 will kill it.
|
---|
20 | N DA
|
---|
21 | ;
|
---|
22 | S PARMERR=-9001
|
---|
23 | S LKUPERR=-9003
|
---|
24 | S XTRCTERR=-9010
|
---|
25 | S ALRTIGND=1010
|
---|
26 | S ERR=0
|
---|
27 | S TARRY="^TMP(""PPP"",$J,""ALERT"")"
|
---|
28 | ;
|
---|
29 | I $G(PATDFN)<1 Q PARMERR
|
---|
30 | I '$D(^DPT(PATDFN)) Q LKUPERR
|
---|
31 | ;
|
---|
32 | I $$GETVIS^PPPGET7(PATDFN,TARRY)>0 D
|
---|
33 | .;
|
---|
34 | .; Increment Alert Issued
|
---|
35 | .;
|
---|
36 | .S TMP=$$STATUPDT^PPPMSC1(3,1)
|
---|
37 | .;
|
---|
38 | .I $$VPDAT(PATDFN,TARRY) D
|
---|
39 | ..S TMP=$$STATUPDT^PPPMSC1(4,1)
|
---|
40 | ..S TMP=$$LOGEVNT^PPPMSC1(ALRTIGND,"PDA_PPPPDA1","PATIENT = "_$$GETPATNM^PPPGET1(PATDFN))
|
---|
41 | K @TARRY
|
---|
42 | Q 0
|
---|
43 | ;
|
---|
44 | VPDAT(PATDFN,TARRY) ; View the pharmacy data
|
---|
45 | ;
|
---|
46 | ; This routine displays the other locations and then prompts the
|
---|
47 | ; user for viewing pharmacy data.
|
---|
48 | ;
|
---|
49 | N TMP,DIR,DTOUT,DUOUT,DIRUT,DIROUT,IGNORED,X,Y
|
---|
50 | ;
|
---|
51 | S IGNORED=0
|
---|
52 | W !!
|
---|
53 | ;S TMP=$$POF^PPPPRT8(PATDFN,TARRY)
|
---|
54 | S TMP=$$POF^PPPDSP4(PATDFN,TARRY)
|
---|
55 | Q IGNORED
|
---|
56 | ;
|
---|
57 | PDAI ; Get foreign visit information interactively
|
---|
58 | ;
|
---|
59 | N TMP,TARRY,PATDFN
|
---|
60 | ;
|
---|
61 | S TARRY="^TMP(""PPP"",$J,""FMAI"")"
|
---|
62 | ;
|
---|
63 | F IX1=0:0 D Q:PATDFN<0
|
---|
64 | .S BANNER="Display Pharmacy Data from other Facilities"
|
---|
65 | .S TMP=$$BANNER^PPPDSP1(BANNER) W !!
|
---|
66 | .S PATDFN=+$$GETDFN^PPPGET1("",1)
|
---|
67 | .I PATDFN<0 Q
|
---|
68 | .K ^TMP("PPP",$J,"FMAI") ;Dave B (24June97)
|
---|
69 | .I $$GETVIS^PPPGET7(PATDFN,TARRY) S TMP=$$VPDAT(PATDFN,TARRY)
|
---|
70 | .E D
|
---|
71 | ..W !,*7,"No pharmacy data available from other facilities for this patient."
|
---|
72 | ..R !!,"Press <RETURN> to continue...",TMP:DTIME
|
---|
73 | K @TARRY
|
---|
74 | Q
|
---|