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

DVBCENQ.m

Go to the documentation of this file.
DVBCENQ ;ALB/GTS-557/THM-2507 INQUIRY ; 1/3/23 12:33pm
 ;;2.7;AMIE;**209,212,220,243**;Apr 10, 1995;Build 13
 ;
 ; Per VHA Directive 6402 this routine should not be modified
 ; Reference to GET^XPAR in ICR #2263
 ; Reference to OWNSKEY^XUSER in ICR #3277
 ; Reference to UP^XLFSTR in ICR #10104
 ;
 G EN
PRINT D VARS^DVBCUTIL,^DVBCENQ1
 I $D(ZTQUEUED) G EXIT ;entry point for TaskMan
 S (NAME,SSN,CNUM,ADR1,ADR2,ADR3,CITY,STATE,ZIP,HOMPHON,BUSPHON,OTHDIS)=""
 Q
 ;
EN K ^TMP($J) S Y=DT X ^DD("DD") S FDT(0)=Y D HOME^%ZIS S FF=IOF
 W @FF,"2507 Request Inquiry",!!!
 S DIC="^DVB(396.3,",DIC(0)="AEQM",DIC("W")="W ""    Date of request: "" S DVBCDT=$P(^(0),U,2) W $E(DVBCDT,4,5)_""/""_$E(DVBCDT,6,7)_""/""_$E(DVBCDT,2,3)",DIC("A")="Enter VETERAN NAME: " D ^DIC G:X=""!(X=U) EXIT
 I +Y<0 W "  ???",*7 G EN
 S JI=$P(Y,U,2),(DA,DA(1),REQDA)=+Y
 ;
DEVICE W ! S %ZIS="AEQ",%ZIS("B")="HOME",%ZIS("A")="Output device: " D ^%ZIS G:POP EXIT
 I $D(IO("Q")) S ZTRTN="PRINT^DVBCENQ",ZTIO=ION,ZTDESC="C&P Request Inquiry" F I="FDT(0)","DA*","REQDA","DVBC*","Y","JI","DUZ","FDT(0)" S ZTSAVE(I)=""
 I  D ^%ZTLOAD G:'$D(ZTSK) EXIT W !!,"Request queued",!! G EXIT
 U IO D PRINT D ^%ZISC G EN
 ;
EXIT K ^TMP($J),TSTA1,TSTAT,XCNP
 D:$D(ZTQUEUED) KILL^%ZTLOAD G KILL^DVBCUTIL
 ;
EDIPIQ(Y,DFN) ; 
 K Y,DVEDIPI S Y=""
 I '$D(DFN) S Y=0 Q
 S DVBED="" F  S DVBED=$O(^DGCN(391.91,"B",DFN,DVBED)) D  Q:DVBED=""
 .Q:DVBED=""
 .I $P($G(^DGCN(391.91,DVBED,2)),U)'["DOD" Q
 .S DVEDIPI=$P(^DGCN(391.91,DVBED,2),U,2)
 S Y=$G(DVEDIPI) I Y="" S Y=0
 Q
EDIPIQ2(DVBRTN,DFN) ;
 K DVBRTN,DVEDIPI S DVBRTN=""
 N DVBED,DVBBOS,DVEDIPI,VASV
 I $G(DFN)="" S DVBRTN=0 Q
 S DVBED="" F  S DVBED=$O(^DGCN(391.91,"B",DFN,DVBED)) D  Q:DVBED=""
 .Q:DVBED=""
 .I $P($G(^DGCN(391.91,DVBED,2)),U)'["DOD" Q
 .S DVEDIPI=$P(^DGCN(391.91,DVBED,2),U,2)
 S DVBRTN=$G(DVEDIPI) I DVBRTN="" S DVBRTN=0
 D SVC^VADPT
 S DVBBOS=$P($G(VASV(6,1)),U,2) I DVBBOS="" S DVBBOS=0
 S DVBRTN=$G(DVBRTN)_"^"_$G(DVBBOS)
 D KVAR^VADPT
 Q
SELFREF(DVBDBQ,DFN) ;
 K DVBDBQ S DVBDBQ=""
 N DVBED,DVBSF,DVBDT,X1,X2,X,CNT,DVBYR,DVBYEAR
 I $G(DFN)="" S DVBDBQ=0 Q
 S CNT=0
 S DVBDT="" F  S DVBDT=$O(^DVB(396.17,"C",DVBDT),-1) D  Q:DVBDT=""
 .S X1=DT,X2=DVBDT,DVBYR=365
 .S DVBYEAR=+$E(DT,1,3)+1700 I $$LEAPYEAR(DVBYEAR) S DVBYR=366
 .D ^%DTC I X>DVBYR Q
 .Q:DVBDT=""
 .S DVBED="" F  S DVBED=$O(^DVB(396.17,"C",DVBDT,DVBED)) D  Q:DVBED=""
 ..S DVBDFN=$$GET1^DIQ(396.17,DVBED,".01","I") I DVBDFN'=DFN Q
 ..S DVBSF=$$GET1^DIQ(396.17,DVBED,"25","I") Q:DVBSF'="Y"
 ..S CNT=CNT+1 S DVBDBQ(CNT)=$$FMTE^XLFDT(DVBDT,"5D")_" "_$$GET1^DIQ(396.17,DVBED,"9","I")
 ..Q
 Q
LEAPYEAR(YEAR) ;
 N RETVAL S RETVAL=0
 I YEAR#400=0 S RETVAL=1
 I YEAR#100=0 S RETVAL=0
 I YEAR#4=0 S RETVAL=1
 Q RETVAL
EFOLDER(DVBRTN,DFN) ;
 ;return is 0, 1 or -1
 K DVBRTN S DVBRTN=""
 I $G(DFN)="" S DVBRTN="-1^MISSING DFN" Q
 N DVBVBA,DVBTIT,DVBLIST,DVNCT,DVBTT
 S DVBRTN=0
 S DVBVBA=$$GET1^DIQ(200,DFN,29)
 S DVBVBA=$$UP^XLFSTR(DVBVBA)
 I $G(DVBVBA)["VBA" S DVBRTN=1 Q
 S DVBTIT=$$GET1^DIQ(200,DFN,8) D
 .I $G(DVBTIT)="" Q
 .S DVBTIT=$$UP^XLFSTR(DVBTIT)
 .S DVBLIST=$$GET^XPAR("PKG","DVBAB CAPRI VHA TITLE",1,"Q")
 .I $D(DVBLIST) D
 ..S DVNCT=0
 ..F  S DVNCT=DVNCT+1 S DVBTT=$P(DVBLIST,"*",DVNCT)  Q:DVBTT=""  D
 ...I DVBTT[DVBTIT S DVBRTN=1 Q
 ..Q
 Q
LOCATION(DVBRTN) ;
 K DVBRTN S DVBRTN=""
 S DVBRTN=$$GET^XPAR("PKG","DVBAB CAPRI EFOLDER LOCATION",1,"Q")
 Q
PROVIDER(DVBRTN,DFN) ;
 K DVBRTN S DVBRTN=0
 N DVBPROV,DVBPROV2
 S DVBPROV="" D OWNSKEY^XUSRB(.DVBPROV,"PROVIDER",DFN) I $G(DVBPROV(0))=1 S DVBRTN=1 Q
 S DVBPROV2="" D OWNSKEY^XUSRB(.DVBPROV2,"XUORES",DFN) I $G(DVBPROV2(0))=1 S DVBRTN=1 Q
 Q