source: WorldVistAEHR/trunk/r/CMOP-PSX/PSXMSGS.m@ 1042

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

initial load of WorldVistAEHR

File size: 4.6 KB
Line 
1PSXMSGS ;BIR/WPB-Miscellaneous Message Handler ;01 JUL 1997 1:55 PM
2 ;;2.0;CMOP;**1,2,4,24,23,27,30,41**;11 Apr 97
3 ;Reference to ^PS(59 supported by DBIA #1976
4 ;Reference to File #200 supported by DBIA #10060
5CAN ;Q:'$D(^TMP("PSXCAN1",$J))
6 S DV="" F S DV=$O(^TMP("PSXCAN1",$J,DV)) Q:DV="" S DIVN=$P(^PS(59,DV,0),"^") D PNM
7 Q
8PNM S XMSUB=DIVN_" CMOP Not Dispensed Rx List, ",XMDUZ=.5,XMDUN="CMOP Manager"
9 D XMZ^XMA2 G:XMZ<0 CAN
10 S LCNT=1,^XMB(3.9,XMZ,2,LCNT,0)="Not Dispensed Rx Report for the "_DIVN_" Division.",LCNT=LCNT+1
11 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
12 S ^XMB(3.9,XMZ,2,LCNT,0)="The following prescriptions were not dispensed by the vendor: ",LCNT=LCNT+1
13 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
14 S DFN="" F S DFN=$O(^TMP("PSXCAN1",$J,DV,DFN)) Q:DFN="" S PNM=$P(^DPT(DFN,0),"^"),SSN1=$P(^DPT(DFN,0),"^",9),SPS=(47-$L(PNM)),PSXSSN=$E(SSN1,1,3)_"-"_$E(SSN1,4,5)_"-"_$E(SSN1,6,9) D
15 .F I=1:1:SPS S SP=$G(SP)_" "
16 .S ^XMB(3.9,XMZ,2,LCNT,0)="Patient: "_PNM_SP_"SSN: "_PSXSSN,LCNT=LCNT+1
17 .S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
18 .S RX1="" F S RX1=$O(^TMP("PSXCAN1",$J,DV,DFN,RX1)) Q:RX1="" D
19 ..S NODE=^TMP("PSXCAN1",$J,DV,DFN,RX1)
20 ..S REASON=$P(NODE,"^",6),BT=$P(NODE,"^",8),FIL=$P(NODE,"^",7)
21 ..S FLL=$S(FIL>0:"REFILL "_FIL,FIL=0:"ORIGINAL",1:"")
22 ..S DRGN=$S($P($G(NODE),"^",1)'="":$P(NODE,"^",1),1:"UNKNOWN")
23 ..S DRGI=$P(NODE,"^",4),CMOPYN=$P(NODE,"^",5),QY=$P(NODE,"^",3)
24 ..S ^XMB(3.9,XMZ,2,LCNT,0)=" Rx #: "_RX1_" "_$S(FIL'>0:"(ORG)",FIL>0:"(REF"_FIL_")",1:"")_" Qty: "_QY_" Trans #: "_BT,LCNT=LCNT+1
25 ..S ^XMB(3.9,XMZ,2,LCNT,0)=" Drug: "_DRGN,LCNT=LCNT+1
26 ..S ^XMB(3.9,XMZ,2,LCNT,0)=" Transmitted under CMOP ID: "_$G(DRGI),LCNT=LCNT+1
27 ..S ^XMB(3.9,XMZ,2,LCNT,0)=" Reason: "_REASON,LCNT=LCNT+1
28 ..I $G(CMOPYN)=1 S ^XMB(3.9,XMZ,2,LCNT,0)=" Note: Local Drug File entry is no longer MARKED for CMOP ",LCNT=LCNT+1
29 ..S:$P(NODE,"^",2)'=$G(DRGI) ^XMB(3.9,XMZ,2,LCNT,0)=" Note: Local Drug File entry is no longer MATCHED to transmitted CMOP I.D. ",LCNT=LCNT+1
30 ..S ^XMB(3.9,XMZ,2,LCNT,0)=" ",LCNT=LCNT+1
31 ..K CMOPYN,FLL,FIL,BT,REASON,DRGI,DRGN,QY,I,SP,SPS,SP1
32 S ^XMB(3.9,XMZ,2,LCNT,0)="Instructions: Prescriptions cannot be processed at CMOP for the reason listed",LCNT=LCNT+1
33 S ^XMB(3.9,XMZ,2,LCNT,0)="above. Please review the prescription and take the appropriate action(s).",LCNT=LCNT+1
34 S ^XMB(3.9,XMZ,2,LCNT,0)="If you have any questions, contact your CMOP contact person.",LCNT=LCNT+1
35 S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_"^"_LCNT_"^"_DT,XMDUN="CMOP Manager"
36 K XMY D GRP S XMDUZ=.5 D ENT1^XMD
37 K XMY,XMDUZ,XMSUB,XMDUN,REASON,RXN,LCNT,XMZ,FILL,FIL,TDT,TDTM,BAT,DOMAIN,PTR,XPTR,FACDOM
38 Q
39INVREL S XMSUB="CMOP Release Return Problems",XMDUZ=DUZ,XMDUN="CMOP Manager"
40 D XMZ^XMA2 G:XMZ<0 INVREL
41 S LCNT=1
42 S RXNN="" F S RXNN=$O(^TMP($J,"PSXINV",RXNN)) Q:RXNN="" D
43 .S ^XMB(3.9,XMZ,2,LCNT,0)=RXNN_" has already been marked as processed",LCNT=LCNT+1
44 S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_"^"_LCNT_"^"_DT,XMDUN="CMOP Manager",XMDUZ=DUZ
45 K XMY S XMY(DUZ)="" D ENT1^XMD
46 Q
47AUTOMSG N TSK D NOW^%DTC S DTE=$$FMTE^XLFDT(%,1),SITE=$P($G(PSXSYS),U,3) K %
48 I $G(PSXCS)'=1 G NONCS ; If not controlled subs
49 D OPTSTAT^XUTMOPT("PSXR SCHEDULED CS TRANS",.TSK)
50 S DTTM=$P($G(TSK(1)),U,2),NUM=+$P($G(TSK(1)),U,3),THRU=$$GET1^DIQ(550,+PSXSYS,12)
51 G MSG1
52NONCS ;
53 D OPTSTAT^XUTMOPT("PSXR SCHEDULED NON-CS TRANS",.TSK)
54 S DTTM=$P($G(TSK(1)),U,2),NUM=+$P($G(TSK(1)),U,3),THRU=$$GET1^DIQ(550,+PSXSYS,11)
55MSG1 S XMDUZ=.5,XMSUB="CMOP "_$S($G(PSXCS)=1:"CS ",1:"")_"Auto-Transmission Schedule",LCNT=1
56 I DTTM S Y=DTTM X ^DD("DD") S DTTM=Y I 1
57 E S DTTM="NONE - Canceled",(NUM,THRU)=""
58 D XMZ^XMA2 G:XMZ<1 AUTOMSG
59 S ^XMB(3.9,XMZ,2,LCNT,0)=$S(DTTM["NONE":"<CANCEL> ",1:"")_$S($G(PSXCS)=1:"CS ",1:"")_"Auto-transmission Schedule.",LCNT=LCNT+1
60 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
61 S ^XMB(3.9,XMZ,2,LCNT,0)="Facility : "_SITE,LCNT=LCNT+1
62 S ^XMB(3.9,XMZ,2,LCNT,0)="Date Initiated : "_$P(DTE,":",1,2),LCNT=LCNT+1
63 S ^XMB(3.9,XMZ,2,LCNT,0)="Begin Automatic Transmissions : "_DTTM,LCNT=LCNT+1
64 S ^XMB(3.9,XMZ,2,LCNT,0)="Number of days to transmit thru: "_$S((($G(THRU)'>0)&(+NUM)):"Current date",1:$G(THRU)),LCNT=LCNT+1
65 S ^XMB(3.9,XMZ,2,LCNT,0)="Scheduling Frequency (hours) : "_NUM,LCNT=LCNT+1
66 S ^XMB(3.9,XMZ,2,LCNT,0)="Initiating Official : "_$$GET1^DIQ(200,DUZ,.01),LCNT=LCNT+1
67 S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_"^"_LCNT_"^"_DT,XMDUN="CMOP Manager"
68 K XMY S XMDUZ=.5
69 D GRP^PSXNOTE
70 ;S XMY(DUZ)=""
71 D ENT1^XMD
72 Q
73GRP I '$D(^XUSEC("PSXMAIL")) G GRP1
74 F MDUZ=0:0 S MDUZ=$O(^XUSEC("PSXMAIL",MDUZ)) Q:MDUZ'>0 S XMY(MDUZ)="",XQA(MDUZ)=""
75 K MDUZ
76 G:'$D(XMY) GRP1
77 Q
78GRP1 F XDUZ=0:0 S XDUZ=$O(^XUSEC("PSXCMOPMGR",XDUZ)) Q:XDUZ'>0 S XMY(XDUZ)="",XQA(XDUZ)=""
79 K XDUZ
80 Q
Note: See TracBrowser for help on using the repository browser.