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

DVBCXFRB.m

Go to the documentation of this file.
DVBCXFRB ;ALB/GTS-557/THM-LOAD TRANSFER MAIL MESSAGE ; 1/12/19 3:48pm
 ;;2.7;AMIE;**149,193,209**;Apr 10, 1995;Build 17
 ;Per VHA Directive 2004-038, this routine should not be modified.
 ;
EN ;file 2
 N DVBSBRCH,DVBDTYPE
 K ^TMP("DVBCXFR",$J),L S X=^DVB(396.3,REQDA,0),DFN=$P(X,U,1)
 S X=^DPT(DFN,0),PNAM=$P(X,U,1),DOB=$P(X,U,3),SEX=$P(X,U,2),SSN=$P(X,U,9),POBC=$P(X,U,11),POBS=$P(X,U,12)
 S X=$S($D(^DPT(DFN,.11)):^(.11),1:""),ADR1=$P(X,U,1),ADR2=$P(X,U,2),ADR3=$P(X,U,3),CITY=$P(X,U,4),STATE=$P(X,U,5),ZIP=$P(X,U,6),CNTY=$P(X,U,7),ZIP4=$P(X,U,12)
 S CNTY=$S($D(^DIC(5,+STATE,1,+CNTY,0)):$P(^(0),U,1),1:""),STATE=$S($D(^DIC(5,+STATE,0)):$P(^(0),U,1),1:"")
 S X=$S($D(^DPT(DFN,.13)):^(.13),1:"") S HOMPHON=$P(X,U,1),BUSPHON=$P(X,U,2)
 S X=$S($D(^DPT(DFN,.3)):^(.3),1:""),SRVCON=$P(X,U,1),SRVPCT=$P(X,U,2)
 S X=$S($D(^DPT(DFN,.31)):^(.31),1:""),CNUM=$P(X,U,3)
 S CFLOC=$$STATION^DVBAUTL1(DFN)
 S:CFLOC=-1 CFLOC=""
 S X=$S($D(^DPT(DFN,.32)):^(.32),1:""),PDSRV=$P(X,U,3),PDSRV=$S($D(^DIC(21,+PDSRV,0)):$P(^(0),U,3),1:"")
 S X=$$SVC^DVBCUTIL(DFN,"I"),SRVEDT=$P(X,U),SRVSDT=$P(X,U,2)
 S X=$$SVC^DVBCUTIL(DFN,"E"),DVBSBRCH=$P(X,U,3),DVBDTYPE=$P(X,U,4)
 S X=$S($D(^DPT(DFN,.36)):^(.36),1:""),ELIGCOD=$P(X,U,1),ELIGCOD=$S($D(^DIC(8,+ELIGCOD,0)):$P(^(0),U,9),1:"")
 S X=$S($D(^DPT(DFN,.361)):^(.361),1:""),ELIGST=$P(X,U,1),ELIGSDT=$P(X,U,2)
 S X=$S($D(^DPT(DFN,.52)):^(.52),1:""),POWSTAT=$P(X,U,5)
 S X=$S($D(^DPT(DFN,"VET")):^("VET"),1:""),VETST=$P(X,U,1)
 S X=$S($D(^DPT(DFN,"TYPE")):^("TYPE"),1:"") S TYPE=$S(X]"":$P(^DG(391,X,0),U,1),1:"")
 S ICN=$$GETICN^MPIF001(DFN),CSPT=$P($G(^DGSL(38.1,DFN,0)),U,2)
 S PREF=$P($G(^DPT(DFN,"ENR")),"^",2)
 S LINE(1)="$DEM0 "_PNAM_U_DOB_U_SEX_U_SSN_U_POBC_U_POBS_U_ICN_U_PREF_U_CSPT
 ;S LINE(1)="$DEM0 "_PNAM_U_DOB_U_SEX_U_SSN
 S LINE(2)="$DEM1 "_ADR1_U_ADR2_U_ADR3_U_CITY_U_STATE_U_CNTY_U_ZIP_U_HOMPHON_U_BUSPHON_U_ZIP4
 S LINE(3)="$ELIG "_SRVCON_U_SRVPCT_U_CFLOC_U_CNUM_U_PDSRV_U_SRVEDT_U_SRVSDT_U_ELIGCOD_U_ELIGST_U_ELIGSDT_U_POWSTAT_U_VETST_U_TYPE_U_DVBSBRCH_U_DVBDTYPE
 ;
 ;file 396.3
