EC2P72PT ;ALB/JAM - PATCH EC*2.0*72 Post-Init Rtn ; 5/11/06 2:57pm
;;2.0; EVENT CAPTURE ;**72**;8 May 96
;
POST ; entry point
D MES^XPDUTL(" ")
D BMES^XPDUTL("Converting Provider fields 10,15 and 17 to a multiple field")
D MES^XPDUTL(" in EVENT CAPTURE PATIENT file (#721)...")
D MES^XPDUTL(" ")
I '$D(^ECH) D Q
.D BMES^XPDUTL("Event Capture File #721 doesn't exist on this account.")
.D MES^XPDUTL(" No conversion necessary. Process terminated...")
D MES^XPDUTL(" ")
I '$D(^DD(721,42)) D Q
.D BMES^XPDUTL("Event Capture Field #42 doesn't exist on this account.")
.D MES^XPDUTL(" Conversion CANNOT proceed. Process terminated...")
D EN1
Q
;
RESTART ;Restart Provider fields conversion backjob
D BMES^XPDUTL("Restarting Conversion of Provider fields 10,15 and 17 to a ")
D MES^XPDUTL(" multiple field in EVENT CAPTURE PATIENT file (#721)...")
D MES^XPDUTL(" ")
D EN1
Q
EN1 ;
L +^ECH(0):10 I '$T D G END
.D BMES^XPDUTL("Event Capture File in Use. Try again later..")
D BMES^XPDUTL("*** Event Capture menu will be locked and unavailable... ***")
D BMES^XPDUTL("You will receive a MailMan message when task is completed or if stopped.")
D BMES^XPDUTL(" ")
S ZTRTN="START^EC2P72PT",ZTDESC="Provider Conversion in File #721, EC*2*72",ZTIO=""
S ZTDTH=$H,ZTREQ="@",ZTSAVE("ZTREQ")=""
I $G(XPDSET)'="" S ZTSAVE("XPDSET")=""
D ^%ZTLOAD
END D KILL1
L -^ECH(0)
Q
;
START ;* background job entry point
N ECIEN,ECDAT,ECPRV,X1,X2,X,I,TXTVAR,LINE,COUNT,STOP,ECX1
;Disable options
D OUT^XPDMENU("ECXEC","OUT OF ORDER FOR EC PROVIDER CONVERSION")
D OUT^XPDMENU("ECMENU","OUT OF ORDER FOR EC PROVIDER CONVERSION")
D OUT^XPDMENU("EC GUI CONTEXT","OUT OF ORDER FOR EC PROVIDER CONVERSION")
D OUT^XPDMENU("ECMGR","OUT OF ORDER FOR EC PROVIDER CONVERSION")
K ^TMP($J,"EC2P72")
S (COUNT,STOP)=0,ECIEN=+$G(^XTMP("ECPROVIDER",1))
S (ECX1,X1)=$$NOW^XLFDT(),X2=60 D C^%DTC
I '$D(^XTMP("ECPROVIDER",0)) D
.S ^XTMP("ECPROVIDER",0)=X_"^"_ECX1_"^EC Provider fields conversion to multiple"
S ^XTMP("ECPROVIDER",3)=$$FMTE^XLFDT($$NOW^XLFDT(),1) ;start time
F I=1:1 S TXTVAR=$P($T(MSGTXT+I),";;",2) Q:TXTVAR="QUIT" D LINE(TXTVAR)
L +^ECH(0):60 ;review if this is necessary
F S ECIEN=$O(^ECH(ECIEN)) Q:'ECIEN D I STOP Q
.S ECDAT=$G(^ECH(ECIEN,0)) I ECDAT="" D UPXTMP Q
.K ECPRV
.I $P(ECDAT,"^",11)'="" S ECPRV(1)=$P(ECDAT,"^",11)_"^P"
.I $P(ECDAT,"^",15)'="" S ECPRV(2)=$P(ECDAT,"^",15)_"^"_$S($O(ECPRV("")):"S",1:"P")
.I $P(ECDAT,"^",17)'="" S ECPRV(3)=$P(ECDAT,"^",17)_"^"_$S($O(ECPRV("")):"S",1:"P")
.D UPD721
.D UPXTMP
.;Check Background task (taskman) - to see if task stopped
.S STOP=$$S^%ZTLOAD()
S $P(^XTMP("ECPROVIDER",3),"^",2)=$$FMTE^XLFDT($$NOW^XLFDT(),1)
I STOP D G END1
.D LINE(" The provider conversion process was aborted.")
.D LINE(" Conversion began: "_$P($G(^XTMP("ECPROVIDER",3)),"^"))
.D LINE(" Conversion terminated: "_$P($G(^XTMP("ECPROVIDER",3)),"^",2))
.D LINE(" Last record (IEN) Updated: "_$G(^XTMP("ECPROVIDER",1)))
.D LINE(" Last IEN in File #721: "_$O(^ECH("A"),-1))
.D LINE(" Total # Records converted: "_$G(^XTMP("ECPROVIDER",2)))
.D LINE(" ")
.D LINE(" To restart the provider conversion process enter the following at the programmer's prompt.")
.D LINE(" D RESTART^EC2P72PT")
.D LINE(" ")
.D LINE(" Make sure the following options are placed out of order")
.D LINE(" ECMENU Event Capture Menu")
.D LINE(" EC GUI CONTEXT EC GUI Context version 2.0.11.1")
.D LINE(" ECXEC Event Capture Extract")
.D LINE(" ECMGR Event Capture Management Menu")
D LINE(" The provider conversion process was successfully completed.")
D LINE(" Conversion began: "_$P($G(^XTMP("ECPROVIDER",3)),"^"))
D LINE(" Conversion completed: "_$P($G(^XTMP("ECPROVIDER",3)),"^",2))
D LINE(" Last record (IEN) converted: "_$G(^XTMP("ECPROVIDER",1)))
D LINE(" Last IEN in File #721: "_$O(^ECH("A"),-1))
D LINE(" Total # Records converted: "_$G(^XTMP("ECPROVIDER",2)))
D LINE(" ")
D LINE(" Make sure the following options are placed back in order")
D LINE(" ECMENU Event Capture Menu")
D LINE(" EC GUI CONTEXT EC GUI Context version 2.1.0.0")
D LINE(" ECXEC Event Capture Extract")
;Place option back in order
D OUT^XPDMENU("ECXEC","")
D OUT^XPDMENU("ECMENU","")
D OUT^XPDMENU("EC GUI CONTEXT","")
D OUT^XPDMENU("ECMGR","")
END1 D MAIL
L -^ECH(0)
K ^TMP($J,"EC2P72"),I,Y
Q
UPXTMP ;Update ^XTMP with last ECIEN from ^ECH
S ^XTMP("ECPROVIDER",1)=ECIEN
S ^XTMP("ECPROVIDER",2)=+$G(^XTMP("ECPROVIDER",2))+1
Q
UPD721 ;Update ^ECH with providers at multiple field #42.
N SIEN,ECDATA,ECPRVDA,ECERR,DA,DIK
;delete old entries
I '$D(ECPRV) Q
I $D(^ECH(ECIEN,"PRV")) D
. S DA(1)=ECIEN,DIK="^ECH("_DA(1)_",""PRV"",",DA=0
. F S DA=$O(^ECH(DA(1),"PRV",DA)) Q:'DA D ^DIK
S SIEN=0
F S SIEN=$O(ECPRV(SIEN)) Q:'SIEN D
.S ECDATA=ECPRV(SIEN)
.D FILALT
Q
FILALT ;If error occurs filing trying record using another method
N DIC,DD,DO,X,DIE,DR,DA
S DIC(0)="L",DA(1)=ECIEN,DIC("P")=$P(^DD(721,42,0),U,2)
S X=+ECDATA,DIC="^ECH("_DA(1)_","_"""PRV"""_"," D FILE^DICN
S DIE=DIC,DR=".02////"_$P(ECDATA,U,2) D ^DIE
Q
;
LINE(TEXT) ; Add line to message global
S COUNT=COUNT+1,^TMP($J,"EC2P72",COUNT)=TEXT
Q
;
MSGTXT ; Message intro
;; Please forward this message to your local DSS Site Manager or
;; Event Capture ADPAC.
;;
;; A conversion was done on the providers stored in fields #10, 15
;; and 17 in Event Capture file #721. The data was moved to a new
;; provider multiple field #42 in file #721. The data in fields
;; #10, 15 and 17 will remain but no new data will be populated in
;; these fields with the installation of EC*2.0*72. This message
;; provides the results of the conversion.
;;
;;QUIT
;
MAIL ; Send message
N XMDUZ,XMY,XMTEXT,XMSUB
S XMY(DUZ)="",XMDUZ=.5
S XMSUB="Event Capture Provider Field Conversion to New Multiple Field"
S XMTEXT="^TMP($J,""EC2P72"","
D ^XMD
Q
KILL1 ;
K ZTDESC,ZTDTH,ZTIO,ZTREQ,ZTRTN,ZTSAVE("ZTREQ"),ECKID
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEC2P72PT 6331 printed Dec 13, 2024@01:56:09 Page 2
EC2P72PT ;ALB/JAM - PATCH EC*2.0*72 Post-Init Rtn ; 5/11/06 2:57pm
+1 ;;2.0; EVENT CAPTURE ;**72**;8 May 96
+2 ;
POST ; entry point
+1 DO MES^XPDUTL(" ")
+2 DO BMES^XPDUTL("Converting Provider fields 10,15 and 17 to a multiple field")
+3 DO MES^XPDUTL(" in EVENT CAPTURE PATIENT file (#721)...")
+4 DO MES^XPDUTL(" ")
+5 IF '$DATA(^ECH)
Begin DoDot:1
+6 DO BMES^XPDUTL("Event Capture File #721 doesn't exist on this account.")
+7 DO MES^XPDUTL(" No conversion necessary. Process terminated...")
End DoDot:1
QUIT
+8 DO MES^XPDUTL(" ")
+9 IF '$DATA(^DD(721,42))
Begin DoDot:1
+10 DO BMES^XPDUTL("Event Capture Field #42 doesn't exist on this account.")
+11 DO MES^XPDUTL(" Conversion CANNOT proceed. Process terminated...")
End DoDot:1
QUIT
+12 DO EN1
+13 QUIT
+14 ;
RESTART ;Restart Provider fields conversion backjob
+1 DO BMES^XPDUTL("Restarting Conversion of Provider fields 10,15 and 17 to a ")
+2 DO MES^XPDUTL(" multiple field in EVENT CAPTURE PATIENT file (#721)...")
+3 DO MES^XPDUTL(" ")
+4 DO EN1
+5 QUIT
EN1 ;
+1 LOCK +^ECH(0):10
IF '$TEST
Begin DoDot:1
+2 DO BMES^XPDUTL("Event Capture File in Use. Try again later..")
End DoDot:1
GOTO END
+3 DO BMES^XPDUTL("*** Event Capture menu will be locked and unavailable... ***")
+4 DO BMES^XPDUTL("You will receive a MailMan message when task is completed or if stopped.")
+5 DO BMES^XPDUTL(" ")
+6 SET ZTRTN="START^EC2P72PT"
SET ZTDESC="Provider Conversion in File #721, EC*2*72"
SET ZTIO=""
+7 SET ZTDTH=$HOROLOG
SET ZTREQ="@"
SET ZTSAVE("ZTREQ")=""
+8 IF $GET(XPDSET)'=""
SET ZTSAVE("XPDSET")=""
+9 DO ^%ZTLOAD
END DO KILL1
+1 LOCK -^ECH(0)
+2 QUIT
+3 ;
START ;* background job entry point
+1 NEW ECIEN,ECDAT,ECPRV,X1,X2,X,I,TXTVAR,LINE,COUNT,STOP,ECX1
+2 ;Disable options
+3 DO OUT^XPDMENU("ECXEC","OUT OF ORDER FOR EC PROVIDER CONVERSION")
+4 DO OUT^XPDMENU("ECMENU","OUT OF ORDER FOR EC PROVIDER CONVERSION")
+5 DO OUT^XPDMENU("EC GUI CONTEXT","OUT OF ORDER FOR EC PROVIDER CONVERSION")
+6 DO OUT^XPDMENU("ECMGR","OUT OF ORDER FOR EC PROVIDER CONVERSION")
+7 KILL ^TMP($JOB,"EC2P72")
+8 SET (COUNT,STOP)=0
SET ECIEN=+$GET(^XTMP("ECPROVIDER",1))
+9 SET (ECX1,X1)=$$NOW^XLFDT()
SET X2=60
DO C^%DTC
+10 IF '$DATA(^XTMP("ECPROVIDER",0))
Begin DoDot:1
+11 SET ^XTMP("ECPROVIDER",0)=X_"^"_ECX1_"^EC Provider fields conversion to multiple"
End DoDot:1
+12 ;start time
SET ^XTMP("ECPROVIDER",3)=$$FMTE^XLFDT($$NOW^XLFDT(),1)
+13 FOR I=1:1
SET TXTVAR=$PIECE($TEXT(MSGTXT+I),";;",2)
if TXTVAR="QUIT"
QUIT
DO LINE(TXTVAR)
+14 ;review if this is necessary
LOCK +^ECH(0):60
+15 FOR
SET ECIEN=$ORDER(^ECH(ECIEN))
if 'ECIEN
QUIT
Begin DoDot:1
+16 SET ECDAT=$GET(^ECH(ECIEN,0))
IF ECDAT=""
DO UPXTMP
QUIT
+17 KILL ECPRV
+18 IF $PIECE(ECDAT,"^",11)'=""
SET ECPRV(1)=$PIECE(ECDAT,"^",11)_"^P"
+19 IF $PIECE(ECDAT,"^",15)'=""
SET ECPRV(2)=$PIECE(ECDAT,"^",15)_"^"_$SELECT($ORDER(ECPRV("")):"S",1:"P")
+20 IF $PIECE(ECDAT,"^",17)'=""
SET ECPRV(3)=$PIECE(ECDAT,"^",17)_"^"_$SELECT($ORDER(ECPRV("")):"S",1:"P")
+21 DO UPD721
+22 DO UPXTMP
+23 ;Check Background task (taskman) - to see if task stopped
+24 SET STOP=$$S^%ZTLOAD()
End DoDot:1
IF STOP
QUIT
+25 SET $PIECE(^XTMP("ECPROVIDER",3),"^",2)=$$FMTE^XLFDT($$NOW^XLFDT(),1)
+26 IF STOP
Begin DoDot:1
+27 DO LINE(" The provider conversion process was aborted.")
+28 DO LINE(" Conversion began: "_$PIECE($GET(^XTMP("ECPROVIDER",3)),"^"))
+29 DO LINE(" Conversion terminated: "_$PIECE($GET(^XTMP("ECPROVIDER",3)),"^",2))
+30 DO LINE(" Last record (IEN) Updated: "_$GET(^XTMP("ECPROVIDER",1)))
+31 DO LINE(" Last IEN in File #721: "_$ORDER(^ECH("A"),-1))
+32 DO LINE(" Total # Records converted: "_$GET(^XTMP("ECPROVIDER",2)))
+33 DO LINE(" ")
+34 DO LINE(" To restart the provider conversion process enter the following at the programmer's prompt.")
+35 DO LINE(" D RESTART^EC2P72PT")
+36 DO LINE(" ")
+37 DO LINE(" Make sure the following options are placed out of order")
+38 DO LINE(" ECMENU Event Capture Menu")
+39 DO LINE(" EC GUI CONTEXT EC GUI Context version 2.0.11.1")
+40 DO LINE(" ECXEC Event Capture Extract")
+41 DO LINE(" ECMGR Event Capture Management Menu")
End DoDot:1
GOTO END1
+42 DO LINE(" The provider conversion process was successfully completed.")
+43 DO LINE(" Conversion began: "_$PIECE($GET(^XTMP("ECPROVIDER",3)),"^"))
+44 DO LINE(" Conversion completed: "_$PIECE($GET(^XTMP("ECPROVIDER",3)),"^",2))
+45 DO LINE(" Last record (IEN) converted: "_$GET(^XTMP("ECPROVIDER",1)))
+46 DO LINE(" Last IEN in File #721: "_$ORDER(^ECH("A"),-1))
+47 DO LINE(" Total # Records converted: "_$GET(^XTMP("ECPROVIDER",2)))
+48 DO LINE(" ")
+49 DO LINE(" Make sure the following options are placed back in order")
+50 DO LINE(" ECMENU Event Capture Menu")
+51 DO LINE(" EC GUI CONTEXT EC GUI Context version 2.1.0.0")
+52 DO LINE(" ECXEC Event Capture Extract")
+53 ;Place option back in order
+54 DO OUT^XPDMENU("ECXEC","")
+55 DO OUT^XPDMENU("ECMENU","")
+56 DO OUT^XPDMENU("EC GUI CONTEXT","")
+57 DO OUT^XPDMENU("ECMGR","")
END1 DO MAIL
+1 LOCK -^ECH(0)
+2 KILL ^TMP($JOB,"EC2P72"),I,Y
+3 QUIT
UPXTMP ;Update ^XTMP with last ECIEN from ^ECH
+1 SET ^XTMP("ECPROVIDER",1)=ECIEN
+2 SET ^XTMP("ECPROVIDER",2)=+$GET(^XTMP("ECPROVIDER",2))+1
+3 QUIT
UPD721 ;Update ^ECH with providers at multiple field #42.
+1 NEW SIEN,ECDATA,ECPRVDA,ECERR,DA,DIK
+2 ;delete old entries
+3 IF '$DATA(ECPRV)
QUIT
+4 IF $DATA(^ECH(ECIEN,"PRV"))
Begin DoDot:1
+5 SET DA(1)=ECIEN
SET DIK="^ECH("_DA(1)_",""PRV"","
SET DA=0
+6 FOR
SET DA=$ORDER(^ECH(DA(1),"PRV",DA))
if 'DA
QUIT
DO ^DIK
End DoDot:1
+7 SET SIEN=0
+8 FOR
SET SIEN=$ORDER(ECPRV(SIEN))
if 'SIEN
QUIT
Begin DoDot:1
+9 SET ECDATA=ECPRV(SIEN)
+10 DO FILALT
End DoDot:1
+11 QUIT
FILALT ;If error occurs filing trying record using another method
+1 NEW DIC,DD,DO,X,DIE,DR,DA
+2 SET DIC(0)="L"
SET DA(1)=ECIEN
SET DIC("P")=$PIECE(^DD(721,42,0),U,2)
+3 SET X=+ECDATA
SET DIC="^ECH("_DA(1)_","_"""PRV"""_","
DO FILE^DICN
+4 SET DIE=DIC
SET DR=".02////"_$PIECE(ECDATA,U,2)
DO ^DIE
+5 QUIT
+6 ;
LINE(TEXT) ; Add line to message global
+1 SET COUNT=COUNT+1
SET ^TMP($JOB,"EC2P72",COUNT)=TEXT
+2 QUIT
+3 ;
MSGTXT ; Message intro
+1 ;; Please forward this message to your local DSS Site Manager or
+2 ;; Event Capture ADPAC.
+3 ;;
+4 ;; A conversion was done on the providers stored in fields #10, 15
+5 ;; and 17 in Event Capture file #721. The data was moved to a new
+6 ;; provider multiple field #42 in file #721. The data in fields
+7 ;; #10, 15 and 17 will remain but no new data will be populated in
+8 ;; these fields with the installation of EC*2.0*72. This message
+9 ;; provides the results of the conversion.
+10 ;;
+11 ;;QUIT
+12 ;
MAIL ; Send message
+1 NEW XMDUZ,XMY,XMTEXT,XMSUB
+2 SET XMY(DUZ)=""
SET XMDUZ=.5
+3 SET XMSUB="Event Capture Provider Field Conversion to New Multiple Field"
+4 SET XMTEXT="^TMP($J,""EC2P72"","
+5 DO ^XMD
+6 QUIT
KILL1 ;
+1 KILL ZTDESC,ZTDTH,ZTIO,ZTREQ,ZTRTN,ZTSAVE("ZTREQ"),ECKID
+2 QUIT