source: WorldVistAEHR/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/EC2P72PT.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 6.0 KB
Line 
1EC2P72PT ;ALB/JAM - PATCH EC*2.0*72 Post-Init Rtn ; 5/11/06 2:57pm
2 ;;2.0; EVENT CAPTURE ;**72**;8 May 96
3 ;
4POST ; entry point
5 D MES^XPDUTL(" ")
6 D BMES^XPDUTL("Converting Provider fields 10,15 and 17 to a multiple field")
7 D MES^XPDUTL(" in EVENT CAPTURE PATIENT file (#721)...")
8 D MES^XPDUTL(" ")
9 I '$D(^ECH) D Q
10 .D BMES^XPDUTL("Event Capture File #721 doesn't exist on this account.")
11 .D MES^XPDUTL(" No conversion necessary. Process terminated...")
12 D MES^XPDUTL(" ")
13 I '$D(^DD(721,42)) D Q
14 .D BMES^XPDUTL("Event Capture Field #42 doesn't exist on this account.")
15 .D MES^XPDUTL(" Conversion CANNOT proceed. Process terminated...")
16 D EN1
17 Q
18 ;
19RESTART ;Restart Provider fields conversion backjob
20 D BMES^XPDUTL("Restarting Conversion of Provider fields 10,15 and 17 to a ")
21 D MES^XPDUTL(" multiple field in EVENT CAPTURE PATIENT file (#721)...")
22 D MES^XPDUTL(" ")
23 D EN1
24 Q
25EN1 ;
26 L +^ECH(0):10 I '$T D G END
27 .D BMES^XPDUTL("Event Capture File in Use. Try again later..")
28 D BMES^XPDUTL("*** Event Capture menu will be locked and unavailable... ***")
29 D BMES^XPDUTL("You will receive a MailMan message when task is completed or if stopped.")
30 D BMES^XPDUTL(" ")
31 S ZTRTN="START^EC2P72PT",ZTDESC="Provider Conversion in File #721, EC*2*72",ZTIO=""
32 S ZTDTH=$H,ZTREQ="@",ZTSAVE("ZTREQ")=""
33 I $G(XPDSET)'="" S ZTSAVE("XPDSET")=""
34 D ^%ZTLOAD
35END D KILL1
36 L -^ECH(0)
37 Q
38 ;
39START ;* background job entry point
40 N ECIEN,ECDAT,ECPRV,X1,X2,X,I,TXTVAR,LINE,COUNT,STOP,ECX1
41 ;Disable options
42 D OUT^XPDMENU("ECXEC","OUT OF ORDER FOR EC PROVIDER CONVERSION")
43 D OUT^XPDMENU("ECMENU","OUT OF ORDER FOR EC PROVIDER CONVERSION")
44 D OUT^XPDMENU("EC GUI CONTEXT","OUT OF ORDER FOR EC PROVIDER CONVERSION")
45 D OUT^XPDMENU("ECMGR","OUT OF ORDER FOR EC PROVIDER CONVERSION")
46 K ^TMP($J,"EC2P72")
47 S (COUNT,STOP)=0,ECIEN=+$G(^XTMP("ECPROVIDER",1))
48 S (ECX1,X1)=$$NOW^XLFDT(),X2=60 D C^%DTC
49 I '$D(^XTMP("ECPROVIDER",0)) D
50 .S ^XTMP("ECPROVIDER",0)=X_"^"_ECX1_"^EC Provider fields conversion to multiple"
51 S ^XTMP("ECPROVIDER",3)=$$FMTE^XLFDT($$NOW^XLFDT(),1) ;start time
52 F I=1:1 S TXTVAR=$P($T(MSGTXT+I),";;",2) Q:TXTVAR="QUIT" D LINE(TXTVAR)
53 L +^ECH(0):60 ;review if this is necessary
54 F S ECIEN=$O(^ECH(ECIEN)) Q:'ECIEN D I STOP Q
55 .S ECDAT=$G(^ECH(ECIEN,0)) I ECDAT="" D UPXTMP Q
56 .K ECPRV
57 .I $P(ECDAT,"^",11)'="" S ECPRV(1)=$P(ECDAT,"^",11)_"^P"
58 .I $P(ECDAT,"^",15)'="" S ECPRV(2)=$P(ECDAT,"^",15)_"^"_$S($O(ECPRV("")):"S",1:"P")
59 .I $P(ECDAT,"^",17)'="" S ECPRV(3)=$P(ECDAT,"^",17)_"^"_$S($O(ECPRV("")):"S",1:"P")
60 .D UPD721
61 .D UPXTMP
62 .;Check Background task (taskman) - to see if task stopped
63 .S STOP=$$S^%ZTLOAD()
64 S $P(^XTMP("ECPROVIDER",3),"^",2)=$$FMTE^XLFDT($$NOW^XLFDT(),1)
65 I STOP D G END1
66 .D LINE(" The provider conversion process was aborted.")
67 .D LINE(" Conversion began: "_$P($G(^XTMP("ECPROVIDER",3)),"^"))
68 .D LINE(" Conversion terminated: "_$P($G(^XTMP("ECPROVIDER",3)),"^",2))
69 .D LINE(" Last record (IEN) Updated: "_$G(^XTMP("ECPROVIDER",1)))
70 .D LINE(" Last IEN in File #721: "_$O(^ECH("A"),-1))
71 .D LINE(" Total # Records converted: "_$G(^XTMP("ECPROVIDER",2)))
72 .D LINE(" ")
73 .D LINE(" To restart the provider conversion process enter the following at the programmer's prompt.")
74 .D LINE(" D RESTART^EC2P72PT")
75 .D LINE(" ")
76 .D LINE(" Make sure the following options are placed out of order")
77 .D LINE(" ECMENU Event Capture Menu")
78 .D LINE(" EC GUI CONTEXT EC GUI Context version 2.0.11.1")
79 .D LINE(" ECXEC Event Capture Extract")
80 .D LINE(" ECMGR Event Capture Management Menu")
81 D LINE(" The provider conversion process was successfully completed.")
82 D LINE(" Conversion began: "_$P($G(^XTMP("ECPROVIDER",3)),"^"))
83 D LINE(" Conversion completed: "_$P($G(^XTMP("ECPROVIDER",3)),"^",2))
84 D LINE(" Last record (IEN) converted: "_$G(^XTMP("ECPROVIDER",1)))
85 D LINE(" Last IEN in File #721: "_$O(^ECH("A"),-1))
86 D LINE(" Total # Records converted: "_$G(^XTMP("ECPROVIDER",2)))
87 D LINE(" ")
88 D LINE(" Make sure the following options are placed back in order")
89 D LINE(" ECMENU Event Capture Menu")
90 D LINE(" EC GUI CONTEXT EC GUI Context version 2.1.0.0")
91 D LINE(" ECXEC Event Capture Extract")
92 ;Place option back in order
93 D OUT^XPDMENU("ECXEC","")
94 D OUT^XPDMENU("ECMENU","")
95 D OUT^XPDMENU("EC GUI CONTEXT","")
96 D OUT^XPDMENU("ECMGR","")
97END1 D MAIL
98 L -^ECH(0)
99 K ^TMP($J,"EC2P72"),I,Y
100 Q
101UPXTMP ;Update ^XTMP with last ECIEN from ^ECH
102 S ^XTMP("ECPROVIDER",1)=ECIEN
103 S ^XTMP("ECPROVIDER",2)=+$G(^XTMP("ECPROVIDER",2))+1
104 Q
105UPD721 ;Update ^ECH with providers at multiple field #42.
106 N SIEN,ECDATA,ECPRVDA,ECERR,DA,DIK
107 ;delete old entries
108 I '$D(ECPRV) Q
109 I $D(^ECH(ECIEN,"PRV")) D
110 . S DA(1)=ECIEN,DIK="^ECH("_DA(1)_",""PRV"",",DA=0
111 . F S DA=$O(^ECH(DA(1),"PRV",DA)) Q:'DA D ^DIK
112 S SIEN=0
113 F S SIEN=$O(ECPRV(SIEN)) Q:'SIEN D
114 .S ECDATA=ECPRV(SIEN)
115 .D FILALT
116 Q
117FILALT ;If error occurs filing trying record using another method
118 N DIC,DD,DO,X,DIE,DR,DA
119 S DIC(0)="L",DA(1)=ECIEN,DIC("P")=$P(^DD(721,42,0),U,2)
120 S X=+ECDATA,DIC="^ECH("_DA(1)_","_"""PRV"""_"," D FILE^DICN
121 S DIE=DIC,DR=".02////"_$P(ECDATA,U,2) D ^DIE
122 Q
123 ;
124LINE(TEXT) ; Add line to message global
125 S COUNT=COUNT+1,^TMP($J,"EC2P72",COUNT)=TEXT
126 Q
127 ;
128MSGTXT ; Message intro
129 ;; Please forward this message to your local DSS Site Manager or
130 ;; Event Capture ADPAC.
131 ;;
132 ;; A conversion was done on the providers stored in fields #10, 15
133 ;; and 17 in Event Capture file #721. The data was moved to a new
134 ;; provider multiple field #42 in file #721. The data in fields
135 ;; #10, 15 and 17 will remain but no new data will be populated in
136 ;; these fields with the installation of EC*2.0*72. This message
137 ;; provides the results of the conversion.
138 ;;
139 ;;QUIT
140 ;
141MAIL ; Send message
142 N XMDUZ,XMY,XMTEXT,XMSUB
143 S XMY(DUZ)="",XMDUZ=.5
144 S XMSUB="Event Capture Provider Field Conversion to New Multiple Field"
145 S XMTEXT="^TMP($J,""EC2P72"","
146 D ^XMD
147 Q
148KILL1 ;
149 K ZTDESC,ZTDTH,ZTIO,ZTREQ,ZTRTN,ZTSAVE("ZTREQ"),ECKID
150 Q
Note: See TracBrowser for help on using the repository browser.