source: WorldVistAEHR/trunk/r/INCOME_VERIFICATION_MATCH-IVM/IVMPMTE.m@ 1604

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1IVMPMTE ;ALB/KCL/CJM/JAN - MEANS TEST EVENT DRIVER INTERFACE ; 07-MAR-01
2 ;;2.0;INCOME VERIFICATION MATCH;**1,9,17,39,49,89**;21-OCT-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; Input - DFN the patient's internal entry number.
6 ; DGMTI the Means Test internal entry number.
7 ; DGMTINF the Means Test Interactive/Non-interactive flag.
8 ; DGMTACT the Means Test event type
9 ; DGMTP annual Means Test 0th node prior to Add, Edit
10 ; or Delete.
11 ; DGMTA annual Means Test 0th node after Add, Edit or Delete.
12 ;
13 ; Output - None.
14 ;
15 ;
16EN ; Entry point
17 N EVENTS,IVMDA
18 S EVENTS("IVM")=1
19 ;
20 ; Quit if supported Means Test variables are not defined
21 Q:'$D(DFN)!('$D(DGMTA))!('$D(DGMTP))!('$D(DGMTINF))!('$D(DGMTACT))
22 ;
23 ; - no processing required when uploading or deleting
24 ; - an IVM-verified Means Test
25 Q:DGMTACT="UPL"!(DGMTACT="DUP")
26 I DGMTP]"",DGMTA]"",DGMTACT="DEL" Q
27 ;
28 ; Prevent DCD/other income tests uploaded from HEC to trigger a
29 ; transmission back to HEC (quit if source of test isn't VAMC)
30 N DGST S DGST=$S(+DGMTA:+$P(DGMTA,U,23),1:+$P(DGMTP,U,23))
31 Q:$P($G(^DG(408.34,DGST,0)),"^")'="VAMC"&(DGMTACT'="CAT")
32 ;
33 W:'DGMTINF !,"Checking Income Verification Match (IVM) for changes..."
34 S IVMMTDT=$S(DGMTA:+DGMTA,1:+DGMTP) Q:'IVMMTDT S IVMDT=$$LYR^DGMTSCU1(IVMMTDT)
35 S IVMNEW=0 S IVMDA=$O(^IVM(301.5,"APT",DFN,IVMDT,0)) I 'IVMDA S IVMNEW=1 ; Check for entry/previous year in IVM PATIENT file
36 I 'IVMNEW D CHK ; If entry in IVM PATIENT file check for Means Test changes
37 I IVMNEW,$$IVM^IVMUFNC(DFN,IVMMTDT),($E(IVMDT,1,3)=($E(DT,1,3)-1)) I $$LOG^IVMPLOG(DFN,IVMDT,.EVENTS) ; new & meets crtieria & current year
38 ;
39 ;log patient for transmission if patient meets DCD criteria
40 D LOGDCD^IVMCUC(DFN,IVMMTDT)
41 ;
42 ; Quit when uploading Future Means Tests
43 Q:$G(IVM1)>DT
44 ;
45 ; Update cross references when editing Future Dated Tests
46 I $D(DGMTI),+$G(DGMT0)>DT,$D(IVMDA) D
47 .I DGMTYPT=1,$P(^IVM(301.5,IVMDA,0),U,6)'="",+DGMTA'>DT S DATA(.06)="" I $$UPD^DGENDBS(301.5,IVMDA,.DATA) K DATA,^IVM(301.5,"AC",+DGMT0,IVMDA,DGMTI)
48 .I DGMTYPT=2,$P(^IVM(301.5,IVMDA,0),U,7)'="",+DGMTA'>DT S DATA(.07)="" I $$UPD^DGENDBS(301.5,IVMDA,.DATA) K DATA,^IVM(301.5,"AD",+DGMT0,IVMDA,DGMTI)
49 ;
50ENQ ; Cleanup
51 W:'DGMTINF "completed."
52 K DA,DIC,DIE,DLAYGO,DR,IVMDA,IVMDT,IVMFLG,IVMMTDT,IVMNEW,X,Y
53 Q
54CHK ; Check if Means Test has been ADDED, DELETED, or EDITED
55 S IVMFLG=0
56 F X=1,2,3,4,5,7,10,12,15,18 Q:IVMFLG=1 D
57 .I $P(DGMTA,"^",X)'=$P(DGMTP,"^",X) S IVMFLG=1 I $$SETSTAT^IVMPLOG(IVMDA,.EVENTS) ; If MT changes then edit IVM PATIENT file
58 Q
Note: See TracBrowser for help on using the repository browser.