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

ACPT28PF.m

Go to the documentation of this file.
  1. ACPT28PF ;IHS/VEN/TOAD - ACPT*2.08*1 POST1 question ; 04/21/2008 13:35
  1. ;;2.08;CPT FILES;**1**;DEC 17, 2007
  1. ;
  1. ; This is the input transform for question POST1 of the post-init for
  1. ; ACPT*2.08*1. The input transform is called at POST1 by KIDS at the
  1. ; beginning of the installation of this patch.
  1. ;
  1. QUIT ; This routine should not be called at the top or anywhere
  1. ; else. It is only to be called at POST1 by KIDS during installation of
  1. ; ACPT*2.08*1.
  1. ;
  1. ; 2008 04 21 Rick Marshall wrote this routine to improve the directory
  1. ; prompt, which was originally in the main post-init routine (ACPTPOST,
  1. ; now called ACPT28PA). The question was moved out into the KIDS build
  1. ; definition as an installation question, and this routine was created
  1. ; to house the expanded input transform. Prior to this, no validation
  1. ; was performed to ensure that the selected directory actually contained
  1. ; the two files (acpt2008.01h and acpt2008.01c), leading to many errors
  1. ; during testing. This expanded input transform does just that. Also
  1. ; worked around a bug in all Cache for UNIX sites in RPMS, in which
  1. ; their ^%ZOSF("OS") instead says Cache for NT. Also worked around a bug
  1. ; in $$LIST^%ZISH in which the output array's format is different on
  1. ; Cache on UNIX, presumably also because of ^%ZOSF("OS") being wrong.
  1. ;
  1. ; The original unrefactored code was written by IHS/ASDST/DMJ and Shonda
  1. ; Render (SDR).
  1. ;
  1. POST1(ACPTDIR) ; input transform for KIDS question POST1
  1. ;
  1. ; .ACPTDIR, passed by reference, is X from the Fileman Reader, the
  1. ; input to this input transform.
  1. ;
  1. I $ZV["UNIX" D ; if unix, ensure proper syntax for unix
  1. . S ACPTDIR=$TR(ACPTDIR,"\","/") ; forward slash should delimit
  1. . S:$E(ACPTDIR)'="/" ACPTDIR="/"_ACPTDIR ; start with root (/)
  1. . S:$E(ACPTDIR,$L(ACPTDIR))'="/" ACPTDIR=ACPTDIR_"/" ; ensure trailing /
  1. ;
  1. E D ; otherwise, ensure proper syntax for other operating systems
  1. . S ACPTDIR=$TR(ACPTDIR,"/","\") ; back slash should delimit
  1. . I $E(ACPTDIR)'="\",ACPTDIR'[":" D
  1. . . S ACPTDIR="\"_ACPTDIR ; start with \ if not using : (?)
  1. . S:$E(ACPTDIR,$L(ACPTDIR))'="\" ACPTDIR=ACPTDIR_"\" ; ensure trailing \
  1. ;
  1. W !!,"Checking directory ",ACPTDIR,"..."
  1. ;
  1. N ACPTFIND S ACPTFIND=0 ; do we find our files in that directory?
  1. D ; find out whether that directory contains those files
  1. . N ACPTFILE S ACPTFILE("acpt2008.01h")="" ; HCPCS description file
  1. . S ACPTFILE("acpt2008.01c")="" ; HCPCS modifiers file
  1. . N Y S Y=$$LIST^%ZISH(ACPTDIR,"ACPTFILE","ACPTFIND")
  1. . D Q:ACPTFIND ; format for most platforms:
  1. . . Q:'$D(ACPTFIND("acpt2008.01h"))
  1. . . Q:'$D(ACPTFIND("acpt2008.01c"))
  1. . . S ACPTFIND=1
  1. . D ; format for Cache on UNIX
  1. . . Q:'$D(ACPTFIND(ACPTDIR_"acpt2008.01h"))
  1. . . Q:'$D(ACPTFIND(ACPTDIR_"acpt2008.01c"))
  1. . . S ACPTFIND=1
  1. ;
  1. I $D(ACPTFIND("acpt2008.01h"))!$D(ACPTFIND(ACPTDIR_"acpt2008.01h")) D
  1. . W !,"HCPCS Description file acpt2008.01h found."
  1. I $D(ACPTFIND("acpt2008.01c"))!$D(ACPTFIND(ACPTDIR_"acpt2008.01c")) D
  1. . W !,"HCPCS Modifiers file acpt2008.01c found."
  1. ;
  1. I ACPTFIND D Q ; if they picked a valid directory
  1. . W !!,"Thank you. Both files are in that directory."
  1. . W !,"Proceeding with the install of ACPT*2.08*1."
  1. ;
  1. W !!,"I'm sorry, but that cannot be correct."
  1. W !,"Directory ",ACPTDIR," does not contain both files."
  1. ;
  1. D
  1. . N ACPTFILE S ACPTFILE("*")=""
  1. . N ACPTLIST
  1. . N Y S Y=$$LIST^%ZISH(ACPTDIR,"ACPTFILE","ACPTLIST")
  1. . W !!,"Directory ",ACPTDIR," contains the following files:"
  1. . N ACPTF S ACPTF="" F S ACPTF=$O(ACPTLIST(ACPTF)) Q:ACPTF="" D
  1. . . W !?5,ACPTF
  1. ;
  1. W !!,"Please select a directory that contains both HCPCS files."
  1. K ACPTDIR
  1. ;
  1. QUIT ; end of POST1
  1. ;
  1. ;
  1. ; end of routine ACPT28PF