- DG53244T ;BPOIFO/KEITH - NAME STANDARDIZATION ; 27 Jan 2002 11:05 PM
- ;;5.3;Registration;**244,1015**;Aug 13, 1993;Build 21
- ;
- PRINT ;Print name conversion report
- ;
- N DGFLAG,DGPDT,DGOUT,DTOUT,DUOUT
- N DIR,DGEND,DGFMT,DGFLD,DGEXC,DGI,DGT0
- D TITL^DG53244V("Patient Name Standardization Report") S (DGEND,DGOUT)=0
- S DGT0=$D(^XTMP("DPTNAME",0)),DGPDT=$G(^XTMP("DPTNAME",0,0))
- I 'DGT0 D
- .W !!,"The patient name conversion report global has not been created. A report"
- .W !,"global will be generated which can be reprinted later."
- .S DGFLAG="K",DGFLAG("K")="Kill the global and regenerate"
- .Q
- I DGT0 D
- .I DGPDT D
- ..W !!,"Name conversion processing started on ",$$FMTE^XLFDT(+DGPDT) W:'$P(DGPDT,U,2) " but has not completed."
- ..W:$P(DGPDT,U,2) " and completed ",!,$$FMTE^XLFDT($P(DGPDT,U,2)),"."
- ..S DGFLAG="U",DGFLAG("U")="Use the existing report global"
- ..Q
- .I 'DGPDT D
- ..W !!,"Name conversion processing doesn't appear to have been performed."
- ..D SUBT^DG53244V("*** Report Generation Action ***")
- ..W !!,"A name conversion report global already exists, you may use it or regenerate",!,"the information.",!
- ..K DIR
- ..S DIR(0)="S^U:Use the existing report global;K:Kill the global and regenerate"
- ..S DIR("A")="Report generation action"
- ..D ^DIR I $D(DTOUT)!$D(DUOUT) S DGOUT=1 Q
- ..S DGFLAG=Y,DGFLAG(Y)=Y(0)
- ..Q
- .Q
- G:DGOUT Q
- D SUBT^DG53244V("*** Report Output Format ***")
- K DIR
- S DIR(0)="S^S:Statistics only;D:Detailed report",DIR("A")="Report format",DIR("?")="Specify if the report should return a list of name exceptions or statistics only."
- D ^DIR I $D(DTOUT)!$D(DUOUT) G Q
- S DGFMT=Y,DGFMT(DGFMT)=Y(0) G:DGFMT="S" QUEUE
- D SUBT^DG53244V("*** Conversion Fields to Include ***")
- W !!,"The name conversion ",$S(DGPDT:"has changed",1:"will change")," data in eleven different PATIENT file fields.",!,"Please specify which of these fields to return on the report."
- FLDS ;Get fields to report
- K DIR
- S DIR(0)="SO^A:All fields;.01:Patient name;.211:K Name;.2191:K2 Name;.2401:Father's name;.2402:Mother's name;.2403:Mother's maiden name;.331:E Name;.3311:E2 Name;.341:D Name;2.01:Alias;2.101:Attorney's Name"
- S DIR("A")="Select field to include",DGFLD="",DIR("B")="All fields"
- F D Q:DGOUT!DGEND
- .D ^DIR I $D(DTOUT)!$D(DUOUT) S DGOUT=1 Q
- .I X="" S DGEND=1 Q
- .S DIR("A")="Select another field to include" K DIR("B")
- .I Y="A" K DGFLD S DGFLD="A",DGFLD(Y)=Y(0),DGEND=1 Q
- .S DGFLD(Y)=Y(0) N DGX
- .S DGX=";"_Y_":"_Y(0),DIR(0)=$P(DIR(0),DGX)_$P(DIR(0),DGX,2)
- .Q
- G:DGOUT Q
- I $D(DGFLD)<10 W !!,$C(7),"At least one selection is required!",! G FLDS
- D SUBT^DG53244V("*** Name Exceptions to Include ***")
- W !!,"This report groups name exceptions by the categories listed below. Of these"
- W !,"types, the first three are considered important to review. Names with no comma"
- W !,"may not be parsed correctly by Kernel name standardization utilities. Names"
- W !,"with parenthetical text, e.g. ""(INELIGIBLE)"" may require clean up prior to"
- W !,"conversion. Names that cannot be converted should be corrected or deleted."
- W !!,"The fourth category will apply to the majority of name changes. These are"
- W !,"instances where characters such as periods, have been removed or changed"
- W !," and probably do not require review. You may review all four categories but"
- W !,"limiting the report to the first three will produce a more relevant and"
- W !,"manageable list."
- K DIR
- S DIR(0)="SO^1:Name value contains no comma;2:Parenthetical text is removed from name;3:Name value cannot be converted;4:Characters are removed or changed"
- S DIR("A")="Select an exception to include",DGEND=0
- EXC F D Q:DGOUT!DGEND
- .D ^DIR I $D(DTOUT)!$D(DUOUT) S DGOUT=1 Q
- .I X="" S DGEND=1 Q
- .S DGEXC(Y)=Y(0)
- .I $D(DGEXC(1)),$D(DGEXC(2)),$D(DGEXC(3)),$D(DGEXC(4)) D Q
- ..S DGEND=1,DGEXC="ALL" Q
- .S DIR("A")="Select another exception to include" N DGX
- .S DGX=Y_":"_Y(0),DIR(0)=$P(DIR(0),DGX)_$P(DIR(0),DGX,2)
- .I DIR(0)[";;" S DIR(0)=$P(DIR(0),";;")_";"_$P(DIR(0),";;",2)
- .Q
- G:DGOUT Q
- I $D(DGEXC)<10 W !!,$C(7),"At least one selection is required!",! G EXC
- ;
- D SUBT^DG53244V("*** Selected Report Parameters ***")
- D PARAM^DG53244V
- K DIR S DIR(0)="Y",DIR("A")="Ok",DIR("B")="YES",DIR("?")="Indicate if the selected parameters are correct."
- D ^DIR G:'Y!$D(DTOUT)!$D(DUOUT) Q
- QUEUE W !!,$C(7),"This report requires 132 column output!"
- F DGI="DGFLAG","DGFLAG(","DGFMT","DGFMT(","DGFLD","DGFLD(","DGEXC","DGEXC(" S ZTSAVE(DGI)=""
- D EN^XUTMDEVQ("PRT^DG53244V","Print Patient Name Standardization Report",.ZTSAVE)
- Q D END^DG53244V Q
- ;
- CONVERT ;Convert patient name fields
- N DGOUT,DGEND,DGPDT,DGRUN,DGT0,DGI,DIR,DTOUT,DUOUT,DGLIM,DGFLAG
- S DGOUT=0,DGFLAG="P",DGFLAG(DGFLAG)="Process patient name conversion"
- D TITL^DG53244V("*** Patient Name Field Conversion ***")
- S DGPDT=$G(^XTMP("DPTNAME",0,0)),DGT0=$G(^XTMP("DPTNAME",0))
- S DGRUN=($P(DGT0,U,5)="RUN")
- I DGPDT D
- .W !!,"Name conversion processing started on ",$$FMTE^XLFDT(+DGPDT) W:'$P(DGPDT,U,2) " but has not completed."
- .W:$P(DGPDT,U,2) " and completed ",!,$$FMTE^XLFDT($P(DGPDT,U,2)),"."
- .Q
- I $P(DGPDT,U,2) D G Q
- .W !!,$C(7),"It appears that the conversion of patient name fields has completed. No"
- .W !,"further action should be necessary. To review the results of the conversion,"
- .W !,"a report may be printed with the PRINT^DG53244T entry point."
- .S DIR(0)="E",DIR("A")="Enter RETURN to exit"
- .W !! D ^DIR
- .Q
- I DGRUN D G Q:DGOUT
- .W !!,"It appears that the conversion of patient name fields is running currently."
- .F DGI=1:1:10 Q:DGOUT D
- ..I $P(^XTMP("DPTNAME",0),U,4)'=$P(DGT0,U,4) S DGOUT=1 Q
- ..H 1 W "." Q
- .I DGOUT D Q
- ..W !!,"An additional processing task should not be started at this time.",!
- ..S DIR(0)="E",DIR("A")="Enter RETURN to exit"
- ..W !! D ^DIR
- ..Q
- .S $P(^XTMP("DPTNAME",0),U,5)="STOP"
- .W "that process has been flagged to stop."
- I 'DGPDT D
- .W !!,"Name conversion processing doesn't appear to have been performed."
- .Q
- LIM D SUBT^DG53244V("*** Processing Limitation ***")
- S DGI="Processing will "_$S(DGPDT:"continue",1:"begin")_" with PATIENT file entry "_$S(DGPDT:$P(DGT0,U,4)+1,1:$O(^DPT(0)))_"."
- W !!?(80-$L(DGI)\2),DGI
- W !!,"The conversion can be tasked to run to completion or stop after a specified"
- W !,"record entry or date/time. If stopped prior to completion it will need to be"
- W !,"re-tasked to run to completion at another time."
- S DIR(0)="S^R:Run to completion;SR:Stop after specified record;SD:Stop after date/time"
- S DIR("A")="Specify processing limitation"
- D ^DIR I $D(DTOUT)!$D(DUOUT) G Q
- S DGLIM=Y
- SR I DGLIM="SR" D G:DGOUT Q
- .D SUBT^DG53244V("*** Specify Ending Record ***")
- .W !!,"Name conversion processing will discontinue after the record number specified."
- .S DIR(0)="N^"_$S(DGPDT:(+$P(DGT0,U,4)+1),1:$O(^DPT(0)))_":"_$O(^DPT(999999999),-1)
- .S DIR("A")="Record number to end processing"
- .W ! D ^DIR I $D(DTOUT)!$D(DUOUT) S DGOUT=1 Q
- .S DGLIM(DGLIM)=Y
- .Q
- SD I DGLIM="SD" D G:DGOUT Q
- .D SUBT^DG53244V("*** Specify Ending Date/Time ***")
- .W !!,"The value specified must include both date and time. It must be at least one"
- .W !,"hour in the future but not more than seven days in the future."
- .S DIR(0)=$$FMADD^XLFDT($P($$NOW^XLFDT(),":",1,2),,1)_":"_$$FMADD^XLFDT($P($$NOW^XLFDT(),":",1,2),7,1)_":ET"
- .S DGI="("_$$FMTE^XLFDT($P(DIR(0),":"))_" / "_$$FMTE^XLFDT($P(DIR(0),":",2))_")"
- .W !!?(80-$L(DGI)\2),DGI
- .S DIR("A")="Date/time to end processing: "
- .S DIR(0)="DA^"_DIR(0)
- .W ! D ^DIR I $D(DTOUT)!$D(DUOUT) S DGOUT=1 Q
- .S DGLIM(DGLIM)=Y
- .Q
- ;
- PQUE ;Queue patient name conversion
- D SUBT^DG53244V("*** Queue Name Conversion Processing ***")
- N %DT,DGI,Y,ZTSK,ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSAVE
- S Y=DT_.22 X ^DD("DD") S %DT("B")=Y,%DT("A")="Queue to run: "
- PQ S %DT="AEFXR" W ! D ^%DT
- I DGLIM="SD",Y>DGLIM(DGLIM) D G PQ
- .W !,$C(7),"Task start time must be earlier than processing end time!"
- .Q
- I Y<1 G QQ
- S ZTDTH=Y,ZTRTN="RUN^DG53244U(.DGFLAG)",ZTIO=""
- F DGI="DGFLAG","DGFLAG(","DGLIM","DGLIM(" S ZTSAVE(DGI)=""
- S ZTDESC="Process patient name conversion"
- F DGI=1:1:20 D ^%ZTLOAD Q:$G(ZTSK)
- QQ W:'$G(ZTSK) !!,"Extract not queued!!!",!
- W:$G(ZTSK) !!,"Task number: ",ZTSK,!
- S DIR(0)="E",DIR("A")="Enter RETURN to exit" K DIR("B")
- W !! D ^DIR
- G Q
- ;
- STOP ;Request patient name conversion to stop
- N DIR,DTOUT,DUOUT,X,Y,DGRUN,DGOUT S DGOUT=0
- D TITL^DG53244V("*** Stop Patient Name Conversion Process ***")
- S DGRUN=($P($G(^XTMP("DPTNAME",0)),U,5)="RUN")
- I 'DGRUN D
- .W !!,"The patient name conversion process doesn't appear to be running currently."
- .Q
- I DGRUN D
- .S DIR(0)="Y",DIR("B")="NO"
- .S DIR("A")="Are you sure you wish to stop the patient name conversion process"
- .D ^DIR I $D(DTOUT)!$D(DUOUT) S DGOUT=1 Q
- .Q:'Y
- .S $P(^XTMP("DPTNAME",0),U,5)="STOP"
- .W !!,"The process has been flagged to stop."
- .Q
- G:DGOUT Q
- S DIR(0)="E",DIR("A")="Enter RETURN to exit" K DIR("B")
- W !! D ^DIR
- G Q
- ;
- MGOUT(DGNCMG) ;Remove name change mail group
- ;Input: DGNCMG=variable to store existing group (pass by reference)
- ;
- N DGFDA,DGMSG
- S DGNCMG=$P($G(^DG(43,1,"NOT")),U,3)
- S:DGNCMG $P(^XTMP(DGNMSP,0),U,6)=DGNCMG
- S DGFDA(43,"1,",502)="@"
- D FILE^DIE("E","DGFDA","DGMSG")
- Q
- ;
- MGIN(DGNCMG) ;Replace name change mail group
- ;Input: DGNCMG=mail group pointer
- ;
- I '$G(DGNCMG) S DGNCMG=$P(^XTMP(DGNMSP,0),U,6) Q:'DGNCMG
- N DGFDA,DGMSG
- S DGFDA(43,"1,",502)=DGNCMG
- D FILE^DIE("","DGFDA","DGMSG")
- Q
- DG53244T ;BPOIFO/KEITH - NAME STANDARDIZATION ; 27 Jan 2002 11:05 PM
- +1 ;;5.3;Registration;**244,1015**;Aug 13, 1993;Build 21
- +2 ;
- PRINT ;Print name conversion report
- +1 ;
- +2 NEW DGFLAG,DGPDT,DGOUT,DTOUT,DUOUT
- +3 NEW DIR,DGEND,DGFMT,DGFLD,DGEXC,DGI,DGT0
- +4 DO TITL^DG53244V("Patient Name Standardization Report")
- SET (DGEND,DGOUT)=0
- +5 SET DGT0=$DATA(^XTMP("DPTNAME",0))
- SET DGPDT=$GET(^XTMP("DPTNAME",0,0))
- +6 IF 'DGT0
- Begin DoDot:1
- +7 WRITE !!,"The patient name conversion report global has not been created. A report"
- +8 WRITE !,"global will be generated which can be reprinted later."
- +9 SET DGFLAG="K"
- SET DGFLAG("K")="Kill the global and regenerate"
- +10 QUIT
- End DoDot:1
- +11 IF DGT0
- Begin DoDot:1
- +12 IF DGPDT
- Begin DoDot:2
- +13 WRITE !!,"Name conversion processing started on ",$$FMTE^XLFDT(+DGPDT)
- IF '$PIECE(DGPDT,U,2)
- WRITE " but has not completed."
- +14 IF $PIECE(DGPDT,U,2)
- WRITE " and completed ",!,$$FMTE^XLFDT($PIECE(DGPDT,U,2)),"."
- +15 SET DGFLAG="U"
- SET DGFLAG("U")="Use the existing report global"
- +16 QUIT
- End DoDot:2
- +17 IF 'DGPDT
- Begin DoDot:2
- +18 WRITE !!,"Name conversion processing doesn't appear to have been performed."
- +19 DO SUBT^DG53244V("*** Report Generation Action ***")
- +20 WRITE !!,"A name conversion report global already exists, you may use it or regenerate",!,"the information.",!
- +21 KILL DIR
- +22 SET DIR(0)="S^U:Use the existing report global;K:Kill the global and regenerate"
- +23 SET DIR("A")="Report generation action"
- +24 DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- SET DGOUT=1
- QUIT
- +25 SET DGFLAG=Y
- SET DGFLAG(Y)=Y(0)
- +26 QUIT
- End DoDot:2
- +27 QUIT
- End DoDot:1
- +28 IF DGOUT
- GOTO Q
- +29 DO SUBT^DG53244V("*** Report Output Format ***")
- +30 KILL DIR
- +31 SET DIR(0)="S^S:Statistics only;D:Detailed report"
- SET DIR("A")="Report format"
- SET DIR("?")="Specify if the report should return a list of name exceptions or statistics only."
- +32 DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- GOTO Q
- +33 SET DGFMT=Y
- SET DGFMT(DGFMT)=Y(0)
- IF DGFMT="S"
- GOTO QUEUE
- +34 DO SUBT^DG53244V("*** Conversion Fields to Include ***")
- +35 WRITE !!,"The name conversion ",$SELECT(DGPDT:"has changed",1:"will change")," data in eleven different PATIENT file fields.",!,"Please specify which of these fields to return on the report."
- FLDS ;Get fields to report
- +1 KILL DIR
- +2 SET DIR(0)="SO^A:All fields;.01:Patient name;.211:K Name;.2191:K2 Name;.2401:Father's name;.2402:Mother's name;.2403:Mother's maiden name;.331:E Name;.3311:E2 Name;.341:D Name;2.01:Alias;2.101:Attorney's Name"
- +3 SET DIR("A")="Select field to include"
- SET DGFLD=""
- SET DIR("B")="All fields"
- +4 FOR
- Begin DoDot:1
- +5 DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- SET DGOUT=1
- QUIT
- +6 IF X=""
- SET DGEND=1
- QUIT
- +7 SET DIR("A")="Select another field to include"
- KILL DIR("B")
- +8 IF Y="A"
- KILL DGFLD
- SET DGFLD="A"
- SET DGFLD(Y)=Y(0)
- SET DGEND=1
- QUIT
- +9 SET DGFLD(Y)=Y(0)
- NEW DGX
- +10 SET DGX=";"_Y_":"_Y(0)
- SET DIR(0)=$PIECE(DIR(0),DGX)_$PIECE(DIR(0),DGX,2)
- +11 QUIT
- End DoDot:1
- IF DGOUT!DGEND
- QUIT
- +12 IF DGOUT
- GOTO Q
- +13 IF $DATA(DGFLD)<10
- WRITE !!,$CHAR(7),"At least one selection is required!",!
- GOTO FLDS
- +14 DO SUBT^DG53244V("*** Name Exceptions to Include ***")
- +15 WRITE !!,"This report groups name exceptions by the categories listed below. Of these"
- +16 WRITE !,"types, the first three are considered important to review. Names with no comma"
- +17 WRITE !,"may not be parsed correctly by Kernel name standardization utilities. Names"
- +18 WRITE !,"with parenthetical text, e.g. ""(INELIGIBLE)"" may require clean up prior to"
- +19 WRITE !,"conversion. Names that cannot be converted should be corrected or deleted."
- +20 WRITE !!,"The fourth category will apply to the majority of name changes. These are"
- +21 WRITE !,"instances where characters such as periods, have been removed or changed"
- +22 WRITE !," and probably do not require review. You may review all four categories but"
- +23 WRITE !,"limiting the report to the first three will produce a more relevant and"
- +24 WRITE !,"manageable list."
- +25 KILL DIR
- +26 SET DIR(0)="SO^1:Name value contains no comma;2:Parenthetical text is removed from name;3:Name value cannot be converted;4:Characters are removed or changed"
- +27 SET DIR("A")="Select an exception to include"
- SET DGEND=0
- EXC FOR
- Begin DoDot:1
- +1 DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- SET DGOUT=1
- QUIT
- +2 IF X=""
- SET DGEND=1
- QUIT
- +3 SET DGEXC(Y)=Y(0)
- +4 IF $DATA(DGEXC(1))
- IF $DATA(DGEXC(2))
- IF $DATA(DGEXC(3))
- IF $DATA(DGEXC(4))
- Begin DoDot:2
- +5 SET DGEND=1
- SET DGEXC="ALL"
- QUIT
- End DoDot:2
- QUIT
- +6 SET DIR("A")="Select another exception to include"
- NEW DGX
- +7 SET DGX=Y_":"_Y(0)
- SET DIR(0)=$PIECE(DIR(0),DGX)_$PIECE(DIR(0),DGX,2)
- +8 IF DIR(0)[";;"
- SET DIR(0)=$PIECE(DIR(0),";;")_";"_$PIECE(DIR(0),";;",2)
- +9 QUIT
- End DoDot:1
- IF DGOUT!DGEND
- QUIT
- +10 IF DGOUT
- GOTO Q
- +11 IF $DATA(DGEXC)<10
- WRITE !!,$CHAR(7),"At least one selection is required!",!
- GOTO EXC
- +12 ;
- +13 DO SUBT^DG53244V("*** Selected Report Parameters ***")
- +14 DO PARAM^DG53244V
- +15 KILL DIR
- SET DIR(0)="Y"
- SET DIR("A")="Ok"
- SET DIR("B")="YES"
- SET DIR("?")="Indicate if the selected parameters are correct."
- +16 DO ^DIR
- IF 'Y!$DATA(DTOUT)!$DATA(DUOUT)
- GOTO Q
- QUEUE WRITE !!,$CHAR(7),"This report requires 132 column output!"
- +1 FOR DGI="DGFLAG","DGFLAG(","DGFMT","DGFMT(","DGFLD","DGFLD(","DGEXC","DGEXC("
- SET ZTSAVE(DGI)=""
- +2 DO EN^XUTMDEVQ("PRT^DG53244V","Print Patient Name Standardization Report",.ZTSAVE)
- Q DO END^DG53244V
- QUIT
- +1 ;
- CONVERT ;Convert patient name fields
- +1 NEW DGOUT,DGEND,DGPDT,DGRUN,DGT0,DGI,DIR,DTOUT,DUOUT,DGLIM,DGFLAG
- +2 SET DGOUT=0
- SET DGFLAG="P"
- SET DGFLAG(DGFLAG)="Process patient name conversion"
- +3 DO TITL^DG53244V("*** Patient Name Field Conversion ***")
- +4 SET DGPDT=$GET(^XTMP("DPTNAME",0,0))
- SET DGT0=$GET(^XTMP("DPTNAME",0))
- +5 SET DGRUN=($PIECE(DGT0,U,5)="RUN")
- +6 IF DGPDT
- Begin DoDot:1
- +7 WRITE !!,"Name conversion processing started on ",$$FMTE^XLFDT(+DGPDT)
- IF '$PIECE(DGPDT,U,2)
- WRITE " but has not completed."
- +8 IF $PIECE(DGPDT,U,2)
- WRITE " and completed ",!,$$FMTE^XLFDT($PIECE(DGPDT,U,2)),"."
- +9 QUIT
- End DoDot:1
- +10 IF $PIECE(DGPDT,U,2)
- Begin DoDot:1
- +11 WRITE !!,$CHAR(7),"It appears that the conversion of patient name fields has completed. No"
- +12 WRITE !,"further action should be necessary. To review the results of the conversion,"
- +13 WRITE !,"a report may be printed with the PRINT^DG53244T entry point."
- +14 SET DIR(0)="E"
- SET DIR("A")="Enter RETURN to exit"
- +15 WRITE !!
- DO ^DIR
- +16 QUIT
- End DoDot:1
- GOTO Q
- +17 IF DGRUN
- Begin DoDot:1
- +18 WRITE !!,"It appears that the conversion of patient name fields is running currently."
- +19 FOR DGI=1:1:10
- IF DGOUT
- QUIT
- Begin DoDot:2
- +20 IF $PIECE(^XTMP("DPTNAME",0),U,4)'=$PIECE(DGT0,U,4)
- SET DGOUT=1
- QUIT
- +21 HANG 1
- WRITE "."
- QUIT
- End DoDot:2
- +22 IF DGOUT
- Begin DoDot:2
- +23 WRITE !!,"An additional processing task should not be started at this time.",!
- +24 SET DIR(0)="E"
- SET DIR("A")="Enter RETURN to exit"
- +25 WRITE !!
- DO ^DIR
- +26 QUIT
- End DoDot:2
- QUIT
- +27 SET $PIECE(^XTMP("DPTNAME",0),U,5)="STOP"
- +28 WRITE "that process has been flagged to stop."
- End DoDot:1
- IF DGOUT
- GOTO Q
- +29 IF 'DGPDT
- Begin DoDot:1
- +30 WRITE !!,"Name conversion processing doesn't appear to have been performed."
- +31 QUIT
- End DoDot:1
- LIM DO SUBT^DG53244V("*** Processing Limitation ***")
- +1 SET DGI="Processing will "_$SELECT(DGPDT:"continue",1:"begin")_" with PATIENT file entry "_$SELECT(DGPDT:$PIECE(DGT0,U,4)+1,1:$ORDER(^DPT(0)))_"."
- +2 WRITE !!?(80-$LENGTH(DGI)\2),DGI
- +3 WRITE !!,"The conversion can be tasked to run to completion or stop after a specified"
- +4 WRITE !,"record entry or date/time. If stopped prior to completion it will need to be"
- +5 WRITE !,"re-tasked to run to completion at another time."
- +6 SET DIR(0)="S^R:Run to completion;SR:Stop after specified record;SD:Stop after date/time"
- +7 SET DIR("A")="Specify processing limitation"
- +8 DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- GOTO Q
- +9 SET DGLIM=Y
- SR IF DGLIM="SR"
- Begin DoDot:1
- +1 DO SUBT^DG53244V("*** Specify Ending Record ***")
- +2 WRITE !!,"Name conversion processing will discontinue after the record number specified."
- +3 SET DIR(0)="N^"_$SELECT(DGPDT:(+$PIECE(DGT0,U,4)+1),1:$ORDER(^DPT(0)))_":"_$ORDER(^DPT(999999999),-1)
- +4 SET DIR("A")="Record number to end processing"
- +5 WRITE !
- DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- SET DGOUT=1
- QUIT
- +6 SET DGLIM(DGLIM)=Y
- +7 QUIT
- End DoDot:1
- IF DGOUT
- GOTO Q
- SD IF DGLIM="SD"
- Begin DoDot:1
- +1 DO SUBT^DG53244V("*** Specify Ending Date/Time ***")
- +2 WRITE !!,"The value specified must include both date and time. It must be at least one"
- +3 WRITE !,"hour in the future but not more than seven days in the future."
- +4 SET DIR(0)=$$FMADD^XLFDT($PIECE($$NOW^XLFDT(),":",1,2),,1)_":"_$$FMADD^XLFDT($PIECE($$NOW^XLFDT(),":",1,2),7,1)_":ET"
- +5 SET DGI="("_$$FMTE^XLFDT($PIECE(DIR(0),":"))_" / "_$$FMTE^XLFDT($PIECE(DIR(0),":",2))_")"
- +6 WRITE !!?(80-$LENGTH(DGI)\2),DGI
- +7 SET DIR("A")="Date/time to end processing: "
- +8 SET DIR(0)="DA^"_DIR(0)
- +9 WRITE !
- DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- SET DGOUT=1
- QUIT
- +10 SET DGLIM(DGLIM)=Y
- +11 QUIT
- End DoDot:1
- IF DGOUT
- GOTO Q
- +12 ;
- PQUE ;Queue patient name conversion
- +1 DO SUBT^DG53244V("*** Queue Name Conversion Processing ***")
- +2 NEW %DT,DGI,Y,ZTSK,ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSAVE
- +3 SET Y=DT_.22
- XECUTE ^DD("DD")
- SET %DT("B")=Y
- SET %DT("A")="Queue to run: "
- PQ SET %DT="AEFXR"
- WRITE !
- DO ^%DT
- +1 IF DGLIM="SD"
- IF Y>DGLIM(DGLIM)
- Begin DoDot:1
- +2 WRITE !,$CHAR(7),"Task start time must be earlier than processing end time!"
- +3 QUIT
- End DoDot:1
- GOTO PQ
- +4 IF Y<1
- GOTO QQ
- +5 SET ZTDTH=Y
- SET ZTRTN="RUN^DG53244U(.DGFLAG)"
- SET ZTIO=""
- +6 FOR DGI="DGFLAG","DGFLAG(","DGLIM","DGLIM("
- SET ZTSAVE(DGI)=""
- +7 SET ZTDESC="Process patient name conversion"
- +8 FOR DGI=1:1:20
- DO ^%ZTLOAD
- IF $GET(ZTSK)
- QUIT
- QQ IF '$GET(ZTSK)
- WRITE !!,"Extract not queued!!!",!
- +1 IF $GET(ZTSK)
- WRITE !!,"Task number: ",ZTSK,!
- +2 SET DIR(0)="E"
- SET DIR("A")="Enter RETURN to exit"
- KILL DIR("B")
- +3 WRITE !!
- DO ^DIR
- +4 GOTO Q
- +5 ;
- STOP ;Request patient name conversion to stop
- +1 NEW DIR,DTOUT,DUOUT,X,Y,DGRUN,DGOUT
- SET DGOUT=0
- +2 DO TITL^DG53244V("*** Stop Patient Name Conversion Process ***")
- +3 SET DGRUN=($PIECE($GET(^XTMP("DPTNAME",0)),U,5)="RUN")
- +4 IF 'DGRUN
- Begin DoDot:1
- +5 WRITE !!,"The patient name conversion process doesn't appear to be running currently."
- +6 QUIT
- End DoDot:1
- +7 IF DGRUN
- Begin DoDot:1
- +8 SET DIR(0)="Y"
- SET DIR("B")="NO"
- +9 SET DIR("A")="Are you sure you wish to stop the patient name conversion process"
- +10 DO ^DIR
- IF $DATA(DTOUT)!$DATA(DUOUT)
- SET DGOUT=1
- QUIT
- +11 IF 'Y
- QUIT
- +12 SET $PIECE(^XTMP("DPTNAME",0),U,5)="STOP"
- +13 WRITE !!,"The process has been flagged to stop."
- +14 QUIT
- End DoDot:1
- +15 IF DGOUT
- GOTO Q
- +16 SET DIR(0)="E"
- SET DIR("A")="Enter RETURN to exit"
- KILL DIR("B")
- +17 WRITE !!
- DO ^DIR
- +18 GOTO Q
- +19 ;
- MGOUT(DGNCMG) ;Remove name change mail group
- +1 ;Input: DGNCMG=variable to store existing group (pass by reference)
- +2 ;
- +3 NEW DGFDA,DGMSG
- +4 SET DGNCMG=$PIECE($GET(^DG(43,1,"NOT")),U,3)
- +5 IF DGNCMG
- SET $PIECE(^XTMP(DGNMSP,0),U,6)=DGNCMG
- +6 SET DGFDA(43,"1,",502)="@"
- +7 DO FILE^DIE("E","DGFDA","DGMSG")
- +8 QUIT
- +9 ;
- MGIN(DGNCMG) ;Replace name change mail group
- +1 ;Input: DGNCMG=mail group pointer
- +2 ;
- +3 IF '$GET(DGNCMG)
- SET DGNCMG=$PIECE(^XTMP(DGNMSP,0),U,6)
- IF 'DGNCMG
- QUIT
- +4 NEW DGFDA,DGMSG
- +5 SET DGFDA(43,"1,",502)=DGNCMG
- +6 DO FILE^DIE("","DGFDA","DGMSG")
- +7 QUIT