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

DGMTE.m

Go to the documentation of this file.
  1. DGMTE ;ALB/RMO,CAW,LD,SCG,BDB - Edit an Existing Means Test ;03 APR 2002 2:00 pm
  1. ;;5.3;Registration;**33,45,182,344,332,433,624,858**;Aug 13, 1993;Build 30
  1. ;
  1. EN ;Entry point to edit an existing means test
  1. N DGMDOD S DGMDOD=""
  1. I DGMTYPT=1 S DIC("S")="I $P(^(0),U,14)"
  1. I DGMTYPT=2!(DGMTYPT=4) S DIC("S")="I $D(^DGMT(408.31,""AID"",DGMTYPT,+Y))"
  1. I $D(DGMTDFN)#2 D UNLOCK^DGMTUTL(DGMTDFN) K DGMTDFN
  1. S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q:Y<0 S (DFN,DGMTDFN)=+Y
  1. I $P($G(^DPT(DFN,.35)),U)'="" S DGMDOD=$P(^DPT(DFN,.35),U)
  1. I $G(DGMDOD) W !,"Patient died on: ",$$FMTE^XLFDT(DGMDOD,"1D") Q
  1. ;
  1. ; check if income test upload in progress
  1. D CKUPLOAD^IVMCUPL(DFN)
  1. ;
  1. ; obtain lock used to synchronize local MT/CT options with income test upload
  1. I $$LOCK^DGMTUTL(DFN)
  1. ;
  1. DT S DIC("A")="Select DATE OF TEST: "
  1. N FUTFLG,VSITE,DGLSTDT S FUTFLG=0,VSITE=+$P($$SITE^VASITE(),U,3)
  1. I $D(^DGMT(408.31,+$$FUT^DGMTU(DFN,"",DGMTYPT),0)),+$P($G(^(2)),U,5)=VSITE S DIC("B")=$P(^(0),"^"),FUTFLG=1
  1. ;cannot edit a means test that is more than 1 year old DG*5.3*858
  1. I 'FUTFLG I $D(^DGMT(408.31,+$$LST^DGMTU(DFN,"",DGMTYPT),0)) S (DIC("B"),DGLSTDT)=$P(^(0),"^") I $$OLD^DGMTU4(DGLSTDT),(DGMTYPT=1) D K DIC G Q
  1. . W !!,"Please use the Add a New Means Test Option.",!,"User may not edit a Means Test that is more than 1 year old."
  1. S DIC("S")="I $P(^(0),U,2)=DFN,$P(^(0),U,19)=DGMTYPT"
  1. S:DGMTYPT'=4 DIC("S")=DIC("S")_" I $G(^(""PRIM""))!($P(^(0),U,1)>DT)"
  1. S DIC="^DGMT(408.31,",DIC(0)="EQZ" W ! D EN^DGMTLK K DIC G Q:Y<0
  1. S DGMTI=+Y,DGMTDT=$P(Y,"^",2),DGMT0=Y(0)
  1. ;
  1. ;If test is uneditable, print error message and allow user to view test
  1. ;or print 10-10EZ/EZR
  1. ;
  1. I '$P($G(^DG(408.34,+$P(Y(0),U,23),0)),U,2) D D:$G(DGMTERR) VIEWPRT G EN
  1. .W !!?3,*7,"Warning: Uneditable "_$S(DGMTYPT=1:"means",1:"copay")_" test. The source of this test is "_$S($$SR^DGMTAUD1(Y(0))]"":$$SR^DGMTAUD1(Y(0)),1:"UNKNOWN")
  1. .W !?12,"which has been flagged as an uneditable source.",!
  1. .S DIR("A")="Would you like to view the "_$S(DGMTYPT=1:"means",1:"copay")_" test or print the 10-10EZR/EZ",DIR("B")="NO",DIR(0)="Y"
  1. .D ^DIR K DIR S DGMTERR=Y I $D(DTOUT)!($D(DUOUT)) K DGMTERR,DTOUT,DUOUT
  1. I "^3^10^"[("^"_$P(Y(0),"^",3)_"^") W !?3,*7,$S(DGMTYPT=1:"Means",1:"Copay")_" test is NO LONGER "_$S(DGMTYPT=1:"REQUIRED",1:"APPLICABLE")_", it cannot be edited." G EN
  1. I DGMTYPT=4,$P($G(^DGMT(408.31,DGMTI,2)),U,8) D I $G(DGOUT) K DGOUT G EN
  1. .N DGMT,DGT S DGMT=$P(^DGMT(408.31,DGMTI,2),U,8),DGT=$P($G(^DGMT(408.31,DGMT,0)),U,19)
  1. .I DGT,DGT>2 Q
  1. .W !!,?3,"This LTC copay exemption test is linked to the ",$$FTIME^DGMTUTL(+^DGMT(408.31,DGMT,0)),$S(DGT=1:" means",1:" RX copay")," test."
  1. .W !,?3,"Changes should be made using the 'Edit an Existing ",$S(DGT=1:"Means",1:"Copay Exemption")," Test'"
  1. .W !,?3,"menu option."
  1. .S DGOUT=1
  1. D DISPLAY^DGMTU23(DGMTI,DGMTYPT),PAUSE I $D(DTOUT)!($D(DUOUT)) K DTOUT,DUOUT G EN
  1. ;
  1. ;hardship determination, once granted, will remain unless deleted by
  1. ;hardship option
  1. ;I $P(DGMT0,"^",20),'$$EDIT() G EN ; if hardship
  1. ;
  1. S DGMTACT="EDT",DGMTROU="EN^DGMTE" G EN^DGMTSC
  1. ;
  1. Q K DFN,DGMTACT,DGMTDT,DGMTERR,DGMT0,DGMTI,DGMTROU,DGMTYPT,DGMTX,DGOUT,DTOUT,DUOUT,X,Y
  1. ;
  1. ; release lock used to synchronize local MT/CT options with income test upload
  1. I $D(DGMTDFN)#2 D UNLOCK^DGMTUTL(DGMTDFN) K DGMTDFN
  1. Q
  1. ;
  1. PAUSE S DIR(0)="E" D ^DIR
  1. Q
  1. ;
  1. VIEWPRT ; Select 1 to view an uneditable means test or 2 to print a 10-10EZ/EZR
  1. ;
  1. S DIR(0)="S^1:View Means Test;2:Print Means Test 10-10EZR/EZ",DIR("A")="Select Choice"
  1. D ^DIR S DGMTANS=Y G:$D(DTOUT)!($D(DUOUT)) VIEWPRTQ
  1. I DGMTANS=1 D EN1^DGMTV
  1. I DGMTANS=2 D
  1. .N RPTSEL,DGTASK
  1. .D FULL^VALM1
  1. .S (RPTSEL,DGTASK)=""
  1. .I $D(DGFINOP) DO
  1. ..W !!,"Options for printing financial assessment information will follow."
  1. ..W !,"Generally, you should answer 'YES' to 'PRINT 10-10EZR?' after updating"
  1. ..W !,"patient demographic or financial information. Answer 'YES' to 'PRINT"
  1. ..W !,"10-10EZ?' after entering new patient demographic and financial information."
  1. .S RPTSEL=$$SEL1010^DG1010P("EZR/EZ") ;*Select 1010EZ/R form to print
  1. .S:RPTSEL'="-1" DGTASK=$$PRT1010^DG1010P(RPTSEL,DFN,DGMTI) ;*Print 1010EZ/R
  1. ;
  1. VIEWPRTQ ;
  1. K DGMTANS,DIR,DTOUT,DUOUT,Y
  1. Q
  1. ;
  1. EDIT() ; want to edit even though MT is hardship?
  1. ;
  1. ; Output: 1 if user wants to edit, 0 otherwise
  1. ;
  1. N DIR,DTOUT,DUOUT,DIRUT,DIROUT,I,X,Y
  1. S DIR("?",1)="WARNING: You are about to access a means test for which a hardship has"
  1. S DIR("?",2)=" been authorized. If you proceed, the hardship will be removed"
  1. S DIR("?",3)=" and the means test category will be recalculated! To avoid"
  1. S DIR("?",4)=" this problem, enter NO at the next prompt and use the 'View"
  1. S DIR("?",5)=" a Past Means Test' option should you need to see details of"
  1. S DIR("?",6)=" this means test."
  1. S DIR("?",7)=" "
  1. S DIR("?")="Enter NO to stop editing this means test. Enter YES to continue"
  1. F I=1:1 Q:'$D(DIR("?",I)) W !,DIR("?",I)
  1. S DIR("A")="Do you want to continue editing this means test? ",DIR("B")="NO",DIR(0)="YA"
  1. D ^DIR
  1. Q Y