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

BMEMLOAD.m

Go to the documentation of this file.
  1. BMEMLOAD ; IHS/PHXAO/TMJ - LOAD THE MEDICAID FILE DRIVER ROUTINE ;
  1. ;;1.0T1;MEDICAID ELIGIBILITY DOWNLOAD;;JUN 25, 2003
  1. ;
  1. MAIN ; -- this is the main program loop
  1. ;This Routine runs either the Flat File 560 Routines
  1. ;or the 834 Transaction Routines
  1. ;
  1. ;The Site Parameter Global BMEPARM Determines the Type of Run
  1. ;based upon Field #.03 Type of Transaction
  1. ;If Type = F Flat File 560 - Runs BMEMED and BMEMED0
  1. ;If Type = 8 834 Transaction - Runs BME834 and BME8340
  1. ;The Fall Off Routines runs independently of Type
  1. ;
  1. S BMEQUIT=0 ;Quit Variable to NOT run 834 Transaction
  1. ;
  1. TYPE ;Determine the type of Run
  1. ;
  1. S BMEFIEN=$O(^BMEPARM("B",DUZ(2),0)) ;Get Facility IEN
  1. Q:'BMEFIEN ;Quit if No Facility Entry in Site Parameter
  1. S BMETYPE=$P($G(^BMEPARM(BMEFIEN,0)),U,3) ; Get Type
  1. ;
  1. Q:BMETYPE=""
  1. I BMETYPE="F" D FLATFILE
  1. I BMETYPE=8 D TRAN834
  1. D END
  1. Q
  1. ;
  1. FLATFILE ;Run the Download from the Unix Flat File
  1. D UNIX
  1. D UPLOAD
  1. D FALLOFF
  1. D END
  1. Q
  1. ;
  1. ;
  1. TRAN834 ;Run the Download from the 834 Transaction/GIS
  1. D P834
  1. D LOAD834
  1. D FALLOFF
  1. D END
  1. Q
  1. ;
  1. ;
  1. UNIX ;Reads the Unix AHCCCS Elig. Roster to ^BMEGMED(GLOBAL
  1. ;This Global is Killed off each month at time of new run
  1. ;
  1. D ^BMEGMED
  1. Q
  1. ;
  1. UPLOAD ;Upload Eligibility Data to RPMS From ^BMEGMED(GLOBAL
  1. ;Creates Monthly Temporary No Match File ^BMETMED(GLOBAL
  1. ;This Temporary File is Killed off each month at time of new run
  1. ;Populates RPMS Master Elig. File ^BMEMSTR(GLOBAL
  1. ;
  1. ;Check to make sure a complete Unit File has been read
  1. ;& the ^BMEGMED( Global has completed to the final record
  1. ;The last Record in Global should match the 20-24 position
  1. ;for record count (Plus One). Quit if incomplete ^BMEGMED
  1. ;Global is created.
  1. ;^BMEGMED(60167)=XX200105019999980006016600000000000
  1. ;
  1. S BMELASTR=$O(^BMEGMED(""),-1) ;Get Last Record
  1. S BMELASTD=$E(^BMEGMED(BMELASTR),20,24) ;Get Pos 20-24
  1. S BMELASTD=BMELASTD+1 ;Add one count for check
  1. I BMELASTR'=BMELASTD W !!,"Incomplete Global",! Q ;Quit if incomplete
  1. ;
  1. D ^BMEMED
  1. Q
  1. ;
  1. FALLOFF ;Run the Eligibility Fall Off Patients
  1. ;This Routine runs through the RPMS Master File and provides
  1. ;a List of Pts (who were Eligible the previous Month's Run)
  1. ;but are not included in the current Month's Roster
  1. ;Populates the RPMS Master Elig. File with Fall Off Date
  1. ;
  1. I BMEQUIT'=1 D ^BMEMFALL
  1. Q
  1. ;
  1. ;
  1. MSG ;Message Displays - Don't Use on TaskMan
  1. ;Would utilize only if User Ran Process
  1. ;W !!,"Finished loading the State of Arizona Medicaid File"
  1. ;W !!,"Now uploading the State information into the RPMS database..."
  1. ;Q
  1. ;
  1. ;
  1. P834 ;Process the 834 Transaction load from GIS
  1. ;THIS ROUTINE HAS NOT BEEN WRITTEN. It should take the
  1. ;834 data from the GIS and Populate the BME MEDICAID HOLDING
  1. ;File - Global ^BMEHOLD. Once populated, the Holding File
  1. ;Global will be utilized to run the ^BME834 Routine which
  1. ;conducts the Actual Download of Data into the RPMS Files
  1. ;
  1. ;Will want to call Routine BHLXRFL and pass in
  1. ;XMSG = Message 834
  1. ;DIR = Directory for the File
  1. ;PRE = 834*
  1. ;XTF = Test or Production
  1. ;
  1. ;
  1. ;Quit as GIS is not Available yet
  1. S BMEQUIT=1
  1. ;
  1. Q
  1. ;
  1. LOAD834 ;Upload the Eligibility Data to RPMS from the Holding
  1. ;File Global ^BMEHOLD(
  1. ;This Temporary Holding File is killed off each month for
  1. ;the new run - The BMEMSTR(Global is also populated
  1. ;
  1. I BMEQUIT'=1 D ^BME834 ;Run Only if GIS is now programmed
  1. Q
  1. ;
  1. END ; -- write the final message
  1. ;W !!,"Finished, uploading the medicaid information into RPMS"
  1. ;W !!,"The new information is in the RPMS database"
  1. ;Q
  1. ;
  1. K BMEFIEN,BMETYPE
  1. Q