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

AGFACE5.m

Go to the documentation of this file.
AGFACE5 ; IHS/ASDS/EFG - FACE SHEET (MEDICAID) ;
 ;;7.1;PATIENT REGISTRATION;**4**;AUG 25,2005
 ;
 G END:'$D(^AUPNMCD("AB",DFN))
 S AG("STATE")=0,(AGHDG,AGPRTXTR,AGSTNUM)="N"
 D HDG
 S AGNINE=$$HTFM^XLFDT($H-275,1) ;Compute 9 Months earlier
GSTATE S AG("STATE")=$O(^AUPNMCD("AB",DFN,AG("STATE"))) G END:AG("STATE")="" S AGNUMBER=0
GNODE S AGNUMBER=$O(^AUPNMCD("AB",DFN,AG("STATE"),AGNUMBER))
 G GSTATE:AGNUMBER=""
 W !,$$GET1^DIQ(5,AG("STATE"),1),?8,AGNUMBER
 D PLNAME
 S DA=$O(^AUPNMCD("AB",DFN,AG("STATE"),AGNUMBER,0))
 S %=$$GET1^DIQ(9000004,DA,2101)
 W:$L(%) !?3,"NAME: ",%
 S %=$$GET1^DIQ(9000004,DA,2102)
 W:$L(%) !?3,"DATE OF BIRTH: ",%
 W !
 G GNODE
IENNODE ;
WRITLN ;
 Q
WSTNUM ;
 Q
WELIGDT ;
WMCNAM ;
END K AGHDG,IEN,AGNINE,AGNUMBER,AGPRTXTR,AG("STATE"),AGSTNUM,AGPLNUM
 Q
HDG ;Q:AGHDG="Y"  W !,AG("-"),!,"MEDICAID:    " W:AGOPT(16)="Y" "(elig. dates null, or less than 9 months ago)"
 Q:$G(AGHDG)="Y"  W !,$G(AG("-")),!,"MEDICAID:    " W:$G(AGOPT(16))="Y" "(elig. dates null, or less than 9 months ago)"  ;AG*7.1*4 IM26968
 W !,"STATE",?8,"NUMBER",?27,"(updated)",?40,"ELIG DATE",?54,"COVERAGE",?67,"ELIG END" S AGHDG="Y"
 Q
PLNAME ;EP - Display Medicaid Plan Name info
 ;Get IEN of Patient in Medicaid Elig. File (^AUPNMCD)
 N AGIEN,AGDATA,AGUPDT,AGBDT,AGEDT,AGINSPTR,AGPLNAME,AGCOV
 S AGIEN=""
 F  S AGIEN=$O(^AUPNMCD("AB",DFN,AG("STATE"),AGNUMBER,AGIEN)) Q:AGIEN=""  D
 .;Get data from 0th node of Mcaid Elig File
 .S AGDATA=$G(^AUPNMCD(AGIEN,0))
 .Q:AGDATA=""
 .;Insurer pointer is the 10th piece of Medicaid Elig Files 0th node
 .S AGINSPTR=$P(AGDATA,U,10)
 .I $G(AGINSPTR)'="" D
 ..S AGPLNAME=$P($G(^AUTNINS(AGINSPTR,0)),U)
 ..W !,"PLAN: ",AGPLNAME
 .E  W !,"PLAN: (none)"
 .S AGUPDT=0
 .S Y=$P($G(^AUPNMCD(AGIEN,0)),U,8)
 .D DD^%DT W ?25,"(",Y,")"
 .F  S AGUPDT=$O(^AUPNMCD(AGIEN,11,AGUPDT)) Q:'+AGUPDT  D
 ..S AGBDT=$P($G(^AUPNMCD(AGIEN,11,AGUPDT,0)),U)
 ..S AGEDT=$P($G(^AUPNMCD(AGIEN,11,AGUPDT,0)),U,2)
 ..S AGCOV=$P($G(^AUPNMCD(AGIEN,11,AGUPDT,0)),U,3)
 ..I AGBDT>DT,(AGBDT'="") Q
 ..I AGOPT(16)="Y",AGBDT<AGNINE Q
 ..W ?40,$$FMTE^XLFDT(AGBDT,1),?57,$G(AGCOV),?66,$$FMTE^XLFDT(AGEDT,1),!
 Q