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

AGED4A2.m

Go to the documentation of this file.
AGED4A2 ; IHS/ASDS/EFG - PAGE 4 - INSURANCE SUMMARY PART 3;    
 ;;7.1;PATIENT REGISTRATION;**2**;JAN 31, 2007
 ;
 ;AG*7.1*2 AG/SD/TPF 6/26/2006 PAGE 37 OF TASK ORDER
VPROMPT(AGPTR) ;EP - VIEW SEQUENCES FOR PARTICULAR CATEGORY
 N CATDT,CATREC,IENS,SUBITEM
 K VIEWDT
AGAIN ;
 I '$D(^AUPNICP("EFF",AGPATDFN,AGPTR)) W !!,"PATIENT HAS NO SEQUENCING TO VIEW IN THIS CATEGORY!" H 3 Q
 W !!,"PRIOR SEQUENCING DATES:"
 K CATENTRY
 S CATDT=""
 F ITEM=1:1 S CATDT=$O(^AUPNICP("EFF",AGPATDFN,AGPTR,CATDT),-1) Q:CATDT=""  D
 .S Y=CATDT X ^DD("DD")
 .W !!,ITEM_". "
 .W " "_Y
 .W !?20,"INSURER",?38,"COVERAGE",?50,"PRIORITY"
 .W !?20,"=======",?38,"========",?50,"========"
 .S CATREC=""
 .F SUBITEM=1:1 S CATREC=$O(^AUPNICP("EFF",AGPATDFN,AGPTR,CATDT,CATREC))  Q:CATREC=""  D
 ..S CATENTRY(ITEM,CATREC)=CATDT
 ..W !?12,"  "
 ..S IENS=$P($G(^AUPNICP(CATREC,0)),U,3)
 ..I IENS'["(" W $E($$GET1^DIQ(9000035,CATREC_",",.03,"E","AGDATA","AGERR"),1,20)
 ..E  I IENS'="",(IENS'["AUPNPAT") W $P($G(@(U_$P($G(^AUPNICP(CATREC,0)),U,3))),U)
 ..E  I IENS'="",(IENS["AUPNPAT") D
 ...S IENS=$P($P(IENS,","),"(",2)
 ...W $P($G(^DPT(IENS,0)),U)
 ..W ?38,$$GET1^DIQ(9000035,CATREC_",",.07,,"AGDATA","AGERR")
 ..W ?50,$$GET1^DIQ(9000035,CATREC_",",.05,,"AGDATA","AGERR")
 S ITEM=ITEM-1
ASKITEM ;EP - ASK SEQUENCE ENTRY ITEM TO DELETE OR VIEW
 N VIEWDT,DELDT
 W !
 K DIR,DUOUT,DTOUT
 S DIR(0)="NO^1:"_ITEM
 D ^DIR
 Q:Y=""
 Q:$D(DUOUT)!($D(DTOUT))
 S CATENTRY=Y
 S VIEWDT=$O(CATENTRY(CATENTRY,""))
 S:VIEWDT'="" VIEWDT=CATENTRY(CATENTRY,VIEWDT)
 K DIR,DUOUT,DTOUT
 S DIR(0)="SO^V:VIEW;R:REVERSE"
 D ^DIR
 G:$D(DUOUT) ASKITEM
 G:Y=""!(Y[U)!($D(DTOUT)) ASKITEM
 I Y="V" S OLDPTR=CATPTR,AGANS="V" S CATPTR=AGPTR D DISPCAT^AGED4A1 Q:AGANS'="V"  G AGAIN
 I Y="R" D  Q:'Y
 .K DIR
 .W !!,"You have selected:"
 .S (Y,DELDT)=VIEWDT X ^DD("DD") S VIEWDT=Y
 .W !!,?4,"SEQ DATE: ",VIEWDT
 .W !!,"Are you sure you want to reverse?"
 .W !!
 .S DIR(0)="Y"
 .D ^DIR
 D REVERSE(.CATENTRY)   ;THE TERM 'REVERSE' DOESN'T MAKE SENSE TO ME
 ;                               DO THEY MEAN REVERT OR DELETE?
 ;DELETE THE AGCAT ENTRY TOO
 K AGCAT(CATPTR,DELDT)
 Q
REVERSE(CATENTRY) ;EP - DELETE CATEGORY PRIORITIZING ENTRY
 N ENTRY
 S ENTRY=CATENTRY
 K DA,DIK
 S DIK="^AUPNICP("
 S DA=""
 F  S DA=$O(CATENTRY(ENTRY,DA)) Q:'DA  D
 .D ^DIK
 Q