DGREGTE2 ;ALB/BAJ,TDM,BDB,JAM - Temporary & Confidential Address Support Routine; 02/27/2006 ; 22 Mar 2017 1:10 PM
;;5.3;Registration;**688,754,851,1040,1143**;Aug 13, 1993;Build 36
;
Q
;
GETACT(DFN,DGTYPE,DGINPUT,DGACTIVE) ; DG*5.3*1143 - populate DGINPUT array with initial fields - Active?, Start/End Dates, Confidential Categories
; Input:
; DFN - Patient IEN
; DGTYPE - "TEMP" or "CONF"
; Output:
; DGINPUT - (pass by reference) - array that will hold the values entered
; DGACTIVE - (pass by reference) - holds the value of the Active? field (Y or N)
; Returns: 1 if an update has occurred
;
N DIR,DA,X,Y,DGN,DGNACT,DGDEFACT
; Prompt for Address Active?
; Get the field number for Active? field
S DGNACT=$S(DGTYPE="TEMP":.12105,DGTYPE="CONF":.14105,1:"")
; Set the default value from the current value of the Active? field stored in the patient file
S DGDEFACT=$$GET1^DIQ(2,DFN,DGNACT,"I")
; If RTA local array has a value for the Active? field, make that the default instead
I DGTYPE="TEMP" I $D(DGADDGRP3(DGNACT)) S DGDEFACT=DGADDGRP3(DGNACT)
I DGTYPE="CONF" I $D(DGADDGRP4(DGNACT)) S DGDEFACT=DGADDGRP4(DGNACT)
RETRY ;
S DA=DFN
S DGACTIVE=""
I DGTYPE="TEMP" S DIR("A")="TEMP MAILING ADDRESS ACTIVE?"
; Set default value for ^DIR from the local DGINPUT array or the current default value or "N" if none of these are defined
S DGDEFACT=$S($D(DGINPUT(DGNACT)):DGINPUT(DGNACT),$G(DGDEFACT)'="":DGDEFACT,1:"N")
S DIR(0)=2_","_DGNACT,DIR("B")=$S($E(DGDEFACT)="Y":"YES",1:"NO")
D ^DIR
I $D(DIRUT) Q 0
; Set value into return variables
S (DGACTIVE,DGINPUT(DGNACT))=Y
; If Active is NO, and is also the default value, no change occurring, quit 0
I Y="N" I DGDEFACT="N" Q 0
; If Active is changed to NO, call code to determine if address is being deleted and store the N in the local array
; Return 1 to indicate an update occurred
I Y="N" D Q 1
. N DGDATA,DGERROR
. I DGTYPE="TEMP" D TADD^DGLOCK I $G(DGRTAON)=1 S DGADDGRP3(DGNACT)="N"
. I DGTYPE="CONF" D CADD^DGLOCK3 I $G(DGRTAON)=1 S DGADDGRP4(DGNACT)="N"
;
; Active set to YES, continue prompting for dates
; Get Start and End Dates
K DIR
N DGOK,ANS
S DGOK=1
; Temp Start/End Dates, store internal format to DGINPUT
I DGTYPE="TEMP" F DGN=.1217,.1218 S DGOK=$$READ(DGTYPE,DGN,.ANS) Q:'DGOK S DGINPUT(DGN)=ANS
; Get Confidential Start/End Dates, store internal format to DGINPUT
I DGTYPE="CONF" F DGN=.1417,.1418 S DGOK=$$READ(DGTYPE,DGN,.ANS) Q:'DGOK S DGINPUT(DGN)=ANS
; Done with Temp address or if 'DGOK
I DGTYPE="TEMP"!('DGOK) Q DGOK
;
; Process CONFIDENTIAL ADDRESS CATEGORIES
N DGORIGINAL,DGUPDATED,DGERROR,DGFDA,DIK,DGIEN,DGNEWIEN,DGSAVE
; Capture current categories in the patient file
D GETS^DIQ(2,DFN,".141*,","IE","DGORIGINAL","DGERROR")
; If we have the RTA group array defined, load the categories from the local array into the patient file
I $D(DGADDGRP4("CCATS",2.141)) D
. ; Clean out existing categories
. S DA(1)=DFN
. S DIK="^DPT("_DFN_",.14,"
. S DA=0 F S DA=$O(^DPT(DFN,.14,DA)) Q:'DA D ^DIK
. ; Restore the categories from Group 4
. K DGFDA
. S DGIEN=0 F S DGIEN=$O(DGADDGRP4("CCATS",2.141,DGIEN)) Q:'DGIEN D
. . S DGNEWIEN=DFN_","
. . S DGNEWIEN="+1,"_DGNEWIEN
. . S DGFDA(2.141,DGNEWIEN,.01)=DGADDGRP4("CCATS",2.141,DGIEN,.01,"I")
. . S DGFDA(2.141,DGNEWIEN,1)=DGADDGRP4("CCATS",2.141,DGIEN,1,"I")
. . D UPDATE^DIE("","DGFDA","","DGERR")
. . K DGFDA
. K DGFDA
; Process input from user for confidential categories
N DIE,DR
S DA=DFN
S DIE("NO^")=1
S DR(2,2.141)=".01;1//YES;"
S DIE="^DPT("
S DR=.141
D ^DIE
; If there is a timeout, X will equal "^" - restore the original data and quit
I X="^" S DGTMOT=1,DGOK=0 G RESTORE
I '$P($$CAACT^DGRPCADD(DFN),U,2) W !?4,"But I need at least one active category." D G RETRY
. ; Clean up current changes and start over
. D RESTORE
. K DGORIGINAL
; Capture updated categories into the local array
D GETS^DIQ(2,DFN,".141*,","IE","DGUPDATED","DGERROR")
; Place user-selections into DGINPUT
M DGINPUT("CCATS")=DGUPDATED
; For Real-time updating: compare the categories in DGORIGINAL with DGINPUT and add/mark those categories in DGINPUT as deleted
I DGRTAON=1 S DGIEN=0 F S DGIEN=$O(DGORIGINAL(2.141,DGIEN)) Q:'DGIEN D
. N DGFOUND,DGCATID
. S DGCATID=DGORIGINAL(2.141,DGIEN,.01,"I")
. ; loop over the categories in DGINPUT and if the category is there, set FOUND=1
. S DGFOUND=0,DGNEWIEN=0 F S DGNEWIEN=$O(DGINPUT("CCATS",2.141,DGNEWIEN)) Q:'DGNEWIEN D Q:DGFOUND
. . I DGINPUT("CCATS",2.141,DGNEWIEN,.01,"I")=DGCATID S DGFOUND=1
. ; If the category was not found, set it into DGINPUT as DELETED
. I 'DGFOUND S DGINPUT("CCATS","DELETE",DGCATID)=DGORIGINAL(2.141,DGIEN,.01,"E")
;
; Restore the original categories
RESTORE ; Restore original set of Confidential Categories
; Clean out existing categories
S DA(1)=DFN
S DIK="^DPT("_DFN_",.14,"
S DA=0 F S DA=$O(^DPT(DFN,.14,DA)) Q:'DA D ^DIK
;
; Restore the original categories
K DGFDA
S DGIEN=0 F S DGIEN=$O(DGORIGINAL(2.141,DGIEN)) Q:'DGIEN D
. S DGNEWIEN=DFN_","
. S DGNEWIEN="+1,"_DGNEWIEN
. S DGFDA(2.141,DGNEWIEN,.01)=DGORIGINAL(2.141,DGIEN,.01,"I")
. S DGFDA(2.141,DGNEWIEN,1)=DGORIGINAL(2.141,DGIEN,1,"I")
. D UPDATE^DIE("","DGFDA","","DGERR")
. K DGFDA
Q DGOK
;
READ(DGTYPE,DGN,ANS) ; DG*5.3*1143 - User entry for start/end dates
; Input: DGN - Field number to prompt for
; Output: ANS - (pass by reference) the internal format of the user entry
; Returns: 1= ok response 0 = no response (timeout or user exit)
N DIR,X,Y,DGCURRENT,DGDEF
; Get current field value in the patient file
S DGCURRENT=$$GET1^DIQ(2,DFN,DGN,"I")
; Get default value for the field from local input array or RTA array (if defined) or current patient record value
I DGTYPE="CONF" S DGDEF=$S($D(DGINPUT(DGN)):DGINPUT(DGN),$D(DGADDGRP4(DGN)):DGADDGRP4(DGN),1:DGCURRENT)
I DGTYPE="TEMP" S DGDEF=$S($D(DGINPUT(DGN)):DGINPUT(DGN),$D(DGADDGRP3(DGN)):DGADDGRP3(DGN),1:DGCURRENT)
; Set default value only if it is different from what's in the DB - transform it to external format
I DGDEF'=DGCURRENT S Y=DGDEF,Y=$$FMTE^DILIBF(Y,"5U") S DIR("B")=Y
; For temp address, set Prompt text
I DGN=.1217 S DIR("A")="TEMP MAILING ADDRESS START DATE"
I DGN=.1218 S DIR("A")="TEMP MAILING ADDRESS END DATE"
S DA=DFN
S DIR(0)=2_","_DGN
PROMPT ; Tag for entering in the date
D ^DIR
I $D(DTOUT) S DGTMOT=1 Q 0
I $D(DUOUT) Q 0
; If an end date entered, check the value against the start date (previously stored in local input array)
I Y'="" I DGN=.1218,(Y<DGINPUT(.1217)) W !,"End Date must not be before Start Date." G PROMPT
I Y'="" I DGN=.1418,(Y<DGINPUT(.1417)) W !,"End Date must not be before Start Date." G PROMPT
S ANS=Y
Q 1
;
GETOLD(DGCMP,DFN,TYPE) ;populate array with existing address info
N CCIEN,DGCURR,CFORGN,CFSTR,L,T,DGCIEN,DGST,DGCNTY,FDESC,FNODE,FPECE,CCNTRY,COUNTRY
S CFORGN=0,FDESC=$S(TYPE="TEMP":"TEMPORARY ADDRESS COUNTRY",1:"CONFIDENTIAL ADDR COUNTRY")
; get current country
S FNODE=$S(TYPE="TEMP":.122,TYPE="CONF":.141,1:.11)
S FPECE=$S(TYPE="TEMP":3,TYPE="CONF":16,1:10)
S CCIEN=$P($G(^DPT(DFN,FNODE)),U,FPECE)
I CCIEN="" S CCNTRY=$O(^HL(779.004,"D","UNITED STATES",""))
S CFORGN=$$FORIEN^DGADDUTL(CCIEN)
;get current address fields and xlate to ^DIQ format
S CFSTR=$$INPT1(DFN,CFORGN),CFSTR=$TR(CFSTR,",",";")
; Domestic data needs some extra fields
; add country field before lookup
D GETS^DIQ(2,DFN_",",CFSTR,"EI","DGCURR")
F L=1:1:$L(CFSTR,";") S T=$P(CFSTR,";",L),DGCMP("OLD",T)=$G(DGCURR(2,DFN_",",T,"E"))
S COUNTRY=$$CNTRYI^DGADDUTL(CCIEN) I COUNTRY=-1 S COUNTRY="UNKNOWN COUNTRY"
S DGCMP("OLD",FCNTRY)=COUNTRY
I 'CFORGN D
. S DGCIEN=$G(DGCURR(2,DFN_",",FCOUNTY,"I"))
. S DGST=$G(DGCURR(2,DFN_",",FSTATE,"I"))
. S DGCNTY=$$CNTY^DGREGAZL(DGST,DGCIEN)
. I DGCNTY=-1 S DGCNTY=""
. S DGCMP("OLD",FCOUNTY)="" I DGCNTY]"" S DGCMP("OLD",FCOUNTY)=$P(DGCNTY,U)_" "_$P(DGCNTY,U,3)
Q
INPT1(DFN,FORGN,PSTR) ; address input prompts
N FSTR
; PSTR contains the full list of address fields to be modified
; FSTR contains the field list based on country
S PSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FCITY_","_FSTATE_","_FCOUNTY_","_FZIP_","_FPROV_","_FPSTAL_","_FCNTRY_","_FPHONE
;S FSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FCITY_","_FSTATE_","_FCOUNTY_","_FZIP_","_FPHONE
S FSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FZIP_","_FPHONE ;DG*5.3*851
I FORGN S FSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FCITY_","_FPROV_","_FPSTAL_","_FPHONE
Q FSTR
;
; DG*5.3*1143 - Tags DISPUS and DISPFGN moved from DGREGTED due to size limitations.
; DG*5.3*1014;jam; Added these tags to display the address prior to calling the Validation service
DISPUS(DGCMP,DGM) ;tag to display US data
N DGCNTRY
; "AddressLine1,AddressLine2,AddressLine3,City,State,County,Zip,Province,PostalCode^Country"
; ".1411,.1412,.1413,.1414,.1415,.14111,.1416,.14114,.14115,.14116" ; Confidential address fields
W !,?2,"[",DGM," CONFIDENTIAL ADDRESS]"
W !?16,$G(DGCMP(DGM,.1411))
I $G(DGCMP(DGM,.1412))'="" W !,?16,$G(DGCMP(DGM,.1412))
I $G(DGCMP(DGM,.1413))'="" W !,?16,$G(DGCMP(DGM,.1413))
W !,?16,$G(DGCMP(DGM,.1414))
W:($G(DGCMP(DGM,.1414))'="")!($P($G(DGCMP(DGM,.1415)),U,2)'="") ","
W $P($G(DGCMP(DGM,.1415)),U,2)
W " ",$G(DGCMP(DGM,.1416))
S DGCNTRY=$$CNTRYI^DGADDUTL($P($G(DGCMP(DGM,.14116)),U))
I DGCNTRY]"",(DGCNTRY'=-1) W !?16,DGCNTRY
I $P($G(DGCMP(DGM,.14111)),U)'="" W !,?6," County: ",$P($G(DGCMP(DGM,.14111)),U,2)
W !
Q
;
DISPFGN(DGCMP,DGM) ;tag to display Foreign data
N DGCNTRY
W !,?2,"[",DGM," CONFIDENTIAL ADDRESS]"
W !?16,$G(DGCMP(DGM,.1411))
I $G(DGCMP(DGM,.1412))'="" W !,?16,$G(DGCMP(DGM,.1412))
I $G(DGCMP(DGM,.1413))'="" W !,?16,$G(DGCMP(DGM,.1413))
W !,?16,$G(DGCMP(DGM,.1414))_" "_$G(DGCMP(DGM,.14114))_" "_$G(DGCMP(DGM,.14115))
S DGCNTRY=$$CNTRYI^DGADDUTL($P($G(DGCMP(DGM,.14116)),U))
S DGCNTRY=$S(DGCNTRY="":"UNSPECIFIED COUNTRY",DGCNTRY=-1:"UNKNOWN COUNTRY",1:DGCNTRY)
I DGCNTRY]"" W !?16,DGCNTRY
W !
Q
;
LOADTEMP ; DG*5.3*1143 - Called from TADD^DGLOCK when the address active? flag is set from YES to NO
; Load DGADDGRP3 Temp Address array from the DB
N DGRP
S DGRP(.121)=$G(^DPT(DFN,.121))
S DGRP(.122)=$G(^DPT(DFN,.122))
K DGADDGRP3
; Set Address Active? field to NO in the local array
S DGADDGRP3(.12105)="N"
; Line 1
S DGADDGRP3(.1211)=$P(DGRP(.121),"^",1)
; Line 2
S DGADDGRP3(.1212)=$P(DGRP(.121),"^",2)
; Line 3
S DGADDGRP3(.1213)=$P(DGRP(.121),"^",3)
; City
S DGADDGRP3(.1214)=$P(DGRP(.121),"^",4)
; State
S DGADDGRP3(.1215)=$P(DGRP(.121),"^",5)
; Zip
S DGADDGRP3(.1216)=$P(DGRP(.121),"^",6)
; Start Date
S DGADDGRP3(.1217)=$P(DGRP(.121),"^",7)
; End Date
S DGADDGRP3(.1218)=$P(DGRP(.121),"^",8)
; Temp Phone
S DGADDGRP3(.1219)=$P(DGRP(.121),"^",10)
; County
S DGADDGRP3(.12111)=$P(DGRP(.121),"^",11)
; Zip+4
S DGADDGRP3(.12112)=$P(DGRP(.121),"^",12)
; Province
S DGADDGRP3(.1221)=$P(DGRP(.122),"^",1)
; Postal Code
S DGADDGRP3(.1222)=$P(DGRP(.122),"^",2)
; Country
S DGADDGRP3(.1223)=$P(DGRP(.122),"^",3)
Q
;
LOADCONF ; DG*5.3*1143 - Called from CADD^DGLOCK3 when the address active? flag is set from YES to NO
; Load DGADDGRP4 Address array from the DB - these fields will be sent to ES with delete flag set. Then deleted from the DB.
K DGADDGRP4
N DGRP
S DGRP(.141)=$G(^DPT(DFN,.141))
S DGRP(.13)=$G(^DPT(DFN,.13))
; Set Address Active? field to NO in the local array
S DGADDGRP4(.14105)="N"
; Line 1
S DGADDGRP4(.1411)=$P(DGRP(.141),"^",1)
; Line 2
S DGADDGRP4(.1412)=$P(DGRP(.141),"^",2)
; Line 3
S DGADDGRP4(.1413)=$P(DGRP(.141),"^",3)
; City
S DGADDGRP4(.1414)=$P(DGRP(.141),"^",4)
; State
S DGADDGRP4(.1415)=$P(DGRP(.141),"^",5)
; Zip
S DGADDGRP4(.1416)=$P(DGRP(.141),"^",6)
; Start Date
S DGADDGRP4(.1417)=$P(DGRP(.141),"^",7)
; End Date
S DGADDGRP4(.1418)=$P(DGRP(.141),"^",8)
; County
S DGADDGRP4(.14111)=$P(DGRP(.141),"^",11)
; Province
S DGADDGRP4(.14114)=$P(DGRP(.141),"^",14)
; Postal Code
S DGADDGRP4(.14115)=$P(DGRP(.141),"^",15)
; Country
S DGADDGRP4(.14116)=$P(DGRP(.141),"^",16)
; CASS Indicator
S DGADDGRP4(.14117)=$P(DGRP(.141),"^",17)
; Conf Phone
S DGADDGRP4(.1315)=$P(DGRP(.13),"^",15)
; Confidential override
S DGADDGRP4(.141201)=$P(DGRP(.141),"^",17)
; Load the Address Categories
N DGADDCATS
; Capture current categories in the patient file and load them into the array
D GETS^DIQ(2,DFN,".141*,","IE","DGADDCATS","DGERROR")
M DGADDGRP4("CCATS")=DGADDCATS
Q
;
SURE() ; Are you sure prompt
N DIR,X,Y,DUOUT,DTOUT,DIRUT
S DIR(0)="Y"
S DIR("B")="NO"
S DIR("A")=" SURE YOU WANT TO DELETE"
D ^DIR
Q Y
SKIP(DGN,DGINPUT) ; determine whether or not to skip the prompt
N SKIP,NULL
S SKIP=0
S NULL=($G(DGINPUT(FSLINE1))="")!(($G(DGINPUT(FSLINE1))="@"))
I NULL,(DGN=FSLINE2) S SKIP=1
S NULL=($G(DGINPUT(FSLINE2))="")!(($G(DGINPUT(FSLINE2))="@"))
I NULL,(DGN=FSLINE3) S SKIP=1
Q SKIP
;
INIT ; initialize variables
; This tag reads the table at FLDDAT (below) to set relationship between
; variables and Field numbers.
;
; Set up array of fields needed
N I,T,FTYPE,VNAME,FNUM,RFLD
F I=1:1 S T=$P($T(FLDDAT+I^DGREGTE2),";;",3) Q:T="QUIT" D
. S FTYPE=$P(T,";",1),VNAME=$P(T,";",2),FNUM=$P(T,";",3)
. I FTYPE=TYPE S @VNAME=FNUM
; Set up array of field and prompting rules
K T,I
F I=1:1 S T=$P($T(FLDPRMPT+I^DGREGTE2),";;",2) Q:T="QUIT" D
. S RFLD=$P(T,";",1) I RFLD'="ALL" S RFLD=@RFLD
. S RPROC(RFLD,$P(T,";",2),$P(T,";",3))=$P(T,";",4)
Q
; DG*5.3*1143 - Add Address Active?, Start and End Date fields
FLDDAT ; Table of field values STRUCTURE --> Description;;Type;Variable Name;Field Number
;;Active;;TEMP;FSACTIVE;.12105
;;Start Date;;TEMP;FSSTART;.1217
;;End Date;;TEMP;FSEND;.1218
;;Street Line 1;;TEMP;FSLINE1;.1211
;;Street Line 2;;TEMP;FSLINE2;.1212
;;Street Line 3;;TEMP;FSLINE3;.1213
;;City;;TEMP;FCITY;.1214
;;State;;TEMP;FSTATE;.1215
;;County;;TEMP;FCOUNTY;.12111
;;Zip;;TEMP;FZIP;.12112
;;Phone;;TEMP;FPHONE;.1219
;;Province;;TEMP;FPROV;.1221
;;Postal Code;;TEMP;FPSTAL;.1222
;;Country;;TEMP;FCNTRY;.1223
;;Address Node 1;;TEMP;FNODE1;.121
;;Address Node 2;;TEMP;FNODE2;.122
;;Country data piece;;TEMP;CPEICE;3
;;Active;;CONF;FSACTIVE;.14105
;;Start Date;;CONF;FSSTART;.1417
;;End Date;;CONF;FSEND;.1418
;;Street Line 1;;CONF;FSLINE1;.1411
;;Street Line 2;;CONF;FSLINE2;.1412
;;Street Line 3;;CONF;FSLINE3;.1413
;;City;;CONF;FCITY;.1414
;;State;;CONF;FSTATE;.1415
;;County;;CONF;FCOUNTY;.14111
;;Zip;;CONF;FZIP;.1416
;;Phone;;CONF;FPHONE;.1315
;;Province;;CONF;FPROV;.14114
;;Postal Code;;CONF;FPSTAL;.14115
;;Country;;CONF;FCNTRY;.14116
;;Address Node 1;;CONF;FNODE1;.141
;;Address Node 2;;CONF;FNODE2;.141
;;Country data piece;;CONF;CPEICE;16
;;QUIT;;QUIT
;;
; DG*5.3*1040; Change NULL FSLINE1 to REPEAT response code instead of REVERSE
FLDPRMPT ;Table of prompts and responses STRUCTURE --> Description;;Field;Old Value;New Value;Response Code
;;ALL;NULL;UPCAR;REPEAT
;;ALL;NULL;DELETE;QUES
;;ALL;NULL;VALUE;OK
;;ALL;VALUE;UPCAR;REPEAT
;;ALL;VALUE;NULL;OK
;;ALL;VALUE;VALUE;OK
;;FSLINE1;NULL;NULL;REPEAT
;;FSLINE2;NULL;NULL;OK
;;FSLINE3;NULL;NULL;OK
;;FCITY;NULL;NULL;REVERSE
;;FSTATE;NULL;NULL;REVERSE
;;FZIP;NULL;NULL;REVERSE
;;FCOUNTY;NULL;NULL;REVERSE
;;FPROV;NULL;NULL;OK
;;FPSTAL;NULL;NULL;OK
;;FCNTRY;NULL;NULL;REVERSE
;;FSLINE1;VALUE;DELETE;INSTRUCT
;;FSLINE2;VALUE;DELETE;CONFIRM
;;FSLINE3;VALUE;DELETE;CONFIRM
;;FCITY;VALUE;DELETE;INSTRUCT
;;FSTATE;VALUE;DELETE;INSTRUCT
;;FZIP;VALUE;DELETE;INSTRUCT
;;FCOUNTY;VALUE;DELETE;INSTRUCT
;;FPROV;VALUE;DELETE;CONFIRM
;;FPSTAL;VALUE;DELETE;CONFIRM
;;FCNTRY;VALUE;DELETE;REVERSE
;;QUIT
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGREGTE2 16017 printed May 25, 2026@12:59:01 Page 2
DGREGTE2 ;ALB/BAJ,TDM,BDB,JAM - Temporary & Confidential Address Support Routine; 02/27/2006 ; 22 Mar 2017 1:10 PM
+1 ;;5.3;Registration;**688,754,851,1040,1143**;Aug 13, 1993;Build 36
+2 ;
+3 QUIT
+4 ;
GETACT(DFN,DGTYPE,DGINPUT,DGACTIVE) ; DG*5.3*1143 - populate DGINPUT array with initial fields - Active?, Start/End Dates, Confidential Categories
+1 ; Input:
+2 ; DFN - Patient IEN
+3 ; DGTYPE - "TEMP" or "CONF"
+4 ; Output:
+5 ; DGINPUT - (pass by reference) - array that will hold the values entered
+6 ; DGACTIVE - (pass by reference) - holds the value of the Active? field (Y or N)
+7 ; Returns: 1 if an update has occurred
+8 ;
+9 NEW DIR,DA,X,Y,DGN,DGNACT,DGDEFACT
+10 ; Prompt for Address Active?
+11 ; Get the field number for Active? field
+12 SET DGNACT=$SELECT(DGTYPE="TEMP":.12105,DGTYPE="CONF":.14105,1:"")
+13 ; Set the default value from the current value of the Active? field stored in the patient file
+14 SET DGDEFACT=$$GET1^DIQ(2,DFN,DGNACT,"I")
+15 ; If RTA local array has a value for the Active? field, make that the default instead
+16 IF DGTYPE="TEMP"
IF $DATA(DGADDGRP3(DGNACT))
SET DGDEFACT=DGADDGRP3(DGNACT)
+17 IF DGTYPE="CONF"
IF $DATA(DGADDGRP4(DGNACT))
SET DGDEFACT=DGADDGRP4(DGNACT)
RETRY ;
+1 SET DA=DFN
+2 SET DGACTIVE=""
+3 IF DGTYPE="TEMP"
SET DIR("A")="TEMP MAILING ADDRESS ACTIVE?"
+4 ; Set default value for ^DIR from the local DGINPUT array or the current default value or "N" if none of these are defined
+5 SET DGDEFACT=$SELECT($DATA(DGINPUT(DGNACT)):DGINPUT(DGNACT),$GET(DGDEFACT)'="":DGDEFACT,1:"N")
+6 SET DIR(0)=2_","_DGNACT
SET DIR("B")=$SELECT($EXTRACT(DGDEFACT)="Y":"YES",1:"NO")
+7 DO ^DIR
+8 IF $DATA(DIRUT)
QUIT 0
+9 ; Set value into return variables
+10 SET (DGACTIVE,DGINPUT(DGNACT))=Y
+11 ; If Active is NO, and is also the default value, no change occurring, quit 0
+12 IF Y="N"
IF DGDEFACT="N"
QUIT 0
+13 ; If Active is changed to NO, call code to determine if address is being deleted and store the N in the local array
+14 ; Return 1 to indicate an update occurred
+15 IF Y="N"
Begin DoDot:1
+16 NEW DGDATA,DGERROR
+17 IF DGTYPE="TEMP"
DO TADD^DGLOCK
IF $GET(DGRTAON)=1
SET DGADDGRP3(DGNACT)="N"
+18 IF DGTYPE="CONF"
DO CADD^DGLOCK3
IF $GET(DGRTAON)=1
SET DGADDGRP4(DGNACT)="N"
End DoDot:1
QUIT 1
+19 ;
+20 ; Active set to YES, continue prompting for dates
+21 ; Get Start and End Dates
+22 KILL DIR
+23 NEW DGOK,ANS
+24 SET DGOK=1
+25 ; Temp Start/End Dates, store internal format to DGINPUT
+26 IF DGTYPE="TEMP"
FOR DGN=.1217,.1218
SET DGOK=$$READ(DGTYPE,DGN,.ANS)
if 'DGOK
QUIT
SET DGINPUT(DGN)=ANS
+27 ; Get Confidential Start/End Dates, store internal format to DGINPUT
+28 IF DGTYPE="CONF"
FOR DGN=.1417,.1418
SET DGOK=$$READ(DGTYPE,DGN,.ANS)
if 'DGOK
QUIT
SET DGINPUT(DGN)=ANS
+29 ; Done with Temp address or if 'DGOK
+30 IF DGTYPE="TEMP"!('DGOK)
QUIT DGOK
+31 ;
+32 ; Process CONFIDENTIAL ADDRESS CATEGORIES
+33 NEW DGORIGINAL,DGUPDATED,DGERROR,DGFDA,DIK,DGIEN,DGNEWIEN,DGSAVE
+34 ; Capture current categories in the patient file
+35 DO GETS^DIQ(2,DFN,".141*,","IE","DGORIGINAL","DGERROR")
+36 ; If we have the RTA group array defined, load the categories from the local array into the patient file
+37 IF $DATA(DGADDGRP4("CCATS",2.141))
Begin DoDot:1
+38 ; Clean out existing categories
+39 SET DA(1)=DFN
+40 SET DIK="^DPT("_DFN_",.14,"
+41 SET DA=0
FOR
SET DA=$ORDER(^DPT(DFN,.14,DA))
if 'DA
QUIT
DO ^DIK
+42 ; Restore the categories from Group 4
+43 KILL DGFDA
+44 SET DGIEN=0
FOR
SET DGIEN=$ORDER(DGADDGRP4("CCATS",2.141,DGIEN))
if 'DGIEN
QUIT
Begin DoDot:2
+45 SET DGNEWIEN=DFN_","
+46 SET DGNEWIEN="+1,"_DGNEWIEN
+47 SET DGFDA(2.141,DGNEWIEN,.01)=DGADDGRP4("CCATS",2.141,DGIEN,.01,"I")
+48 SET DGFDA(2.141,DGNEWIEN,1)=DGADDGRP4("CCATS",2.141,DGIEN,1,"I")
+49 DO UPDATE^DIE("","DGFDA","","DGERR")
+50 KILL DGFDA
End DoDot:2
+51 KILL DGFDA
End DoDot:1
+52 ; Process input from user for confidential categories
+53 NEW DIE,DR
+54 SET DA=DFN
+55 SET DIE("NO^")=1
+56 SET DR(2,2.141)=".01;1//YES;"
+57 SET DIE="^DPT("
+58 SET DR=.141
+59 DO ^DIE
+60 ; If there is a timeout, X will equal "^" - restore the original data and quit
+61 IF X="^"
SET DGTMOT=1
SET DGOK=0
GOTO RESTORE
+62 IF '$PIECE($$CAACT^DGRPCADD(DFN),U,2)
WRITE !?4,"But I need at least one active category."
Begin DoDot:1
+63 ; Clean up current changes and start over
+64 DO RESTORE
+65 KILL DGORIGINAL
End DoDot:1
GOTO RETRY
+66 ; Capture updated categories into the local array
+67 DO GETS^DIQ(2,DFN,".141*,","IE","DGUPDATED","DGERROR")
+68 ; Place user-selections into DGINPUT
+69 MERGE DGINPUT("CCATS")=DGUPDATED
+70 ; For Real-time updating: compare the categories in DGORIGINAL with DGINPUT and add/mark those categories in DGINPUT as deleted
+71 IF DGRTAON=1
SET DGIEN=0
FOR
SET DGIEN=$ORDER(DGORIGINAL(2.141,DGIEN))
if 'DGIEN
QUIT
Begin DoDot:1
+72 NEW DGFOUND,DGCATID
+73 SET DGCATID=DGORIGINAL(2.141,DGIEN,.01,"I")
+74 ; loop over the categories in DGINPUT and if the category is there, set FOUND=1
+75 SET DGFOUND=0
SET DGNEWIEN=0
FOR
SET DGNEWIEN=$ORDER(DGINPUT("CCATS",2.141,DGNEWIEN))
if 'DGNEWIEN
QUIT
Begin DoDot:2
+76 IF DGINPUT("CCATS",2.141,DGNEWIEN,.01,"I")=DGCATID
SET DGFOUND=1
End DoDot:2
if DGFOUND
QUIT
+77 ; If the category was not found, set it into DGINPUT as DELETED
+78 IF 'DGFOUND
SET DGINPUT("CCATS","DELETE",DGCATID)=DGORIGINAL(2.141,DGIEN,.01,"E")
End DoDot:1
+79 ;
+80 ; Restore the original categories
RESTORE ; Restore original set of Confidential Categories
+1 ; Clean out existing categories
+2 SET DA(1)=DFN
+3 SET DIK="^DPT("_DFN_",.14,"
+4 SET DA=0
FOR
SET DA=$ORDER(^DPT(DFN,.14,DA))
if 'DA
QUIT
DO ^DIK
+5 ;
+6 ; Restore the original categories
+7 KILL DGFDA
+8 SET DGIEN=0
FOR
SET DGIEN=$ORDER(DGORIGINAL(2.141,DGIEN))
if 'DGIEN
QUIT
Begin DoDot:1
+9 SET DGNEWIEN=DFN_","
+10 SET DGNEWIEN="+1,"_DGNEWIEN
+11 SET DGFDA(2.141,DGNEWIEN,.01)=DGORIGINAL(2.141,DGIEN,.01,"I")
+12 SET DGFDA(2.141,DGNEWIEN,1)=DGORIGINAL(2.141,DGIEN,1,"I")
+13 DO UPDATE^DIE("","DGFDA","","DGERR")
+14 KILL DGFDA
End DoDot:1
+15 QUIT DGOK
+16 ;
READ(DGTYPE,DGN,ANS) ; DG*5.3*1143 - User entry for start/end dates
+1 ; Input: DGN - Field number to prompt for
+2 ; Output: ANS - (pass by reference) the internal format of the user entry
+3 ; Returns: 1= ok response 0 = no response (timeout or user exit)
+4 NEW DIR,X,Y,DGCURRENT,DGDEF
+5 ; Get current field value in the patient file
+6 SET DGCURRENT=$$GET1^DIQ(2,DFN,DGN,"I")
+7 ; Get default value for the field from local input array or RTA array (if defined) or current patient record value
+8 IF DGTYPE="CONF"
SET DGDEF=$SELECT($DATA(DGINPUT(DGN)):DGINPUT(DGN),$DATA(DGADDGRP4(DGN)):DGADDGRP4(DGN),1:DGCURRENT)
+9 IF DGTYPE="TEMP"
SET DGDEF=$SELECT($DATA(DGINPUT(DGN)):DGINPUT(DGN),$DATA(DGADDGRP3(DGN)):DGADDGRP3(DGN),1:DGCURRENT)
+10 ; Set default value only if it is different from what's in the DB - transform it to external format
+11 IF DGDEF'=DGCURRENT
SET Y=DGDEF
SET Y=$$FMTE^DILIBF(Y,"5U")
SET DIR("B")=Y
+12 ; For temp address, set Prompt text
+13 IF DGN=.1217
SET DIR("A")="TEMP MAILING ADDRESS START DATE"
+14 IF DGN=.1218
SET DIR("A")="TEMP MAILING ADDRESS END DATE"
+15 SET DA=DFN
+16 SET DIR(0)=2_","_DGN
PROMPT ; Tag for entering in the date
+1 DO ^DIR
+2 IF $DATA(DTOUT)
SET DGTMOT=1
QUIT 0
+3 IF $DATA(DUOUT)
QUIT 0
+4 ; If an end date entered, check the value against the start date (previously stored in local input array)
+5 IF Y'=""
IF DGN=.1218
IF (Y<DGINPUT(.1217))
WRITE !,"End Date must not be before Start Date."
GOTO PROMPT
+6 IF Y'=""
IF DGN=.1418
IF (Y<DGINPUT(.1417))
WRITE !,"End Date must not be before Start Date."
GOTO PROMPT
+7 SET ANS=Y
+8 QUIT 1
+9 ;
GETOLD(DGCMP,DFN,TYPE) ;populate array with existing address info
+1 NEW CCIEN,DGCURR,CFORGN,CFSTR,L,T,DGCIEN,DGST,DGCNTY,FDESC,FNODE,FPECE,CCNTRY,COUNTRY
+2 SET CFORGN=0
SET FDESC=$SELECT(TYPE="TEMP":"TEMPORARY ADDRESS COUNTRY",1:"CONFIDENTIAL ADDR COUNTRY")
+3 ; get current country
+4 SET FNODE=$SELECT(TYPE="TEMP":.122,TYPE="CONF":.141,1:.11)
+5 SET FPECE=$SELECT(TYPE="TEMP":3,TYPE="CONF":16,1:10)
+6 SET CCIEN=$PIECE($GET(^DPT(DFN,FNODE)),U,FPECE)
+7 IF CCIEN=""
SET CCNTRY=$ORDER(^HL(779.004,"D","UNITED STATES",""))
+8 SET CFORGN=$$FORIEN^DGADDUTL(CCIEN)
+9 ;get current address fields and xlate to ^DIQ format
+10 SET CFSTR=$$INPT1(DFN,CFORGN)
SET CFSTR=$TRANSLATE(CFSTR,",",";")
+11 ; Domestic data needs some extra fields
+12 ; add country field before lookup
+13 DO GETS^DIQ(2,DFN_",",CFSTR,"EI","DGCURR")
+14 FOR L=1:1:$LENGTH(CFSTR,";")
SET T=$PIECE(CFSTR,";",L)
SET DGCMP("OLD",T)=$GET(DGCURR(2,DFN_",",T,"E"))
+15 SET COUNTRY=$$CNTRYI^DGADDUTL(CCIEN)
IF COUNTRY=-1
SET COUNTRY="UNKNOWN COUNTRY"
+16 SET DGCMP("OLD",FCNTRY)=COUNTRY
+17 IF 'CFORGN
Begin DoDot:1
+18 SET DGCIEN=$GET(DGCURR(2,DFN_",",FCOUNTY,"I"))
+19 SET DGST=$GET(DGCURR(2,DFN_",",FSTATE,"I"))
+20 SET DGCNTY=$$CNTY^DGREGAZL(DGST,DGCIEN)
+21 IF DGCNTY=-1
SET DGCNTY=""
+22 SET DGCMP("OLD",FCOUNTY)=""
IF DGCNTY]""
SET DGCMP("OLD",FCOUNTY)=$PIECE(DGCNTY,U)_" "_$PIECE(DGCNTY,U,3)
End DoDot:1
+23 QUIT
INPT1(DFN,FORGN,PSTR) ; address input prompts
+1 NEW FSTR
+2 ; PSTR contains the full list of address fields to be modified
+3 ; FSTR contains the field list based on country
+4 SET PSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FCITY_","_FSTATE_","_FCOUNTY_","_FZIP_","_FPROV_","_FPSTAL_","_FCNTRY_","_FPHONE
+5 ;S FSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FCITY_","_FSTATE_","_FCOUNTY_","_FZIP_","_FPHONE
+6 ;DG*5.3*851
SET FSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FZIP_","_FPHONE
+7 IF FORGN
SET FSTR=FSLINE1_","_FSLINE2_","_FSLINE3_","_FCITY_","_FPROV_","_FPSTAL_","_FPHONE
+8 QUIT FSTR
+9 ;
+10 ; DG*5.3*1143 - Tags DISPUS and DISPFGN moved from DGREGTED due to size limitations.
+11 ; DG*5.3*1014;jam; Added these tags to display the address prior to calling the Validation service
DISPUS(DGCMP,DGM) ;tag to display US data
+1 NEW DGCNTRY
+2 ; "AddressLine1,AddressLine2,AddressLine3,City,State,County,Zip,Province,PostalCode^Country"
+3 ; ".1411,.1412,.1413,.1414,.1415,.14111,.1416,.14114,.14115,.14116" ; Confidential address fields
+4 WRITE !,?2,"[",DGM," CONFIDENTIAL ADDRESS]"
+5 WRITE !?16,$GET(DGCMP(DGM,.1411))
+6 IF $GET(DGCMP(DGM,.1412))'=""
WRITE !,?16,$GET(DGCMP(DGM,.1412))
+7 IF $GET(DGCMP(DGM,.1413))'=""
WRITE !,?16,$GET(DGCMP(DGM,.1413))
+8 WRITE !,?16,$GET(DGCMP(DGM,.1414))
+9 if ($GET(DGCMP(DGM,.1414))'="")!($PIECE($GET(DGCMP(DGM,.1415)),U,2)'="")
WRITE ","
+10 WRITE $PIECE($GET(DGCMP(DGM,.1415)),U,2)
+11 WRITE " ",$GET(DGCMP(DGM,.1416))
+12 SET DGCNTRY=$$CNTRYI^DGADDUTL($PIECE($GET(DGCMP(DGM,.14116)),U))
+13 IF DGCNTRY]""
IF (DGCNTRY'=-1)
WRITE !?16,DGCNTRY
+14 IF $PIECE($GET(DGCMP(DGM,.14111)),U)'=""
WRITE !,?6," County: ",$PIECE($GET(DGCMP(DGM,.14111)),U,2)
+15 WRITE !
+16 QUIT
+17 ;
DISPFGN(DGCMP,DGM) ;tag to display Foreign data
+1 NEW DGCNTRY
+2 WRITE !,?2,"[",DGM," CONFIDENTIAL ADDRESS]"
+3 WRITE !?16,$GET(DGCMP(DGM,.1411))
+4 IF $GET(DGCMP(DGM,.1412))'=""
WRITE !,?16,$GET(DGCMP(DGM,.1412))
+5 IF $GET(DGCMP(DGM,.1413))'=""
WRITE !,?16,$GET(DGCMP(DGM,.1413))
+6 WRITE !,?16,$GET(DGCMP(DGM,.1414))_" "_$GET(DGCMP(DGM,.14114))_" "_$GET(DGCMP(DGM,.14115))
+7 SET DGCNTRY=$$CNTRYI^DGADDUTL($PIECE($GET(DGCMP(DGM,.14116)),U))
+8 SET DGCNTRY=$SELECT(DGCNTRY="":"UNSPECIFIED COUNTRY",DGCNTRY=-1:"UNKNOWN COUNTRY",1:DGCNTRY)
+9 IF DGCNTRY]""
WRITE !?16,DGCNTRY
+10 WRITE !
+11 QUIT
+12 ;
LOADTEMP ; DG*5.3*1143 - Called from TADD^DGLOCK when the address active? flag is set from YES to NO
+1 ; Load DGADDGRP3 Temp Address array from the DB
+2 NEW DGRP
+3 SET DGRP(.121)=$GET(^DPT(DFN,.121))
+4 SET DGRP(.122)=$GET(^DPT(DFN,.122))
+5 KILL DGADDGRP3
+6 ; Set Address Active? field to NO in the local array
+7 SET DGADDGRP3(.12105)="N"
+8 ; Line 1
+9 SET DGADDGRP3(.1211)=$PIECE(DGRP(.121),"^",1)
+10 ; Line 2
+11 SET DGADDGRP3(.1212)=$PIECE(DGRP(.121),"^",2)
+12 ; Line 3
+13 SET DGADDGRP3(.1213)=$PIECE(DGRP(.121),"^",3)
+14 ; City
+15 SET DGADDGRP3(.1214)=$PIECE(DGRP(.121),"^",4)
+16 ; State
+17 SET DGADDGRP3(.1215)=$PIECE(DGRP(.121),"^",5)
+18 ; Zip
+19 SET DGADDGRP3(.1216)=$PIECE(DGRP(.121),"^",6)
+20 ; Start Date
+21 SET DGADDGRP3(.1217)=$PIECE(DGRP(.121),"^",7)
+22 ; End Date
+23 SET DGADDGRP3(.1218)=$PIECE(DGRP(.121),"^",8)
+24 ; Temp Phone
+25 SET DGADDGRP3(.1219)=$PIECE(DGRP(.121),"^",10)
+26 ; County
+27 SET DGADDGRP3(.12111)=$PIECE(DGRP(.121),"^",11)
+28 ; Zip+4
+29 SET DGADDGRP3(.12112)=$PIECE(DGRP(.121),"^",12)
+30 ; Province
+31 SET DGADDGRP3(.1221)=$PIECE(DGRP(.122),"^",1)
+32 ; Postal Code
+33 SET DGADDGRP3(.1222)=$PIECE(DGRP(.122),"^",2)
+34 ; Country
+35 SET DGADDGRP3(.1223)=$PIECE(DGRP(.122),"^",3)
+36 QUIT
+37 ;
LOADCONF ; DG*5.3*1143 - Called from CADD^DGLOCK3 when the address active? flag is set from YES to NO
+1 ; Load DGADDGRP4 Address array from the DB - these fields will be sent to ES with delete flag set. Then deleted from the DB.
+2 KILL DGADDGRP4
+3 NEW DGRP
+4 SET DGRP(.141)=$GET(^DPT(DFN,.141))
+5 SET DGRP(.13)=$GET(^DPT(DFN,.13))
+6 ; Set Address Active? field to NO in the local array
+7 SET DGADDGRP4(.14105)="N"
+8 ; Line 1
+9 SET DGADDGRP4(.1411)=$PIECE(DGRP(.141),"^",1)
+10 ; Line 2
+11 SET DGADDGRP4(.1412)=$PIECE(DGRP(.141),"^",2)
+12 ; Line 3
+13 SET DGADDGRP4(.1413)=$PIECE(DGRP(.141),"^",3)
+14 ; City
+15 SET DGADDGRP4(.1414)=$PIECE(DGRP(.141),"^",4)
+16 ; State
+17 SET DGADDGRP4(.1415)=$PIECE(DGRP(.141),"^",5)
+18 ; Zip
+19 SET DGADDGRP4(.1416)=$PIECE(DGRP(.141),"^",6)
+20 ; Start Date
+21 SET DGADDGRP4(.1417)=$PIECE(DGRP(.141),"^",7)
+22 ; End Date
+23 SET DGADDGRP4(.1418)=$PIECE(DGRP(.141),"^",8)
+24 ; County
+25 SET DGADDGRP4(.14111)=$PIECE(DGRP(.141),"^",11)
+26 ; Province
+27 SET DGADDGRP4(.14114)=$PIECE(DGRP(.141),"^",14)
+28 ; Postal Code
+29 SET DGADDGRP4(.14115)=$PIECE(DGRP(.141),"^",15)
+30 ; Country
+31 SET DGADDGRP4(.14116)=$PIECE(DGRP(.141),"^",16)
+32 ; CASS Indicator
+33 SET DGADDGRP4(.14117)=$PIECE(DGRP(.141),"^",17)
+34 ; Conf Phone
+35 SET DGADDGRP4(.1315)=$PIECE(DGRP(.13),"^",15)
+36 ; Confidential override
+37 SET DGADDGRP4(.141201)=$PIECE(DGRP(.141),"^",17)
+38 ; Load the Address Categories
+39 NEW DGADDCATS
+40 ; Capture current categories in the patient file and load them into the array
+41 DO GETS^DIQ(2,DFN,".141*,","IE","DGADDCATS","DGERROR")
+42 MERGE DGADDGRP4("CCATS")=DGADDCATS
+43 QUIT
+44 ;
SURE() ; Are you sure prompt
+1 NEW DIR,X,Y,DUOUT,DTOUT,DIRUT
+2 SET DIR(0)="Y"
+3 SET DIR("B")="NO"
+4 SET DIR("A")=" SURE YOU WANT TO DELETE"
+5 DO ^DIR
+6 QUIT Y
SKIP(DGN,DGINPUT) ; determine whether or not to skip the prompt
+1 NEW SKIP,NULL
+2 SET SKIP=0
+3 SET NULL=($GET(DGINPUT(FSLINE1))="")!(($GET(DGINPUT(FSLINE1))="@"))
+4 IF NULL
IF (DGN=FSLINE2)
SET SKIP=1
+5 SET NULL=($GET(DGINPUT(FSLINE2))="")!(($GET(DGINPUT(FSLINE2))="@"))
+6 IF NULL
IF (DGN=FSLINE3)
SET SKIP=1
+7 QUIT SKIP
+8 ;
INIT ; initialize variables
+1 ; This tag reads the table at FLDDAT (below) to set relationship between
+2 ; variables and Field numbers.
+3 ;
+4 ; Set up array of fields needed
+5 NEW I,T,FTYPE,VNAME,FNUM,RFLD
+6 FOR I=1:1
SET T=$PIECE($TEXT(FLDDAT+I^DGREGTE2),";;",3)
if T="QUIT"
QUIT
Begin DoDot:1
+7 SET FTYPE=$PIECE(T,";",1)
SET VNAME=$PIECE(T,";",2)
SET FNUM=$PIECE(T,";",3)
+8 IF FTYPE=TYPE
SET @VNAME=FNUM
End DoDot:1
+9 ; Set up array of field and prompting rules
+10 KILL T,I
+11 FOR I=1:1
SET T=$PIECE($TEXT(FLDPRMPT+I^DGREGTE2),";;",2)
if T="QUIT"
QUIT
Begin DoDot:1
+12 SET RFLD=$PIECE(T,";",1)
IF RFLD'="ALL"
SET RFLD=@RFLD
+13 SET RPROC(RFLD,$PIECE(T,";",2),$PIECE(T,";",3))=$PIECE(T,";",4)
End DoDot:1
+14 QUIT
+15 ; DG*5.3*1143 - Add Address Active?, Start and End Date fields
FLDDAT ; Table of field values STRUCTURE --> Description;;Type;Variable Name;Field Number
+1 ;;Active;;TEMP;FSACTIVE;.12105
+2 ;;Start Date;;TEMP;FSSTART;.1217
+3 ;;End Date;;TEMP;FSEND;.1218
+4 ;;Street Line 1;;TEMP;FSLINE1;.1211
+5 ;;Street Line 2;;TEMP;FSLINE2;.1212
+6 ;;Street Line 3;;TEMP;FSLINE3;.1213
+7 ;;City;;TEMP;FCITY;.1214
+8 ;;State;;TEMP;FSTATE;.1215
+9 ;;County;;TEMP;FCOUNTY;.12111
+10 ;;Zip;;TEMP;FZIP;.12112
+11 ;;Phone;;TEMP;FPHONE;.1219
+12 ;;Province;;TEMP;FPROV;.1221
+13 ;;Postal Code;;TEMP;FPSTAL;.1222
+14 ;;Country;;TEMP;FCNTRY;.1223
+15 ;;Address Node 1;;TEMP;FNODE1;.121
+16 ;;Address Node 2;;TEMP;FNODE2;.122
+17 ;;Country data piece;;TEMP;CPEICE;3
+18 ;;Active;;CONF;FSACTIVE;.14105
+19 ;;Start Date;;CONF;FSSTART;.1417
+20 ;;End Date;;CONF;FSEND;.1418
+21 ;;Street Line 1;;CONF;FSLINE1;.1411
+22 ;;Street Line 2;;CONF;FSLINE2;.1412
+23 ;;Street Line 3;;CONF;FSLINE3;.1413
+24 ;;City;;CONF;FCITY;.1414
+25 ;;State;;CONF;FSTATE;.1415
+26 ;;County;;CONF;FCOUNTY;.14111
+27 ;;Zip;;CONF;FZIP;.1416
+28 ;;Phone;;CONF;FPHONE;.1315
+29 ;;Province;;CONF;FPROV;.14114
+30 ;;Postal Code;;CONF;FPSTAL;.14115
+31 ;;Country;;CONF;FCNTRY;.14116
+32 ;;Address Node 1;;CONF;FNODE1;.141
+33 ;;Address Node 2;;CONF;FNODE2;.141
+34 ;;Country data piece;;CONF;CPEICE;16
+35 ;;QUIT;;QUIT
+36 ;;
+37 ; DG*5.3*1040; Change NULL FSLINE1 to REPEAT response code instead of REVERSE
FLDPRMPT ;Table of prompts and responses STRUCTURE --> Description;;Field;Old Value;New Value;Response Code
+1 ;;ALL;NULL;UPCAR;REPEAT
+2 ;;ALL;NULL;DELETE;QUES
+3 ;;ALL;NULL;VALUE;OK
+4 ;;ALL;VALUE;UPCAR;REPEAT
+5 ;;ALL;VALUE;NULL;OK
+6 ;;ALL;VALUE;VALUE;OK
+7 ;;FSLINE1;NULL;NULL;REPEAT
+8 ;;FSLINE2;NULL;NULL;OK
+9 ;;FSLINE3;NULL;NULL;OK
+10 ;;FCITY;NULL;NULL;REVERSE
+11 ;;FSTATE;NULL;NULL;REVERSE
+12 ;;FZIP;NULL;NULL;REVERSE
+13 ;;FCOUNTY;NULL;NULL;REVERSE
+14 ;;FPROV;NULL;NULL;OK
+15 ;;FPSTAL;NULL;NULL;OK
+16 ;;FCNTRY;NULL;NULL;REVERSE
+17 ;;FSLINE1;VALUE;DELETE;INSTRUCT
+18 ;;FSLINE2;VALUE;DELETE;CONFIRM
+19 ;;FSLINE3;VALUE;DELETE;CONFIRM
+20 ;;FCITY;VALUE;DELETE;INSTRUCT
+21 ;;FSTATE;VALUE;DELETE;INSTRUCT
+22 ;;FZIP;VALUE;DELETE;INSTRUCT
+23 ;;FCOUNTY;VALUE;DELETE;INSTRUCT
+24 ;;FPROV;VALUE;DELETE;CONFIRM
+25 ;;FPSTAL;VALUE;DELETE;CONFIRM
+26 ;;FCNTRY;VALUE;DELETE;REVERSE
+27 ;;QUIT
+28 ;;