DGDDDTTM ;ALB/MRL,BAJ,TDM - TRIGGER DT/TM CROSS REFERENCES
;;5.3;PIMS;**665,653,688,1015,1016**;JUN 30, 2012;Build 20
;
; This routine contains the code for new style cross-reference record
; triggers for the PATIENT File #2.
;
TEMP ; PATIENT File #2 Record Index: ADTTM1
;
; This code updates the TEMPORARY ADDRESS CHANGE DT/TM field when any
; of the following Temporary Address related data changes for a patient:
;
; TEMPORARY STREET [LINE 1] (#.1211)
; TEMPORARY STREET [LINE 2] (#.1212)
; TEMPORARY STREET [LINE 3] (#.1213)
; TEMPORARY CITY (#.1214)
; TEMPORARY STATE (#.1215)
; TEMPORARY ZIP CODE (#.1216)
; TEMPORARY ADDRESS START DATE (#.1217)
; TEMPORARY ADDRESS END DATE (#.1218)
; TEMPORARY ADDRESS ACTIVE? (#.12105)
; TEMPORARY ZIP+4 (#.12112)
; TEMPORARY ADDRESS COUNTY (#.12111)
; TEMPORARY ADDRESS PROVINCE (#.1221)
; TEMPORARY ADDRESS POSTAL CODE (#.1222)
; TEMPORARY ADDRESS COUNTRY (#.1223)
;
Q:$G(DGRONUPD)=1 ;Suppress update for ROM (set in routine DGROHLR1)
N DGIEN,DATA S DATA(.12113)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
CONF ; PATIENT File #2 Record Index: ADTTM2
;
; This code updates the CONFIDENTIAL ADDR CHANGE DT/TM field when any
; of the following Confidential Address related data changes for a
; patient:
;
; CONFIDENTIAL STREET [LINE 1] (#.1411)
; CONFIDENTIAL STREET [LINE 2] (#.1412)
; CONFIDENTIAL STREET [LINE 3] (#.1413)
; CONFIDENTIAL ADDRESS CITY (#.1414)
; CONFIDENTIAL ADDRESS STATE (#.1415)
; CONFIDENTIAL ADDRESS ZIP CODE (#.1416)
; CONFIDENTIAL START DATE (#.1417)
; CONFIDENTIAL END DATE (#.1418)
; CONFIDENTIAL ADDRESS ACTIVE? (#.14105)
; CONFIDENTIAL ADDRESS COUNTY (#.14111)
; CONFIDENTIAL ADDR PROVINCE (#.14114)
; CONFIDENTIAL ADDR POSTAL CODE (#.14115)
; CONFIDENTIAL ADDR COUNTRY (#.14116)
; CONFIDENTIAL PHONE NUMBER (#.1315)
;
Q:$G(DGRONUPD)=1 ;Suppress update for ROM (set in routine DGROHLR1)
N DGIEN,DATA S DATA(.14112)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
PNOK ; PATIENT File #2 Record Index: ADTTM3
;
; This code updates the PRIMARY NOK CHANGE DATE/TIME field when any
; of the following Primary Next of Kin related data changes for a
; patient:
;
; K-NAME OF PRIMARY NOK (#.211)
; K-RELATIONSHIP TO PATIENT (#.212)
; K-STREET ADDRESS [LINE 1] (#.213)
; K-STREET ADDRESS [LINE 2] (#.214)
; K-STREET ADDRESS [LINE 3] (#.215)
; K-CITY (#.216)
; K-STATE (#.217)
; K-ZIP CODE (#.218)
; K-ADDRESS SAME AS PATIENT'S? (#.2125)
; K-ZIP+4 (#.2207)
; K-PHONE NUMBER (#.219)
; K-WORK PHONE NUMBER (#.21011)
;
N DGIEN,DATA S DATA(.21012)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
SNOK ; PATIENT File #2 Record Index: ADTTM4
;
; This code updates the SECONDARY NOK CHANGE DATE/TIME field when any
; of the following Secondary Next of Kin related data changes for a
; patient:
;
; K2-NAME OF SECONDARY NOK (#.2191)
; K2-RELATIONSHIP TO PATIENT (#.2192)
; K2-STREET ADDRESS [LINE 1] (#.2193)
; K2-STREET ADDRESS [LINE 2] (#.2194)
; K2-STREET ADDRESS [LINE 3] (#.2195)
; K2-CITY (#.2196)
; K2-STATE (#.2197)
; K2-ZIP CODE (#.2198)
; K2-ADDRESS SAME AS PATIENT'S? (#.21925)
; K2-ZIP+4 (#.2203)
; K2-PHONE NUMBER (#.2199)
; K2-WORK PHONE NUMBER (#.211011)
;
N DGIEN,DATA S DATA(.211012)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
ECON ; PATIENT File #2 Record Index: ADTTM5
;
; This code updates the E-CONTACT CHANGE DATE/TIME field when any
; of the following Emergency Contact related data changes for a
; patient:
;
; E-NAME (#.331)
; E-RELATIONSHIP TO PATIENT (#.332)
; E-STREET ADDRESS [LINE 1] (#.333)
; E-STREET ADDRESS [LINE 2] (#.334)
; E-STREET ADDRESS [LINE 3] (#.335)
; E-CITY (#.336)
; E-STATE (#.337)
; E-ZIP CODE (#.338)
; E-EMER. CONTACT SAME AS NOK? (#.3305)
; E-ZIP+4 (#.2201)
; E-PHONE NUMBER (#.339)
; E-WORK PHONE NUMBER (#.33011)
;
N DGIEN,DATA S DATA(.33012)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
ECON2 ; PATIENT File #2 Record Index: ADTTM6
;
; This code updates the E2-CONTACT CHANGE DATE/TIME field when any
; of the following Secondary Emergency Contact related data changes
; for a patient:
;
; E2-NAME OF SECONDARY CONTACT (#.3311)
; E2-RELATIONSHIP TO PATIENT (#.3312)
; E2-STREET ADDRESS [LINE 1] (#.3313)
; E2-STREET ADDRESS [LINE 2] (#.3314)
; E2-STREET ADDRESS [LINE 3] (#.3315)
; E2-CITY (#.3316)
; E2-STATE (#.3317)
; E2-ZIP CODE (#.3318)
; E2-ZIP+4 (#.2204)
; E2-PHONE NUMBER (#.3319)
; E2-WORK PHONE NUMBER (#.331011)
;
N DGIEN,DATA S DATA(.33112)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
DESIG ; PATIENT File #2 Record Index: ADTTM7
;
; This code updates the DESIGNEE CHANGE DATE/TIME field when any
; of the following Designee related data changes for a patient:
;
; D-NAME OF DESIGNEE (#.341)
; D-RELATIONSHIP TO PATIENT (#.342)
; D-STREET ADDRESS [LINE 1] (#.343)
; D-STREET ADDRESS [LINE 2] (#.344)
; D-STREET ADDRESS [LINE 3] (#.345)
; D-CITY (#.346)
; D-STATE (#.347)
; D-ZIP CODE (#.348)
; D-DESIGNEE SAME AS NOK? (#.3405)
; D-ZIP+4 (#.2202)
; D-PHONE NUMBER (#.349)
; D-WORK PHONE NUMBER (#.34011)
;
N DGIEN,DATA S DATA(.3412)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
DGDDDTTM ;ALB/MRL,BAJ,TDM - TRIGGER DT/TM CROSS REFERENCES
+1 ;;5.3;PIMS;**665,653,688,1015,1016**;JUN 30, 2012;Build 20
+2 ;
+3 ; This routine contains the code for new style cross-reference record
+4 ; triggers for the PATIENT File #2.
+5 ;
TEMP ; PATIENT File #2 Record Index: ADTTM1
+1 ;
+2 ; This code updates the TEMPORARY ADDRESS CHANGE DT/TM field when any
+3 ; of the following Temporary Address related data changes for a patient:
+4 ;
+5 ; TEMPORARY STREET [LINE 1] (#.1211)
+6 ; TEMPORARY STREET [LINE 2] (#.1212)
+7 ; TEMPORARY STREET [LINE 3] (#.1213)
+8 ; TEMPORARY CITY (#.1214)
+9 ; TEMPORARY STATE (#.1215)
+10 ; TEMPORARY ZIP CODE (#.1216)
+11 ; TEMPORARY ADDRESS START DATE (#.1217)
+12 ; TEMPORARY ADDRESS END DATE (#.1218)
+13 ; TEMPORARY ADDRESS ACTIVE? (#.12105)
+14 ; TEMPORARY ZIP+4 (#.12112)
+15 ; TEMPORARY ADDRESS COUNTY (#.12111)
+16 ; TEMPORARY ADDRESS PROVINCE (#.1221)
+17 ; TEMPORARY ADDRESS POSTAL CODE (#.1222)
+18 ; TEMPORARY ADDRESS COUNTRY (#.1223)
+19 ;
+20 ;Suppress update for ROM (set in routine DGROHLR1)
IF $GET(DGRONUPD)=1
QUIT
+21 NEW DGIEN,DATA
SET DATA(.12113)=$$NOW^XLFDT()
SET DGIEN=DA
+22 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+23 QUIT
+24 ;
CONF ; PATIENT File #2 Record Index: ADTTM2
+1 ;
+2 ; This code updates the CONFIDENTIAL ADDR CHANGE DT/TM field when any
+3 ; of the following Confidential Address related data changes for a
+4 ; patient:
+5 ;
+6 ; CONFIDENTIAL STREET [LINE 1] (#.1411)
+7 ; CONFIDENTIAL STREET [LINE 2] (#.1412)
+8 ; CONFIDENTIAL STREET [LINE 3] (#.1413)
+9 ; CONFIDENTIAL ADDRESS CITY (#.1414)
+10 ; CONFIDENTIAL ADDRESS STATE (#.1415)
+11 ; CONFIDENTIAL ADDRESS ZIP CODE (#.1416)
+12 ; CONFIDENTIAL START DATE (#.1417)
+13 ; CONFIDENTIAL END DATE (#.1418)
+14 ; CONFIDENTIAL ADDRESS ACTIVE? (#.14105)
+15 ; CONFIDENTIAL ADDRESS COUNTY (#.14111)
+16 ; CONFIDENTIAL ADDR PROVINCE (#.14114)
+17 ; CONFIDENTIAL ADDR POSTAL CODE (#.14115)
+18 ; CONFIDENTIAL ADDR COUNTRY (#.14116)
+19 ; CONFIDENTIAL PHONE NUMBER (#.1315)
+20 ;
+21 ;Suppress update for ROM (set in routine DGROHLR1)
IF $GET(DGRONUPD)=1
QUIT
+22 NEW DGIEN,DATA
SET DATA(.14112)=$$NOW^XLFDT()
SET DGIEN=DA
+23 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+24 QUIT
+25 ;
PNOK ; PATIENT File #2 Record Index: ADTTM3
+1 ;
+2 ; This code updates the PRIMARY NOK CHANGE DATE/TIME field when any
+3 ; of the following Primary Next of Kin related data changes for a
+4 ; patient:
+5 ;
+6 ; K-NAME OF PRIMARY NOK (#.211)
+7 ; K-RELATIONSHIP TO PATIENT (#.212)
+8 ; K-STREET ADDRESS [LINE 1] (#.213)
+9 ; K-STREET ADDRESS [LINE 2] (#.214)
+10 ; K-STREET ADDRESS [LINE 3] (#.215)
+11 ; K-CITY (#.216)
+12 ; K-STATE (#.217)
+13 ; K-ZIP CODE (#.218)
+14 ; K-ADDRESS SAME AS PATIENT'S? (#.2125)
+15 ; K-ZIP+4 (#.2207)
+16 ; K-PHONE NUMBER (#.219)
+17 ; K-WORK PHONE NUMBER (#.21011)
+18 ;
+19 NEW DGIEN,DATA
SET DATA(.21012)=$$NOW^XLFDT()
SET DGIEN=DA
+20 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+21 QUIT
+22 ;
SNOK ; PATIENT File #2 Record Index: ADTTM4
+1 ;
+2 ; This code updates the SECONDARY NOK CHANGE DATE/TIME field when any
+3 ; of the following Secondary Next of Kin related data changes for a
+4 ; patient:
+5 ;
+6 ; K2-NAME OF SECONDARY NOK (#.2191)
+7 ; K2-RELATIONSHIP TO PATIENT (#.2192)
+8 ; K2-STREET ADDRESS [LINE 1] (#.2193)
+9 ; K2-STREET ADDRESS [LINE 2] (#.2194)
+10 ; K2-STREET ADDRESS [LINE 3] (#.2195)
+11 ; K2-CITY (#.2196)
+12 ; K2-STATE (#.2197)
+13 ; K2-ZIP CODE (#.2198)
+14 ; K2-ADDRESS SAME AS PATIENT'S? (#.21925)
+15 ; K2-ZIP+4 (#.2203)
+16 ; K2-PHONE NUMBER (#.2199)
+17 ; K2-WORK PHONE NUMBER (#.211011)
+18 ;
+19 NEW DGIEN,DATA
SET DATA(.211012)=$$NOW^XLFDT()
SET DGIEN=DA
+20 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+21 QUIT
+22 ;
ECON ; PATIENT File #2 Record Index: ADTTM5
+1 ;
+2 ; This code updates the E-CONTACT CHANGE DATE/TIME field when any
+3 ; of the following Emergency Contact related data changes for a
+4 ; patient:
+5 ;
+6 ; E-NAME (#.331)
+7 ; E-RELATIONSHIP TO PATIENT (#.332)
+8 ; E-STREET ADDRESS [LINE 1] (#.333)
+9 ; E-STREET ADDRESS [LINE 2] (#.334)
+10 ; E-STREET ADDRESS [LINE 3] (#.335)
+11 ; E-CITY (#.336)
+12 ; E-STATE (#.337)
+13 ; E-ZIP CODE (#.338)
+14 ; E-EMER. CONTACT SAME AS NOK? (#.3305)
+15 ; E-ZIP+4 (#.2201)
+16 ; E-PHONE NUMBER (#.339)
+17 ; E-WORK PHONE NUMBER (#.33011)
+18 ;
+19 NEW DGIEN,DATA
SET DATA(.33012)=$$NOW^XLFDT()
SET DGIEN=DA
+20 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+21 QUIT
+22 ;
ECON2 ; PATIENT File #2 Record Index: ADTTM6
+1 ;
+2 ; This code updates the E2-CONTACT CHANGE DATE/TIME field when any
+3 ; of the following Secondary Emergency Contact related data changes
+4 ; for a patient:
+5 ;
+6 ; E2-NAME OF SECONDARY CONTACT (#.3311)
+7 ; E2-RELATIONSHIP TO PATIENT (#.3312)
+8 ; E2-STREET ADDRESS [LINE 1] (#.3313)
+9 ; E2-STREET ADDRESS [LINE 2] (#.3314)
+10 ; E2-STREET ADDRESS [LINE 3] (#.3315)
+11 ; E2-CITY (#.3316)
+12 ; E2-STATE (#.3317)
+13 ; E2-ZIP CODE (#.3318)
+14 ; E2-ZIP+4 (#.2204)
+15 ; E2-PHONE NUMBER (#.3319)
+16 ; E2-WORK PHONE NUMBER (#.331011)
+17 ;
+18 NEW DGIEN,DATA
SET DATA(.33112)=$$NOW^XLFDT()
SET DGIEN=DA
+19 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+20 QUIT
+21 ;
DESIG ; PATIENT File #2 Record Index: ADTTM7
+1 ;
+2 ; This code updates the DESIGNEE CHANGE DATE/TIME field when any
+3 ; of the following Designee related data changes for a patient:
+4 ;
+5 ; D-NAME OF DESIGNEE (#.341)
+6 ; D-RELATIONSHIP TO PATIENT (#.342)
+7 ; D-STREET ADDRESS [LINE 1] (#.343)
+8 ; D-STREET ADDRESS [LINE 2] (#.344)
+9 ; D-STREET ADDRESS [LINE 3] (#.345)
+10 ; D-CITY (#.346)
+11 ; D-STATE (#.347)
+12 ; D-ZIP CODE (#.348)
+13 ; D-DESIGNEE SAME AS NOK? (#.3405)
+14 ; D-ZIP+4 (#.2202)
+15 ; D-PHONE NUMBER (#.349)
+16 ; D-WORK PHONE NUMBER (#.34011)
+17 ;
+18 NEW DGIEN,DATA
SET DATA(.3412)=$$NOW^XLFDT()
SET DGIEN=DA
+19 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+20 QUIT