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

DVBABEBD.m

Go to the documentation of this file.
DVBABEBD ;ALB - CAPRI EXAM BY DATE REPORT;09/13/04 ; 2/10/11 12:12pm
 ;;2.7;AMIE;**57,108,185,190,192,193**;Apr 10, 1995;Build 84
 ;ALB/RTW - 192 added Claim Type,and Special Consideration(s)
 Q
 ;
EXAMBYDT(MSG,BEGDT,ENDDT,DVBADLMTR) ; CALLED BY REMOTE PROCEDURE DVBAB EXAMS BY DATE
 N DVBABCNT,DVBABIEN,DVBABPAT,DVBABT,DVBAB0,DVBABT1,DVBABT2,DVBABT3,DVBABT4,DVBABT5,DVBABT6,DFN
 N DVBAA,DVBCNT,DVBX,DVBAD,DVBCTN,DVBCTW,DVBSC,DVBSCC,DVBSCN,DVBSCNS,DVBSCW,DVBSCWA,VADM
 ; GRE;  Reroute information added to report and CSV file
 N RRIENINC,RRSTATINC,RRSTAT,RRDATE,RRTOSITE,RRFRMSITE,RRSTATDTE
 S DVBADLMTR=$S($G(DVBADLMTR)=1:",",1:0)
 S DVBAD=DVBADLMTR
 ; AJF ; Request Status Conversion; removed call to SETSTAT 
 K ^TMP("DVBABEBD",DUZ)
 I $G(DVBAD)="," D
 . S ^TMP("DVBABEBD",DUZ,1)="SSN"_DVBAD_"PATIENT NAME"_DVBAD_"REQUEST DATE"_DVBAD_"DATE RELEASED"_DVBAD_"DATE PRINTED BY RO"_DVBAD_"REQUEST STATUS"_DVBAD_"CLAIM TYPE"_DVBAD_"SPECIAL CONSIDERATION(S)"_$C(13)
 S DVBABCNT=$S(DVBAD'=",":1,1:2),DVBABIEN=0,MSG=$NA(^TMP("DVBABEBD",DUZ))
 F  S DVBABIEN=$O(^DVB(396.3,DVBABIEN)) Q:+DVBABIEN=0  D
 . ;REQUEST DATE
 . S DVBAB0=$G(^DVB(396.3,DVBABIEN,0)) Q:DVBAB0=""
 . S DVBABPAT=$G(^DPT($P(DVBAB0,"^"),0)) Q:DVBABPAT=""
 . S DVBABT2=$P($P(DVBAB0,"^",2),".")
 . I (DVBABT2>(BEGDT-1))&(DVBABT2<(ENDDT+1)) D
 .. S DVBABT1=$P(DVBABPAT,"^",1) ;PATIENT NAME
 .. S DFN=$P(DVBAB0,"^") D DEM^VADPT I $G(VADM(1))'="" S DVBABT6=$S($G(DVBAD)=",":$P($G(VADM(2)),U,2),1:$P($G(VADM(2)),U,1))  ;SSN
 .. S DVBABT3=$P($P(DVBAB0,"^",14),".") ;DATE RELEASED
 .. S DVBABT4=$P($P(DVBAB0,"^",16),".") ;DATE PRINTED BY RO
 .. S DVBABT5=$P(DVBAB0,"^",18) ;REQUEST STATUS
 .. S (DVBCTW,DVBSCWA)="" D CLAIMTYP,SPEC
 .. ;AJF ; Request Status Conversion
 .. S DVBABT5=$$RTSTAT^DVBCUTL8(DVBABT5)
 .. S DVBABT2=$$FMTE^XLFDT(DVBABT2,"5DZ"),DVBABT3=$$FMTE^XLFDT(DVBABT3,"5DZ"),DVBABT4=$$FMTE^XLFDT(DVBABT4,"5DZ")
 .. I $G(DVBAD)'="," S ^TMP("DVBABEBD",DUZ,DVBABCNT)=DVBABT1_U_DVBABT2_U_DVBABT3_U_DVBABT4_U_DVBABT5_U_DVBABT6_U_DVBCTW_U_DVBSCWA_$C(13)
 .. I $G(DVBAD)="," S ^TMP("DVBABEBD",DUZ,DVBABCNT)=DVBABT6_DVBADLMTR_""""_DVBABT1_""""_DVBADLMTR_$$FMTE^XLFDT(DVBABT2,"5DZ")_DVBADLMTR_$$FMTE^XLFDT(DVBABT3,"5DZ")_DVBADLMTR_$$FMTE^XLFDT(DVBABT4,"5DZ") D
 .. .S ^TMP("DVBABEBD",DUZ,DVBABCNT)=^TMP("DVBABEBD",DUZ,DVBABCNT)_DVBADLMTR_""""_DVBABT5_""""_DVBAD_""""_DVBCTW_""""_DVBAD_""""_DVBSCWA_""""_$C(13)
 .. S DVBABCNT=DVBABCNT+1
 Q
 ;
CLAIMTYP ;THE CLAIM TYPE OF A 2507 REQUEST
 S DVBCTW=""
 Q:'$D(^DVB(396.3,DVBABIEN,9,0))
 ;DVBIEN is the 2507 REQUEST FILE IEN
 ;DVBCTW is the string /name of the CLAIM TYPE
 D GETS^DIQ(396.3,DVBABIEN_",","9.1*","E","MSG","ERR")
 S DVBCTW=MSG("396.32","1,"_DVBABIEN_",",".01","E")
 Q
 ;
SPEC ;SPECIAL CONSIDERATION(S) FOR A 2507 REQUEST
 K DVBSCW
 S DVBSCWA=""
 Q:'$D(^DVB(396.3,DVBABIEN,8))
 ;DVBABIEN is the 2507 REQUEST FILE IEN
 ;DVBSC is a the SPECIAL CONSIDERATION entry for the 2507 REQUEST
 ;DVBSCN is the pointer number to the SPECIAL CONSIDERATION file 396.25
 ;DVBSCW is the string /name of the SPECIAL CONSIDERATION
 S DVBAA=$P(^DVB(396.3,DVBABIEN,8,0),U,4)
 S (DVBSC,DVBCNT)=0 F  S DVBSC=$O(^DVB(396.3,DVBABIEN,8,DVBSC)) Q:'DVBSC  D
 .S DVBSCN=$P(^DVB(396.3,DVBABIEN,8,DVBSC,0),U,1)
 .S DVBSCW(DVBSC)=$G(^DVB(396.25,DVBSCN,0))
 .S DVBCNT=DVBCNT+1
 .I (DVBCNT'=DVBAA) S:$D(DVBSCW(DVBSC)) DVBSCW(DVBSC)=DVBSCW(DVBSC)_","
 S DVBX="" F  S DVBX=$O(DVBSCW(DVBX)) Q:'DVBX  S DVBSCWA=DVBSCWA_DVBSCW(DVBX)
 Q
 ;