Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: VAQPST20

VAQPST20.m

Go to the documentation of this file.
  1. VAQPST20 ;ALB/JRP - POST INIT (FILE CONVERSION);11-JUN-93
  1. ;;1.5;PATIENT DATA EXCHANGE;**5**;NOV 17, 1993
  1. ;
  1. TASK ;ENTRY POINT TO TASK CONVERSION
  1. N %ZIS,POP,ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK,WTEXT
  1. W @IOF
  1. W !!!,"- Conversion of version 1.0 files will now be tasked -"
  1. W !!,"Entering 'HOME' as the device for output will cause conversion"
  1. W !,"to be run without an output device. It is recommended that a"
  1. W !,"device be chosen so that errors during the conversion can be"
  1. W !,"reported."
  1. W !!,"Entering '^' as the device for output will skip the conversion"
  1. W !,"process. Please refer to the INSTALLATION GUIDE if you choose"
  1. W !,"to do this.",!!
  1. S %ZIS="N0"
  1. S %ZIS("A")="Enter device to use during conversion: "
  1. D ^%ZIS
  1. I (POP) D Q
  1. .W !!,"- Conversion will not be done at this time -"
  1. .W !!,"To run conversion at a later date the entry point TASK^VAQPST20"
  1. .W !,"should be used."
  1. .W !!,"If you have chosen to skip the conversion the entry point"
  1. .W !,"DELETE^VAQPST24(1) must be used in order to delete entries"
  1. .W !,"contained in the 1.0 files.",!!
  1. S:(IOT="HFS") IO("HFSIO")=IO
  1. S WTEXT=$S((IO=IO(0)):0,1:1)
  1. S ZTRTN=$S(WTEXT:"INTER^VAQPST20",1:"NONINTER^VAQPST20")
  1. S ZTDESC="Conversion of PDX version 1.0 files ("_$S(WTEXT:"with output",1:"no output")_")"
  1. S ZTIO=$S(WTEXT:ION,1:"")
  1. S ZTDTH=""
  1. D ^%ZTLOAD
  1. I ('$G(ZTSK)) D Q
  1. .W !!,"** Tasking of conversion was not accomplished **"
  1. .W !,"Use the entry point TASK^VAQPST20 to retry tasking of conversion"
  1. W !!,"Conversion tasked (",ZTSK,")"
  1. Q
  1. INTER ;ENTRY POINT FOR INTERACTIVE CONVERSION
  1. D CONVERT(1) Q
  1. ;
  1. NONINTER ;ENTRY POINT FOR NON-INTERACTIVE CONVERSION
  1. D CONVERT(0) Q
  1. ;
  1. CONVERT(WTEXT) ;CONVERT VERSION 1.0 FILE ENTRIES TO VERSION 1.5
  1. ;INPUT : WTEXT - Write text to screen
  1. ; (used for debugging/interactive conversion)
  1. ; 1 - Yes
  1. ; 0 - No (default)
  1. ;CHECK INPUT
  1. S WTEXT=+$G(WTEXT)
  1. N SITENAME,ADDRESS,NODE,TRANARR,TMP,RQSTDONE,MANDONE,RSLTDONE,X,Y
  1. S TRANARR="^VAT(394,""A-CONVERT"")"
  1. ;DETERMINE SITE NAME AND DOMAIN
  1. S TMP=+$O(^VAT(394.2,0))
  1. I ('TMP) W:(WTEXT) !,"Entry in PDX PARAMETER file (#394.2) not present" Q
  1. S NODE=$G(^VAT(394.2,TMP,0))
  1. S SITENAME=$P(NODE,"^",6)
  1. I (SITENAME="") W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's name" Q
  1. S TMP=+$P(NODE,"^",4)
  1. I ('TMP) W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's domain" Q
  1. S ADDRESS=$P($G(^DIC(4.2,TMP,0)),"^",1)
  1. I (ADDRESS="") W:(WTEXT) !,"PDX PARAMETER file (#394.2) did not contain facility's domain" Q
  1. ;WRITE BEGINNING TEXT
  1. I (WTEXT) D
  1. .S TMP=$$REPEAT^VAQUTL1("*",80)
  1. .S X=" BEGIN CONVERSION OF PDX VERSION 1.0 FILES "
  1. .S Y=(40-($L(X)/2))+1
  1. .W !!
  1. .W $$INSERT^VAQUTL1(X,TMP,Y,$L(X))
  1. .W !!
  1. .W !,"Your site's name: ",SITENAME
  1. .W !,"Your site's domain: ",ADDRESS
  1. .W !,"Conversion started at: ",$$NOW^VAQUTL99
  1. ;CONVERT LOCAL REQUESTS
  1. S RQSTDONE=$$REQUEST^VAQPST21(SITENAME,ADDRESS,TRANARR,WTEXT)
  1. W:(WTEXT) !!
  1. I (RQSTDONE<1) D
  1. .W:(WTEXT) !
  1. .W:((WTEXT)&(+RQSTDONE)) !,"** Unable to attempt conversion of local requests **",!,?5,$P(TMP,"^",2)
  1. .W:((WTEXT)&('RQSTDONE)) !,"** No local requests were successfully converted **"
  1. I (RQSTDONE>0) W:(WTEXT) !!,RQSTDONE," local request",$S((RQSTDONE=1):" was",1:"s were")," successfully converted"
  1. W:(WTEXT) !
  1. ;CONVERT REMOTE REQUESTS
  1. S MANDONE=$$PROCESS^VAQPST22(SITENAME,ADDRESS,WTEXT)
  1. W:(WTEXT) !!
  1. I (MANDONE<1) D
  1. .W:(WTEXT) !
  1. .W:((WTEXT)&(+MANDONE)) !,"** Unable to attempt conversion of remote requests **",!,?5,$P(TMP,"^",2)
  1. .W:((WTEXT)&('MANDONE)) !,"** No remote requests were successfully converted **"
  1. I (MANDONE>0) W:(WTEXT) !!,MANDONE," remote request",$S((MANDONE=1):" was",1:"s were")," successfully converted"
  1. W:(WTEXT) !
  1. ;CONVERT REMOTE REQUESTS
  1. S RSLTDONE=$$RESULTS^VAQPST23(TRANARR,WTEXT)
  1. W:(WTEXT) !!
  1. I (RSLTDONE<1) D
  1. .W:(WTEXT) !
  1. .W:((WTEXT)&(+RSLTDONE)) !,"** Unable to attempt conversion of Unsolicited PDXs & request results **",!,?5,$P(TMP,"^",2)
  1. .W:((WTEXT)&('RSLTDONE)) !,"** No Unsolicited PDXs & request results were successfully converted **"
  1. I (RSLTDONE>0) W:(WTEXT) !!,RSLTDONE," Unsolicited PDXs & request results were successfully converted"
  1. W:(WTEXT) !
  1. ;DELETE ENTRIES IN 1.0 FILES
  1. D DELETE^VAQPST24(WTEXT)
  1. W:(WTEXT) !!
  1. D CLEAN
  1. Q
  1. ;
  1. CLEAN ;CLEAN UP
  1. K @TRANARR
  1. I (WTEXT) D
  1. .W !!!,"Conversion completed at: ",$$NOW^VAQUTL99
  1. .S TMP=$$REPEAT^VAQUTL1("*",80)
  1. .S X=" END CONVERSION OF PDX VERSION 1.0 FILES "
  1. .S Y=(40-($L(X)/2))+1
  1. .W !!
  1. .W $$INSERT^VAQUTL1(X,TMP,Y,$L(X))
  1. .W @IOF
  1. Q