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

DVBCTPD2.m

Go to the documentation of this file.
DVBCTPD2 ;ALB/BG - CAPRI XML RPCS; FEB 6, 2023@16:20 ; 10/4/23 10:07am
 ;;2.7;AMIE;**250**;Apr 10, 1995;Build 19
 ; Per VHA Directive 6402 this routine should not be modified
 ; Reference to $$NOW^XLFDT and $$FMTE^XLFDT in ICR #10103
 Q
 ;
TRANSRPT(DVBRTN,DVBIEN,DVBSDT,DVBEDT) ;
 K ^TMP("CAPRI TRANSRPT",$J) S DVBCNNT=""
 I DVBIEN'="" D 
 .S DVBCT=0 F  S DVBCT=$O(^DVB(396.17,DVBIEN,14,"B",DVBCT)) Q:DVBCT=""  D
 ..S DVBINN1=""_DVBCT_","_DVBIEN_","_""
 ..S DVBSTA=$$GET1^DIQ(396.1726,DVBINN1,".02","E")
 ..S DVBNAME=$$GET1^DIQ(396.1726,DVBINN1,".03","I")
 ..I DVBNAME?.N S DVBNAME=$$GET1^DIQ(396.1726,DVBINN1,".03","E")
 ..S DVBPT=$$GET1^DIQ(396.17,DVBIEN,".01","E")
 ..S DVBCNT=0 F  S DVBCNT=$O(^DVB(396.17,DVBIEN,14,DVBCT,10,"B",DVBCNT)) Q:DVBCNT=""  D
 ...S DVBINN2=""_DVBCNT_","_DVBCT_","_DVBIEN_","_""
 ...S DVBAUTH=$$GET1^DIQ(396.2026,DVBINN2,".03","E")
 ...S DVBTRDT=$$GET1^DIQ(396.2026,DVBINN2,".02","E")
 ...S DVBRESP=$$GET1^DIQ(396.2026,DVBINN2,".04","E")
 ...S DVBCNNT=DVBCNNT+1 S ^TMP("CAPRI TRANSRPT",$J,DVBNAME,DVBTRDT,DVBCNNT)=DVBNAME_U_DVBPT_U_DVBAUTH_U_DVBTRDT_U_DVBSTA_U_DVBRESP
 ...Q
 .S DVBRTN=$NA(^TMP("CAPRI TRANSRPT",$J))
 .Q
 ;;
 I DVBIEN="" D
 .S DVBDT=$$NOW^XLFDT
 .I DVBSDT="",DVBEDT="" S DVBRTN="-1^MISSING DATE RANGE" Q
 .S X=$G(DVBSDT) D ^%DT S DVBSDT=Y
 .I DVBEDT'="" S X=DVBEDT D ^%DT S DVBEDT=Y
 .I DVBEDT="" S DVBEDT=$P(DVBDT,".",1)
 .S DVBIEN=0 F  S DVBIEN=$O(^DVB(396.17,DVBIEN)) Q:DVBIEN=""  D
 ..S DVBCT=0 F  S DVBCT=$O(^DVB(396.17,DVBIEN,14,"B",DVBCT)) Q:DVBCT=""  D
 ...S DVBINN1=""_DVBCT_","_DVBIEN_","_""
 ...S DVBCNT=0 F  S DVBCNT=$O(^DVB(396.17,DVBIEN,14,DVBCT,10,"B",DVBCNT)) Q:DVBCNT=""  D
 ....S DVBINN2=""_DVBCNT_","_DVBCT_","_DVBIEN_","_""
 ....S DVBCHKDT=$$GET1^DIQ(396.2026,DVBINN2,".02","I")
 ....S DVBCHKDT=$P(DVBCHKDT,".",1)
 ....I DVBCHKDT<DVBSDT Q
 ....I DVBCHKDT>DVBEDT Q 
 ....S DVBTRDT=$$GET1^DIQ(396.2026,DVBINN2,".02","E")
 ....S DVBSTA=$$GET1^DIQ(396.1726,DVBINN1,".02","E")
 ....S DVBNAME=$$GET1^DIQ(396.1726,DVBINN1,".03","I")
 ....I DVBNAME?.N S DVBNAME=$$GET1^DIQ(396.1726,DVBINN1,".03","E")
 ....S DVBPT=$$GET1^DIQ(396.17,DVBIEN,".01","E")
 ....S DVBAUTH=$$GET1^DIQ(396.2026,DVBINN2,".03","E")
 ....S DVBRESP=$$GET1^DIQ(396.2026,DVBINN2,".04","E")
 ....S DVBCNNT=DVBCNNT+1 S ^TMP("CAPRI TRANSRPT",$J,DVBNAME,DVBTRDT,DVBCNNT)=DVBNAME_U_DVBPT_U_DVBAUTH_U_DVBTRDT_U_DVBSTA_U_DVBRESP
 ....Q
 .S DVBRTN=$NA(^TMP("CAPRI TRANSRPT",$J))
 .Q
 K DVBCNNT,X,Y,DVBCT,DVBINN1,DVBSTA,DVBNAME,DVBPT,DVBCNT,DVBINN2,DVBAUTH,DVBTRDT,DVBRESP,DVBCHKDT,DVBDT
 Q
ZIP(DVBRTN,DVBZIP,DVBUUID) ; 
 N DVBINS,DVBDATA,DVBNAME,DVBDNS,DVBPORT,DVBTELE K DVBRTN
 S DVBINS="" S DVBINS=$O(^DIZ(396.98,"D",DVBZIP,DVBINS))
 I '$D(DVBINS) S DVBRTN="0^NO INSTITUTION SERVICES THAT ZIPCODE" Q
 S DVBNAME=$$GET1^DIQ(396.98,DVBINS,".01","E")
 S DVBSTAT=$$GET1^DIQ(396.98,DVBINS,".01","I")
 S DVBDNS=$$GET1^DIQ(396.98,DVBINS,"1","I")
 S DVBPORT=$$GET1^DIQ(396.98,DVBINS,"2","I")
 S DVBTELE=$$GET1^DIQ(396.98,DVBINS,"4","I")
 S DVBRTN=DVBNAME_U_DVBSTAT_U_DVBDNS_U_DVBPORT_U_DVBTELE
 Q
 ;