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

AZAGMED.m

Go to the documentation of this file.
  1. AZAGMED ; IHS/PHXAO/TMJ - UNIX GENERIC FILE READER ; [ 06/11/03 4:11 PM ]
  1. ;1.0;BME MEDICAID UTILITIES;NOVEMBER 12, 2003
  1. ;
  1. ;
  1. ;This Reader Routine works on Cache, NT, or Unix
  1. ;It Calls OPEN^%ZISH to read file
  1. ;It Call STATUS^%ZISH to quit at End of File
  1. ;
  1. ;This Routine Reads the AHCCCS Medicaid Eligibility Roster Unix File
  1. ;Then sets a Monthly Temporary Global - ^AZAGMED(
  1. ;The Routine ^AZAMED $ORDERS through this Global and Populates
  1. ;The Monthly Temporary No Match File, the RPMS Master File, and
  1. ;The RPMS MEDICAID ELIGIBILITY FILE
  1. ;
  1. MAIN ; -- this is the main program loop
  1. S AZAERROR=0
  1. S BEGTIME=0,ENDTIME=0,UNIXTIME=0
  1. D ^XBKVAR
  1. K ^AZAGMED
  1. D AZAG I AZAERROR=1 G END
  1. S BEGTIME=$$NOW^XLFDT
  1. D OPENAZAG
  1. D END
  1. S ENDTIME=$$NOW^XLFDT
  1. S UNIXTIME=ENDTIME-BEGTIME
  1. Q
  1. ;
  1. AZAG ; -- this sets up the device and sets the file name
  1. S AZALSTN="" ;Last Log IEN # for Last File processed
  1. S AZALSTNM="" ;Actual File Name in Log
  1. S AZALSTN=$P($G(^AZAMEDLG(0)),U,3)
  1. I AZALSTN="" G FIRST
  1. S AZALSTNM=$P($G(^AZAMEDLG(AZALSTN,0)),U,8)
  1. I AZALSTNM="" W !!,"Last File Name does NOT exist in Log. Contact Site Manager!" S AZAERROR=1 Q
  1. D PROCESS Q
  1. ;
  1. FIRST ;FILENAME FOR 1ST TIME RUN AT FACILTY - HARD CODED
  1. ;
  1. I AZALSTN="" S FILE="MED012001.TXT" D FIRST1 Q
  1. ;
  1. PROCESS ;Process file here
  1. S MM=$E(AZALSTNM,4,5) S YY=$E(AZALSTNM,6,9)
  1. S MM=MM+1 I MM>12 S YY=YY+1,MM="01"
  1. I $L(MM)=1 S MM="0"_MM
  1. S NEXTFDT=MM_YY
  1. S FILE="MED"_NEXTFDT_".TXT"
  1. ;Q
  1. ;
  1. FIRST1 ;Called from First
  1. S PATH="c:\inetpub\ftproot\pub\" ;**Hard Code this line at each Site NT or Unix**
  1. ;
  1. Q
  1. ;
  1. ;
  1. OPENAZAG ; -- this uses the device and reads in the records from the file
  1. ;
  1. D OPEN^%ZISH("AHCCCS",PATH,FILE,"R")
  1. I POP U IO(0) W !,"Can't open Host File Server" Q
  1. U IO(0) W !,"Reading this file",!
  1. ;
  1. ;
  1. F AZAGI=1:1 D Q:$$STATUS^%ZISH
  1. .U IO R X Q:$$STATUS^%ZISH
  1. .S ^AZAGMED(AZAGI)=$E(X,1,420)
  1. Q
  1. END ; -- close the device here a kill variables
  1. S AZAGITOT=AZAGI-2
  1. ;W !,"Total Records Processed: "_AZAGITOT
  1. D ^%ZISC
  1. K AZAGI,%FN,AZAGPTR,AZAGX,PATH,X
  1. Q