DGDDDTTM ;ALB/MRL,BAJ,TDM,JAM,JAM - TRIGGER DT/TM CROSS REFERENCES [PATIENT] ;18 Sept 2017 12:54 PM
;;5.3;Registration;**665,653,688,754,941,997,1067**;Aug 13, 1993;Build 23
;
; This routine contains the code for new style cross-reference record
; triggers for the PATIENT File #2.
;
; DG*5.3*997;JAM; Added Country, Province and Postal Code fields in comments for NOK/E-Contact/Designee fields
; DG*5.3*1067;JAM; Added Relationship Type fields in comments for NOK/E-Contact/Designee fields
;
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)
; K-COUNTRY (#.221)
; K-PROVINCE (#.222)
; K-POSTAL CODE (#.223)
; K-RELATIONSHIP TYPE (#.224)
;
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)
; K2-COUNTRY (#.2101)
; K2-PROVINCE (#.2102)
; K2-POSTAL CODE (#.2103)
; K2-RELATIONSHIP TYPE (#.2104)
;
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)
; E-COUNTRY (#.3306)
; E-PROVINCE (#.3307)
; E-POSTAL CODE (#.3308)
; E-RELATIONSHIP TYPE (#.3309)
;
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)
; E2-COUNTRY (#.331012)
; E2-PROVINCE (#.331013)
; E2-POSTAL CODE (#.331014)
; E2-RELATIONSHIP TYPE (#.331015)
;
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)
; D-COUNTRY (#.34012)
; D-PROVINCE (#.34013)
; D-POSTAL CODE (#.34014)
; D-RELATIONSHIP TYPE (#.34015)
;
N DGIEN,DATA S DATA(.3412)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
;
; DG*5.3*941; JAM; Added tag RES for Residential Address
RES ; PATIENT File #2 Record Index: ADTTM8
;
; This code updates the RESIDENTIAL ADDR CHANGE DT/TM field when any
; of the following Residential Address related data changes for a
; patient:
;
; RESIDENTIAL STREET [LINE 1] (#.1151)
; RESIDENTIAL STREET [LINE 2] (#.1152)
; RESIDENTIAL STREET [LINE 3] (#.1153)
; RESIDENTIAL CITY (#.1154)
; RESIDENTIAL STATE (#.1155)
; RESIDENTIAL ZIP+4 (#.1156)
; RESIDENTIAL PROVINCE (#.11571)
; RESIDENTIAL POSTAL CODE (#.11572)
; RESIDENTIAL COUNTRY (#.11573)
;
Q:$G(DGRONUPD)=1 ;Suppress update for ROM (set in routine DGROHLR1)
N DGIEN,DATA S DATA(.1158)=$$NOW^XLFDT(),DGIEN=DA
I $$UPD^DGENDBS(2,.DGIEN,.DATA)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGDDDTTM 8382 printed Nov 22, 2024@17:51:50 Page 2
DGDDDTTM ;ALB/MRL,BAJ,TDM,JAM,JAM - TRIGGER DT/TM CROSS REFERENCES [PATIENT] ;18 Sept 2017 12:54 PM
+1 ;;5.3;Registration;**665,653,688,754,941,997,1067**;Aug 13, 1993;Build 23
+2 ;
+3 ; This routine contains the code for new style cross-reference record
+4 ; triggers for the PATIENT File #2.
+5 ;
+6 ; DG*5.3*997;JAM; Added Country, Province and Postal Code fields in comments for NOK/E-Contact/Designee fields
+7 ; DG*5.3*1067;JAM; Added Relationship Type fields in comments for NOK/E-Contact/Designee fields
+8 ;
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 ; K-COUNTRY (#.221)
+19 ; K-PROVINCE (#.222)
+20 ; K-POSTAL CODE (#.223)
+21 ; K-RELATIONSHIP TYPE (#.224)
+22 ;
+23 NEW DGIEN,DATA
SET DATA(.21012)=$$NOW^XLFDT()
SET DGIEN=DA
+24 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+25 QUIT
+26 ;
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 ; K2-COUNTRY (#.2101)
+19 ; K2-PROVINCE (#.2102)
+20 ; K2-POSTAL CODE (#.2103)
+21 ; K2-RELATIONSHIP TYPE (#.2104)
+22 ;
+23 NEW DGIEN,DATA
SET DATA(.211012)=$$NOW^XLFDT()
SET DGIEN=DA
+24 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+25 QUIT
+26 ;
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 ; E-COUNTRY (#.3306)
+19 ; E-PROVINCE (#.3307)
+20 ; E-POSTAL CODE (#.3308)
+21 ; E-RELATIONSHIP TYPE (#.3309)
+22 ;
+23 NEW DGIEN,DATA
SET DATA(.33012)=$$NOW^XLFDT()
SET DGIEN=DA
+24 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+25 QUIT
+26 ;
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 ; E2-COUNTRY (#.331012)
+18 ; E2-PROVINCE (#.331013)
+19 ; E2-POSTAL CODE (#.331014)
+20 ; E2-RELATIONSHIP TYPE (#.331015)
+21 ;
+22 NEW DGIEN,DATA
SET DATA(.33112)=$$NOW^XLFDT()
SET DGIEN=DA
+23 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+24 QUIT
+25 ;
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 ; D-COUNTRY (#.34012)
+18 ; D-PROVINCE (#.34013)
+19 ; D-POSTAL CODE (#.34014)
+20 ; D-RELATIONSHIP TYPE (#.34015)
+21 ;
+22 NEW DGIEN,DATA
SET DATA(.3412)=$$NOW^XLFDT()
SET DGIEN=DA
+23 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+24 QUIT
+25 ;
+26 ; DG*5.3*941; JAM; Added tag RES for Residential Address
RES ; PATIENT File #2 Record Index: ADTTM8
+1 ;
+2 ; This code updates the RESIDENTIAL ADDR CHANGE DT/TM field when any
+3 ; of the following Residential Address related data changes for a
+4 ; patient:
+5 ;
+6 ; RESIDENTIAL STREET [LINE 1] (#.1151)
+7 ; RESIDENTIAL STREET [LINE 2] (#.1152)
+8 ; RESIDENTIAL STREET [LINE 3] (#.1153)
+9 ; RESIDENTIAL CITY (#.1154)
+10 ; RESIDENTIAL STATE (#.1155)
+11 ; RESIDENTIAL ZIP+4 (#.1156)
+12 ; RESIDENTIAL PROVINCE (#.11571)
+13 ; RESIDENTIAL POSTAL CODE (#.11572)
+14 ; RESIDENTIAL COUNTRY (#.11573)
+15 ;
+16 ;Suppress update for ROM (set in routine DGROHLR1)
if $GET(DGRONUPD)=1
QUIT
+17 NEW DGIEN,DATA
SET DATA(.1158)=$$NOW^XLFDT()
SET DGIEN=DA
+18 IF $$UPD^DGENDBS(2,.DGIEN,.DATA)
+19 QUIT