BMEMSTR ; IHS/PHXAO/TMJ - Master Routine Population ;
;;1.0T1;MEDICAID ELIGIBILITY DOWNLOAD;;JUN 25, 2003
;
;
;This Routine Populates the Master List and is called from BMEMED
;If Patient is added 1st time to MEDICAID ELIGIBLE FILE, then Patient
;is also added 1st time to BME MEDICAID MASTER LIST File
;
;If Patient already Exists in MEDICAID ELIGIBLE File AND a
;Updated Date is entered into the Eligibility Dt Multiple
;then the Patient Record already exists in this file and only
;the Updated Date & Still Eligible Date fields are populated
;
;
;The FALL Line Tag is Only called from BMEMFALL Routine
;Only if an Ending Date has been added to an existing
;Beginning Elig Date in Medicaid Elig. File
;
;Adding New Patients to Master List-Called from NEW^BMEMED
NEW ;EP -- create new entry in BME MEDICAID MASTER LIST File ^BMEMSTR(
Q:$O(^BMEMASTR("B",+DFN,0)) ;Quit if already in Master List
D ^XBFMK K DIADD,DINUM
S X=DFN,DIC="^BMEMASTR(",DIC(0)="L",DLAYGO=90334
S DIC("DR")=".02////"_DT_";.06////"_BMEMEED ;New Add DT - Triggers Still Elig. DT
D FILE^DICN S BMEIEN=+Y D ^XBFMK K DIADD,DINUM
Q
;
UPDATES ;EP - Edit Existing BME MEDICAID MASTR LIST Entries
;Called from MED^BMEMED -Update Dates - Still Eligible Dates
S BMEIEN=$O(^BMEMASTR("B",DFN,0)) D:'BMEIEN NEW ;Add Record to Master File if not there
S BMEIEN=$O(^BMEMASTR("B",DFN,0)) Q:'BMEIEN ;Quit if still not in Master
S DIE="^BMEMASTR(",DA=BMEIEN,DR=".03////"_DT_";.06////"_BMEMEED
D ^DIE K DIE,DR,DA
;
Q
;
STILLACT ;EP - Still Active Tags ONLY - No Adds/No Updates - Fall throughs
;Called from MED^BMEMED -Update Dates - Still Eligible Dates
S BMEIEN=$O(^BMEMASTR("B",DFN,0)) D:'BMEIEN NEW ;Add Record to Master if missing
S BMEIEN=$O(^BMEMASTR("B",DFN,0)) Q:'BMEIEN ;Quit if still not in Master
S DIE="^BMEMASTR(",DA=BMEIEN,DR=".04////"_DT_";.06////"_BMEMEED
D ^DIE K DIE,DR,DA
;
Q
;
FALL ;EP - Fall Off Date
;Called from ^BMEMFALL - If Ending Date is added to Medicaid Eligible File
Q:'$D(^BMEMASTR(BMEMAIEN,0)) ;Quit if still not in Master
S DIE="^BMEMASTR(",DA=BMEMAIEN,DR=".05////"_DT
D ^DIE K DIE,DR,DA
;
Q
BMEMSTR ; IHS/PHXAO/TMJ - Master Routine Population ;
+1 ;;1.0T1;MEDICAID ELIGIBILITY DOWNLOAD;;JUN 25, 2003
+2 ;
+3 ;
+4 ;This Routine Populates the Master List and is called from BMEMED
+5 ;If Patient is added 1st time to MEDICAID ELIGIBLE FILE, then Patient
+6 ;is also added 1st time to BME MEDICAID MASTER LIST File
+7 ;
+8 ;If Patient already Exists in MEDICAID ELIGIBLE File AND a
+9 ;Updated Date is entered into the Eligibility Dt Multiple
+10 ;then the Patient Record already exists in this file and only
+11 ;the Updated Date & Still Eligible Date fields are populated
+12 ;
+13 ;
+14 ;The FALL Line Tag is Only called from BMEMFALL Routine
+15 ;Only if an Ending Date has been added to an existing
+16 ;Beginning Elig Date in Medicaid Elig. File
+17 ;
+18 ;Adding New Patients to Master List-Called from NEW^BMEMED
NEW ;EP -- create new entry in BME MEDICAID MASTER LIST File ^BMEMSTR(
+1 ;Quit if already in Master List
IF $ORDER(^BMEMASTR("B",+DFN,0))
QUIT
+2 DO ^XBFMK
KILL DIADD,DINUM
+3 SET X=DFN
SET DIC="^BMEMASTR("
SET DIC(0)="L"
SET DLAYGO=90334
+4 ;New Add DT - Triggers Still Elig. DT
SET DIC("DR")=".02////"_DT_";.06////"_BMEMEED
+5 DO FILE^DICN
SET BMEIEN=+Y
DO ^XBFMK
KILL DIADD,DINUM
+6 QUIT
+7 ;
UPDATES ;EP - Edit Existing BME MEDICAID MASTR LIST Entries
+1 ;Called from MED^BMEMED -Update Dates - Still Eligible Dates
+2 ;Add Record to Master File if not there
SET BMEIEN=$ORDER(^BMEMASTR("B",DFN,0))
IF 'BMEIEN
DO NEW
+3 ;Quit if still not in Master
SET BMEIEN=$ORDER(^BMEMASTR("B",DFN,0))
IF 'BMEIEN
QUIT
+4 SET DIE="^BMEMASTR("
SET DA=BMEIEN
SET DR=".03////"_DT_";.06////"_BMEMEED
+5 DO ^DIE
KILL DIE,DR,DA
+6 ;
+7 QUIT
+8 ;
STILLACT ;EP - Still Active Tags ONLY - No Adds/No Updates - Fall throughs
+1 ;Called from MED^BMEMED -Update Dates - Still Eligible Dates
+2 ;Add Record to Master if missing
SET BMEIEN=$ORDER(^BMEMASTR("B",DFN,0))
IF 'BMEIEN
DO NEW
+3 ;Quit if still not in Master
SET BMEIEN=$ORDER(^BMEMASTR("B",DFN,0))
IF 'BMEIEN
QUIT
+4 SET DIE="^BMEMASTR("
SET DA=BMEIEN
SET DR=".04////"_DT_";.06////"_BMEMEED
+5 DO ^DIE
KILL DIE,DR,DA
+6 ;
+7 QUIT
+8 ;
FALL ;EP - Fall Off Date
+1 ;Called from ^BMEMFALL - If Ending Date is added to Medicaid Eligible File
+2 ;Quit if still not in Master
IF '$DATA(^BMEMASTR(BMEMAIEN,0))
QUIT
+3 SET DIE="^BMEMASTR("
SET DA=BMEMAIEN
SET DR=".05////"_DT
+4 DO ^DIE
KILL DIE,DR,DA
+5 ;
+6 QUIT