source: WorldVistAEHR/trunk/r/CMOP-PSX/PSXRTN.m@ 846

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

initial load of WorldVistAEHR

File size: 5.0 KB
Line 
1PSXRTN ;BIR/WPB,PWC-Queue for the Background Filer at Host Facilities ;MAR 1,2002@16:11:17
2 ;;2.0;CMOP;**32,44**;11 Apr 97
3QUE W !!
4 I $D(^PSX(554,"AB")) S DIR(0)="Y",DIR("A",1)="This job is already scheduled.",DIR("A")="Do you want to unschedule this job",DIR("B")="NO" D ^DIR K DIR G:Y<1!($D(DIRUT)) EXIT G:Y=1 STOPJOB^PSXBKD Q
5 S %DT="AEXR",%DT("A")="Enter starting date/time: ",%DT("B")="NOW" D ^%DT K %DT G:Y<0!($D(DTOUT)) EXIT S PSXDATE=Y K Y,X
6 S ZTDTH=PSXDATE,ZTDESC="CMOP Background Filer CMOP Master Database file",ZTIO="",ZTRTN="DATA^PSXRTN1",ZTSAVE("DUZ")="" D ^%ZTLOAD
7 I $G(ZTSK)>0 W !,"Job Started.",! D
8 .K DD,DO
9 .S:'$D(^PSX(554,1,1,0)) ^PSX(554,1,1,0)="^554.01SA^^"
10 .S DA(1)=1,X=1,DIC(0)="Z",DIC="^PSX(554,"_DA(1)_",1,",DIC("DR")="1////"_PSXDATE_";2////"_ZTSK_";3////S;4////"_DUZ D FILE^DICN K DIC,DIC(0),DIC("DR"),X
11 S ZTREQ="@"
12 Q
13NEXT S FREQ="900S",ZTSK=PSXZTSK,ZTRTN="DATA^PSXRTN1",ZTIO="",ZTDESC="CMOP Automated Release Data Processor",ZTDTH=FREQ D REQ^%ZTLOAD
14 ;D ISQED^%ZTLOAD S:$G(ZTSK(0))=0!($G(ZTSK(0))=1) NXTM=$$HTFM^XLFDT($G(ZTSK("D")))
15 D NOW^%DTC
16 S RE=$O(^PSX(554,"AB","")) S:$G(RE)>0 $P(^PSX(554,1,1,RE,0),"^",9)=%
17 K ZTDESC,ZTRTN,ZTSK,ZTIO,ZTDTH,FREQ,ZTSAVE("DUZ"),ZTREQ,PSXZTSK,RE,%
18EXIT K AF,BB,CC,CNT,COMDT,DIE,DIC,DR,DA,DRUG,EMPID,FILL,I,NPTR,NREC,PSXFM,PSXNDC,PSXTS,QRYID,QTY,REASON,RECDT,REL,RXN,RXSTAT,SNODE,SS,STAT,REL1,DUPFLG,CANFLG,CDT1,RX1,SP,SP2,SP3,XX1,XX2
19 K TNODE,UU,VV,X,XPTR,XREC,XX,XXX,Y,DEL,IEN50,N,NK,NNREC,PSXDATE,COST,STDATE,TIME,XDA,QRYN,ACKTM,ACKT,%,TDT,CANFLG,STOP,LST,LSTQRY,CANF,IDDRG,COST,IEN50,DIROUT,DIR,DIRUT,DTOUT,DUOUT,CDT,LCNT,NXTM
20 Q
21NDRGMSG Q:'$D(^TMP($J,"PSXNDG"))
22 I $$GET1^DIQ(554,1,8)="NO" Q
23 S XMSUB="CMOP DRUG Cost Missing",XMDUZ=.5,XMDUN="CMOP Manager"
24 D XMZ^XMA2 G:XMZ'>0 NDRGMSG
25 S XX2="********************"
26 S LCNT=1,^XMB(3.9,XMZ,2,LCNT,0)="DRUG/Items listed below are missing cost data or are not marked for CMOP.",LCNT=LCNT+1
27 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1,XX1=" "
28 S ^XMB(3.9,XMZ,2,LCNT,0)="DRUG ID COMPLETED DATE RX NUMBER TRANSMISSION",LCNT=LCNT+1
29 S ^XMB(3.9,XMZ,2,LCNT,0)="-------------------------------------------------------------------------------",LCNT=LCNT+1
30 S IDRG="" F S IDRG=$O(^TMP($J,"PSXNDG",IDRG)) Q:IDRG="" S CDT="" F S CDT=$O(^TMP($J,"PSXNDG",IDRG,CDT)) Q:CDT="" D
31 .S CDT1=$$FMTE^XLFDT(CDT,"2D"),RX1=$P(^TMP($J,"PSXNDG",IDRG,CDT),"^",1),SP=" ",SP2=$E(XX1,1,18-$L(CDT1)),SP3=$E(XX1,1,18-$L(RX1))
32 .S ^XMB(3.9,XMZ,2,LCNT,0)=IDRG_SP_CDT1_SP2_RX1_SP3_$P(^TMP($J,"PSXNDG",IDRG,CDT),"^",2),LCNT=LCNT+1
33 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
34 S ^XMB(3.9,XMZ,2,LCNT,0)=XX2_XX2_XX2_$E(XX2,1,$L(XX2)-1),LCNT=LCNT+1
35 S ^XMB(3.9,XMZ,2,LCNT,0)="There is NO ENTRY in DRUG file #50 marked for CMOP Dispense with this ID number",LCNT=LCNT+1
36 S ^XMB(3.9,XMZ,2,LCNT,0)="and/or there is no COST information available.",LCNT=LCNT+1
37 S ^XMB(3.9,XMZ,2,LCNT,0)=XX2_XX2_XX2_$E(XX2,1,$L(XX2)-1),LCNT=LCNT+1
38 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
39 S ^XMB(3.9,XMZ,2,LCNT,0)="Corrective Action: ",LCNT=LCNT+1
40 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 1: Locate the correct entry in DRUG file #50, or create the new entry",LCNT=LCNT+1
41 S ^XMB(3.9,XMZ,2,LCNT,0)=" if necessary. Since the drug/item was filled by the automated",LCNT=LCNT+1
42 S ^XMB(3.9,XMZ,2,LCNT,0)=" system, you can look up the VA Print Name on that system, not",LCNT=LCNT+1
43 S ^XMB(3.9,XMZ,2,LCNT,0)=" DHCP, to determine what the DRUG file #50 entry should be. The",LCNT=LCNT+1
44 S ^XMB(3.9,XMZ,2,LCNT,0)=" remainder of the steps should be done on DHCP.",LCNT=LCNT+1
45 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 2: Be sure the entry is marked for Outpatient use.",LCNT=LCNT+1
46 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 3: Match to the correct NATIONAL DRUG file entry.",LCNT=LCNT+1
47 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 4: Verify the match.",LCNT=LCNT+1
48 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 5: Merge the NDF data into DRUG file #50.",LCNT=LCNT+1
49 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 6: Enter the correct cost information in DRUG file #50.",LCNT=LCNT+1
50 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 7: Run the Cost Update option for the completed date listed to",LCNT=LCNT+1
51 S ^XMB(3.9,XMZ,2,LCNT,0)=" update the CMOP MASTER DATABASE file.",LCNT=LCNT+1
52 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 8: Review prescriptions listed above using the Rx Inquiry option",LCNT=LCNT+1
53 S ^XMB(3.9,XMZ,2,LCNT,0)=" to validate that the cost entry is complete.",LCNT=LCNT+1
54 S ^XMB(3.9,XMZ,2,LCNT,0)=" Step 9: Recompile the cost data for the date(s) listed to pick up the new",LCNT=LCNT+1
55 S ^XMB(3.9,XMZ,2,LCNT,0)=" cost data.",LCNT=LCNT+1
56 S ^XMB(3.9,XMZ,2,LCNT,0)="",LCNT=LCNT+1
57 S ^XMB(3.9,XMZ,2,LCNT,0)=XX2_XX2_XX2_$E(XX2,1,$L(XX2)-1),LCNT=LCNT+1
58 S ^XMB(3.9,XMZ,2,LCNT,0)="** Failure to complete these changes will result in inaccurate cost reports. **",LCNT=LCNT+1
59 S ^XMB(3.9,XMZ,2,LCNT,0)=XX2_XX2_XX2_$E(XX2,1,$L(XX2)-1),LCNT=LCNT+1
60 S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_"^"_LCNT_"^"_DT
61 K XMY D GRP^PSXNOTE D ENT1^XMD
62 G EXIT
Note: See TracBrowser for help on using the repository browser.