Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRCFARRT

PRCFARRT.m

Go to the documentation of this file.
PRCFARRT ;WISC@ALTOONA/CTB-SEND RECEIVING REPORT TO AUSTIN ;9/21/94  10:52
V ;;5.1;IFCAP;;Oct 20, 2000
 ;Per VHA Directive 10-93-142, this routine should not be modified.
 D:$D(ZTQUEUED) KILL^%ZTLOAD
 I '$D(PRCFA("RETRANS")) D BUILD Q:$G(LCKFLG)  D CREATE Q
 S PRCACT="M"
 D BUILD Q:$G(LCKFLG)
 D RETRANS Q
BUILD ;BUILD MESSAGE IN UTILITY AND TRANSMIT
 S PRCFPO=PRCFA("PODA"),PRCFPR=PRCFA("PARTIAL")
 D EN^PRCFARR Q:$G(LCKFLG) 
 ;SET VARIABLES FOR MAILMAN AND TRANSMIT
 S XMDUZ=$S($D(DUZ)#2:DUZ,1:.5),XMSUB="RECEIVING REPORT "_$P(^PRC(442,PRCFA("PODA"),0),"^",1)_" PARTIAL #: "_PRCFA("PARTIAL"),XMTEXT="^TMP(""PRCFARR"","_$J_","
 ;
 ; Note: CRD was changed to CRT for 5.0 lab testing only.  It needs
 ;       to be changed back before 5.0 is released for Alpha test.
 ;
 S XMY(XMDUZ)=""
 S XMY("XXX@Q-CRD.DOMAIN.EXT")="" ;,DIC=3.8,DIC(0)="MOX",X="CRD" D ^DIC K DIC I Y<0 S XMY(.5)=""
 ;I Y>0 S DA=+Y,D1=0 F I=1:1 S D1=$O(^XMB(3.8,DA,1,"B",D1)) Q:'D1  S XMY(D1)=""
 D ^XMD K ^TMP("PRCFARR",$J) Q
CREATE ;CREATE TRANSMISSION RECORD
 S (X,BATCH)=PRC("SITE")_"-RR-"_$P($P(^PRC(442,PRCFA("PODA"),0),"^"),"-",2)_"-"_PRCFA("PARTIAL")
 S DIC=421.2,DLAYGO=DIC,DIC(0)="MOL" D ^DIC K DIC,DLAYGO Q:Y<0
 S DA=+Y
 D NOW^PRCFQ
 S $P(^PRCF(421.2,DA,0),"^",3,4)="R^"_%X
 S $P(^PRCF(421.2,DA,0),"^",11,12)=DUZ_"^"_XMZ
 K %X,%Y,X,Y
 S MESSAGE=""
 D ENCODE^PRCFAES1(DA,+PRC("PER"),.MESSAGE)
 K MESSAGE
 S ^PRCF(421.2,"D",XMZ,DA)=""
 ;ENTER BATCH # INTO 442
 S $P(^PRC(442,PRCFA("PODA"),11,PRCFA("PARTIAL"),0),"^",19)=BATCH K BATCH
 Q
RETRANS ;CREATE RETRANSMISSION RECORD
 S (X,BATCH)=PRC("SITE")_"-RR-"_$P($P(^PRC(442,PRCFA("PODA"),0),"^"),"-",2)_"-"_PRCFA("PARTIAL")
 S DIC=421.2,DIC(0)="MO" D ^DIC K DIC,DLAYGO G:Y<0 CREATE
 S DA=+Y
 D NOW^PRCFQ
 S XX=^PRCF(421.2,DA,0)
 S $P(XX,"^",4)=%X,$P(XX,"^",12)=XMZ,^PRCF(421.2,DA,0)=XX
 K %X,%Y,X,Y
 D REMOVE^PRCFAES2(DA)
 I $P(XX,"^",12)]"" K ^PRCF(421.2,"D",$P(XX,"^",12),DA)
 S MESSAGE=""
 D ENCODE^PRCFAES2(DA,PRC("PER"),.MESSAGE)
 K MESSAGE
 S ^PRCF(421.2,"D",XMZ,DA)=""
OUT Q
PRINT ;RECEIVING REPORT HISTORY REPORT
 S PRCF("X")="AS" D ^PRCFSITE Q:'%
 S DIC="^PRCF(421.2,",L=0,(BY,FLDS)="[PRCFA RR INQUIRY LISTING]",FR=",?,"_PRC("SITE"),TO=",?,"_PRC("SITE")+1 D EN1^DIP Q