1 | IVMZ072 ;BAJ/PHH - HL7 Z07 CONSISTENCY CHECKER -- DRIVER ROUTINE II ; 05/22/08
|
---|
2 | ;;2.0;INCOME VERIFICATION MATCH;**105,130**;JUL 8,1996;Build 2
|
---|
3 | ;
|
---|
4 | ;
|
---|
5 | ; This routine supports the IVMZ07C consistency checker routines.
|
---|
6 | LOADSD(DFN,DGSD) ; Load spouse & dependent data into array
|
---|
7 | ; We will need to look at the Patient Relationship file to determine the spouse(s) and dependents for the patient
|
---|
8 | ; from the Patient Relation file ^DGPR(408.12) This file will point to an IEN in the Income Person file.
|
---|
9 | ; Next, we will load all of the spouse(s) and dependents from the Income Person file into the array.
|
---|
10 | N NIEN,IEN,RIEN,NODE,I,ENODE
|
---|
11 | ; look into Patient Relation file #408.12. Here we will find a pointer to each relation. And the record itself will
|
---|
12 | ; contain a pointer into the INCOME PERSON file (#408.13)
|
---|
13 | ;
|
---|
14 | ;Global ^DGPR(408.12,,DFN
|
---|
15 | ;^DGPR(408.12,"B",9999955601,3206)=
|
---|
16 | ; 3210)= <<------|
|
---|
17 | ; 3211)= |
|
---|
18 | ; 3212)= |
|
---|
19 | ; ]
|
---|
20 | ;Global ^DGPR(408.12,3210 <<------------
|
---|
21 | ;^DGPR(408.12,3210,0)=9999955601^2^7170758;DGPR(408.13,
|
---|
22 | ;^DGPR(408.12,3210,"E",0)=^408.1275D^1^1 |
|
---|
23 | ;^DGPR(408.12,3210,"E",1,0)=2560406^1 |
|
---|
24 | ;^DGPR(408.12,3210,"E","AID",-2560406,1)= |
|
---|
25 | ;^DGPR(408.12,3210,"E","B",2560406,1)= |
|
---|
26 | ; |
|
---|
27 | ; |
|
---|
28 | ;Global ^DGPR(408.13,7170758 <<--------------
|
---|
29 | ;^DGPR(408.13,7170758,0)=XXXXXX,XXXX SPOUSE^F^2560406^^^^^^174040656P^N
|
---|
30 | ; 1)=XXXXX,XXXX^^^^^^^
|
---|
31 | ;
|
---|
32 | I '$D(^DGPR(408.12,"B",DFN)) Q
|
---|
33 | S NIEN="" F S NIEN=$O(^DGPR(408.12,"B",DFN,NIEN)) Q:NIEN="" D
|
---|
34 | . Q:'$D(^DGPR(408.12,NIEN,0))
|
---|
35 | . S IEN=$P(^DGPR(408.12,NIEN,0),U,3)
|
---|
36 | . ; an entry in DPT is the patient. we only need relations
|
---|
37 | . Q:$P(IEN,";",2)["DPT"!'IEN
|
---|
38 | . Q:'$$ACTIF(NIEN,.ENODE) ;include only Active dependents
|
---|
39 | . S RIEN=$P(IEN,";",1),NODE=$P(IEN,";",2)
|
---|
40 | . S NODE=U_NODE,NODE=NODE_RIEN_")"
|
---|
41 | . Q:'$D(@NODE)
|
---|
42 | . S DGSD("DEP",RIEN,"EFF")=ENODE
|
---|
43 | . S DGSD("DEP",RIEN)=$P(^DGPR(408.12,NIEN,0),U,2)
|
---|
44 | . M DGSD("DEP",RIEN)=@NODE
|
---|
45 | Q
|
---|
46 | ;
|
---|
47 | ACTIF(NIEN,ENODE) ;determine if record in ^DGPR(408.12) is currently active. If active, populate variable ENODE with Effective Date.
|
---|
48 | ; This API should be called something like this I $$ACTIF^IVMZ072(NIEN,.ENODE)...
|
---|
49 | ; Input:
|
---|
50 | ; NIEN = IEN of ^DGPR(408.12) reference
|
---|
51 | ; ENODE = Variable to contain Effective Date
|
---|
52 | ;
|
---|
53 | ; Populates:
|
---|
54 | ; ENODE = With the most recent effective date of changes
|
---|
55 | ;
|
---|
56 | ; Returns:
|
---|
57 | ; ACTIVE flag
|
---|
58 | ; 1 = Active
|
---|
59 | ; 0 = Inactive
|
---|
60 | ;
|
---|
61 | N ROOT,ACTDAT,INDEX,ACTIVE,EFF
|
---|
62 | S ACTIVE=0
|
---|
63 | D Q ACTIVE
|
---|
64 | . S ROOT=$O(^DGPR(408.12,NIEN,"E","AID","")) Q:ROOT=""
|
---|
65 | . S INDEX=$O(^DGPR(408.12,NIEN,"E","AID",ROOT,"")) Q:INDEX=""
|
---|
66 | . S ACTDAT=^DGPR(408.12,NIEN,"E",INDEX,0)
|
---|
67 | . S ACTIVE=$P(ACTDAT,"^",2),ENODE=$P(ACTDAT,"^",1)
|
---|
68 | Q ACTIVE
|
---|
69 | ;
|
---|