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

BCSVDQR1.m

Go to the documentation of this file.
BCSVDQR1 ;IHS/SD/SDR - BCSV*1.0 Reports ; 12/21/2008 00:29
 ;;1.0;BCSV;;APR 23, 2010
 ;
GETFILE ;
 K DIR,DIC,DIE,DA,X,Y
 S DIR(0)="F^Ar"
 S DIR("A")="Enter path"
 D ^DIR K DIR
 Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
 S BCSVPATH=Y
 ;filename
 K DIR,DIC,DIE,DA,X,Y
 S DIR(0)="F^Ar"
 S DIR("A")="Enter filename"
 D ^DIR K DIR
 Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
 S BCSVFNAM=Y
 Q
MAPCK ;EP
 D GETFILE
 Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
 ;
 F BCSVFILE="ICD0","ICD9","ICPT","DIC|81.3" D
 .K ^BCSVT(BCSVFILE)
 .S BCSVIENI=0
 .F  S BCSVIENI=$O(^XCSV(BCSVFILE,"MAP",BCSVIENI)) Q:'BCSVIENI  D
 ..S BCSVIENV=+$G(^XCSV(BCSVFILE,"MAP",BCSVIENI))  ;VA IEN
 ..I '$D(^BCSVT(BCSVFILE,BCSVIENV)) S ^BCSVT(BCSVFILE,BCSVIENV)=BCSVIENI Q
 ..I $D(^BCSVT(BCSVFILE,BCSVIENV)) D
 ...I $G(^BCSVT(BCSVFILE,"DUP",BCSVIENV))'="" D  Q
 ....S ^BCSVT(BCSVFILE,"DUP",BCSVIENV)=$G(^BCSVT(BCSVFILE,"DUP",BCSVIENV))_"^"_BCSVIENI
 ...;
 ...S ^BCSVT(BCSVFILE,"DUP",BCSVIENV)=$G(^BCSVT(BCSVFILE,BCSVIENV))_"^"_BCSVIENI
 ;
 ;write
 D OPEN^%ZISH("BCSVFILE",BCSVPATH,BCSVFNAM,"W")
 Q:POP
 U IO(0) W !!,"Writing report...."
 U IO
 D NOW^%DTC
 S Y=%
 D DD^%DT
 W !,"Report:-- MAP CHECK REPORT",?53,"Date: ",Y
 W !,"File:---- ",BCSVFNAM
 W !
 F BCSV=1:1:80 W "="
 W !,"The following items appear to have duplicate mapping."
 W !,"*  IHS Values"
 W !,"=> VA Value",!!
 F BCSV=1:1:80 W "="
 F BCSVFILE="ICD0","ICD9","ICPT","DIC|81.3" D
 .S BCSVVA=0
 .F  S BCSVVA=$O(^BCSVT(BCSVFILE,"DUP",BCSVVA)) Q:'BCSVVA  D
 ..S BCSVIHS=$G(^BCSVT(BCSVFILE,"DUP",BCSVVA))
 ..W !,"=> "_$P($G(^XCSV(BCSVFILE,"DATA",BCSVVA,0)),U)
 ..W ?15
 ..I BCSVFILE="ICPT"!(BCSVFILE="DIC|81.3") W $P($G(^XCSV(BCSVFILE,"DATA",BCSVVA,0)),U,2)
 ..I BCSVFILE="ICD9" W $P($G(^XCSV(BCSVFILE,"DATA",BCSVVA,0)),U,3)
 ..I BCSVFILE="ICD0" W $P($G(^XCSV(BCSVFILE,"DATA",BCSVVA,0)),U,4)
 ..W " ("_BCSVVA_")"
 ..I $L(BCSVIHS,"^")>0 D
 ...F BCSVJ=1:1:$L(BCSVIHS,"^") D
 ....S BCSVIEN=$P(BCSVIHS,"^",BCSVJ)
 ....W !,"*  "
 ....I BCSVFILE="ICPT" D
 .....W $P($G(^BCSVTMP("BCSV-CPT",BCSVIEN,0)),U)
 .....W ?15,$P($G(^BCSVTMP("BCSV-CPT",BCSVIEN,0)),U,2)
 ....I BCSVFILE="ICD9" D
 .....W $P($G(^BCSVTMP("BCSV-ICD9",BCSVIEN,0)),U)
 .....W ?15,$P($G(^BCSVTMP("BCSV-ICD9",BCSVIEN,0)),U,3)
 ....I BCSVFILE="ICD0" D
 .....W $P($G(^BCSVTMP("BCSV-ICD0",BCSVIEN,0)),U)
 .....W ?15,$P($G(^BCSVTMP("BCSV-ICD0",BCSVIEN,0)),U,4)
 ....W " ("_BCSVIEN_")"
 ..W !
 .K ^BCSVT(BCSVFILE)
 D CLOSE^%ZISH("BCSVFILE")
 Q
 ;
