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

VBECDCDC.m

Go to the documentation of this file.
  1. VBECDCDC ;hoifo/gjc-display data conversion statistics;Nov 21, 2002
  1. ;;2.0;VBEC;;Jun 05, 2015;Build 4
  1. ;
  1. ;Medical Device #:
  1. ;Note: The food and Drug Administration classifies this software as a
  1. ;medical device. As such, it may not be changed in any way.
  1. ;Modifications to this software may result in an adulterated medical
  1. ;device under 21CFR820, the use of which is considered to be a
  1. ;violation of US Federal Statutes. Acquiring and implementing this
  1. ;software through the Freedom of Information Act requires the
  1. ;implementer to assume total responsibility for the software, and
  1. ;become a registered manufacturer of a medical device, subject to FDA
  1. ;regulations.
  1. ;
  1. ;Call to $$NEWERR^%ZTER is supported by IA: 1621
  1. ;Call to $$S^%ZTLOAD is supported by IA: 10063
  1. ;Call to $$EXTERNAL^DILFD is supported by IA: 2055
  1. ;Call to ^DIR is supported by IA: 10026
  1. ;Call to $$FMTE^XLFDT is supported by IA: 10103
  1. ;Call to $$CJ^XLFSTR is supported by IA: 10104
  1. ;Call to EN^XUTMDEVQ is supported by IA: 1519
  1. ;Call to ^DIC is supported by IA: 10006
  1. ;Call to $$DT^XLFDT is supported by IA: 10103
  1. ;
  1. EN ;entry point for data conversion report. this is an evocable entry
  1. ;point for the option: VBEC PRINT SQL/VISTA MAPPINGS.
  1. ;
  1. I $S($D(DUZ)[0:1,$D(DUZ(0))[0:1,'DUZ:1,DUZ=.5:1,1:0) W !!?3,$C(7),"DUZ & DUZ(0) must be defined to an active user (not POSTMASTER) in order to",!?3,"proceed." Q
  1. ;
  1. ; initialize the error trap
  1. I $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERR^VBECDCU1"
  1. E S X="D ERR^VBECDCU1",@^%ZOSF("TRAP")
  1. ;
  1. S DIC="^VBEC(6001,",DIC(0)="QEANZ",DIC("A")="Select the data conversion event date/time: ",DIC("S")="I $P(^(0),""^"",2)" D ^DIC
  1. I $D(DTOUT)#2!($D(DUOUT)#2)!(+Y'>0) K DIC,DTOUT,DUOUT,X,Y Q
  1. S VBECIEN=+Y ;data conversion record ien
  1. S VBECY0=Y(0),VBECY00=Y(0,0)
  1. K DIC,X,Y
  1. ;
  1. S DIR(0)="S^B:Both Individual & Summary;I:Individual Records;S:Summary"
  1. S DIR("A")="Enter Data Conversion statistics report type",DIR("B")="Summary"
  1. S DIR("?",1)="Enter 'B' to obtain both individual and overall data element counts"
  1. S DIR("?",2)="Enter 'I' to obtain individual data element counts"
  1. S DIR("?",3)="Enter 'S' to obtain overall data element counts"
  1. S DIR("?")="Enter '^' to stop." D ^DIR K DIR
  1. I $D(DIRUT) K DIROUT,DIRUT,DTOUT,DUOUT,X,Y D KILL Q
  1. S VBECTY=Y ;'B' for both, 'S' for summary only, 'I' for individual recs
  1. ;
  1. K DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. ;
  1. S VBECR="START^VBECDCDC"
  1. F I="VBECIEN","VBECTY","VBECY0","VBECY00" S VBECS(I)=""
  1. K I S VBECD="VBECS display current data conversion statistics"
  1. S VBECZ="MQ" D EN^XUTMDEVQ(VBECR,VBECD,.VBECS,,1)
  1. I +$G(ZTSK)>0 W !!,"Task Number: "_ZTSK,!
  1. ;
  1. KILL ;clean up symbol table, exit
  1. K VBECD,VBECIEN,VBECR,VBECTY,VBECY0,VBECY00,VBECZ
  1. Q
  1. ;
  1. START ;start the process of displaying how many specific data elements were
  1. ;FTP'ed by the SQL Server process for the VBECS data conversion
  1. ;
  1. S:$D(ZTQUEUED) ZTREQ="@" S:U'="^" U="^"
  1. K ^TMP("VBEC TOTALS",$J) S $P(^TMP("VBEC TOTALS",$J),"0^",28)=""
  1. S VBECPG=1,$P(VBECLN,"-",(IOM+1))="",VBECTDAY=$$FMTE^XLFDT($$DT^XLFDT(),"1P")
  1. S VBECDCFN=$$FMTE^XLFDT($E($P(VBECY0,U,3),1,12),1)
  1. S VBECUSER=$$EXTERNAL^DILFD(6001,.04,,$P(VBECY0,U,4))
  1. S (VBECIEN1,VBECNT,VBECXIT)=0 D HDR
  1. F S VBECIEN1=$O(^VBEC(6001,VBECIEN,"TOT",VBECIEN1)) Q:VBECIEN1'>0 D Q:VBECXIT
  1. .S VBEC0=$G(^VBEC(6001,VBECIEN,"TOT",VBECIEN1,0)) Q:VBEC0=""
  1. .S VBECNT=VBECNT+1
  1. .I VBECNT#500=0 I $$S^%ZTLOAD() S (ZTSTOP,VBECXIT)=1 Q:VBECXIT
  1. .D:VBECTY'="S" PRINT(VBEC0) Q:VBECXIT
  1. .F VBECI=1:1:27 D
  1. ..S:VBECI'>2 $P(^TMP("VBEC TOTALS",$J),U,VBECI)=$P(^TMP("VBEC TOTALS",$J),U,VBECI)+1
  1. ..S:VBECI>2 $P(^TMP("VBEC TOTALS",$J),U,VBECI)=$P(^TMP("VBEC TOTALS",$J),U,VBECI)+$P(VBEC0,U,VBECI)
  1. ..Q
  1. .Q
  1. W:'VBECNT !,$$CJ^XLFSTR("*** No Records To Print ***",IOM)
  1. I VBECNT,(VBECTY'="I") D
  1. .W:VBECTY="B" ! ;need the additional line feed to separate data
  1. .W !,$$CJ^XLFSTR("Total number of data elements converted",IOM)
  1. .D PRINT(^TMP("VBEC TOTALS",$J))
  1. .Q
  1. ;
  1. EXIT ;kill and quit
  1. K VBEC0,VBECD,VBECDCFN,VBECFLD,VBECI,VBECIEN,VBECIEN1,VBECLN,VBECNT,VBECPG,VBECR,VBECTDAY,VBECUSER,VBECXIT,VBECZ
  1. K ^TMP("VBEC TOTALS",$J)
  1. Q
  1. ;
  1. EOS ; end of screen (eos) check & refresh screen action
  1. ; check to see if additional data exist to print, if not exit w/o
  1. ; issuing the eos prompt.
  1. ;
  1. I +VBECFLD=27,($O(^VBEC(6001,VBECIEN,"TOT",VBECIEN1))="") Q
  1. I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR S VBECXIT=$S(Y'>0:1,1:0)
  1. K DIR,X,Y Q:VBECXIT
  1. HDR ; draw header
  1. W:($E(IOST)="C")!(VBECPG>1) @IOF
  1. W !,$$CJ^XLFSTR("VistA Blood Bank Data Element Summary",IOM)
  1. W !,"Data Conversion start time: "_VBECY00
  1. W !,"Data Conversion end time: "_VBECDCFN
  1. W !,"User: "_VBECUSER
  1. W !,"Report Run Date: ",VBECTDAY,?69,"Page: ",VBECPG,!,VBECLN
  1. S VBECPG=VBECPG+1
  1. Q
  1. ;
  1. PRINT(VBECDSTR) ;print data
  1. ;Input: VBECDSTR=data string; each delimited piece indicates the
  1. ; total number of occurences for a data element.
  1. F VBECI=1:1 S VBECFLD=$P($T(FORMAT+VBECI),";;",2) Q:VBECFLD="" D Q:VBECXIT
  1. .W !,$P(VBECFLD,";",2)_": "_$P(VBECDSTR,U,VBECI)
  1. .I $Y>(IOSL-4) D EOS ;sets the variable VBECXIT
  1. .W:+VBECFLD=27&($O(^VBEC(6001,VBECIEN,"TOT",VBECIEN1))>0) !
  1. .Q
  1. Q
  1. ;
  1. FORMAT ;field names are formatted here
  1. ;;1;LRDFN
  1. ;;2;DFN
  1. ;;3;Family Name
  1. ;;4;Given Name
  1. ;;5;Middle Name
  1. ;;6;Suffix (Name)
  1. ;;7;Sex
  1. ;;8;DOB
  1. ;;9;SSN
  1. ;;10;ICN
  1. ;;11;ABO
  1. ;;12;RH
  1. ;;13;RBC Antigens Present
  1. ;;14;RBC Antigens Present Comments
  1. ;;15;RBC Antigens Present Chars
  1. ;;16;RBC Antigens Absent
  1. ;;17;RBC Antigens Absent Comments
  1. ;;18;RBC Antigens Absent Chars
  1. ;;19;Antibodies Identified
  1. ;;20;Antibodies Identified Comments
  1. ;;21;Antibodies Identified Chars
  1. ;;22;Transfusion Reaction Date
  1. ;;23;Transfusion Reaction
  1. ;;24;Transfusion Reaction Comments
  1. ;;25;Trans. Reaction Comment Chars
  1. ;;26;Blood Bank Comments
  1. ;;27;Blood Bank Comment Chars
  1. ;;