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