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

ABMMCDCU.m

Go to the documentation of this file.
  1. ABMMCDCU ; IHS/SD/SDR - Medicaid Eligible file cleanup for TPB ; 02/19/2015
  1. ;;99.1;IHS DICTIONARIES (PATIENT);**24**;MAR 9, 1999;Build 1
  1. ;
  1. ;For CR4215 - This routine is called by AUPNMCDF to clean up TPB claims and bills based
  1. ; on Medicaid Eligible records that are cleaned up in the AUPNMCDF routine. It will
  1. ; use one patient/Medicaid DFN and look for all claims associated with that entry, changing
  1. ; .07 MEDICAID MULTIPLE in the Insurer multiple.
  1. ;
  1. ;
  1. Q
  1. ; *********************************************************************
  1. EN(A,B,C,D) ;
  1. ; ABM("PDFN")=PATIENT
  1. ; ABM("MDFN")=Medicaid Eligible IEN
  1. ; ABMOLD - original value; what we are looking for
  1. ; ABMNEW - new value; what we are replacing old value with
  1. ;
  1. S ABM("PDFN")=A
  1. S ABM("MDFN")=B
  1. S ABMOLD=C
  1. S ABMNEW=D
  1. ;
  1. S ABMHOLD=DUZ(2)
  1. S DUZ(2)=0
  1. ;
  1. F S DUZ(2)=$O(^ABMDCLM(DUZ(2))) Q:'DUZ(2) D
  1. .S ABM("CDFN")=0
  1. .F S ABM("CDFN")=$O(^ABMDCLM(DUZ(2),"B",ABM("PDFN"),ABM("CDFN"))) Q:'ABM("CDFN") D
  1. ..S ABM("MIEN")=0
  1. ..F S ABM("MIEN")=$O(^ABMDCLM(DUZ(2),ABM("CDFN"),13,ABM("MIEN"))) Q:'ABM("MIEN") D
  1. ...I $P($G(^ABMDCLM(DUZ(2),ABM("CDFN"),13,ABM("MIEN"),0)),U,6)'=ABM("MDFN") Q ;not the Medicaid entry we are looking for
  1. ...S ABM("OLD")=$P($G(^ABMDCLM(DUZ(2),ABM("CDFN"),13,ABM("MIEN"),0)),U,7)
  1. ...I ABM("OLD")'=ABMOLD Q ;not the Medicaid eligibility entry we are looking for
  1. ...S DA(1)=ABM("CDFN")
  1. ...S DA=ABM("MIEN")
  1. ...S DIE="^ABMDCLM(DUZ(2),"_DA(1)_",13,"
  1. ...S DR=".07////"_ABMNEW
  1. ...D ^DIE
  1. ...D LOG^AUPNMCDF(9002274.3,ABM("MIEN")_",13,"_ABM("CDFN")_","_DUZ(2),"9002274.3013"_","_".07",ABM("OLD"))
  1. ...D BILLS
  1. S DUZ(2)=ABMHOLD
  1. Q
  1. BILLS ;EP
  1. S ABM("BILL")=ABM("CDFN")_" " ;the space makes it act like a string
  1. F S ABM("BILL")=$O(^ABMDBILL(DUZ(2),"B",ABM("BILL"))) Q:(ABM("BILL")'[ABM("CDFN")) D
  1. .S ABM("BDFN")=0
  1. .F S ABM("BDFN")=$O(^ABMDBILL(DUZ(2),"B",ABM("BILL"),ABM("BDFN"))) Q:'ABM("BDFN") D
  1. ..S ABM("BMIEN")=0
  1. ..F S ABM("BMIEN")=$O(^ABMDBILL(DUZ(2),ABM("BDFN"),13,ABM("BMIEN"))) Q:'ABM("BMIEN") D
  1. ...I $P($G(^ABMDBILL(DUZ(2),ABM("BDFN"),13,ABM("BMIEN"),0)),U,6)'=ABM("MDFN") Q ;not the Medicaid entry we are looking for
  1. ...S ABM("OLD")=$P($G(^ABMDBILL(DUZ(2),ABM("BDFN"),13,ABM("BMIEN"),0)),U,7)
  1. ...I ABM("OLD")'=ABMOLD Q ;not the Medicaid eligibility entry we are looking for
  1. ...S DA(1)=ABM("BDFN")
  1. ...S DA=ABM("BMIEN")
  1. ...S DIE="^ABMDBILL(DUZ(2),"_DA(1)_",13,"
  1. ...S DR=".07////"_ABMNEW
  1. ...D ^DIE
  1. ...D LOG^AUPNMCDF(9002274.4,ABM("MIEN")_",13,"_ABM("BDFN")_","_DUZ(2),"9002274.4013"_","_".07",ABM("OLD"))
  1. Q