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

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1DGENDD ;ALB/CJM,JAN,LBD,AMA - Enrollment Data Dictionary Functions; 13 JUN 1997;6-28-01
2 ;;5.3;Registration;**121,351,503,733**;Aug 13,1993;Build 15
3 ;
4SET1(DFN,DGENRIEN) ;
5 ;Description: sets the "AENRC" X-ref on the patient file
6 ;Inputs:
7 ; DFN - the patient ien
8 ; DGENRIEN - ien of current enrollment
9 ;
10 Q:'$G(DGENRIEN)
11 Q:'$G(DFN)
12 ;
13 N STATUS
14 S STATUS=$P($G(^DGEN(27.11,DGENRIEN,0)),"^",4)
15 S:STATUS ^DPT("AENRC",STATUS,DFN)=""
16 ;
17 Q
18 ;
19KILL1(DFN) ;
20 ;Description: This is the kill logic that corresponds to SET1.
21 ;Input: DFN is the patient ien
22 ;
23 Q:'$G(DFN)
24 ;
25 N DGSTATUS,STATUS
26 S DGSTATUS=$P(^DGEN(27.15,0),U,3)
27 F STATUS=1:1:DGSTATUS K ^DPT("AENRC",STATUS,DFN)
28 Q
29 ;
30SET2(DGENRIEN,STATUS) ;
31 ;Description: This MUMPS x-ref on the Patient Enrollment file sets the
32 ; "AENRC" X-ref on the patient file.
33 ;Inputs:
34 ; DGENRIEN - enrollment ien
35 ; STATUS - the enrollment status
36 ;
37 Q:'$G(DGENRIEN)
38 Q:'$G(STATUS)
39 ;
40 N DFN
41 S DFN=$P($G(^DGEN(27.11,DGENRIEN,0)),"^",2)
42 Q:'DFN
43 I $$FINDCUR^DGENA(DFN)=DGENRIEN D
44 . S ^DPT("AENRC",STATUS,DFN)=""
45 ;
46 Q
47 ;
48KILL2(DGENRIEN,STATUS) ;
49 ;Description: This is the kill logic that corresponds to SET2.
50 ;Inputs:
51 ; DGENRIEN - enrollment ien
52 ; STATUS - the enrollment status
53 ;
54 Q:'$G(DGENRIEN)
55 Q:'$G(STATUS)
56 ;
57 N DFN
58 S DFN=$P($G(^DGEN(27.11,DGENRIEN,0)),"^",2)
59 Q:'DFN
60 I $$FINDCUR^DGENA(DFN)=DGENRIEN D
61 . K ^DPT("AENRC",STATUS,DFN)
62 Q
63 ;
64SETREM(DGENRIEN,STATUS) ;
65 ;This set logic is called by the Enrollment Status field (#.04) in
66 ;the Patient Enrollment file (#27.11). If the Enrollment Status
67 ;contains the word REJECTED, then "**REJECTED**" will be stuffed
68 ;into the Remarks field (#.091) of the Patient file (#2). If the
69 ;Enrollment Status does not contain REJECTED, then the word
70 ;"**REJECTED**" will be removed.
71 ;Input:
72 ; DGENRIEN - IEN of the enrollment record
73 ; STATUS - enrollment status
74 ;
75 Q:'$G(DGENRIEN)
76 Q:'$G(STATUS)
77 ;
78 N DFN,REM
79 S DFN=$P($G(^DGEN(27.11,DGENRIEN,0)),U,2)
80 Q:'DFN Q:$G(^DPT(DFN,0))=""
81 L +^DPT(DFN,0):5 I '$T Q
82 S REM=$P(^DPT(DFN,0),U,10)
83 ;The enrollment status contains REJECTED, set REMARKS
84 I "^11^12^13^14^22^"[(U_STATUS_U) D G SETREMQ
85 . I REM["**REJECTED**" Q ;Remarks already contain REJECTED
86 . S REM=REM_"**REJECTED**"
87 . S $P(^DPT(DFN,0),U,10)=REM
88 ;The enrollment status does not contain REJECTED, remove REMARKS
89 I REM'["**REJECTED**" G SETREMQ
90 S REM=$P(REM,"**REJECTED**",1)_$P(REM,"**REJECTED**",2,99)
91 S $P(^DPT(DFN,0),U,10)=REM
92SETREMQ L -^DPT(DFN,0)
93 Q
94 ;
95CSI1010(DA) ;
96 ;If COMBAT SERVICE INDICATED? (2/.5291) is "NO,"
97 ;set COMBAT INDICATED ON 1010EZ (2/1010.157) to "NO."
98 I $P($G(^DPT(DA,.52)),U,11)="N" D
99 . N DGFDA
100 . S DGFDA(2,DA_",",1010.157)=0
101 . D FILE^DIE(,"DGFDA")
102 Q
103 ;
104CTD1010(DA) ;
105 ;If COMBAT SERVICE INDICATED? (2/.5291) is "YES" and
106 ;COMBAT TO DATE (2/.5294) is greater than 11/11/1998,
107 ;set COMBAT INDICATED ON 1010EZ (2/1010.157) to "YES."
108 N NODE,ANS,DGFDA
109 S NODE=$G(^DPT(DA,.52)),ANS=0
110 I ($P(NODE,U,11)="Y"),($P(NODE,U,14)>2981111) S ANS=1
111 S DGFDA(2,DA_",",1010.157)=ANS
112 D FILE^DIE(,"DGFDA")
113 Q
Note: See TracBrowser for help on using the repository browser.