PRECSV ;EP
 S BCSVANS=1
 I +$$VERSION^XPDUTL("BCSV")>0 D
 .K DIR,DIC,DIE,DA,X,Y
 .S DIR(0)="YA"
 .S DIR("A",1)="The Conversion is complete at this time so the data reported"
 .S DIR("A",2)="may be inaccurate."
 .S DIR("A")="Are you sure you want to run this report? "
 .S DIR("B")="N"
 .D ^DIR K DIR
 .S BCSVANS=+Y
 Q:BCSVANS'=1  ;they exited out of report
 ;
 D GETFILE
 Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
 ;
 ;
 D OPEN^%ZISH("BCSVFILE",BCSVPATH,BCSVFNAM,"W")
 Q:POP
 U IO(0) W !!,"Writing report...."
 U IO
 D NOW^%DTC
 S Y=%
 D DD^%DT
 W !,"Report:-- POST-CONVERSION DATA QUALITY REPORT  Date: ",Y
 W !,"File:---- ",BCSVFNAM
 ;D CPTADDS  ;counts and writes adds to IHS file
 ;D ICD0ADDS
 ;D ICD9ADDS
 W !,"File^IEN^Code^field^IHS value^VA value"
 D CPTDIFFS
 ;D CMODDIFF
 D ICD0DIFF
 D ICD9DIFF
 D CLOSE^%ZISH("BCSVFILE")
 Q
 ;
CPTDIFFS ;
 S BCSVI=0
 F  S BCSVI=$O(^XCSV("ICPT","MAP",BCSVI)) Q:'BCSVI  D
 .S BCSVVA=$P($G(^XCSV("ICPT","MAP",BCSVI)),U)
 .I $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,3)'=$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U,3) D
 ..W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)
 ..W "^CPT Category^"
 ..W $S($P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,3)'="":$P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,3),1:"NONE")
 ..W "^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U,3)
 .;
 .I $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,4)'=$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U,4) D
 ..W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)
 ..W "^Inactive Flag^"_$P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,4)_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U,4)
 .;
 .I $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,5)'=$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,5) D
 ..W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)_"^ASC Pymt Grp^"
 ..W $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,5)_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,5)
 .;
 .I $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,6)'=$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,6) D
 ..W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)
 ..W "^Dt Added^"_$P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,6)_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,6)
 .;
 .I $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,7)'=$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,7) D
 ..W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)
 ..W "^Dt Deleted^"_$P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,7)_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,7)
 .;
 .I $P($G(^BCSVTMP("BCSV-CPT",BCSVI,9999999)),U,2)'=$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,2) D
 ..W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)
 ..W "^Default Rev. Code^"
 ..W $P($G(^BCSVTMP("BCSV-CPT",BCSVI,9999999)),U,2)_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,9999999)),U,2)
 .;
 .;short desc check
 .S BCSVMDT=9999999
 .S BCSVMDT=$O(^XCSV("ICPT","DATA",BCSVVA,61,"B",BCSVMDT),-1)  ;get most recent entry
 .I BCSVMDT'="" D
 ..S BCSVMIEN=$O(^XCSV("ICPT","DATA",BCSVVA,61,"B",BCSVMDT,0))
 ..I BCSVMIEN="" D  Q
 ...W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)
 ...W "^Short Desc^"_$P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,2)_"^NONE"
 ..S BCSVUPIH=$$UPC^ABMERUTL($P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,2))
 ..S BCSVUPVA=$$UPC^ABMERUTL($P($G(^XCSV("ICPT","DATA",BCSVVA,61,BCSVMIEN,0)),U,2))
 ..I BCSVUPIH'=BCSVUPVA D
 ...W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)_"^Short Desc^"
 ...W $P($G(^BCSVTMP("BCSV-CPT",BCSVI,0)),U,2)_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,61,BCSVMIEN,0)),U,2)
 .;
 .;desc check
 .S BCSVMDT=9999999
 .S BCSVODSC=""
 .S BCSVNDSC=""
 .S BCSVMDT=$O(^XCSV("ICPT","DATA",BCSVVA,62,"B",BCSVMDT),-1)  ;get most recent entry
 .I BCSVMDT'="" D
 ..S BCSVDIEN=$O(^XCSV("ICPT","DATA",BCSVVA,62,"B",BCSVMDT,0))
 ..S BCSVMIEN=0
 ..F  S BCSVMIEN=$O(^XCSV("ICPT","DATA",BCSVVA,62,BCSVDIEN,1,BCSVMIEN)) Q:'BCSVMIEN  D
 ...S BCSVNDSC=BCSVNDSC_" "_$G(^XCSV("ICPT","DATA",BCSVVA,62,BCSVDIEN,1,BCSVMIEN,0))
 ..S BCSVMIEN=0
 ..F  S BCSVMIEN=$O(^BCSVTMP("BCSV-CPT",BCSVI,"D",BCSVMIEN)) Q:'BCSVMIEN  D
 ...S BCSVODSC=BCSVODSC_" "_$G(^BCSVTMP("BCSV-CPT",BCSVI,"D",BCSVMIEN,0))
 ..I $$UPC^ABMERUTL($TR(BCSVNDSC," "))'=$$UPC^ABMERUTL($TR(BCSVODSC," ")) D
 ...W !,"CPT^"_BCSVI_"^"_$P($G(^XCSV("ICPT","DATA",BCSVVA,0)),U)_"^Desc^"_BCSVODSC_"^"_BCSVNDSC
 .;
 Q
 ;
