SDESGETREGA1 ;ALB/LAB,RRM,ANU,DJS - Get registration info JSON format ; July 29, 2023
;;5.3;SCHEDULING;**823,824,853**;AUG 13, 1993;Build 9
;;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
;
;Cloned from SDESGETREGA for new version
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,SDDOD
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 ;
N PATIENTLIST
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")=SDDEMO("SSN")
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"))
; 853
; Elig
;
D GETELIGIBILITY^SDESPATSEARCH(.PATIENTLIST,DFN,1)
M SDINFO("Patient")=PATIENTLIST("Patient",1)
;
; 853
; Date Of Death
;
S SDDOD=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.351,"I")),SDDOD=$E(SDDOD,1,10)
S SDINFO("Patient","DateOfDeath")=SDDOD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESGETREGA1 9703 printed Dec 13, 2024@02:57:04 Page 2
SDESGETREGA1 ;ALB/LAB,RRM,ANU,DJS - Get registration info JSON format ; July 29, 2023
+1 ;;5.3;SCHEDULING;**823,824,853**;AUG 13, 1993;Build 9
+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 ;
+11 ;Cloned from SDESGETREGA for new version
+12 QUIT
+13 ;
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,SDDOD
+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 NEW PATIENTLIST
+2 SET SDINFO("Patient","DataFileNumber")=DFN
+3 SET SDINFO("Patient","ICN")=$$GETPATICN^SDESINPUTVALUTL(DFN)
+4 ;assign all values needed to build SDINFO array
DO ASSIGNVALS
+5 ;
+6 ;person identification information
+7 ;
+8 SET SDINFO("Patient","Name")=SDDEMO("NAME")
+9 SET SDINFO("Patient","SocialSecurityNumber")=SDDEMO("SSN")
+10 ;vse-2500 IA 10035
SET SDINFO("Patient","DateOfBirth")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.03,"I"))
+11 SET SDINFO("Patient","Race","IEN")=$GET(PRACE)
+12 SET SDINFO("Patient","Race","Name")=$GET(PRACEN)
+13 SET SDINFO("Patient","Ethnicity","IEN")=$GET(PETH)
+14 SET SDINFO("Patient","Ethnicity","Name")=$GET(PETHN)
+15 SET SDINFO("Patient","Sex")=SDDEMO("GENDER")
+16 SET SDINFO("Patient","Security")=$$PTSEC^SDECUTL(DFN)
+17 SET SDINFO("Patient","Marital")=SDDEMO("PMARITAL")
+18 SET SDINFO("Patient","Religion")=SDDEMO("PRELIGION")
+19 SET SDINFO("Patient","TimeStamp")=PREREGTIM
+20 ;
+21 ;health information
+22 ;
+23 SET SDINFO("Patient","PrimaryCareProvider")=$PIECE(SDPCP,"^",2)
+24 SET SDINFO("Patient","ServiceConnected")=SDDEMO("SVCCONN")
+25 SET SDINFO("Patient","ServiceConnectedPercentage")=SDDEMO("SVCCONNP")
+26 SET SDINFO("Patient","Ward")=$GET(SDPATARR(2,SDDFN,.1,"E"))
+27 SET SDINFO("Patient","HealthRecordNumber")=SDDEMO("HRN")
+28 SET SDINFO("Patient","MentalHealthProvider")=$PIECE(SDMHP,"^",2)
+29 ;
+30 ;flags
+31 ;
+32 SET SDINFO("Patient","FugitiveFlag")=SDDEMO("PF_FFF")
+33 SET SDINFO("Patient","VeteranCatastrophicallyDisabled")=SDDEMO("PF_VCD")
+34 SET SDINFO("Patient","NationalFlag")=SDDEMO("PFNATIONAL")
+35 SET SDINFO("Patient","LocalFlag")=SDDEMO("PFLOCAL")
+36 SET SDINFO("Patient","EnrollmentSubgroup")=SDDEMO("SUBGRP")
+37 SET SDINFO("Patient","Category8GFlag")=(SDDEMO("PRIGRP")="GROUP 8")&(SDDEMO("SUBGRP")="g")
+38 SET SDINFO("Patient","SimilarPatients")=SDDEMO("SIMILAR")
+39 SET SDINFO("Patient","PriorityGroup")=SDDEMO("PRIGRP")
+40 SET SDINFO("Patient","GAFRequired")=$GET(GAFR)
+41 ;
+42 ;contact information
+43 ;
+44 SET SDINFO("Patient","Cell")=SDDEMO("PCELL")
+45 SET SDINFO("Patient","Email")=SDDEMO("PEMAIL")
+46 SET SDINFO("Patient","HomePhone")=SDDEMO("HPHONE")
+47 SET SDINFO("Patient","OfficePhone")=SDDEMO("OPHONE")
+48 ;
+49 ;mail address information
+50 ;
+51 SET SDINFO("Patient","MailingAddress","Street1")=SDDEMO("PADDRES1")
+52 SET SDINFO("Patient","MailingAddress","Street2")=SDDEMO("PADDRES2")
+53 SET SDINFO("Patient","MailingAddress","Street3")=SDDEMO("PADDRES3")
+54 SET SDINFO("Patient","MailingAddress","City")=SDDEMO("PCITY")
+55 SET SDINFO("Patient","MailingAddress","State")=SDDEMO("PSTATE")
+56 SET SDINFO("Patient","MailingAddress","County")=SDDEMO("PCOUNTY")
+57 SET SDINFO("Patient","MailingAddress","Country")=SDDEMO("PCOUNTRY")
+58 SET SDINFO("Patient","MailingAddress","CountryName")=$GET(SDPATARR(2,SDDFN,.1173,"E"))
+59 SET SDINFO("Patient","MailingAddress","Zip4")=SDDEMO("PZIP+4")
+60 SET SDINFO("Patient","MailingAddress","Zip")=$GET(SDPATARR(2,SDDFN,.116,"E"))
+61 SET SDINFO("Patient","AddressIndicator")=SDDEMO("BADADD")
+62 ;
+63 ;Residential Address Info
+64 ;
+65 SET SDINFO("Patient","ResidentialAddress","Address1")=$GET(SDPATARR(2,SDDFN,.1151,"E"))
+66 SET SDINFO("Patient","ResidentialAddress","Address2")=$GET(SDPATARR(2,SDDFN,.1152,"E"))
+67 SET SDINFO("Patient","ResidentialAddress","Address3")=$GET(SDPATARR(2,SDDFN,.1153,"E"))
+68 SET SDINFO("Patient","ResidentialAddress","City")=$GET(SDPATARR(2,SDDFN,.1154,"E"))
+69 SET SDINFO("Patient","ResidentialAddress","State")=$GET(SDPATARR(2,SDDFN,.1155,"E"))
+70 SET SDINFO("Patient","ResidentialAddress","Zip4")=$GET(SDPATARR(2,SDDFN,.1156,"E"))
+71 ;S SDINFO("Patient","ResidentialAddress","Zip")=$G(SDPATARR(2,SDDFN,.1156,"E"))
+72 ;
+73 ;Temp Address information
+74 ;
+75 SET SDINFO("Patient","TemporaryAddress","Address1")=SDDEMO("PTADDRESS1")
+76 SET SDINFO("Patient","TemporaryAddress","Address2")=SDDEMO("PTADDRESS2")
+77 SET SDINFO("Patient","TemporaryAddress","Address3")=SDDEMO("PTADDRESS3")
+78 SET SDINFO("Patient","TemporaryAddress","City")=SDDEMO("PTCITY")
+79 SET SDINFO("Patient","TemporaryAddress","State")=SDDEMO("PTSTATE")
+80 SET SDINFO("Patient","TemporaryAddress","Zip")=SDDEMO("PTZIP")
+81 SET SDINFO("Patient","TemporaryAddress","Zip4")=SDDEMO("PTZIP+4")
+82 SET SDINFO("Patient","TemporaryAddress","Country")=SDDEMO("PTCOUNTRY")
+83 SET SDINFO("Patient","TemporaryAddress","CountryName")=$GET(SDPATARR(2,SDDFN,.1223,"E"))
+84 SET SDINFO("Patient","TemporaryAddress","County")=SDDEMO("PTCOUNTY")
+85 ;vse-2500 IA 7019
SET SDINFO("Patient","TemporaryAddressStart")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.1217,"I"))
+86 ;vse-2500 IA 7019
SET SDINFO("Patient","TemporaryAddressEnd")=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.1218,"I"))
+87 SET SDINFO("Patient","TemporaryPhone")=$GET(SDPATARR(2,SDDFN,.1219,"E"))
+88 ;
+89 ;Primary Next Of Kin Information
+90 ;
+91 SET SDINFO("Patient","PrimaryNextOfKin","Name")=SDDEMO("NOK")
+92 SET SDINFO("Patient","PrimaryNextOfKin","Relationship")=SDDEMO("KREL")
+93 SET SDINFO("Patient","PrimaryNextOfKin","Phone")=SDDEMO("KPHONE")
+94 SET SDINFO("Patient","PrimaryNextOfKin","Address","Address")=SDDEMO("KSTREET")
+95 SET SDINFO("Patient","PrimaryNextOfKin","Address","City")=SDDEMO("KCITY")
+96 SET SDINFO("Patient","PrimaryNextOfKin","Address","State")=SDDEMO("KSTATE")
+97 SET SDINFO("Patient","PrimaryNextOfKin","Address","Zip")=SDDEMO("KZIP")
+98 SET SDINFO("Patient","PrimaryNextOfKin","Address","street2")=SDDEMO("KSTREET2")
+99 SET SDINFO("Patient","PrimaryyNextOfKin","Address","Street3")=SDDEMO("KSTREET3")
+100 SET SDINFO("Patient","PrimaryNextOfKin","Address","Zip4")=$GET(SDPATARR(2,SDDFN,.2207,"E"))
+101 ;
+102 ;Secondary Next of Kin Information
+103 ;
+104 SET SDINFO("Patient","SecondaryNextOfKin","Name")=SDDEMO("K2NAME")
+105 SET SDINFO("Patient","SecondaryNextOfKin","Relationship")=SDDEMO("K2REL")
+106 SET SDINFO("Patient","SecondaryNextOfKin","Phone")=SDDEMO("K2PHONE")
+107 SET SDINFO("Patient","SecondaryNextOfKin","Address","Street")=SDDEMO("K2STREET")
+108 SET SDINFO("Patient","SecondaryNextOfKin","Address","Street2")=SDDEMO("K2STREET2")
+109 SET SDINFO("Patient","SecondaryNextOfKin","Address","Street3")=SDDEMO("K2STREET3")
+110 SET SDINFO("Patient","SecondaryNextOfKin","Address","City")=SDDEMO("K2CITY")
+111 SET SDINFO("Patient","SecondaryNextOfKin","Address","State")=SDDEMO("K2STATE")
+112 SET SDINFO("Patient","SecondaryNextOfKin","Address","Zip")=SDDEMO("K2ZIP")
+113 SET SDINFO("Patient","SecondaryNextOfKin","Address","Zip4")=$GET(SDPATARR(2,SDDFN,.2203,"E"))
+114 ;
+115 ; Emergency Contact
+116 ;
+117 SET SDINFO("Patient","EmergencyContact","Name")=$GET(SDPATARR(2,SDDFN,.331,"E"))
+118 SET SDINFO("Patient","EmergencyContact","Relationship")=$GET(SDPATARR(2,SDDFN,.332,"E"))
+119 SET SDINFO("Patient","EmergencyContact","Phone")=$GET(SDPATARR(2,SDDFN,.339,"E"))
+120 SET SDINFO("Patient","EmergencyContact","WorkPhone")=$GET(SDPATARR(2,SDDFN,.33011,"E"))
+121 SET SDINFO("Patient","EmergencyContact","Address","Street")=$GET(SDPATARR(2,SDDFN,.333,"E"))
+122 SET SDINFO("Patient","EmergencyContact","Address","Street2")=$GET(SDPATARR(2,SDDFN,.334,"E"))
+123 SET SDINFO("Patient","EmergencyContact","Address","Street3")=$GET(SDPATARR(2,SDDFN,.335,"E"))
+124 SET SDINFO("Patient","EmergencyContact","Address","City")=$GET(SDPATARR(2,SDDFN,.336,"E"))
+125 SET SDINFO("Patient","EmergencyContact","Address","State")=$GET(SDPATARR(2,SDDFN,.337,"E"))
+126 SET SDINFO("Patient","EmergencyContact","Address","Zip")=$GET(SDPATARR(2,SDDFN,.338,"E"))
+127 SET SDINFO("Patient","EmergencyContact","Address","Zip4")=$GET(SDPATARR(2,SDDFN,.2201,"E"))
+128 ; 853
+129 ; Elig
+130 ;
+131 DO GETELIGIBILITY^SDESPATSEARCH(.PATIENTLIST,DFN,1)
+132 MERGE SDINFO("Patient")=PATIENTLIST("Patient",1)
+133 ;
+134 ; 853
+135 ; Date Of Death
+136 ;
+137 SET SDDOD=$$FMTISO^SDAMUTDT($$GET1^DIQ(2,DFN_",",.351,"I"))
SET SDDOD=$EXTRACT(SDDOD,1,10)
+138 SET SDINFO("Patient","DateOfDeath")=SDDOD
+139 QUIT