- VAQPST20 ;ALB/JRP - POST INIT (FILE CONVERSION);11-JUN-93
- ;;1.5;PATIENT DATA EXCHANGE;**5**;NOV 17, 1993
- ;
- TASK ;ENTRY POINT TO TASK CONVERSION
- N %ZIS,POP,ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK,WTEXT
- W @IOF
- W !!!,"- Conversion of version 1.0 files will now be tasked -"
- W !!,"Entering 'HOME' as the device for output will cause conversion"
- W !,"to be run without an output device. It is recommended that a"
- W !,"device be chosen so that errors during the conversion can be"
- W !,"reported."
- W !!,"Entering '^' as the device for output will skip the conversion"
- W !,"process. Please refer to the INSTALLATION GUIDE if you choose"
- W !,"to do this.",!!
- S %ZIS="N0"
- S %ZIS("A")="Enter device to use during conversion: "
- D ^%ZIS
- I (POP) D Q
- .W !!,"- Conversion will not be done at this time -"
- .W !!,"To run conversion at a later date the entry point TASK^VAQPST20"
- .W !,"should be used."
- .W !!,"If you have chosen to skip the conversion the entry point"
- .W !,"DELETE^VAQPST24(1) must be used in order to delete entries"
- .W !,"contained in the 1.0 files.",!!
- S:(IOT="HFS") IO("HFSIO")=IO
- S WTEXT=$S((IO=IO(0)):0,1:1)
- S ZTRTN=$S(WTEXT:"INTER^VAQPST20",1:"NONINTER^VAQPST20")
- S ZTDESC="Conversion of PDX version 1.0 files ("_$S(WTEXT:"with output",1:"no output")_")"
- S ZTIO=$S(WTEXT:ION,1:"")
- S ZTDTH=""
- D ^%ZTLOAD
- I ('$G(ZTSK)) D Q
- .W !!,"** Tasking of conversion was not accomplished **"
- .W !,"Use the entry point TASK^VAQPST20 to retry tasking of conversion"
- W !!,"Conversion tasked (",ZTSK,")"
- Q
- INTER ;ENTRY POINT FOR INTERACTIVE CONVERSION
- D CONVERT(1) Q
- ;
- NONINTER ;ENTRY POINT FOR NON-INTERACTIVE CONVERSION
- D CONVERT(0) Q
- ;
- CONVERT(WTEXT) ;CONVERT VERSION 1.0 FILE ENTRIES TO VERSION 1.5
- ;INPUT : WTEXT - Write text to screen
- ; (used for debugging/interactive conversion)
- ; 1 - Yes
- ; 0 - No (default)
- ;CHECK INPUT
- S WTEXT=+$G(WTEXT)
- N SITENAME,ADDRESS,NODE,TRANARR,TMP,RQSTDONE,MANDONE,RSLTDONE,X,Y
- S TRANARR="^VAT(394,""A-CONVERT"")"
- ;DETERMINE SITE NAME AND DOMAIN
- S TMP=+$O(^VAT(394.2,0))
- I ('TMP) W:(WTEXT) !,"Entry in PDX PARAMETER file (#394.2) not present" Q
- S NODE=$G(^VAT(394.2,TMP,0))
- S SITENAME=$P(NODE,"^",6)
- I (SITENAME="") W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's name" Q
- S TMP=+$P(NODE,"^",4)
- I ('TMP) W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's domain" Q
- S ADDRESS=$P($G(^DIC(4.2,TMP,0)),"^",1)
- I (ADDRESS="") W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's domain" Q
- ;WRITE BEGINNING TEXT
- I (WTEXT) D
- .S TMP=$$REPEAT^VAQUTL1("*",80)
- .S X=" BEGIN CONVERSION OF PDX VERSION 1.0 FILES "
- .S Y=(40-($L(X)/2))+1
- .W !!
- .W $$INSERT^VAQUTL1(X,TMP,Y,$L(X))
- .W !!
- .W !,"Your site's name: ",SITENAME
- .W !,"Your site's domain: ",ADDRESS
- .W !,"Conversion started at: ",$$NOW^VAQUTL99
- ;CONVERT LOCAL REQUESTS
- S RQSTDONE=$$REQUEST^VAQPST21(SITENAME,ADDRESS,TRANARR,WTEXT)
- W:(WTEXT) !!
- I (RQSTDONE<1) D
- .W:(WTEXT) !
- .W:((WTEXT)&(+RQSTDONE)) !,"** Unable to attempt conversion of local requests **",!,?5,$P(TMP,"^",2)
- .W:((WTEXT)&('RQSTDONE)) !,"** No local requests were successfully converted **"
- I (RQSTDONE>0) W:(WTEXT) !!,RQSTDONE," local request",$S((RQSTDONE=1):" was",1:"s were")," successfully converted"
- W:(WTEXT) !
- ;CONVERT REMOTE REQUESTS
- S MANDONE=$$PROCESS^VAQPST22(SITENAME,ADDRESS,WTEXT)
- W:(WTEXT) !!
- I (MANDONE<1) D
- .W:(WTEXT) !
- .W:((WTEXT)&(+MANDONE)) !,"** Unable to attempt conversion of remote requests **",!,?5,$P(TMP,"^",2)
- .W:((WTEXT)&('MANDONE)) !,"** No remote requests were successfully converted **"
- I (MANDONE>0) W:(WTEXT) !!,MANDONE," remote request",$S((MANDONE=1):" was",1:"s were")," successfully converted"
- W:(WTEXT) !
- ;CONVERT REMOTE REQUESTS
- S RSLTDONE=$$RESULTS^VAQPST23(TRANARR,WTEXT)
- W:(WTEXT) !!
- I (RSLTDONE<1) D
- .W:(WTEXT) !
- .W:((WTEXT)&(+RSLTDONE)) !,"** Unable to attempt conversion of Unsolicited PDXs & request results **",!,?5,$P(TMP,"^",2)
- .W:((WTEXT)&('RSLTDONE)) !,"** No Unsolicited PDXs & request results were successfully converted **"
- I (RSLTDONE>0) W:(WTEXT) !!,RSLTDONE," Unsolicited PDXs & request results were successfully converted"
- W:(WTEXT) !
- ;DELETE ENTRIES IN 1.0 FILES
- D DELETE^VAQPST24(WTEXT)
- W:(WTEXT) !!
- D CLEAN
- Q
- ;
- CLEAN ;CLEAN UP
- K @TRANARR
- I (WTEXT) D
- .W !!!,"Conversion completed at: ",$$NOW^VAQUTL99
- .S TMP=$$REPEAT^VAQUTL1("*",80)
- .S X=" END CONVERSION OF PDX VERSION 1.0 FILES "
- .S Y=(40-($L(X)/2))+1
- .W !!
- .W $$INSERT^VAQUTL1(X,TMP,Y,$L(X))
- .W @IOF
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVAQPST20 4663 printed Mar 13, 2025@21:30:57 Page 2
- VAQPST20 ;ALB/JRP - POST INIT (FILE CONVERSION);11-JUN-93
- +1 ;;1.5;PATIENT DATA EXCHANGE;**5**;NOV 17, 1993
- +2 ;
- TASK ;ENTRY POINT TO TASK CONVERSION
- +1 NEW %ZIS,POP,ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK,WTEXT
- +2 WRITE @IOF
- +3 WRITE !!!,"- Conversion of version 1.0 files will now be tasked -"
- +4 WRITE !!,"Entering 'HOME' as the device for output will cause conversion"
- +5 WRITE !,"to be run without an output device. It is recommended that a"
- +6 WRITE !,"device be chosen so that errors during the conversion can be"
- +7 WRITE !,"reported."
- +8 WRITE !!,"Entering '^' as the device for output will skip the conversion"
- +9 WRITE !,"process. Please refer to the INSTALLATION GUIDE if you choose"
- +10 WRITE !,"to do this.",!!
- +11 SET %ZIS="N0"
- +12 SET %ZIS("A")="Enter device to use during conversion: "
- +13 DO ^%ZIS
- +14 IF (POP)
- Begin DoDot:1
- +15 WRITE !!,"- Conversion will not be done at this time -"
- +16 WRITE !!,"To run conversion at a later date the entry point TASK^VAQPST20"
- +17 WRITE !,"should be used."
- +18 WRITE !!,"If you have chosen to skip the conversion the entry point"
- +19 WRITE !,"DELETE^VAQPST24(1) must be used in order to delete entries"
- +20 WRITE !,"contained in the 1.0 files.",!!
- End DoDot:1
- QUIT
- +21 if (IOT="HFS")
- SET IO("HFSIO")=IO
- +22 SET WTEXT=$SELECT((IO=IO(0)):0,1:1)
- +23 SET ZTRTN=$SELECT(WTEXT:"INTER^VAQPST20",1:"NONINTER^VAQPST20")
- +24 SET ZTDESC="Conversion of PDX version 1.0 files ("_$SELECT(WTEXT:"with output",1:"no output")_")"
- +25 SET ZTIO=$SELECT(WTEXT:ION,1:"")
- +26 SET ZTDTH=""
- +27 DO ^%ZTLOAD
- +28 IF ('$GET(ZTSK))
- Begin DoDot:1
- +29 WRITE !!,"** Tasking of conversion was not accomplished **"
- +30 WRITE !,"Use the entry point TASK^VAQPST20 to retry tasking of conversion"
- End DoDot:1
- QUIT
- +31 WRITE !!,"Conversion tasked (",ZTSK,")"
- +32 QUIT
- INTER ;ENTRY POINT FOR INTERACTIVE CONVERSION
- +1 DO CONVERT(1)
- QUIT
- +2 ;
- NONINTER ;ENTRY POINT FOR NON-INTERACTIVE CONVERSION
- +1 DO CONVERT(0)
- QUIT
- +2 ;
- CONVERT(WTEXT) ;CONVERT VERSION 1.0 FILE ENTRIES TO VERSION 1.5
- +1 ;INPUT : WTEXT - Write text to screen
- +2 ; (used for debugging/interactive conversion)
- +3 ; 1 - Yes
- +4 ; 0 - No (default)
- +5 ;CHECK INPUT
- +6 SET WTEXT=+$GET(WTEXT)
- +7 NEW SITENAME,ADDRESS,NODE,TRANARR,TMP,RQSTDONE,MANDONE,RSLTDONE,X,Y
- +8 SET TRANARR="^VAT(394,""A-CONVERT"")"
- +9 ;DETERMINE SITE NAME AND DOMAIN
- +10 SET TMP=+$ORDER(^VAT(394.2,0))
- +11 IF ('TMP)
- if (WTEXT)
- WRITE !,"Entry in PDX PARAMETER file (#394.2) not present"
- QUIT
- +12 SET NODE=$GET(^VAT(394.2,TMP,0))
- +13 SET SITENAME=$PIECE(NODE,"^",6)
- +14 IF (SITENAME="")
- if (WTEXT)
- WRITE !,"PDX PARAMETER file (#394.2) did not contain facility's name"
- QUIT
- +15 SET TMP=+$PIECE(NODE,"^",4)
- +16 IF ('TMP)
- if (WTEXT)
- WRITE !,"PDX PARAMETER file (#394.2) did not contain facility's domain"
- QUIT
- +17 SET ADDRESS=$PIECE($GET(^DIC(4.2,TMP,0)),"^",1)
- +18 IF (ADDRESS="")
- if (WTEXT)
- WRITE !,"PDX PARAMETER file (#394.2) did not contain facility's domain"
- QUIT
- +19 ;WRITE BEGINNING TEXT
- +20 IF (WTEXT)
- Begin DoDot:1
- +21 SET TMP=$$REPEAT^VAQUTL1("*",80)
- +22 SET X=" BEGIN CONVERSION OF PDX VERSION 1.0 FILES "
- +23 SET Y=(40-($LENGTH(X)/2))+1
- +24 WRITE !!
- +25 WRITE $$INSERT^VAQUTL1(X,TMP,Y,$LENGTH(X))
- +26 WRITE !!
- +27 WRITE !,"Your site's name: ",SITENAME
- +28 WRITE !,"Your site's domain: ",ADDRESS
- +29 WRITE !,"Conversion started at: ",$$NOW^VAQUTL99
- End DoDot:1
- +30 ;CONVERT LOCAL REQUESTS
- +31 SET RQSTDONE=$$REQUEST^VAQPST21(SITENAME,ADDRESS,TRANARR,WTEXT)
- +32 if (WTEXT)
- WRITE !!
- +33 IF (RQSTDONE<1)
- Begin DoDot:1
- +34 if (WTEXT)
- WRITE !
- +35 if ((WTEXT)&(+RQSTDONE))
- WRITE !,"** Unable to attempt conversion of local requests **",!,?5,$PIECE(TMP,"^",2)
- +36 if ((WTEXT)&('RQSTDONE))
- WRITE !,"** No local requests were successfully converted **"
- End DoDot:1
- +37 IF (RQSTDONE>0)
- if (WTEXT)
- WRITE !!,RQSTDONE," local request",$SELECT((RQSTDONE=1):" was",1:"s were")," successfully converted"
- +38 if (WTEXT)
- WRITE !
- +39 ;CONVERT REMOTE REQUESTS
- +40 SET MANDONE=$$PROCESS^VAQPST22(SITENAME,ADDRESS,WTEXT)
- +41 if (WTEXT)
- WRITE !!
- +42 IF (MANDONE<1)
- Begin DoDot:1
- +43 if (WTEXT)
- WRITE !
- +44 if ((WTEXT)&(+MANDONE))
- WRITE !,"** Unable to attempt conversion of remote requests **",!,?5,$PIECE(TMP,"^",2)
- +45 if ((WTEXT)&('MANDONE))
- WRITE !,"** No remote requests were successfully converted **"
- End DoDot:1
- +46 IF (MANDONE>0)
- if (WTEXT)
- WRITE !!,MANDONE," remote request",$SELECT((MANDONE=1):" was",1:"s were")," successfully converted"
- +47 if (WTEXT)
- WRITE !
- +48 ;CONVERT REMOTE REQUESTS
- +49 SET RSLTDONE=$$RESULTS^VAQPST23(TRANARR,WTEXT)
- +50 if (WTEXT)
- WRITE !!
- +51 IF (RSLTDONE<1)
- Begin DoDot:1
- +52 if (WTEXT)
- WRITE !
- +53 if ((WTEXT)&(+RSLTDONE))
- WRITE !,"** Unable to attempt conversion of Unsolicited PDXs & request results **",!,?5,$PIECE(TMP,"^",2)
- +54 if ((WTEXT)&('RSLTDONE))
- WRITE !,"** No Unsolicited PDXs & request results were successfully converted **"
- End DoDot:1
- +55 IF (RSLTDONE>0)
- if (WTEXT)
- WRITE !!,RSLTDONE," Unsolicited PDXs & request results were successfully converted"
- +56 if (WTEXT)
- WRITE !
- +57 ;DELETE ENTRIES IN 1.0 FILES
- +58 DO DELETE^VAQPST24(WTEXT)
- +59 if (WTEXT)
- WRITE !!
- +60 DO CLEAN
- +61 QUIT
- +62 ;
- CLEAN ;CLEAN UP
- +1 KILL @TRANARR
- +2 IF (WTEXT)
- Begin DoDot:1
- +3 WRITE !!!,"Conversion completed at: ",$$NOW^VAQUTL99
- +4 SET TMP=$$REPEAT^VAQUTL1("*",80)
- +5 SET X=" END CONVERSION OF PDX VERSION 1.0 FILES "
- +6 SET Y=(40-($LENGTH(X)/2))+1
- +7 WRITE !!
- +8 WRITE $$INSERT^VAQUTL1(X,TMP,Y,$LENGTH(X))
- +9 WRITE @IOF
- End DoDot:1
- +10 QUIT