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

DGMTCOU.m

Go to the documentation of this file.
  1. DGMTCOU ;ALB/CAW/HM - Copay Utilities ; 12/10/92
  1. ;;5.3;Registration;**45,182,972**;Aug 13, 1993;Build 80
  1. ;
  1. EDT(DFN,DGDT) ;Display patients current copay test information and provide
  1. ; the user with the option of proceeding with adding a
  1. ; copay test or editing an existing copay test
  1. ; Input -- DFN Patient IEN
  1. ; DGDT Date/Time
  1. ; Output -- None
  1. ;
  1. ;
  1. N DGMTERR,SOURCE,DGMTYPT
  1. S DGMTYPT=2
  1. ;
  1. ; obtain lock used to synchronize local MT/CT options with income test upload
  1. I $$LOCK^DGMTUTL(DFN)
  1. ;
  1. S DGMTI=+$$LST^DGMTU(DFN,DGDT,2)
  1. S DGMT0=$G(^DGMT(408.31,DGMTI,0)),DGMTDT=+DGMT0 S DGMTS=$P(DGMT0,"^",3)
  1. I $$YR(DFN,DGDT,+DGMT0) S DGMTS=""
  1. G:$P($$RXST^IBARXEU(DFN,DT),U,3)=2010&('$$YR(DFN,DT,DGMTI)) EDTQ I $P($G(^DPT(DFN,.54)),"^")="Y" D DISP^IBARXEU(DFN,DGDT,2) W ! ;DG*5.3*972 HM if MOH="Y" do not display
  1. ;
  1. ;If test is uneditable, print error message and allow user to view test
  1. S SOURCE=$P($G(^DGMT(408.31,DGMTI,0)),U,23)
  1. I SOURCE,'$P($G(^DG(408.34,SOURCE,0)),U,2) D D:$G(DGMTERR) DISPLAY^DGMTU23(DGMTI,2),PAUSE^DGMTE G EDTQ
  1. .W !,"The source of this test makes the test uneditable."
  1. .S DIR("A")="Would you like to view the copay test",DIR("B")="NO",DIR(0)="Y"
  1. .D ^DIR K DIR S DGMTERR=Y I $D(DTOUT)!($D(DUOUT)) K DGMTERR,DTOUT,DUOUT
  1. ;
  1. S DIR("A")="Do you wish to "_$S(DGMTS="":"add a",1:"edit the")_" copay test at this time"
  1. S DIR("B")=$S(DGMTS=10:"YES",1:"NO"),DIR(0)="Y"
  1. W ! D ^DIR G EDTQ:$D(DTOUT)!($D(DUOUT))
  1. I Y,DGMTS]"" S DGMTYPT=2,DGMTACT="EDT",DGMTROU="EDTQ^DGMTCOU" G EN^DGMTSC
  1. I Y,DGMTS="" S DGMTYPT=2,DGMTACT="ADD",DGMTROU="EDTQ^DGMTCOU" S DGMTDT=DT D ADD^DGMTA G EN^DGMTSC
  1. EDTQ K DGMT0,DGMTACT,DGMTDT,DGMTI,DGMTROU,DGMTS,DIR,Y
  1. ;
  1. ; release lock used to synchronize local MT/CT options with income test upload
  1. D UNLOCK^DGMTUTL(DFN)
  1. Q
  1. ;
  1. YR(DFN,DGDT,DGMT0) ;Check to see if test is greater than 365 days
  1. ; Input -- DFN Patient IEN
  1. ; DGDT Date/Time to check against
  1. ; DGMT0 Zeroth node of Copay test
  1. ; Output -- 1 = TEST IS 365 OR MORE DAYS OLD
  1. ; 0 = TEST IS LESS THAN 365 DAYS OLD
  1. ;
  1. N X,X1,X2,DGLDYR,DGY S DGY=1
  1. S DGLDYR=$E(DGMT0,1,3)_"1231"
  1. I DGMTI S X1=DGDT,X2=$P(DGMT0,U,2) D ^%DTC I X<365,DGDT'>DGLDYR S DGY=0
  1. Q DGY
  1. ;
  1. ON ; Check to see of copay software is on
  1. ; Input - none
  1. ; Output - 1 = YES
  1. ; 0 = NO
  1. I $P(^DG(43,1,0),U,41) S Y=1 Q
  1. S Y=0
  1. Q
  1. ASKNW() ;
  1. Q 0