EN1 S X=^DVB(396.3,REQDA,0),RO=$P(X,U,3),RONAM=$P($G(^DIC(4,+RO,99)),U,1),REQDT=$P(X,U,2),FEXM=$P(X,U,9),PRIO=$P(X,U,10),OTHDIS=$P(X,U,11),LREXMDT=$P(X,U,20)
 S X=$S($D(^DVB(396.3,REQDA,1)):^(1),1:""),CFREQ=$P(X,U,2),OTHDOC=$P(X,U,3),LREXMDT=$P(X,U,7),OTHDIS1=$P(X,U,9),OTHDIS2=$P(X,U,10)
 S LINE(4)="$REQ0 "_REQDA_U_RO_U_PRIO_U_CFLOC_U_LREXMDT_U_CFREQ_U_LREXMDT_U_RONAM_U_U_REQDT
 S LINE(5)="$ODIS "_OTHDIS_U_OTHDIS1_U_OTHDIS2
 S EXAMS="$EXAM "_EXAMS,LINE(6)=EXAMS
 ;**NOTE: RONAM is now RO NUMBER
LOAD S L=1,^TMP("DVBCXFR",$J,L,0)="$TRANSFER IN",L=L+1
 F X=1:1 Q:'$D(LINE(X))  S ^TMP("DVBCXFR",$J,L,0)=LINE(X),L=L+1
 F JI=0:0 S JI=$O(^DVB(396.3,REQDA,2,JI)) Q:JI=""  S ^TMP("DVBCXFR",$J,L,0)="$REMK "_^DVB(396.3,REQDA,2,JI,0),L=L+1
 S SITE=$P(^XMB(1,1,0),U,1),SITE1=$P(^DIC(4.2,SITE,0),U,1)
 S USERNM=$P(^VA(200,DUZ,0),U,1),^TMP("DVBCXFR",$J,L,0)="$USER "_USERNM_U_SITE_U_SITE1,L=L+1
 S ^TMP("DVBCXFR",$J,L,0)="$END "
 N XMNODE
 S XMNODE=0
 F X=(L+1):1:(L+XMCNT) DO
 .S XMNODE=XMNODE+1
 .S ^TMP("DVBCXFR",$J,X,0)=XMVAR(XMNODE)
 S ^TMP("DVBCXFR",$J,X+1,0)="$END1 "
 ;
SEND K XMZ
 ;S XMY("POSTMASTER@"_DOMNAM)=DOMNUM
 S XMY(DUZ)="",XMY("S.DVBA C PROCESS MAIL MESSAGE@"_DOMNAM)=DOMNUM,XMSUB="Transfer of C&P Exams",XMTEXT="^TMP(""DVBCXFR"",$J,",XMDUZ=DUZ D ^XMD
 I $D(XMZ) W !!,"Transmitted as message # "_XMZ_" from this site to "_DOMNAM,! H 3
 I '$D(XMZ) W !!,*7,"Message transmission error!",!,"Request WILL NOT be transferred!",!!,"Press RETURN  " R ANS:DTIME S OUT=1 G KILL^DVBCUTIL
 ;if all ok, update main, sub-file
 F III=0:0 S III=$O(XEXAMS(III)) Q:III=""  S DIE="^DVB(396.4,",DA=III,DR=".04///T;62///"_DOMNAM_";60////"_DT_";61///"_USERNM D ^DIE
 K DIE,DA,DR S DIE="^DVB(396.3,",DA=REQDA,DR="31///y;32///N"
 D ^DIE ;set transfer items
 K LINE,DOMNUM,DOMNUM1,^TMP("DVBCXFR",$J),XMDUZ,III,L,JI,JY,XMY,XMZ,XMSUB,XMTEXT,XMDUZ,DIE,DA,DR,TYPE
 G KILL^DVBCUTIL