CMODDIFF ;
 S BCSVI=0
 F  S BCSVI=$O(^DIC(81.3,BCSVI)) Q:'BCSVI  D
 .S BCSVCD=$P($G(^DIC(81.3,BCSVI,0)),U)
 .I '$D(^AUTTCMOD("B",BCSVCD)) W !,"CPT MOD^"_BCSVI_"^^Not found (IHS)" Q
 ;;THIS CODE IS NOT COMPLETE.  NEED CLARIFICATION ON ONE-TO-MANY ISSUE
 ;;VA has multiple entries for some code while IHS only has one
 Q
 ;
ICD9DIFF ;
 S BCSVI=0
 F  S BCSVI=$O(^XCSV("ICD9","MAP",BCSVI)) Q:'BCSVI  D
 .S BCSVVA=$P($G(^XCSV("ICD9","MAP",BCSVI)),U)
 .;Identifier
 .I $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,2)'=$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,2) D
 ..W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Identifer^"
 ..W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,2)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,2)
 .;Diagnosis
 .S BCSVMDT=9999999
 .S BCSVMDT=$O(^XCSV("ICD9","DATA",BCSVVA,67,"B",BCSVMDT),-1)  ;get most recent entry
 .I BCSVMDT'="" D
 ..S BCSVMIEN=$O(^XCSV("ICD9","DATA",BCSVVA,67,"B",BCSVMDT,0))
 ..I BCSVMIEN="" D  Q
 ...W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)
 ...W "^Diagnosis^"_$P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,2)_"^NONE"
 ..I $$UPC^ABMERUTL($TR($P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,3)," "))'=$$UPC^ABMERUTL($TR($P($G(^XCSV("ICD9","DATA",BCSVVA,67,BCSVMIEN,0)),U,2)," ")) D
 ...W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Diagnosis^"
 ...W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,3)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,67,BCSVMIEN,0)),U,2)
 .;Inactive Flag
 .I $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,9)'=$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,9) D
 ..W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Inactive Flag^"
 ..W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,9)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,9)
 .;Inactive Date
 .I $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,11)'=$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,11) D
 ..W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Inactive Date^"
 ..W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,0)),U,11)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,11)
 .;Lower age
 .I $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,9999999)),U)'=$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,14) D
 ..W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Lower Age^"
 ..W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,9999999)),U)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,14)
 .;Upper age
 .I $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,9999999)),U,2)'=$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,15) D
 ..W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Upper Age^"
 ..W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,9999999)),U,2)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,15)
 .;Date Added
 .I $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,9999999)),U,4)'=$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,16) D
 ..W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Date Added^"
 ..W $P($G(^BCSVTMP("BCSV-ICD9",BCSVI,9999999)),U,4)_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U,16)
 .;Description
 .S BCSVODSC=$P($G(^BCSVTMP("BCSV-ICD9",BCSVI,1)),U)
 .S BCSVMDT=$O(^XCSV("ICD9","DATA",BCSVVA,"B",9999999))
 .I BCSVMDT'="" D
 ..S BCSVMIEN=$O(^XCSV("ICD9","DATA",BCSVVA,"B",BCSVMDT,0))
 ..S BCSVNDSC=$G(^XCSV("ICD9","DATA",BCSVVA,68,BCSVMIEN,1))
 ..I $$UPC^ABMERUTL($TR(BCSVODSC," "))'=$$UPC^ABMERUTL($TR(BCSVNDSC," ")) D
 ...W !,"ICD9^"_BCSVI_"^"_$P($G(^XCSV("ICD9","DATA",BCSVVA,0)),U)_"^Desc^"_BCSVODSC_"^"_BCSVNDSC
 Q
 ;
