DVBABEBD ;ALB - CAPRI EXAM BY DATE REPORT;09/13/04 ; 2/10/11 12:12pm
 ;;2.7;AMIE;**57,108,185,190,192**;Apr 10, 1995;Build 15
 ;ALB/RTW - 192 added Claim Type,and Special Consideration(s)
 
Q
 
;
EXAMBYDT(MSG,BEGDT,ENDDT,DVBADLMTR) ; CALLED BY REMOTE PROCEDURE DVBAB EXAMS BY DATE
 
DVBABCNT,DVBABIEN,DVBABPAT,DVBABT,DVBAB0,DVBABT1,DVBABT2,DVBABT3,DVBABT4,DVBABT5,DVBABT6,DFN
 
DVBAA,DVBCNT,DVBX,DVBAD,DVBCTN,DVBCTW,DVBSC,DVBSCC,DVBSCN,DVBSCNS,DVBSCW,DVBSCWA
 
DVBADLMTR=$S($G(DVBADLMTR)=1:",",1:0)
 
DVBAD=DVBADLMTR
 
^TMP("DVBABEBD",DUZSETSTAT
 
I $G(DVBAD)="," D
 
^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)
 
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
 
DVBAB0=$G(^DVB(396.3,DVBABIEN,0)) Q:DVBAB0=""
 
DVBABPAT=$G(^DPT($P(DVBAB0,"^"),0)) Q:DVBABPAT=""
 
DVBABT2=$P($P(DVBAB0,"^",2),".")
 . 
(DVBABT2>(BEGDT-1))&(DVBABT2<(ENDDT+1)) D
 
.. DVBABT1=$P(DVBABPAT,"^",1) ;PATIENT NAME
 
.. DFN=$P(DVBAB0,"^"DEM^VADPT I $G(VADM(1))'="" DVBABT6=$S($G(DVBAD)=",":$P($G(VADM(2)),U,2),1:$P($G(VADM(2)),U,1))  ;SSN
 
.. DVBABT3=$P($P(DVBAB0,"^",14),".";DATE RELEASED
 
.. DVBABT4=$P($P(DVBAB0,"^",16),".";DATE PRINTED BY RO
 
.. DVBABT5=$P(DVBAB0,"^",18) ;REQUEST STATUS
 
.. (DVBCTW,DVBSCWA)="" CLAIMTYP,SPEC
 
.. S:$D(DVBABT(DVBABT5)) DVBABT5=DVBABT(DVBABT5)
 .. 
DVBABT2=$$FMTE^XLFDT(DVBABT2,"5DZ"),DVBABT3=$$FMTE^XLFDT(DVBABT3,"5DZ"),DVBABT4=$$FMTE^XLFDT(DVBABT4,"5DZ")
 .. 
I $G(DVBAD)'="," ^TMP("DVBABEBD",DUZ,DVBABCNT)=DVBABT1_U_DVBABT2_U_DVBABT3_U_DVBABT4_U_DVBABT5_U_DVBABT6_U_DVBCTW_U_DVBSCWA_$C(13)
 .. 
I $G(DVBAD)="," ^TMP("DVBABEBD",DUZ,DVBABCNT)=DVBABT6_DVBADLMTR_""""_DVBABT1_""""_DVBADLMTR_$$FMTE^XLFDT(DVBABT2,"5DZ")_DVBADLMTR_$$FMTE^XLFDT(DVBABT3,"5DZ")_DVBADLMTR_$$FMTE^XLFDT(DVBABT4,"5DZ"D
 
.. .^TMP("DVBABEBD",DUZ,DVBABCNT)=^TMP("DVBABEBD",DUZ,DVBABCNT)_DVBADLMTR_""""_DVBABT5_""""_DVBAD_""""_DVBCTW_""""_DVBAD_""""_DVBSCWA_""""_$C(13)
 .. 
DVBABCNT=DVBABCNT+1
 
Q
 
;
SETSTAT DVBABT("N")="NEW"
 
DVBABT("P")="PENDING, REPORTED"
 
DVBABT("S")="PENDING, SCHEDULED"
 
DVBABT("R")="RELEASED TO RO, NOT PRINTED"
 
DVBABT("C")="COMPLETED, PRINTED BY RO"
 
DVBABT("X")="CANCELLED BY MAS"
 
DVBABT("RX")="CANCELLED BY RO"
 
DVBABT("T")="TRANSCRIBED"
 
DVBABT("NT")="NEW, TRANSFERRED IN"
 
DVBABT("CT")="COMPLETE, TRANSFERRED OUT"
 
Q
CLAIMTYP ;THE CLAIM TYPE OF A 2507 REQUEST
 
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
 
GETS^DIQ(396.3,DVBABIEN_",","9.1*","E","MSG","ERR")
 
DVBCTW=MSG("396.32","1,"_DVBABIEN_",",".01","E")
 
Q
 
;
SPEC ;SPECIAL CONSIDERATION(S) FOR A 2507 REQUEST
 
DVBSCW
 
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
 
DVBAA=$P(^DVB(396.3,DVBABIEN,8,0),U,4)
 
(DVBSC,DVBCNT)=0 F  S DVBSC=$O(^DVB(396.3,DVBABIEN,8,DVBSC)) Q:'DVBSC  D
 
.DVBSCN=$P(^DVB(396.3,DVBABIEN,8,DVBSC,0),U,1)
 .
DVBSCW(DVBSC)=$G(^DVB(396.25,DVBSCN,0))
 .
DVBCNT=DVBCNT+1
 .
(DVBCNT'=DVBAAS:$D(DVBSCW(DVBSC)) DVBSCW(DVBSC)=DVBSCW(DVBSC)_","
 
DVBX="" F  S DVBX=$O(DVBSCW(DVBX)) Q:'DVBX  DVBSCWA=DVBSCWA_DVBSCW(DVBX)
 
Q