source: FOIAVistA/trunk/r/CMOP-PSX/PSXRTRA1.m@ 1726

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

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1PSXRTRA1 ;BIR/PDW-RETRANSMISSION REPORT SUBROUTINE ;11 AUG 2002
2 ;;2.0;CMOP;**41,51**;11 Apr 97
3 ;Reference to ^PSRX( supported by DBIA #1977
4REPORT ;
5 K ^TMP($J,"PSXRTRPT"),LSSN S CNT=21
6 S PTNM="" F S PTNM=$O(^PSX(550.2,OLDBAT,15,"C",PTNM)) Q:PTNM="" D
7 . S DFN=0 F S LSSN="" S DFN=$O(^PSX(550.2,OLDBAT,15,"C",PTNM,DFN)) Q:DFN'>0 D RXS
8 D MM
9 K PTNM,RXPTR,XSTAT
10 Q
11RXS ;
12 S RXPTR=0 F S RXPTR=$O(^PSX(550.2,OLDBAT,15,"C",PTNM,DFN,RXPTR)) Q:RXPTR="" D
13 . S FILL=$O(^PSX(550.2,OLDBAT,15,"C",PTNM,DFN,RXPTR,""))
14 . D TXT
15 Q
16MM S XMSUB="CMOP Retransmission Report for "_$G(OLDBATNM),XMDUZ=.5,XMDUN="CMOP Managers"
17 D XMZ^XMA2 G:$G(XMZ)'>0 MM
18 S ^XMB(3.9,XMZ,2,1,0)="CMOP Re-Transmission Report"
19 S ^XMB(3.9,XMZ,2,2,0)=$G(PSXBATNM)_" Re-Transmission of "_$G(OLDBATNM)
20 S ^XMB(3.9,XMZ,2,3,0)=" "
21 S ^XMB(3.9,XMZ,2,4,0)="The Original Transmission # "_$G(OLDBATNM)_" contained:"
22 S ^XMB(3.9,XMZ,2,5,0)="Beginning Message Number: "_$P(^PSX(550.2,OLDBAT,1),"^",5)
23 S ^XMB(3.9,XMZ,2,6,0)="Ending Message Number : "_$P(^PSX(550.2,OLDBAT,1),"^",6)
24 S ^XMB(3.9,XMZ,2,7,0)="Total Orders : "_$P(^PSX(550.2,OLDBAT,1),"^",7)
25 S ^XMB(3.9,XMZ,2,8,0)="Total Rx's : "_$P(^PSX(550.2,OLDBAT,1),"^",8)
26 S ^XMB(3.9,XMZ,2,9,0)=" "
27 S ^XMB(3.9,XMZ,2,10,0)="Retransmission # "_$G(PSXBATNM)_" contained:"
28 S ^XMB(3.9,XMZ,2,11,0)="Beginning Message Number: "_$G(MCT)
29 S ^XMB(3.9,XMZ,2,12,0)="Ending Message Number : "_$G(LMSG)
30 S ^XMB(3.9,XMZ,2,13,0)="Total Orders : "_$G(PSXMSGCT)
31 S ^XMB(3.9,XMZ,2,14,0)="Total Rx's : "_$G(PSXRXCT)
32 S ^XMB(3.9,XMZ,2,15,0)=" "
33 S ^XMB(3.9,XMZ,2,16,0)="Following is a list of the original prescription orders and their status."
34 S ^XMB(3.9,XMZ,2,17,0)="** Prescriptions that have been refilled or released are not sent. **"
35 I '$D(^TMP($J,"PSXRTRPT")) S ^XMB(3.9,XMZ,17,0)="All prescriptions were transmitted" S CNT=17 G MAIL
36 F JJ=18,19,20 S ^XMB(3.9,XMZ,2,JJ,0)=" "
37 S XX="Patient",Y="SSN",XX=$$SETSTR^VALM1("SSN",XX,25,3)
38 S XX=$$SETSTR^VALM1("RX",XX,40,2),XX=$$SETSTR^VALM1("RELEASE DATE | FILL'=",XX,55,21)
39 S ^XMB(3.9,XMZ,2,21,0)=XX
40 M ^XMB(3.9,XMZ,2)=^TMP($J,"PSXRTRPT","MM")
41MAIL ;
42 S ^XMB(3.9,XMZ,2,0)="^3.92A^"_CNT_"^"_CNT_"^"_DT
43 K XMY
44 S XMY(DUZ)="" ;****TESTING
45 D GRP^PSXNOTE ;****TESTING
46 D ENT1^XMD
47 Q
48TXT ; store PAT & RX info for mail message
49 D DEM^VADPT S SSN=$P(VADM(2),U,2),PATNM=VADM(1)
50 S RXNM=$P(^PSRX(RXPTR,0),U)_"-"_FILL
51 S XSTAT=""
52 I '$D(^PSX(550.2,PSXBAT,15,"B",RXPTR)) D
53 .S XSTAT=$$TESTREL^PSXRTRAN(RXPTR,FILL)
54 .S:XSTAT="SENT" XSTAT="OTHER"
55 S XX=""
56 I $G(LSSN)'=SSN D
57 . S XX=$E(PATNM,1,23)
58 . S XX=$$SETSTR^VALM1(SSN,XX,25,$L(SSN))
59 S XX=$$SETSTR^VALM1(RXNM,XX,40,$L(RXNM))
60 S:$L(XSTAT) XX=$$SETSTR^VALM1(XSTAT,XX,60,$L(XSTAT))
61 S CNT=$G(CNT)+1,LSSN=SSN
62 S ^TMP($J,"PSXRTRPT","MM",CNT,0)=XX
63 Q
64CANMSG ; lock on 550.1 not achieved send transmission cancelled message
65 S PSXCS=+$G(PSXCS)
66 S XMSUB=$S($G(PSXCS):"",1:"NON-")_"CS Retransmission Cancelled"
67 S XMTEXT="TXT("
68 S TXT(1,0)="The "_$S($G(PSXCS):"",1:"NON-")_"CS Manual Transmission was cancelled "_$$GET1^DIQ(550.2,OLDBAT,.01)
69 S TXT(2,0)="It could not obtain a lock on the RX QUEUE file. #550.1"
70 S TXT(3,0)="This indicates that a transmission was in progress."
71 S TXT(6,0)=" "
72 S TXT(7,0)="If you are getting this message frequently, please contact your IRM Group"
73 D EN^PSXNOTE ;****TESTING
74 D ^XMD
75 Q
76SETSTAT ;Set RX CMOP status to re-transmitted
77 N RXDA,CMPDA
78 S RXDA=0 F S RXDA=$O(^PSX(550.2,PSXBAT,15,"B",RXDA)) Q:RXDA'>0 D
79 . S CMPDA=$O(^PSRX(RXDA,4,"B",OLDBAT,0)) Q:'CMPDA
80 . Q:'CMPDA Q:'$D(^PSRX(RXDA,4,CMPDA,0))
81 . S $P(^PSRX(RXDA,4,CMPDA,0),U,4)=2
82 Q
Note: See TracBrowser for help on using the repository browser.