SDESGETREGA ;ALB/LAB,TAW,LAB,KML,MGD,LAB,RRM - Get registration info JSON format ; Jul 28,2022
;;5.3;SCHEDULING;**799,804,805,809,814,820,823,824**;AUG 13, 1993;Build 3
;;Per VHA Directive 6402, this routine should not be modified
; Documented API's and Integration Agreements
; -------------------------------------------
; Reference to PATIENT in ICR #7030
; Reference to PATIENT in ICR #7029
; Reference to PATIENT in ICR #1476
; Reference to PATIENT in ICR #10035
; Reference to SCHEDULED ADMISSION in ICR #4425
Q
;
GETREGA(SDECY,DFN,SDEAS) ;return basic reg info/demographics for given patient in JSON format
;Input Parameter:
; DFN - Patient ID - Pointer to PATIENT file
; SDEAS - [optional] Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
;Returns:
; json formatted output (need to add)
NEW POP,SDINFO,SDDFN,SDPATARR,SDDEMO,PRACE,PRACEN,PETH,PETHN,SDMHP,SDPCP,GAF,GAFR,SDZIP,PREREGTIM
S POP=0
D VALIDATE D:POP BUILDER Q:POP
D GETREG
D BUILDER
Q
;
VALIDATE ;validate input Parameter
I +DFN=0 S POP=1 D ERRLOG^SDESJSON(.SDINFO,1) Q
I '$D(^DPT(DFN,0)) S POP=1 D ERRLOG^SDESJSON(.SDINFO,2)
S SDEAS=$G(SDEAS,"")
I $L(SDEAS) S SDEAS=$$EASVALIDATE^SDESUTIL(SDEAS)
I $G(SDEAS)=-1 S POP=1 D ERRLOG^SDESJSON(.SDINFO,142)
Q
;
BUILDER ;Convert data to JSON
N JSONERR
S JSONERR=""
D ENCODE^SDESJSON(.SDINFO,.SDECY,.JSONERR)
Q
;
ASSIGNVALS ;assign values to be used to build output
; assign data values
;
N PREREGTIMIEN
S SDDFN=DFN_",",PREREGTIM=""
D GETS^DIQ(2,SDDFN,".1;.116;.2203;.2207;.331;.332;.333;.334;.335;.336;.337;.338;.339;.1219;.1151;.1152;.1153;.1154;.1155;.1156;.1173;.1223;.2201;.33011","E","SDPATARR")
D PDEMO^SDECU3(.SDDEMO,DFN)
D RACELST^SDECU2(DFN,.PRACE,.PRACEN)
D ETH^SDECU2(DFN,.PETH,.PETHN) ;get ethnicity
S SDMHP=$$START^SCMCMHTC(DFN) ;Return Mental Health Provider
S SDPCP=$$OUTPTPR^SDUTL3(DFN) ;Return Primary Care Provider
S GAF=$$NEWGAF^SDUTL2(DFN)
S GAFR=""
S:GAF="" GAF=-1
S $P(GAFR,"|",1)=$S(+GAF:"New GAF Required",1:"No new GAF required")
S PREREGTIMIEN=$O(^DGS(41.41,"B",DFN,"A"),-1)
I PREREGTIMIEN'="" D
. S PREREGTIM=$$FMTISO^SDAMUTDT($$GET1^DIQ(41.41,PREREGTIMIEN_",",1,"I"))
Q
;
GETREG ;
S SDINFO("Patient","DataFileNumber")=DFN
S SDINFO("Patient","ICN")=$$GETPATICN^SDESINPUTVALUTL(DFN)
D ASSIGNVALS ;assign all values needed to build SDINFO array
;
;person identification information
;
S SDINFO("Patient","Name")=SDDEMO("NAME")
S SDINFO("Patient","SocialSecurityNumber")=$$GET1^DIQ(2,DFN_",",.09,"E")
S SDINFO("Patient","DateOfBirth")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.03,"I")) ;vse-2500 IA 10035
S SDINFO("Patient","Race","IEN")=$G(PRACE)
S SDINFO("Patient","Race","Name")=$G(PRACEN)
S SDINFO("Patient","Ethnicity","IEN")=$G(PETH)
S SDINFO("Patient","Ethnicity","Name")=$G(PETHN)
S SDINFO("Patient","Sex")=SDDEMO("GENDER")
S SDINFO("Patient","Security")=$$PTSEC^SDECUTL(DFN)
S SDINFO("Patient","Marital")=SDDEMO("PMARITAL")
S SDINFO("Patient","Religion")=SDDEMO("PRELIGION")
S SDINFO("Patient","TimeStamp")=PREREGTIM
;
;health information
;
S SDINFO("Patient","PrimaryCareProvider")=$P(SDPCP,"^",2)
S SDINFO("Patient","ServiceConnected")=SDDEMO("SVCCONN")
S SDINFO("Patient","ServiceConnectedPercentage")=SDDEMO("SVCCONNP")
S SDINFO("Patient","Ward")=$G(SDPATARR(2,SDDFN,.1,"E"))
S SDINFO("Patient","HealthRecordNumber")=SDDEMO("HRN")
S SDINFO("Patient","MentalHealthProvider")=$P(SDMHP,"^",2)
;
;flags
;
S SDINFO("Patient","FugitiveFlag")=SDDEMO("PF_FFF")
S SDINFO("Patient","VeteranCatastrophicallyDisabled")=SDDEMO("PF_VCD")
S SDINFO("Patient","NationalFlag")=SDDEMO("PFNATIONAL")
S SDINFO("Patient","LocalFlag")=SDDEMO("PFLOCAL")
S SDINFO("Patient","EnrollmentSubgroup")=SDDEMO("SUBGRP")
S SDINFO("Patient","Category8GFlag")=(SDDEMO("PRIGRP")="GROUP 8")&(SDDEMO("SUBGRP")="g")
S SDINFO("Patient","SimilarPatients")=SDDEMO("SIMILAR")
S SDINFO("Patient","PriorityGroup")=SDDEMO("PRIGRP")
S SDINFO("Patient","GAFRequired")=$G(GAFR)
;
;contact information
;
S SDINFO("Patient","Cell")=SDDEMO("PCELL")
S SDINFO("Patient","Email")=SDDEMO("PEMAIL")
S SDINFO("Patient","HomePhone")=SDDEMO("HPHONE")
S SDINFO("Patient","OfficePhone")=SDDEMO("OPHONE")
;
;mail address information
;
S SDINFO("Patient","MailingAddress","Street1")=SDDEMO("PADDRES1")
S SDINFO("Patient","MailingAddress","Street2")=SDDEMO("PADDRES2")
S SDINFO("Patient","MailingAddress","Street3")=SDDEMO("PADDRES3")
S SDINFO("Patient","MailingAddress","City")=SDDEMO("PCITY")
S SDINFO("Patient","MailingAddress","State")=SDDEMO("PSTATE")
S SDINFO("Patient","MailingAddress","County")=SDDEMO("PCOUNTY")
S SDINFO("Patient","MailingAddress","Country")=SDDEMO("PCOUNTRY")
S SDINFO("Patient","MailingAddress","CountryName")=$G(SDPATARR(2,SDDFN,.1173,"E"))
S SDINFO("Patient","MailingAddress","Zip4")=SDDEMO("PZIP+4")
S SDINFO("Patient","MailingAddress","Zip")=$G(SDPATARR(2,SDDFN,.116,"E"))
S SDINFO("Patient","AddressIndicator")=SDDEMO("BADADD")
;
;Residential Address Info
;
S SDINFO("Patient","ResidentialAddress","Address1")=$G(SDPATARR(2,SDDFN,.1151,"E"))
S SDINFO("Patient","ResidentialAddress","Address2")=$G(SDPATARR(2,SDDFN,.1152,"E"))
S SDINFO("Patient","ResidentialAddress","Address3")=$G(SDPATARR(2,SDDFN,.1153,"E"))
S SDINFO("Patient","ResidentialAddress","City")=$G(SDPATARR(2,SDDFN,.1154,"E"))
S SDINFO("Patient","ResidentialAddress","State")=$G(SDPATARR(2,SDDFN,.1155,"E"))
S SDINFO("Patient","ResidentialAddress","Zip4")=$G(SDPATARR(2,SDDFN,.1156,"E"))
;S SDINFO("Patient","ResidentialAddress","Zip")=$G(SDPATARR(2,SDDFN,.1156,"E"))
;
;Temp Address information
;
S SDINFO("Patient","TemporaryAddress","Address1")=SDDEMO("PTADDRESS1")
S SDINFO("Patient","TemporaryAddress","Address2")=SDDEMO("PTADDRESS2")
S SDINFO("Patient","TemporaryAddress","Address3")=SDDEMO("PTADDRESS3")
S SDINFO("Patient","TemporaryAddress","City")=SDDEMO("PTCITY")
S SDINFO("Patient","TemporaryAddress","State")=SDDEMO("PTSTATE")
S SDINFO("Patient","TemporaryAddress","Zip")=SDDEMO("PTZIP")
S SDINFO("Patient","TemporaryAddress","Zip4")=SDDEMO("PTZIP+4")
S SDINFO("Patient","TemporaryAddress","Country")=SDDEMO("PTCOUNTRY")
S SDINFO("Patient","TemporaryAddress","CountryName")=$G(SDPATARR(2,SDDFN,.1223,"E"))
S SDINFO("Patient","TemporaryAddress","County")=SDDEMO("PTCOUNTY")
S SDINFO("Patient","TemporaryAddressStart")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.1217,"I")) ;vse-2500 IA 7019
S SDINFO("Patient","TemporaryAddressEnd")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.1218,"I")) ;vse-2500 IA 7019
S SDINFO("Patient","TemporaryPhone")=$G(SDPATARR(2,SDDFN,.1219,"E"))
;
;Primary Next Of Kin Information
;
S SDINFO("Patient","PrimaryNextOfKin","Name")=SDDEMO("NOK")
S SDINFO("Patient","PrimaryNextOfKin","Relationship")=SDDEMO("KREL")
S SDINFO("Patient","PrimaryNextOfKin","Phone")=SDDEMO("KPHONE")
S SDINFO("Patient","PrimaryNextOfKin","Address","Address")=SDDEMO("KSTREET")
S SDINFO("Patient","PrimaryNextOfKin","Address","City")=SDDEMO("KCITY")
S SDINFO("Patient","PrimaryNextOfKin","Address","State")=SDDEMO("KSTATE")
S SDINFO("Patient","PrimaryNextOfKin","Address","Zip")=SDDEMO("KZIP")
S SDINFO("Patient","PrimaryNextOfKin","Address","street2")=SDDEMO("KSTREET2")
S SDINFO("Patient","PrimaryyNextOfKin","Address","Street3")=SDDEMO("KSTREET3")
S SDINFO("Patient","PrimaryNextOfKin","Address","Zip4")=$G(SDPATARR(2,SDDFN,.2207,"E"))
;
;Secondary Next of Kin Information
;
S SDINFO("Patient","SecondaryNextOfKin","Name")=SDDEMO("K2NAME")
S SDINFO("Patient","SecondaryNextOfKin","Relationship")=SDDEMO("K2REL")
S SDINFO("Patient","SecondaryNextOfKin","Phone")=SDDEMO("K2PHONE")
S SDINFO("Patient","SecondaryNextOfKin","Address","Street")=SDDEMO("K2STREET")
S SDINFO("Patient","SecondaryNextOfKin","Address","Street2")=SDDEMO("K2STREET2")
S SDINFO("Patient","SecondaryNextOfKin","Address","Street3")=SDDEMO("K2STREET3")
S SDINFO("Patient","SecondaryNextOfKin","Address","City")=SDDEMO("K2CITY")
S SDINFO("Patient","SecondaryNextOfKin","Address","State")=SDDEMO("K2STATE")
S SDINFO("Patient","SecondaryNextOfKin","Address","Zip")=SDDEMO("K2ZIP")
S SDINFO("Patient","SecondaryNextOfKin","Address","Zip4")=$G(SDPATARR(2,SDDFN,.2203,"E"))
;
; Emergency Contact
;
S SDINFO("Patient","EmergencyContact","Name")=$G(SDPATARR(2,SDDFN,.331,"E"))
S SDINFO("Patient","EmergencyContact","Relationship")=$G(SDPATARR(2,SDDFN,.332,"E"))
S SDINFO("Patient","EmergencyContact","Phone")=$G(SDPATARR(2,SDDFN,.339,"E"))
S SDINFO("Patient","EmergencyContact","WorkPhone")=$G(SDPATARR(2,SDDFN,.33011,"E"))
S SDINFO("Patient","EmergencyContact","Address","Street")=$G(SDPATARR(2,SDDFN,.333,"E"))
S SDINFO("Patient","EmergencyContact","Address","Street2")=$G(SDPATARR(2,SDDFN,.334,"E"))
S SDINFO("Patient","EmergencyContact","Address","Street3")=$G(SDPATARR(2,SDDFN,.335,"E"))
S SDINFO("Patient","EmergencyContact","Address","City")=$G(SDPATARR(2,SDDFN,.336,"E"))
S SDINFO("Patient","EmergencyContact","Address","State")=$G(SDPATARR(2,SDDFN,.337,"E"))
S SDINFO("Patient","EmergencyContact","Address","Zip")=$G(SDPATARR(2,SDDFN,.338,"E"))
S SDINFO("Patient","EmergencyContact","Address","Zip4")=$G(SDPATARR(2,SDDFN,.2201,"E"))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESGETREGA 9401 printed Dec 13, 2024@02:57:03 Page 2
SDESGETREGA ;ALB/LAB,TAW,LAB,KML,MGD,LAB,RRM - Get registration info JSON format ; Jul 28,2022
+1 ;;5.3;SCHEDULING;**799,804,805,809,814,820,823,824**;AUG 13, 1993;Build 3
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ; Documented API's and Integration Agreements
+4 ; -------------------------------------------
+5 ; Reference to PATIENT in ICR #7030
+6 ; Reference to PATIENT in ICR #7029
+7 ; Reference to PATIENT in ICR #1476
+8 ; Reference to PATIENT in ICR #10035
+9 ; Reference to SCHEDULED ADMISSION in ICR #4425
+10 QUIT
+11 ;
GETREGA(SDECY,DFN,SDEAS) ;return basic reg info/demographics for given patient in JSON format
+1 ;Input Parameter:
+2 ; DFN - Patient ID - Pointer to PATIENT file
+3 ; SDEAS - [optional] Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
+4 ;Returns:
+5 ; json formatted output (need to add)
+6 NEW POP,SDINFO,SDDFN,SDPATARR,SDDEMO,PRACE,PRACEN,PETH,PETHN,SDMHP,SDPCP,GAF,GAFR,SDZIP,PREREGTIM
+7 SET POP=0
+8 DO VALIDATE
if POP
DO BUILDER
if POP
QUIT
+9 DO GETREG
+10 DO BUILDER
+11 QUIT
+12 ;
VALIDATE ;validate input Parameter
+1 IF +DFN=0
SET POP=1
DO ERRLOG^SDESJSON(.SDINFO,1)
QUIT
+2 IF '$DATA(^DPT(DFN,0))
SET POP=1
DO ERRLOG^SDESJSON(.SDINFO,2)
+3 SET SDEAS=$GET(SDEAS,"")
+4 IF $LENGTH(SDEAS)
SET SDEAS=$$EASVALIDATE^SDESUTIL(SDEAS)
+5 IF $GET(SDEAS)=-1
SET POP=1
DO ERRLOG^SDESJSON(.SDINFO,142)
+6 QUIT
+7 ;
BUILDER ;Convert data to JSON
+1 NEW JSONERR
+2 SET JSONERR=""
+3 DO ENCODE^SDESJSON(.SDINFO,.SDECY,.JSONERR)
+4 QUIT
+5 ;
ASSIGNVALS ;assign values to be used to build output
+1 ; assign data values
+2 ;
+3 NEW PREREGTIMIEN
+4 SET SDDFN=DFN_","
SET PREREGTIM=""
+5 DO GETS^DIQ(2,SDDFN,".1;.116;.2203;.2207;.331;.332;.333;.334;.335;.336;.337;.338;.339;.1219;.1151;.1152;.1153;.1154;.1155;.1156;.1173;.1223;.2201;.33011","E","SDPATARR")
+6 DO PDEMO^SDECU3(.SDDEMO,DFN)
+7 DO RACELST^SDECU2(DFN,.PRACE,.PRACEN)
+8 ;get ethnicity
DO ETH^SDECU2(DFN,.PETH,.PETHN)
+9 ;Return Mental Health Provider
SET SDMHP=$$START^SCMCMHTC(DFN)
+10 ;Return Primary Care Provider
SET SDPCP=$$OUTPTPR^SDUTL3(DFN)
+11 SET GAF=$$NEWGAF^SDUTL2(DFN)
+12 SET GAFR=""
+13 if GAF=""
SET GAF=-1
+14 SET $PIECE(GAFR,"|",1)=$SELECT(+GAF:"New GAF Required",1:"No new GAF required")
+15 SET PREREGTIMIEN=$ORDER(^DGS(41.41,"B",DFN,"A"),-1)
+16 IF PREREGTIMIEN'=""
Begin DoDot:1
+17 SET PREREGTIM=$$FMTISO^SDAMUTDT($$GET1^DIQ(41.41,PREREGTIMIEN_",",1,"I"))
End DoDot:1
+18 QUIT
+19 ;
GETREG ;
+1 SET SDINFO("Patient","DataFileNumber")=DFN
+2 SET SDINFO("Patient","ICN")=$$GETPATICN^SDESINPUTVALUTL(DFN)
+3 ;assign all values needed to build SDINFO array
DO ASSIGNVALS
+4 ;
+5 ;person identification information
+6 ;
+7 SET SDINFO("Patient","Name")=SDDEMO("NAME")
+8 SET SDINFO("Patient","SocialSecurityNumber")=$$GET1^DIQ(2,DFN_",",.09,"E")
+9 ;vse-2500 IA 10035
SET SDINFO("Patient","DateOfBirth")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.03,"I"))
+10 SET SDINFO("Patient","Race","IEN")=$GET(PRACE)
+11 SET SDINFO("Patient","Race","Name")=$GET(PRACEN)
+12 SET SDINFO("Patient","Ethnicity","IEN")=$GET(PETH)
+13 SET SDINFO("Patient","Ethnicity","Name")=$GET(PETHN)
+14 SET SDINFO("Patient","Sex")=SDDEMO("GENDER")
+15 SET SDINFO("Patient","Security")=$$PTSEC^SDECUTL(DFN)
+16 SET SDINFO("Patient","Marital")=SDDEMO("PMARITAL")
+17 SET SDINFO("Patient","Religion")=SDDEMO("PRELIGION")
+18 SET SDINFO("Patient","TimeStamp")=PREREGTIM
+19 ;
+20 ;health information
+21 ;
+22 SET SDINFO("Patient","PrimaryCareProvider")=$PIECE(SDPCP,"^",2)
+23 SET SDINFO("Patient","ServiceConnected")=SDDEMO("SVCCONN")
+24 SET SDINFO("Patient","ServiceConnectedPercentage")=SDDEMO("SVCCONNP")
+25 SET SDINFO("Patient","Ward")=$GET(SDPATARR(2,SDDFN,.1,"E"))
+26 SET SDINFO("Patient","HealthRecordNumber")=SDDEMO("HRN")
+27 SET SDINFO("Patient","MentalHealthProvider")=$PIECE(SDMHP,"^",2)
+28 ;
+29 ;flags
+30 ;
+31 SET SDINFO("Patient","FugitiveFlag")=SDDEMO("PF_FFF")
+32 SET SDINFO("Patient","VeteranCatastrophicallyDisabled")=SDDEMO("PF_VCD")
+33 SET SDINFO("Patient","NationalFlag")=SDDEMO("PFNATIONAL")
+34 SET SDINFO("Patient","LocalFlag")=SDDEMO("PFLOCAL")
+35 SET SDINFO("Patient","EnrollmentSubgroup")=SDDEMO("SUBGRP")
+36 SET SDINFO("Patient","Category8GFlag")=(SDDEMO("PRIGRP")="GROUP 8")&(SDDEMO("SUBGRP")="g")
+37 SET SDINFO("Patient","SimilarPatients")=SDDEMO("SIMILAR")
+38 SET SDINFO("Patient","PriorityGroup")=SDDEMO("PRIGRP")
+39 SET SDINFO("Patient","GAFRequired")=$GET(GAFR)
+40 ;
+41 ;contact information
+42 ;
+43 SET SDINFO("Patient","Cell")=SDDEMO("PCELL")
+44 SET SDINFO("Patient","Email")=SDDEMO("PEMAIL")
+45 SET SDINFO("Patient","HomePhone")=SDDEMO("HPHONE")
+46 SET SDINFO("Patient","OfficePhone")=SDDEMO("OPHONE")
+47 ;
+48 ;mail address information
+49 ;
+50 SET SDINFO("Patient","MailingAddress","Street1")=SDDEMO("PADDRES1")
+51 SET SDINFO("Patient","MailingAddress","Street2")=SDDEMO("PADDRES2")
+52 SET SDINFO("Patient","MailingAddress","Street3")=SDDEMO("PADDRES3")
+53 SET SDINFO("Patient","MailingAddress","City")=SDDEMO("PCITY")
+54 SET SDINFO("Patient","MailingAddress","State")=SDDEMO("PSTATE")
+55 SET SDINFO("Patient","MailingAddress","County")=SDDEMO("PCOUNTY")
+56 SET SDINFO("Patient","MailingAddress","Country")=SDDEMO("PCOUNTRY")
+57 SET SDINFO("Patient","MailingAddress","CountryName")=$GET(SDPATARR(2,SDDFN,.1173,"E"))
+58 SET SDINFO("Patient","MailingAddress","Zip4")=SDDEMO("PZIP+4")
+59 SET SDINFO("Patient","MailingAddress","Zip")=$GET(SDPATARR(2,SDDFN,.116,"E"))
+60 SET SDINFO("Patient","AddressIndicator")=SDDEMO("BADADD")
+61 ;
+62 ;Residential Address Info
+63 ;
+64 SET SDINFO("Patient","ResidentialAddress","Address1")=$GET(SDPATARR(2,SDDFN,.1151,"E"))
+65 SET SDINFO("Patient","ResidentialAddress","Address2")=$GET(SDPATARR(2,SDDFN,.1152,"E"))
+66 SET SDINFO("Patient","ResidentialAddress","Address3")=$GET(SDPATARR(2,SDDFN,.1153,"E"))
+67 SET SDINFO("Patient","ResidentialAddress","City")=$GET(SDPATARR(2,SDDFN,.1154,"E"))
+68 SET SDINFO("Patient","ResidentialAddress","State")=$GET(SDPATARR(2,SDDFN,.1155,"E"))
+69 SET SDINFO("Patient","ResidentialAddress","Zip4")=$GET(SDPATARR(2,SDDFN,.1156,"E"))
+70 ;S SDINFO("Patient","ResidentialAddress","Zip")=$G(SDPATARR(2,SDDFN,.1156,"E"))
+71 ;
+72 ;Temp Address information
+73 ;
+74 SET SDINFO("Patient","TemporaryAddress","Address1")=SDDEMO("PTADDRESS1")
+75 SET SDINFO("Patient","TemporaryAddress","Address2")=SDDEMO("PTADDRESS2")
+76 SET SDINFO("Patient","TemporaryAddress","Address3")=SDDEMO("PTADDRESS3")
+77 SET SDINFO("Patient","TemporaryAddress","City")=SDDEMO("PTCITY")
+78 SET SDINFO("Patient","TemporaryAddress","State")=SDDEMO("PTSTATE")
+79 SET SDINFO("Patient","TemporaryAddress","Zip")=SDDEMO("PTZIP")
+80 SET SDINFO("Patient","TemporaryAddress","Zip4")=SDDEMO("PTZIP+4")
+81 SET SDINFO("Patient","TemporaryAddress","Country")=SDDEMO("PTCOUNTRY")
+82 SET SDINFO("Patient","TemporaryAddress","CountryName")=$GET(SDPATARR(2,SDDFN,.1223,"E"))
+83 SET SDINFO("Patient","TemporaryAddress","County")=SDDEMO("PTCOUNTY")
+84 ;vse-2500 IA 7019
SET SDINFO("Patient","TemporaryAddressStart")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.1217,"I"))
+85 ;vse-2500 IA 7019
SET SDINFO("Patient","TemporaryAddressEnd")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.1218,"I"))
+86 SET SDINFO("Patient","TemporaryPhone")=$GET(SDPATARR(2,SDDFN,.1219,"E"))
+87 ;
+88 ;Primary Next Of Kin Information
+89 ;
+90 SET SDINFO("Patient","PrimaryNextOfKin","Name")=SDDEMO("NOK")
+91 SET SDINFO("Patient","PrimaryNextOfKin","Relationship")=SDDEMO("KREL")
+92 SET SDINFO("Patient","PrimaryNextOfKin","Phone")=SDDEMO("KPHONE")
+93 SET SDINFO("Patient","PrimaryNextOfKin","Address","Address")=SDDEMO("KSTREET")
+94 SET SDINFO("Patient","PrimaryNextOfKin","Address","City")=SDDEMO("KCITY")
+95 SET SDINFO("Patient","PrimaryNextOfKin","Address","State")=SDDEMO("KSTATE")
+96 SET SDINFO("Patient","PrimaryNextOfKin","Address","Zip")=SDDEMO("KZIP")
+97 SET SDINFO("Patient","PrimaryNextOfKin","Address","street2")=SDDEMO("KSTREET2")
+98 SET SDINFO("Patient","PrimaryyNextOfKin","Address","Street3")=SDDEMO("KSTREET3")
+99 SET SDINFO("Patient","PrimaryNextOfKin","Address","Zip4")=$GET(SDPATARR(2,SDDFN,.2207,"E"))
+100 ;
+101 ;Secondary Next of Kin Information
+102 ;
+103 SET SDINFO("Patient","SecondaryNextOfKin","Name")=SDDEMO("K2NAME")
+104 SET SDINFO("Patient","SecondaryNextOfKin","Relationship")=SDDEMO("K2REL")
+105 SET SDINFO("Patient","SecondaryNextOfKin","Phone")=SDDEMO("K2PHONE")
+106 SET SDINFO("Patient","SecondaryNextOfKin","Address","Street")=SDDEMO("K2STREET")
+107 SET SDINFO("Patient","SecondaryNextOfKin","Address","Street2")=SDDEMO("K2STREET2")
+108 SET SDINFO("Patient","SecondaryNextOfKin","Address","Street3")=SDDEMO("K2STREET3")
+109 SET SDINFO("Patient","SecondaryNextOfKin","Address","City")=SDDEMO("K2CITY")
+110 SET SDINFO("Patient","SecondaryNextOfKin","Address","State")=SDDEMO("K2STATE")
+111 SET SDINFO("Patient","SecondaryNextOfKin","Address","Zip")=SDDEMO("K2ZIP")
+112 SET SDINFO("Patient","SecondaryNextOfKin","Address","Zip4")=$GET(SDPATARR(2,SDDFN,.2203,"E"))
+113 ;
+114 ; Emergency Contact
+115 ;
+116 SET SDINFO("Patient","EmergencyContact","Name")=$GET(SDPATARR(2,SDDFN,.331,"E"))
+117 SET SDINFO("Patient","EmergencyContact","Relationship")=$GET(SDPATARR(2,SDDFN,.332,"E"))
+118 SET SDINFO("Patient","EmergencyContact","Phone")=$GET(SDPATARR(2,SDDFN,.339,"E"))
+119 SET SDINFO("Patient","EmergencyContact","WorkPhone")=$GET(SDPATARR(2,SDDFN,.33011,"E"))
+120 SET SDINFO("Patient","EmergencyContact","Address","Street")=$GET(SDPATARR(2,SDDFN,.333,"E"))
+121 SET SDINFO("Patient","EmergencyContact","Address","Street2")=$GET(SDPATARR(2,SDDFN,.334,"E"))
+122 SET SDINFO("Patient","EmergencyContact","Address","Street3")=$GET(SDPATARR(2,SDDFN,.335,"E"))
+123 SET SDINFO("Patient","EmergencyContact","Address","City")=$GET(SDPATARR(2,SDDFN,.336,"E"))
+124 SET SDINFO("Patient","EmergencyContact","Address","State")=$GET(SDPATARR(2,SDDFN,.337,"E"))
+125 SET SDINFO("Patient","EmergencyContact","Address","Zip")=$GET(SDPATARR(2,SDDFN,.338,"E"))
+126 SET SDINFO("Patient","EmergencyContact","Address","Zip4")=$GET(SDPATARR(2,SDDFN,.2201,"E"))
+127 QUIT