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

DVBAB98.m

Go to the documentation of this file.
  1. DVBAB98 ;ALB/SPH - CAPRI CONVERSION OF DVBARAD1 FOR SUPPORT ; 3/22/12 8:33am
  1. ;;2.7;AMIE;**35,149,179,185**;Apr 10, 1995;Build 18
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. S ZX="PENSION ",ZY="A & A "
  1. S MSG="" F ZZ=1:1:7 S MSG=MSG_ZX
  1. S MSG1="" F ZZ=1:1:7 S MSG1=MSG1_ZY
  1. U IO K DVBAQUIT
  1. F DVBAT="PEN","A&A" W:((IOST?1"C-".E)!(IOST'?1"P-OTHER".E)) @IOF W !!!!!!!!!! D PRINT Q:$D(DVBAQUIT)
  1. S ZMSG=$NA(^TMP("DVBAR",$J))
  1. G KILL
  1. ;
  1. PRINTB S DATA1=$S($D(^TMP("DVBA",DVBAT,$J,SORTDT,XCN,XCFLOC,K,DA,"LADM")):^("LADM"),1:"") S (LADMDT,ADMDT)=$P(DATA1,U),LTDIS=$P(DATA1,U,2),DFN=DA,QUIT1=1 K DATA1 D ADM^DVBAVDPT K QUIT1,DVBAQ
  1. S LBEDSEC=BEDSEC,LDIAG=DIAG,LDCHGDT=DCHGDT,ADMDT=$P(DATA,U),RCVAA=$P(DATA,U,2),RCVPEN=$P(DATA,U,3),CNUM=$P(DATA,U,4),TDIS=$P(DATA,U,5) D ADM^DVBAVDPT
  1. S RCVPEN=$S(RCVPEN=0:"NO",RCVPEN=1:"YES",1:"Not specified"),RCVAA=$S(RCVAA=0:"NO",RCVAA=1:"YES",1:"Not specified")
  1. W @IOF,!!!,?(80-$L(HEAD)\2),HEAD,!,?(80-$L(HEAD1)\2),HEAD1,!,?(80-$L(HEADDT)\2),HEADDT,!!!
  1. S:ADMDT]"" ADMDT=$$FMTE^XLFDT(ADMDT,"5DZ")
  1. S:DCHGDT]"" DCHGDT=$$FMTE^XLFDT(DCHGDT,"5DZ")
  1. S:LADMDT]"" LADMDT=$$FMTE^XLFDT(LADMDT,"5DZ")
  1. S:LDCHGDT]"" LDCHGDT=$$FMTE^XLFDT(LDCHGDT,"5DZ")
  1. ;create delimited/non-delimited report
  1. D:($G(DVBADLMTR)'="") PRINTD
  1. D:($G(DVBADLMTR)="") PRINTND
  1. Q
  1. ;
  1. PRINTND ;create non-delimited re-admission report
  1. S ^TMP("DVBAR",$J,DVBABCNT)="",DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Patient: "_PNAM_" SSN: "_SSN_" Claim Folder Loc: "_CFLOC,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Claim #: "_CNUM_" Pension: "_RCVPEN_" A&A: "_RCVAA,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="================================================================================",DVBABCNT=DVBABCNT+1
  1. D ELIG
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Current Admission Data:",DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="-----------------------",DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Admission Date: "_ADMDT,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Admitting Diagnosis: "_DIAG,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Discharge Date: "_DCHGDT,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Discharge Type: "_TDIS,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Bed Service: "_BEDSEC,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="",DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Prior Admission Data:",DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="---------------------",DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Admission Date: "_LADMDT,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Admitting Diagnosis: "_LDIAG,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Discharge Date: "_LDCHGDT,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Discharge Type: "_LTDIS,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Bed Service: "_LBEDSEC,DVBABCNT=DVBABCNT+1
  1. S ^TMP("DVBAR",$J,DVBABCNT)="",DVBABCNT=DVBABCNT+1
  1. ;I IOST?1"C-".E W *7,!,"Press RETURN to continue or ""^"" to stop " R ANS:DTIME S:ANS=U!('$T) XCN="ZZZZ" I '$T S DVBAQUIT=1
  1. Q
  1. ;
  1. PRINTD ;create delimited re-admission report
  1. N DVBATMP,X,X1,X2,X3
  1. D:('$D(^XTMP("DVBA_READMISSION_RPT"_$J,0))) COLHDR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=PNAM_DVBADLMTR_SSN_DVBADLMTR_CFLOC_DVBADLMTR_CNUM_DVBADLMTR_RCVPEN_DVBADLMTR_RCVAA_DVBADLMTR
  1. D ELIG
  1. S ^TMP("DVBAR",$J,DVBABCNT)=^TMP("DVBAR",$J,DVBABCNT)_ADMDT_DVBADLMTR_DIAG_DVBADLMTR_DCHGDT_DVBADLMTR_TDIS_DVBADLMTR_BEDSEC_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=^TMP("DVBAR",$J,DVBABCNT)_LADMDT_DVBADLMTR_LDIAG_DVBADLMTR_LDCHGDT_DVBADLMTR_LTDIS_DVBADLMTR_LBEDSEC
  1. ;
  1. S DVBATMP=^TMP("DVBAR",$J,DVBABCNT)
  1. S X=$P(DVBATMP,DVBADLMTR,2)
  1. I $L(X)'>9 S X=""""_$E("000000000",1,9-$L(X))_X_"""",X1=$E(X,1,4),X2=$E(X,5,6),X3=$E(X,7,11),X=X1_"-"_X2_"-"_X3
  1. I $E(X,10,10)'?.N S X=""""_$E("0000000000",1,10-$L(X))_X_"""",X1=$E(X,1,4),X2=$E(X,5,6),X3=$E(X,7,12),X=X1_"-"_X2_"-"_X3
  1. S $P(DVBATMP,DVBADLMTR,2)=X
  1. S X=$P(DVBATMP,DVBADLMTR,4)
  1. S X=$C(160)_X
  1. S $P(DVBATMP,DVBADLMTR,4)=X
  1. F I=1:1:$L(DVBATMP,DVBADLMTR) I $P(DVBATMP,DVBADLMTR,I)["," S $P(DVBATMP,DVBADLMTR,I)=""""_$P(DVBATMP,DVBADLMTR,I)_""""
  1. S DVBATMP=$TR(DVBATMP,DVBADLMTR,",")
  1. S ^TMP("DVBAR",$J,DVBABCNT)=DVBATMP
  1. ;
  1. S DVBABCNT=DVBABCNT+1
  1. Q
  1. ;
  1. PRINT S NODTA=1 S (SORTDT,XCN,XCFLOC,ANS)=""
  1. I $D(^TMP("DVBA",DVBAT,$J)) F XLINE=1:1:5 W ?5,$S(DVBAT="PEN":MSG,DVBAT="A&A":MSG1,1:""),!!
  1. F G=0:0 S SORTDT=$O(^TMP("DVBA",DVBAT,$J,SORTDT)) Q:SORTDT="" F DVBAM=0:0 S XCN=$O(^TMP("DVBA",DVBAT,$J,SORTDT,XCN)) Q:XCN="" D PRINT1
  1. Q
  1. PRINT1 F J=0:0 S XCFLOC=$O(^TMP("DVBA",DVBAT,$J,SORTDT,XCN,XCFLOC)) Q:XCFLOC="" F K=0:0 S K=$O(^TMP("DVBA",DVBAT,$J,SORTDT,XCN,XCFLOC,K)) Q:K="" D PRINTC
  1. Q
  1. PRINTC F DA=0:0 S DA=$O(^TMP("DVBA",DVBAT,$J,SORTDT,XCN,XCFLOC,K,DA)) Q:DA="" S DATA=^(DA) D PRINTB
  1. Q
  1. ;
  1. KILL K ^TMP("DVBA","A&A",$J),^TMP("DVBA","PEN",$J)
  1. K:(DVBAFNLDTE=$P(EDATE,".")) ^XTMP("DVBA_READMISSION_RPT"_$J,0)
  1. D ^%ZISC S X=7 D:$D(ZTQUEUED) KILL^%ZTLOAD G FINAL^DVBAUTIL
  1. ;
  1. ELIG S ELIG=DVBAELIG,INCMP=0
  1. W "Eligibility: "
  1. I ELIG]"" S ELIG=ELIG_" ("_$S(DVBAELST="P":"Pend Ver",DVBAELST="R":"Pend Re-verif",DVBAELST="V":"Verified",1:"Not Verified")_")"
  1. I $D(^DPT(DA,.29)),$P(^(.29),U,1)]"" S INCMP=1 ;date ruled incomp, VA
  1. I $D(^DPT(DA,.29)),$P(^(.29),U,12)=1 S INCMP=1 ;ruled incomp field
  1. W ELIG_$S(ELIG]"":", ",1:"") W:$X>60 !?14 W $S(INCMP=1:"Incompetent",1:""),!
  1. Q
  1. ;
  1. COLHDR ;Column header for delimited report
  1. N DVBADLMTR
  1. S DVBADLMTR=","
  1. S ^TMP("DVBAR",$J,DVBABCNT)="Patient"_DVBADLMTR_"SSN"_DVBADLMTR_"Claim Folder Loc"_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=(^TMP("DVBAR",$J,DVBABCNT))_"Claim #"_DVBADLMTR_"Pension"_DVBADLMTR_"A&A"_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=(^TMP("DVBAR",$J,DVBABCNT))_"Current Admission Date"_DVBADLMTR_"Current Admitting Diagnosis"_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=(^TMP("DVBAR",$J,DVBABCNT))_"Current Discharge Date"_DVBADLMTR_"Current Discharge Type"_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=(^TMP("DVBAR",$J,DVBABCNT))_"Current Bed Service"_DVBADLMTR_"Prior Admission Date"_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=(^TMP("DVBAR",$J,DVBABCNT))_"Prior Admitting Diagnosis"_DVBADLMTR_"Prior Discharge Date"_DVBADLMTR
  1. S ^TMP("DVBAR",$J,DVBABCNT)=(^TMP("DVBAR",$J,DVBABCNT))_"Prior Discharge Type"_DVBADLMTR_"Prior Bed Service"
  1. S DVBABCNT=DVBABCNT+1
  1. S ^XTMP("DVBA_READMISSION_RPT"_$J,0)=DT_U_DT
  1. Q