source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGMTCOU.m@ 1046

Last change on this file since 1046 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1DGMTCOU ;ALB/CAW - Copay Utilities ; 12/10/92
2 ;;5.3;Registration;**45,182**;Aug 13, 1993
3 ;
4EDT(DFN,DGDT) ;Display patients current copay test information and provide
5 ; the user with the option of proceeding with adding a
6 ; copay test or editing an existing copay test
7 ; Input -- DFN Patient IEN
8 ; DGDT Date/Time
9 ; Output -- None
10 ;
11 ;
12 N DGMTERR,SOURCE,DGMTYPT
13 S DGMTYPT=2
14 ;
15 ; obtain lock used to synchronize local MT/CT options with income test upload
16 I $$LOCK^DGMTUTL(DFN)
17 ;
18 S DGMTI=+$$LST^DGMTU(DFN,DGDT,2)
19 S DGMT0=$G(^DGMT(408.31,DGMTI,0)),DGMTDT=+DGMT0 S DGMTS=$P(DGMT0,"^",3)
20 I $$YR(DFN,DGDT,+DGMT0) S DGMTS=""
21 G:$P($$RXST^IBARXEU(DFN,DT),U,3)=2010&('$$YR(DFN,DT,DGMTI)) EDTQ D DISP^IBARXEU(DFN,DGDT,2) W !
22 ;
23 ;If test is uneditable, print error message and allow user to view test
24 S SOURCE=$P($G(^DGMT(408.31,DGMTI,0)),U,23)
25 I SOURCE,'$P($G(^DG(408.34,SOURCE,0)),U,2) D D:$G(DGMTERR) DISPLAY^DGMTU23(DGMTI,2),PAUSE^DGMTE G EDTQ
26 .W !,"The source of this test makes the test uneditable."
27 .S DIR("A")="Would you like to view the copay test",DIR("B")="NO",DIR(0)="Y"
28 .D ^DIR K DIR S DGMTERR=Y I $D(DTOUT)!($D(DUOUT)) K DGMTERR,DTOUT,DUOUT
29 ;
30 S DIR("A")="Do you wish to "_$S(DGMTS="":"add a",1:"edit the")_" copay test at this time"
31 S DIR("B")=$S(DGMTS=10:"YES",1:"NO"),DIR(0)="Y"
32 W ! D ^DIR G EDTQ:$D(DTOUT)!($D(DUOUT))
33 I Y,DGMTS]"" S DGMTYPT=2,DGMTACT="EDT",DGMTROU="EDTQ^DGMTCOU" G EN^DGMTSC
34 I Y,DGMTS="" S DGMTYPT=2,DGMTACT="ADD",DGMTROU="EDTQ^DGMTCOU" S DGMTDT=DT D ADD^DGMTA G EN^DGMTSC
35EDTQ K DGMT0,DGMTACT,DGMTDT,DGMTI,DGMTROU,DGMTS,DIR,Y
36 ;
37 ; release lock used to synchronize local MT/CT options with income test upload
38 D UNLOCK^DGMTUTL(DFN)
39 Q
40 ;
41YR(DFN,DGDT,DGMT0) ;Check to see if test is greater than 365 days
42 ; Input -- DFN Patient IEN
43 ; DGDT Date/Time to check against
44 ; DGMT0 Zeroth node of Copay test
45 ; Output -- 1 = TEST IS 365 OR MORE DAYS OLD
46 ; 0 = TEST IS LESS THAN 365 DAYS OLD
47 ;
48 N X,X1,X2,DGLDYR,DGY S DGY=1
49 S DGLDYR=$E(DGMT0,1,3)_"1231"
50 I DGMTI S X1=DGDT,X2=$P(DGMT0,U,2) D ^%DTC I X<365,DGDT'>DGLDYR S DGY=0
51 Q DGY
52 ;
53ON ; Check to see of copay software is on
54 ; Input - none
55 ; Output - 1 = YES
56 ; 0 = NO
57 I $P(^DG(43,1,0),U,41) S Y=1 Q
58 S Y=0
59 Q
60ASKNW() ;
61 Q 0
Note: See TracBrowser for help on using the repository browser.