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

AGMCDCNT.m

Go to the documentation of this file.
AGMCDCNT ; IHS/ASDS/EFG - FIX MCD ELIG HEADER NODE ;  
 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
 ;
 ;THIS ROUTINE CAN BE USED WHEN THE ELIG HEADER NODE'S PIECE
 ;3 AND 4 ARE WRONG. IT WILL FIX THOSE PIECES BY LOOPING THROUGH
 ;ALL THE MEDICAID FILE ENTRIES AND COUNTING THE ELIG RECORDS. IT
 ;WILL THEN POPULATE THE THIRD PIECE WITH THE LAST ELIG BEGIN DATE
 ;AND THE FOURTH PIECE WITH THE CORRECT COUNT OF ELIG RECORDS.
 ;
ECNT    ;EP
 S AG("MCD")=0
 S AG("FIXED")=0
 S AG("OLDCNT")=0
 F  S AG("MCD")=$O(^AUPNMCD(AG("MCD"))) Q:'AG("MCD")  D
 . S AG("DATE")=0 S AG("CNT")=0 S AG("P3")=0
 . S AG("OLDCNT")=$P($G(^AUPNMCD(AG("MCD"),11,0)),U,4)
 . Q:$O(^AUPNMCD(AG("MCD"),11,0))=""
 . S $P(^AUPNMCD(AG("MCD"),11,0),U,3)=""
 . S $P(^AUPNMCD(AG("MCD"),11,0),U,4)=0
 . S $P(^AUPNMCD(AG("MCD"),11,0),U,2)="9000004.11D"
 . F  S AG("DATE")=$O(^AUPNMCD(AG("MCD"),11,AG("DATE"))) Q:'AG("DATE")  D
 .. S AG("CNT")=AG("CNT")+1
 .. S AG("P3")=AG("DATE")
 .. S $P(^AUPNMCD(AG("MCD"),11,0),U,3)=AG("P3")
 .. S $P(^AUPNMCD(AG("MCD"),11,0),U,4)=AG("CNT")
 . I $P($G(^AUPNMCD(AG("MCD"),11,0)),U,4)'=AG("OLDCNT") S AG("FIXED")=AG("FIXED")+1
 K AG
 Q