VAFCMGB0 ;ALB/JRP-DEMOGRAPHIC MERGE SCREENS ;10/18/96
;;5.3;Registration;**149,255,477,479,1015**;Aug 13, 1993;Build 21
;
;NOTE: This routine contains line tags used to build the display
; screen for a List Manager interface. Refer to routine
; VAFCMGB for a description of input/output variables.
;
LOCAL(FILE,FIELD,IENS,ARRAY) ;Get local data from extraction array
;
;Input : FILE - File number
; FIELD - Field number
; IENS - FDA entry number (ex: "DFN,")
; ARRAY - FDA array containing local data (full global ref)
; (ie: ARRAY(File,IENS,Field) = Value)
; All variables denoted in VAFCMGB routine
;Output : Value to display
;Notes : Existance/validity of input variables is assumed
; : ARRAY() is the ouput of the call to GETDATA^VAFCMGU0()
; :<No Data Found> is returned when ARRAY(File,IENS,Field) is NULL
; or does not exist
; : Phone numbers are returned in HL7 format
; : Social security numbers will contain dashes
; : Dates are returned in the format MM-DD-YYYY@HH:MM:SS
;
;Declare variables
N VALUE,QUOTE
S QUOTE=$C(34)
;Get data
S VALUE=$G(@ARRAY@(FILE,IENS,FIELD))
;Convert NULLS and quit
Q:(VALUE="") "<No Data Found>"
;Convert phone numbers to HL7 format
I ((FIELD=.131)!(FIELD=.132)!(FIELD=.219)) I (FILE=2) D
.S VALUE=$$HLPHONE^HLFNC(VALUE)
;Add dashes to SSN
I (FIELD=.09) I (FILE=2) D
.S VALUE=$TR(VALUE,"-","")
.S VALUE=$E(VALUE,1,3)_"-"_$E(VALUE,4,5)_"-"_$E(VALUE,6,10)
;Convert dates to MM-DD-YYYY@HH:MM:SS format
I ((FIELD=.03)!(FIELD=.351)) I (FILE=2) D
.S VALUE=$$EX2INDT^VAFCMGU0(VALUE)
.S VALUE=$$IN2EXDT^VAFCMGU0(VALUE)
;Done
Q VALUE
;
REMOTE(FILE,FIELD) ;Get remote data from merge array [VAFCARR()]
;
;Input : FILE - File number
; FIELD - Field number
; All variables denoted in VAFCMGB routine
;Output : Value to display
;Notes : Existance/validity of input variables is assumed
; :<No Data Found> is returned when VAFCARR(File,Field) is NULL or
; does not exist
; : <Data Deleted> is returned when VAFCARR(File,Field)="@"
; : When VAFCARR(Field,Field)="^text", text will be returned
; : Phone numbers are returned in HL7 format
; : Social security numbers will contain dashes
; : Dates are returned in the format MM-DD-YYYY@HH:MM:SS
;
;Declare variables
N VALUE,QUOTE
S QUOTE=$C(34)
;Get data
S VALUE=$G(@VAFCARR@(FILE,FIELD))
;Convert NULLS and quit
Q:($P(VALUE,U)="") "<No Data Found>"
;Convert "@" and quit
Q:($P(VALUE,U)=(QUOTE_"@"_QUOTE)) "<Data Deleted>"
;Convert unresolved and quit
Q:$P(VALUE,U,3) "<UR> "_$P(VALUE,U)
S VALUE=$P(VALUE,U)
;Convert phone numbers to HL7 format
I ((FIELD=.131)!(FIELD=.132)!(FIELD=.219)) I (FILE=2) D
.S VALUE=$$HLPHONE^HLFNC(VALUE)
;Add dashes to SSN
I (FIELD=.09) I (FILE=2) D
.S VALUE=$TR(VALUE,"-","")
.S VALUE=$E(VALUE,1,3)_"-"_$E(VALUE,4,5)_"-"_$E(VALUE,6,10)
;Convert dates to MM-DD-YYYY@HH:MM:SS format
I ((FIELD=.03)!(FIELD=.351)) I (FILE=2) D
.S VALUE=$$IN2EXDT^VAFCMGU0(VALUE)
;Convert ZIP to ZIP+4
;I (FIELD=.1112) I (FILE=2) D ;**255 **479
;.S VALUE=$TR(VALUE,"-") ;**477 old messaging didn't contain '-'
;.S VALUE=$E(VALUE,1,5)_$S($E(VALUE,6,9)]"":"-"_$E(VALUE,6,9),1:"")
I (FIELD=.3612) I (FILE=2) D ;**477
.I $L(VALUE)>7 S VALUE=$$HL7TFM^XLFDT(VALUE) ;convert hl7 to fileman date
;Done
Q VALUE
;
DIFFCHK(FILE,FIELD,IENS,ARRAY) ;Compare local and remote data for differences
;
;Input : FILE - File number
; FIELD - Field number
; IENS - FDA entry number (ex: "2169,")
; ARRAY - FDA array containing local data (full global ref)
; (ie: ARRAY(File,IENS,Field) = Value)
; All variables denoted in VAFCMGB routine
;Output : 1 = Local & remote data are different
; 0 = Local & remote data are not different
;Notes : Existance/validity of input variables is assumed
; : ARRAY() is the ouput of the call to GETDATA^VAFCMGU0()
; : If VAFCARR(File,Field) is undefined, NULL, or has a value of
; "^text" a difference is not found (prevents overwritting of
; local data)
; : If VAFCARR(File,Field) is "@" and ARRAY(File,IENS,Field) is
; NULL or does not exist a difference is not found (prevents
; deletion of nothing)
; : Phone numbers are converted to HL7 format for comparison
; : Social security numbers are compared with dashes removed
; : Dates are converted to FileMan format for comparison
;
;Declare variables
N LOCAL,REMOTE,QUOTE
S QUOTE=$C(34)
;Get local data
S LOCAL=$G(@ARRAY@(FILE,IENS,FIELD))
;Get remote data
S REMOTE=$P($G(@VAFCARR@(FILE,FIELD)),U)
;S:$E(REMOTE)=U&($P(REMOTE,U,2)]"") REMOTE=$P(REMOTE,U,2)
;S:$P(REMOTE,U)=""&('$P(REMOTE,U,2)) REMOTE=""
;S:$P(REMOTE,U)]"" REMOTE=$P(REMOTE,U)
;Screen for remote value of NULL - return no diff
I (REMOTE="") Q 0
;Screen for remote value of "^text" - return no diff
I (REMOTE=(QUOTE_"^")) Q 0
;Screen for remote value of "@" and no local value - return no diff
I ((REMOTE=(QUOTE_"@"_QUOTE))&(LOCAL="")) Q 0
;Convert phone numbers to HL7 format
I ((FIELD=.131)!(FIELD=.132)!(FIELD=.219)) I (FILE=2) D
.S LOCAL=$$HLPHONE^HLFNC(LOCAL)
.S REMOTE=$$HLPHONE^HLFNC(REMOTE)
;Remove dashes from SSN
I (FIELD=.09) I (FILE=2) D
.S LOCAL=$TR(LOCAL,"-","")
.S REMOTE=$TR(REMOTE,"-","")
;Convert dates to FileMan format (remote dates already in FM format)
I ((FIELD=.03)!(FIELD=.351)) I (FILE=2) D
.S LOCAL=$$EX2INDT^VAFCMGU0(LOCAL)
I (FIELD=.3612) I (FILE=2) D ;*477
.S LOCAL=$$EX2INDT^VAFCMGU0(LOCAL)
.I $L(REMOTE)>7 S REMOTE=$$HL7TFM^XLFDT(REMOTE) ;convert hl7 to fileman date
;Convert zip+4 to fileman format
;I (FIELD=.1112) I (FILE=2) D ;**255 **479
;.S LOCAL=$TR(LOCAL,"-","")
;.S REMOTE=$TR(REMOTE,"-","")
;Done - return comparison of local & remote data
Q ('(LOCAL=REMOTE))
;
GROUP1 ;Line tag to build logical group number one
;
;Group one contains the following fields:
; .01, .03, .09, .351
;
;Column width is limited to 30 characters
;
;Declare variables
N IENS,TARGET,MESSAGE,LINE,DATA,LOCAL,REMOTE,DIFF
S TARGET="^TMP(""VAFC-MERGE-TO"","_$J_",""DATA"")"
S MESSAGE="^TMP(""VAFC-MERGE-TO"","_$J_",""MESSAGE"")"
;Initialize global locations
K @TARGET,@MESSAGE
;Set group index
S @VALMAR@("GRP",1)=VALMCNT
;Get local data for patient
D GETDATA^VAFCMGU0(VAFCDFN,1,TARGET,MESSAGE)
;Build display
S IENS=VAFCDFN_","
;Name
S LOCAL=$$LOCAL(2,.01,IENS,TARGET)
S LOCAL=$E(LOCAL,1,30)
S REMOTE=$$REMOTE(2,.01)
S REMOTE=$E(REMOTE,1,30)
S DIFF=$$DIFFCHK(2,.01,IENS,TARGET)
S LINE=$S(DIFF:"**",1:" ")_" 1"
S:DIFF&($P($G(@VAFCARR@(2,.01)),U,2)) LINE="->"_" 1" ;**477 flag name if different - no longer auto updated
S DATA="Name: "_LOCAL
S LINE=$$INSERT^VAFCMGU0(DATA,LINE,8)
S @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
S @VALMAR@("IDX",VALMCNT,1)=""
I (DIFF) D
.S @VALMAR@("E2F",1,1)="2^.01"
.S @VALMAR@("E2G",1)=1
I ('DIFF) D
.K @VALMAR@("E2F",1)
.K @VALMAR@("E2G",1)
W:(+$G(VAFCDOTS)) "."
S VALMCNT=VALMCNT+1
;SSN
S LOCAL=$$LOCAL(2,.09,IENS,TARGET)
S REMOTE=$$REMOTE(2,.09)
S DIFF=$$DIFFCHK(2,.09,IENS,TARGET)
S LINE=$S(DIFF:"**",1:" ")_" 2"
S:DIFF&($P($G(@VAFCARR@(2,.09)),U,2)) LINE="->"_" 2"
S DATA="SSN: "_LOCAL
S LINE=$$INSERT^VAFCMGU0(DATA,LINE,9)
S @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
S @VALMAR@("IDX",VALMCNT,2)=""
I (DIFF) D
.S @VALMAR@("E2F",2,1)="2^.09"
.S @VALMAR@("E2G",2)=1
I ('DIFF) D
.K @VALMAR@("E2F",2)
.K @VALMAR@("E2G",2)
W:(+$G(VAFCDOTS)) "."
S VALMCNT=VALMCNT+1
;Date of birth
S LOCAL=$$LOCAL(2,.03,IENS,TARGET)
S LOCAL=$P(LOCAL,"@",1)
S REMOTE=$$REMOTE(2,.03)
S REMOTE=$P(REMOTE,"@",1)
S DIFF=$$DIFFCHK(2,.03,IENS,TARGET)
S LINE=$S(DIFF:"**",1:" ")_" 3"
S:DIFF&($P($G(@VAFCARR@(2,.03)),U,2)) LINE="->"_" 3"
S DATA="DOB: "_LOCAL
S LINE=$$INSERT^VAFCMGU0(DATA,LINE,9)
S @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
S @VALMAR@("IDX",VALMCNT,3)=""
I (DIFF) D
.S @VALMAR@("E2F",3,1)="2^.03"
.S @VALMAR@("E2G",3)=1
I ('DIFF) D
.K @VALMAR@("E2F",3)
.K @VALMAR@("E2G",3)
W:(+$G(VAFCDOTS)) "."
S VALMCNT=VALMCNT+1
;Date of death - strip time
S LOCAL=$$LOCAL(2,.351,IENS,TARGET)
;S LOCAL=$P(LOCAL,"@",1) ;**477 time has already been stripped
S REMOTE=$$REMOTE(2,.351)
;S REMOTE=$P(REMOTE,"@",1) ;**477 time has already been stripped
S DIFF=$$DIFFCHK(2,.351,IENS,TARGET)
S LINE=$S(DIFF:"**",1:" ")_" 4"
S:DIFF&($P($G(@VAFCARR@(2,.351)),U,2)) LINE="->"_" 4"
S DATA="DOD: "_LOCAL
S LINE=$$INSERT^VAFCMGU0(DATA,LINE,9)
S @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
S @VALMAR@("IDX",VALMCNT,4)=""
I (DIFF) D
.S @VALMAR@("E2F",4,1)="2^.351"
.S @VALMAR@("E2G",4)=1
I ('DIFF) D
.K @VALMAR@("E2F",4)
.K @VALMAR@("E2G",4)
W:(+$G(VAFCDOTS)) "."
S VALMCNT=VALMCNT+1
Q
VAFCMGB0 ;ALB/JRP-DEMOGRAPHIC MERGE SCREENS ;10/18/96
+1 ;;5.3;Registration;**149,255,477,479,1015**;Aug 13, 1993;Build 21
+2 ;
+3 ;NOTE: This routine contains line tags used to build the display
+4 ; screen for a List Manager interface. Refer to routine
+5 ; VAFCMGB for a description of input/output variables.
+6 ;
LOCAL(FILE,FIELD,IENS,ARRAY) ;Get local data from extraction array
+1 ;
+2 ;Input : FILE - File number
+3 ; FIELD - Field number
+4 ; IENS - FDA entry number (ex: "DFN,")
+5 ; ARRAY - FDA array containing local data (full global ref)
+6 ; (ie: ARRAY(File,IENS,Field) = Value)
+7 ; All variables denoted in VAFCMGB routine
+8 ;Output : Value to display
+9 ;Notes : Existance/validity of input variables is assumed
+10 ; : ARRAY() is the ouput of the call to GETDATA^VAFCMGU0()
+11 ; :<No Data Found> is returned when ARRAY(File,IENS,Field) is NULL
+12 ; or does not exist
+13 ; : Phone numbers are returned in HL7 format
+14 ; : Social security numbers will contain dashes
+15 ; : Dates are returned in the format MM-DD-YYYY@HH:MM:SS
+16 ;
+17 ;Declare variables
+18 NEW VALUE,QUOTE
+19 SET QUOTE=$CHAR(34)
+20 ;Get data
+21 SET VALUE=$GET(@ARRAY@(FILE,IENS,FIELD))
+22 ;Convert NULLS and quit
+23 IF (VALUE="")
QUIT "<No Data Found>"
+24 ;Convert phone numbers to HL7 format
+25 IF ((FIELD=.131)!(FIELD=.132)!(FIELD=.219))
IF (FILE=2)
Begin DoDot:1
+26 SET VALUE=$$HLPHONE^HLFNC(VALUE)
End DoDot:1
+27 ;Add dashes to SSN
+28 IF (FIELD=.09)
IF (FILE=2)
Begin DoDot:1
+29 SET VALUE=$TRANSLATE(VALUE,"-","")
+30 SET VALUE=$EXTRACT(VALUE,1,3)_"-"_$EXTRACT(VALUE,4,5)_"-"_$EXTRACT(VALUE,6,10)
End DoDot:1
+31 ;Convert dates to MM-DD-YYYY@HH:MM:SS format
+32 IF ((FIELD=.03)!(FIELD=.351))
IF (FILE=2)
Begin DoDot:1
+33 SET VALUE=$$EX2INDT^VAFCMGU0(VALUE)
+34 SET VALUE=$$IN2EXDT^VAFCMGU0(VALUE)
End DoDot:1
+35 ;Done
+36 QUIT VALUE
+37 ;
REMOTE(FILE,FIELD) ;Get remote data from merge array [VAFCARR()]
+1 ;
+2 ;Input : FILE - File number
+3 ; FIELD - Field number
+4 ; All variables denoted in VAFCMGB routine
+5 ;Output : Value to display
+6 ;Notes : Existance/validity of input variables is assumed
+7 ; :<No Data Found> is returned when VAFCARR(File,Field) is NULL or
+8 ; does not exist
+9 ; : <Data Deleted> is returned when VAFCARR(File,Field)="@"
+10 ; : When VAFCARR(Field,Field)="^text", text will be returned
+11 ; : Phone numbers are returned in HL7 format
+12 ; : Social security numbers will contain dashes
+13 ; : Dates are returned in the format MM-DD-YYYY@HH:MM:SS
+14 ;
+15 ;Declare variables
+16 NEW VALUE,QUOTE
+17 SET QUOTE=$CHAR(34)
+18 ;Get data
+19 SET VALUE=$GET(@VAFCARR@(FILE,FIELD))
+20 ;Convert NULLS and quit
+21 IF ($PIECE(VALUE,U)="")
QUIT "<No Data Found>"
+22 ;Convert "@" and quit
+23 IF ($PIECE(VALUE,U)=(QUOTE_"@"_QUOTE))
QUIT "<Data Deleted>"
+24 ;Convert unresolved and quit
+25 IF $PIECE(VALUE,U,3)
QUIT "<UR> "_$PIECE(VALUE,U)
+26 SET VALUE=$PIECE(VALUE,U)
+27 ;Convert phone numbers to HL7 format
+28 IF ((FIELD=.131)!(FIELD=.132)!(FIELD=.219))
IF (FILE=2)
Begin DoDot:1
+29 SET VALUE=$$HLPHONE^HLFNC(VALUE)
End DoDot:1
+30 ;Add dashes to SSN
+31 IF (FIELD=.09)
IF (FILE=2)
Begin DoDot:1
+32 SET VALUE=$TRANSLATE(VALUE,"-","")
+33 SET VALUE=$EXTRACT(VALUE,1,3)_"-"_$EXTRACT(VALUE,4,5)_"-"_$EXTRACT(VALUE,6,10)
End DoDot:1
+34 ;Convert dates to MM-DD-YYYY@HH:MM:SS format
+35 IF ((FIELD=.03)!(FIELD=.351))
IF (FILE=2)
Begin DoDot:1
+36 SET VALUE=$$IN2EXDT^VAFCMGU0(VALUE)
End DoDot:1
+37 ;Convert ZIP to ZIP+4
+38 ;I (FIELD=.1112) I (FILE=2) D ;**255 **479
+39 ;.S VALUE=$TR(VALUE,"-") ;**477 old messaging didn't contain '-'
+40 ;.S VALUE=$E(VALUE,1,5)_$S($E(VALUE,6,9)]"":"-"_$E(VALUE,6,9),1:"")
+41 ;**477
IF (FIELD=.3612)
IF (FILE=2)
Begin DoDot:1
+42 ;convert hl7 to fileman date
IF $LENGTH(VALUE)>7
SET VALUE=$$HL7TFM^XLFDT(VALUE)
End DoDot:1
+43 ;Done
+44 QUIT VALUE
+45 ;
DIFFCHK(FILE,FIELD,IENS,ARRAY) ;Compare local and remote data for differences
+1 ;
+2 ;Input : FILE - File number
+3 ; FIELD - Field number
+4 ; IENS - FDA entry number (ex: "2169,")
+5 ; ARRAY - FDA array containing local data (full global ref)
+6 ; (ie: ARRAY(File,IENS,Field) = Value)
+7 ; All variables denoted in VAFCMGB routine
+8 ;Output : 1 = Local & remote data are different
+9 ; 0 = Local & remote data are not different
+10 ;Notes : Existance/validity of input variables is assumed
+11 ; : ARRAY() is the ouput of the call to GETDATA^VAFCMGU0()
+12 ; : If VAFCARR(File,Field) is undefined, NULL, or has a value of
+13 ; "^text" a difference is not found (prevents overwritting of
+14 ; local data)
+15 ; : If VAFCARR(File,Field) is "@" and ARRAY(File,IENS,Field) is
+16 ; NULL or does not exist a difference is not found (prevents
+17 ; deletion of nothing)
+18 ; : Phone numbers are converted to HL7 format for comparison
+19 ; : Social security numbers are compared with dashes removed
+20 ; : Dates are converted to FileMan format for comparison
+21 ;
+22 ;Declare variables
+23 NEW LOCAL,REMOTE,QUOTE
+24 SET QUOTE=$CHAR(34)
+25 ;Get local data
+26 SET LOCAL=$GET(@ARRAY@(FILE,IENS,FIELD))
+27 ;Get remote data
+28 SET REMOTE=$PIECE($GET(@VAFCARR@(FILE,FIELD)),U)
+29 ;S:$E(REMOTE)=U&($P(REMOTE,U,2)]"") REMOTE=$P(REMOTE,U,2)
+30 ;S:$P(REMOTE,U)=""&('$P(REMOTE,U,2)) REMOTE=""
+31 ;S:$P(REMOTE,U)]"" REMOTE=$P(REMOTE,U)
+32 ;Screen for remote value of NULL - return no diff
+33 IF (REMOTE="")
QUIT 0
+34 ;Screen for remote value of "^text" - return no diff
+35 IF (REMOTE=(QUOTE_"^"))
QUIT 0
+36 ;Screen for remote value of "@" and no local value - return no diff
+37 IF ((REMOTE=(QUOTE_"@"_QUOTE))&(LOCAL=""))
QUIT 0
+38 ;Convert phone numbers to HL7 format
+39 IF ((FIELD=.131)!(FIELD=.132)!(FIELD=.219))
IF (FILE=2)
Begin DoDot:1
+40 SET LOCAL=$$HLPHONE^HLFNC(LOCAL)
+41 SET REMOTE=$$HLPHONE^HLFNC(REMOTE)
End DoDot:1
+42 ;Remove dashes from SSN
+43 IF (FIELD=.09)
IF (FILE=2)
Begin DoDot:1
+44 SET LOCAL=$TRANSLATE(LOCAL,"-","")
+45 SET REMOTE=$TRANSLATE(REMOTE,"-","")
End DoDot:1
+46 ;Convert dates to FileMan format (remote dates already in FM format)
+47 IF ((FIELD=.03)!(FIELD=.351))
IF (FILE=2)
Begin DoDot:1
+48 SET LOCAL=$$EX2INDT^VAFCMGU0(LOCAL)
End DoDot:1
+49 ;*477
IF (FIELD=.3612)
IF (FILE=2)
Begin DoDot:1
+50 SET LOCAL=$$EX2INDT^VAFCMGU0(LOCAL)
+51 ;convert hl7 to fileman date
IF $LENGTH(REMOTE)>7
SET REMOTE=$$HL7TFM^XLFDT(REMOTE)
End DoDot:1
+52 ;Convert zip+4 to fileman format
+53 ;I (FIELD=.1112) I (FILE=2) D ;**255 **479
+54 ;.S LOCAL=$TR(LOCAL,"-","")
+55 ;.S REMOTE=$TR(REMOTE,"-","")
+56 ;Done - return comparison of local & remote data
+57 QUIT ('(LOCAL=REMOTE))
+58 ;
GROUP1 ;Line tag to build logical group number one
+1 ;
+2 ;Group one contains the following fields:
+3 ; .01, .03, .09, .351
+4 ;
+5 ;Column width is limited to 30 characters
+6 ;
+7 ;Declare variables
+8 NEW IENS,TARGET,MESSAGE,LINE,DATA,LOCAL,REMOTE,DIFF
+9 SET TARGET="^TMP(""VAFC-MERGE-TO"","_$JOB_",""DATA"")"
+10 SET MESSAGE="^TMP(""VAFC-MERGE-TO"","_$JOB_",""MESSAGE"")"
+11 ;Initialize global locations
+12 KILL @TARGET,@MESSAGE
+13 ;Set group index
+14 SET @VALMAR@("GRP",1)=VALMCNT
+15 ;Get local data for patient
+16 DO GETDATA^VAFCMGU0(VAFCDFN,1,TARGET,MESSAGE)
+17 ;Build display
+18 SET IENS=VAFCDFN_","
+19 ;Name
+20 SET LOCAL=$$LOCAL(2,.01,IENS,TARGET)
+21 SET LOCAL=$EXTRACT(LOCAL,1,30)
+22 SET REMOTE=$$REMOTE(2,.01)
+23 SET REMOTE=$EXTRACT(REMOTE,1,30)
+24 SET DIFF=$$DIFFCHK(2,.01,IENS,TARGET)
+25 SET LINE=$SELECT(DIFF:"**",1:" ")_" 1"
+26 ;**477 flag name if different - no longer auto updated
IF DIFF&($PIECE($GET(@VAFCARR@(2,.01)),U,2))
SET LINE="->"_" 1"
+27 SET DATA="Name: "_LOCAL
+28 SET LINE=$$INSERT^VAFCMGU0(DATA,LINE,8)
+29 SET @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
+30 SET @VALMAR@("IDX",VALMCNT,1)=""
+31 IF (DIFF)
Begin DoDot:1
+32 SET @VALMAR@("E2F",1,1)="2^.01"
+33 SET @VALMAR@("E2G",1)=1
End DoDot:1
+34 IF ('DIFF)
Begin DoDot:1
+35 KILL @VALMAR@("E2F",1)
+36 KILL @VALMAR@("E2G",1)
End DoDot:1
+37 IF (+$GET(VAFCDOTS))
WRITE "."
+38 SET VALMCNT=VALMCNT+1
+39 ;SSN
+40 SET LOCAL=$$LOCAL(2,.09,IENS,TARGET)
+41 SET REMOTE=$$REMOTE(2,.09)
+42 SET DIFF=$$DIFFCHK(2,.09,IENS,TARGET)
+43 SET LINE=$SELECT(DIFF:"**",1:" ")_" 2"
+44 IF DIFF&($PIECE($GET(@VAFCARR@(2,.09)),U,2))
SET LINE="->"_" 2"
+45 SET DATA="SSN: "_LOCAL
+46 SET LINE=$$INSERT^VAFCMGU0(DATA,LINE,9)
+47 SET @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
+48 SET @VALMAR@("IDX",VALMCNT,2)=""
+49 IF (DIFF)
Begin DoDot:1
+50 SET @VALMAR@("E2F",2,1)="2^.09"
+51 SET @VALMAR@("E2G",2)=1
End DoDot:1
+52 IF ('DIFF)
Begin DoDot:1
+53 KILL @VALMAR@("E2F",2)
+54 KILL @VALMAR@("E2G",2)
End DoDot:1
+55 IF (+$GET(VAFCDOTS))
WRITE "."
+56 SET VALMCNT=VALMCNT+1
+57 ;Date of birth
+58 SET LOCAL=$$LOCAL(2,.03,IENS,TARGET)
+59 SET LOCAL=$PIECE(LOCAL,"@",1)
+60 SET REMOTE=$$REMOTE(2,.03)
+61 SET REMOTE=$PIECE(REMOTE,"@",1)
+62 SET DIFF=$$DIFFCHK(2,.03,IENS,TARGET)
+63 SET LINE=$SELECT(DIFF:"**",1:" ")_" 3"
+64 IF DIFF&($PIECE($GET(@VAFCARR@(2,.03)),U,2))
SET LINE="->"_" 3"
+65 SET DATA="DOB: "_LOCAL
+66 SET LINE=$$INSERT^VAFCMGU0(DATA,LINE,9)
+67 SET @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
+68 SET @VALMAR@("IDX",VALMCNT,3)=""
+69 IF (DIFF)
Begin DoDot:1
+70 SET @VALMAR@("E2F",3,1)="2^.03"
+71 SET @VALMAR@("E2G",3)=1
End DoDot:1
+72 IF ('DIFF)
Begin DoDot:1
+73 KILL @VALMAR@("E2F",3)
+74 KILL @VALMAR@("E2G",3)
End DoDot:1
+75 IF (+$GET(VAFCDOTS))
WRITE "."
+76 SET VALMCNT=VALMCNT+1
+77 ;Date of death - strip time
+78 SET LOCAL=$$LOCAL(2,.351,IENS,TARGET)
+79 ;S LOCAL=$P(LOCAL,"@",1) ;**477 time has already been stripped
+80 SET REMOTE=$$REMOTE(2,.351)
+81 ;S REMOTE=$P(REMOTE,"@",1) ;**477 time has already been stripped
+82 SET DIFF=$$DIFFCHK(2,.351,IENS,TARGET)
+83 SET LINE=$SELECT(DIFF:"**",1:" ")_" 4"
+84 IF DIFF&($PIECE($GET(@VAFCARR@(2,.351)),U,2))
SET LINE="->"_" 4"
+85 SET DATA="DOD: "_LOCAL
+86 SET LINE=$$INSERT^VAFCMGU0(DATA,LINE,9)
+87 SET @VALMAR@(VALMCNT,0)=$$INSERT^VAFCMGU0(REMOTE,LINE,48)
+88 SET @VALMAR@("IDX",VALMCNT,4)=""
+89 IF (DIFF)
Begin DoDot:1
+90 SET @VALMAR@("E2F",4,1)="2^.351"
+91 SET @VALMAR@("E2G",4)=1
End DoDot:1
+92 IF ('DIFF)
Begin DoDot:1
+93 KILL @VALMAR@("E2F",4)
+94 KILL @VALMAR@("E2G",4)
End DoDot:1
+95 IF (+$GET(VAFCDOTS))
WRITE "."
+96 SET VALMCNT=VALMCNT+1
+97 QUIT