ICD0DIFF ;
 S BCSVI=0
 F  S BCSVI=$O(^XCSV("ICD0","MAP",BCSVI)) Q:'BCSVI  D
 .S BCSVVA=$P($G(^XCSV("ICD0","MAP",BCSVI)),U)
 .;Identifier
 .I $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,2)'=$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,2) D
 ..W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Identifer^"
 ..W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,2)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,2)
 .;Operation/Procedure
 .S BCSVMDT=9999999
 .S BCSVMDT=$O(^XCSV("ICD0","DATA",BCSVVA,67,"B",BCSVMDT),-1)  ;get most recent entry
 .I BCSVMDT'="" D
 ..S BCSVMIEN=$O(^XCSV("ICD0","DATA",BCSVVA,67,"B",BCSVMDT,0))
 ..I BCSVMIEN="" D  Q
 ...W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Diagnosis^"
 ...W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,2)_"^NONE"
 ..I $$UPC^ABMERUTL($TR($P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,4)," "))'=$$UPC^ABMERUTL($TR($P($G(^XCSV("ICD0","DATA",BCSVVA,67,BCSVMIEN,0)),U,2)," ")) D
 ...W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Diagnosis^"
 ...W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,4)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,67,BCSVMIEN,0)),U,2)
 .;Inactive Flag
 .I $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,9)'=$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,9) D
 ..W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Inactive Flag^"
 ..W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,9)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,9)
 .;Inactive Date
 .I $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,11)'=$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,11) D
 ..W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Inactive Date^"
 ..W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,0)),U,11)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,11)
 .;Lower age
 .I $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,9999999)),U)'=$P($G(^XCSV("ICD0","DATA",BCSVVA,9999999)),U) D
 ..W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Lower Age^"
 ..W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,9999999)),U)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,9999999)),U)
 .;Upper age
 .I $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,9999999)),U,2)'=$P($G(^XCSV("ICD0","DATA",BCSVVA,9999999)),U,2) D
 ..W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Upper Age^"
 ..W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,9999999)),U,2)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,9999999)),U,2)
 .;Date Added
 .I $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,9999999)),U,4)'=$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,12) D
 ..W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Date Added^"
 ..W $P($G(^BCSVTMP("BCSV-ICD0",BCSVI,9999999)),U,4)_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U,12)
 .;Description
 .S BCSVODSC=$P($G(^BCSVTMP("BCSV-ICD0",BCSVI,1)),U)
 .S BCSVMDT=$O(^XCSV("ICD0","DATA",BCSVVA,"B",9999999))
 .I BCSVMDT'="" D
 ..S BCSVMIEN=$O(^XCSV("ICD0","DATA",BCSVVA,"B",BCSVMDT,0))
 ..S BCSVNDSC=$G(^XCSV("ICD0","DATA",BCSVVA,68,BCSVMIEN,1))
 ..I $$UPC^ABMERUTL($TR(BCSVODSC," "))'=$$UPC^ABMERUTL($TR(BCSVNDSC," ")) D
 ...W !,"ICD0^"_BCSVI_"^"_$P($G(^XCSV("ICD0","DATA",BCSVVA,0)),U)_"^Desc^"_BCSVODSC_"^"_BCSVNDSC
 Q