Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDES2GETPATDEMO

SDES2GETPATDEMO.m

Go to the documentation of this file.
SDES2GETPATDEMO ;ALB/BLB/JDJ - SDES2 GET PATIENT DEMOGRAPHICS ;JUN 5,2024
 ;;5.3;Scheduling;**877,880**;Aug 13, 1993;Build 5
 ;;Per VHA Directive 6402, this routine should not be modified
 ;---------------------------------------------------------------
 Q
 ;
GETDEMOGRAPHICS(JSON,SDCONTEXT,PATIENT) ;
 N ERRORS,DEMOGRAPHICS,VAL
 ;
 D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
 D VALFILEIEN^SDES2VALUTIL(.VAL,.ERRORS,2,$G(PATIENT("DFN")),1,,1,2)
 I $D(ERRORS) S ERRORS("PatientDemographics")="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
 ;
 D BUILDDEMO(.DEMOGRAPHICS,$G(PATIENT("DFN")))
 D BUILDJSON^SDES2JSON(.JSON,.DEMOGRAPHICS)
 Q
 ;
BUILDDEMO(DEMOGRAPHICS,DFN) ;
 N RACECOUNT,RACETOTAL,VADM,VAERR,VA
 ;
 D DEM^VADPT
 S DEMOGRAPHICS("PatientDemographics","Religion")=$P($G(VADM(9)),U,2)
 S DEMOGRAPHICS("PatientDemographics","MaritalStatus")=$P($G(VADM(10)),U,2)
 S DEMOGRAPHICS("PatientDemographics","Ethnicity")=$P($G(VADM(11,1)),U,2)
 ;
 S RACETOTAL=$G(VADM(12))
 I RACETOTAL=0 S DEMOGRAPHICS("PatientDemographics","RaceInformation",1,"Race")="" Q
 S RACECOUNT=0 F  S RACECOUNT=$O(VADM(12,RACECOUNT)) Q:'RACECOUNT  D
 .S DEMOGRAPHICS("PatientDemographics","RaceInformation",RACECOUNT,"Race")=$P($G(VADM(12,RACECOUNT)),U,2)
 Q
 ;