source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQPST20.m@ 1406

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

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1VAQPST20 ;ALB/JRP - POST INIT (FILE CONVERSION);11-JUN-93
2 ;;1.5;PATIENT DATA EXCHANGE;**5**;NOV 17, 1993
3 ;
4TASK ;ENTRY POINT TO TASK CONVERSION
5 N %ZIS,POP,ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK,WTEXT
6 W @IOF
7 W !!!,"- Conversion of version 1.0 files will now be tasked -"
8 W !!,"Entering 'HOME' as the device for output will cause conversion"
9 W !,"to be run without an output device. It is recommended that a"
10 W !,"device be chosen so that errors during the conversion can be"
11 W !,"reported."
12 W !!,"Entering '^' as the device for output will skip the conversion"
13 W !,"process. Please refer to the INSTALLATION GUIDE if you choose"
14 W !,"to do this.",!!
15 S %ZIS="N0"
16 S %ZIS("A")="Enter device to use during conversion: "
17 D ^%ZIS
18 I (POP) D Q
19 .W !!,"- Conversion will not be done at this time -"
20 .W !!,"To run conversion at a later date the entry point TASK^VAQPST20"
21 .W !,"should be used."
22 .W !!,"If you have chosen to skip the conversion the entry point"
23 .W !,"DELETE^VAQPST24(1) must be used in order to delete entries"
24 .W !,"contained in the 1.0 files.",!!
25 S:(IOT="HFS") IO("HFSIO")=IO
26 S WTEXT=$S((IO=IO(0)):0,1:1)
27 S ZTRTN=$S(WTEXT:"INTER^VAQPST20",1:"NONINTER^VAQPST20")
28 S ZTDESC="Conversion of PDX version 1.0 files ("_$S(WTEXT:"with output",1:"no output")_")"
29 S ZTIO=$S(WTEXT:ION,1:"")
30 S ZTDTH=""
31 D ^%ZTLOAD
32 I ('$G(ZTSK)) D Q
33 .W !!,"** Tasking of conversion was not accomplished **"
34 .W !,"Use the entry point TASK^VAQPST20 to retry tasking of conversion"
35 W !!,"Conversion tasked (",ZTSK,")"
36 Q
37INTER ;ENTRY POINT FOR INTERACTIVE CONVERSION
38 D CONVERT(1) Q
39 ;
40NONINTER ;ENTRY POINT FOR NON-INTERACTIVE CONVERSION
41 D CONVERT(0) Q
42 ;
43CONVERT(WTEXT) ;CONVERT VERSION 1.0 FILE ENTRIES TO VERSION 1.5
44 ;INPUT : WTEXT - Write text to screen
45 ; (used for debugging/interactive conversion)
46 ; 1 - Yes
47 ; 0 - No (default)
48 ;CHECK INPUT
49 S WTEXT=+$G(WTEXT)
50 N SITENAME,ADDRESS,NODE,TRANARR,TMP,RQSTDONE,MANDONE,RSLTDONE,X,Y
51 S TRANARR="^VAT(394,""A-CONVERT"")"
52 ;DETERMINE SITE NAME AND DOMAIN
53 S TMP=+$O(^VAT(394.2,0))
54 I ('TMP) W:(WTEXT) !,"Entry in PDX PARAMETER file (#394.2) not present" Q
55 S NODE=$G(^VAT(394.2,TMP,0))
56 S SITENAME=$P(NODE,"^",6)
57 I (SITENAME="") W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's name" Q
58 S TMP=+$P(NODE,"^",4)
59 I ('TMP) W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's domain" Q
60 S ADDRESS=$P($G(^DIC(4.2,TMP,0)),"^",1)
61 I (ADDRESS="") W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's domain" Q
62 ;WRITE BEGINNING TEXT
63 I (WTEXT) D
64 .S TMP=$$REPEAT^VAQUTL1("*",80)
65 .S X=" BEGIN CONVERSION OF PDX VERSION 1.0 FILES "
66 .S Y=(40-($L(X)/2))+1
67 .W !!
68 .W $$INSERT^VAQUTL1(X,TMP,Y,$L(X))
69 .W !!
70 .W !,"Your site's name: ",SITENAME
71 .W !,"Your site's domain: ",ADDRESS
72 .W !,"Conversion started at: ",$$NOW^VAQUTL99
73 ;CONVERT LOCAL REQUESTS
74 S RQSTDONE=$$REQUEST^VAQPST21(SITENAME,ADDRESS,TRANARR,WTEXT)
75 W:(WTEXT) !!
76 I (RQSTDONE<1) D
77 .W:(WTEXT) !
78 .W:((WTEXT)&(+RQSTDONE)) !,"** Unable to attempt conversion of local requests **",!,?5,$P(TMP,"^",2)
79 .W:((WTEXT)&('RQSTDONE)) !,"** No local requests were successfully converted **"
80 I (RQSTDONE>0) W:(WTEXT) !!,RQSTDONE," local request",$S((RQSTDONE=1):" was",1:"s were")," successfully converted"
81 W:(WTEXT) !
82 ;CONVERT REMOTE REQUESTS
83 S MANDONE=$$PROCESS^VAQPST22(SITENAME,ADDRESS,WTEXT)
84 W:(WTEXT) !!
85 I (MANDONE<1) D
86 .W:(WTEXT) !
87 .W:((WTEXT)&(+MANDONE)) !,"** Unable to attempt conversion of remote requests **",!,?5,$P(TMP,"^",2)
88 .W:((WTEXT)&('MANDONE)) !,"** No remote requests were successfully converted **"
89 I (MANDONE>0) W:(WTEXT) !!,MANDONE," remote request",$S((MANDONE=1):" was",1:"s were")," successfully converted"
90 W:(WTEXT) !
91 ;CONVERT REMOTE REQUESTS
92 S RSLTDONE=$$RESULTS^VAQPST23(TRANARR,WTEXT)
93 W:(WTEXT) !!
94 I (RSLTDONE<1) D
95 .W:(WTEXT) !
96 .W:((WTEXT)&(+RSLTDONE)) !,"** Unable to attempt conversion of Unsolicited PDXs & request results **",!,?5,$P(TMP,"^",2)
97 .W:((WTEXT)&('RSLTDONE)) !,"** No Unsolicited PDXs & request results were successfully converted **"
98 I (RSLTDONE>0) W:(WTEXT) !!,RSLTDONE," Unsolicited PDXs & request results were successfully converted"
99 W:(WTEXT) !
100 ;DELETE ENTRIES IN 1.0 FILES
101 D DELETE^VAQPST24(WTEXT)
102 W:(WTEXT) !!
103 D CLEAN
104 Q
105 ;
106CLEAN ;CLEAN UP
107 K @TRANARR
108 I (WTEXT) D
109 .W !!!,"Conversion completed at: ",$$NOW^VAQUTL99
110 .S TMP=$$REPEAT^VAQUTL1("*",80)
111 .S X=" END CONVERSION OF PDX VERSION 1.0 FILES "
112 .S Y=(40-($L(X)/2))+1
113 .W !!
114 .W $$INSERT^VAQUTL1(X,TMP,Y,$L(X))
115 .W @IOF
116 Q
Note: See TracBrowser for help on using the repository browser.