source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOATRF1.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 1.4 KB
Line 
1PSOATRF1 ;BIR/MHA - Automate Internet Refill Cont ;07/24/07
2 ;;7.0;OUTPATIENT PHARMACY;**264**;DEC 1997;Build 19
3 ;Reference ^PSDRUG supported by DBIA 221
4 ;
5SMAIL ;
6 S ZZ="PSOATRF"
7 S DV="" F S DV=$O(^XTMP(ZZ,$J,DV)) Q:DV="" S DIVN=$P(^PS(59,DV,0),U) D BMAIL
8 K ^TMP(ZZ,$J)
9 Q
10 ;
11BMAIL ;
12 K ^TMP(ZZ,$J)
13 S XMSUB=DIVN_" Internet Refills Not Processed List, ",XMDUZ=.5,XMDUN="Pharmacy Manager"
14 S LC=1,^TMP(ZZ,$J,LC)="Internet Refills Not Processed Report for the "_DIVN_" Division.",LC=LC+1
15 S ^TMP(ZZ,$J,LC)="",LC=LC+1
16 S ^TMP(ZZ,$J,LC)="The following refill requests were not processed: ",LC=LC+1
17 S ^TMP(ZZ,$J,LC)="",LC=LC+1
18 S DFN="" F S DFN=$O(^XTMP(ZZ,$J,DV,DFN)) Q:DFN="" D
19 .D PID^VADPT
20 .S ^TMP(ZZ,$J,LC)="Patient: "_$P(^DPT(DFN,0),U)_" SSN: "_$G(VA("BID")),LC=LC+1
21 .S ^TMP(ZZ,$J,LC)="",LC=LC+1
22 .S RX="" F S RX=$O(^XTMP(ZZ,$J,DV,DFN,RX)) Q:RX="" D
23 ..I '$D(^PSRX(RX,0)) S ^TMP(ZZ,$J,LC)="There is no data for IEN #: "_RX,LC=LC+1 Q
24 ..S RX0=^PSRX(RX,0)
25 ..S ^TMP(ZZ,$J,LC)=" Rx #: "_$P(RX0,U)_" (REF #"_(1+$$LSTRFL^PSOBPSU1(RX))_") Qty: "_$P(RX0,U,7),LC=LC+1
26 ..S ^TMP(ZZ,$J,LC)=" Drug: "_$S($P(^PSDRUG($P(RX0,U,6),0),U)]"":$P(^PSDRUG($P(RX0,U,6),0),U),1:"UNKNOWN"),LC=LC+1
27 ..S ^TMP(ZZ,$J,LC)=" Reason: "_^XTMP(ZZ,$J,DV,DFN,RX),LC=LC+1
28 ..S ^TMP(ZZ,$J,LC)=" ",LC=LC+1 S ^TMP(ZZ,$J,LC)=" ",LC=LC+1
29 D GRP^PSOATRF
30 S:'$O(XMY(0)) XMY(DUZ)=""
31 S XMTEXT="^TMP(""PSOATRF"",$J," N DIFROM D ^XMD K XMDUZ,XMTEXT,XMSUB
32 Q
33 ;
Note: See TracBrowser for help on using the repository browser.