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

SDES2GETDEMOS.m

Go to the documentation of this file.
SDES2GETDEMOS ;ALB/BLB,BWF - SDES2 GET DEMOGRAPHICS ;MAY 20,2024
 ;;5.3;Scheduling;**877,878**;Aug 13, 1993;Build 11
 ;;Per VHA Directive 6402, this routine should not be modified
 ;---------------------------------------------------------------
 ; Reference to DGUTL4 in ICR #3799
 ; Reference to MARITAL STATUS in ICR #428
 ; Reference to RELIGION in ICR #1414
 ;
 Q
 ;
GETDEMOGRAPHICS(JSON,SDCONTEXT) ;
 N DEMOGRAPHICS,ERRORS
 ;
 D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
 I $D(ERRORS) S ERRORS("Demographics")="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
 ;
 D BUILDRACE(.DEMOGRAPHICS)
 D BUILDRELIGION(.DEMOGRAPHICS)
 D BUILDETHNICITY(.DEMOGRAPHICS)
 D BUILDMARITALSTAT(.DEMOGRAPHICS)
 D BUILDJSON^SDES2JSON(.JSON,.DEMOGRAPHICS)
 Q
 ;
BUILDRACE(DEMOGRAPHICS) ;
 N RACEIEN,RACECOUNT
 ;
 S RACEIEN=0,RACECOUNT=0
 F  S RACEIEN=$O(^DIC(10,RACEIEN)) Q:'RACEIEN  D
 .Q:+$$INACTIVE^DGUTL4(RACEIEN,1)
 .S RACECOUNT=RACECOUNT+1
 .S DEMOGRAPHICS("Demographics","Race",RACECOUNT)=$$PTR2TEXT^DGUTL4(RACEIEN,1)
 Q
 ;
BUILDRELIGION(DEMOGRAPHICS) ;
 N RELIGIONIEN,RELIGIONCOUNT
 ;
 S RELIGIONIEN=0,RELIGIONCOUNT=0
 F  S RELIGIONIEN=$O(^DIC(13,RELIGIONIEN)) Q:'RELIGIONIEN  D
 .S RELIGIONCOUNT=RELIGIONCOUNT+1
 .S DEMOGRAPHICS("Demographics","Religion",RELIGIONCOUNT)=$$GET1^DIQ(13,RELIGIONIEN,.01,"E")
 Q
 ;
BUILDETHNICITY(DEMOGRAPHICS) ;
 N ETHNICITYIEN,ETHNICITYCOUNT
 ;
 S ETHNICITYIEN=0,ETHNICITYCOUNT=0
 F  S ETHNICITYIEN=$O(^DIC(10.2,ETHNICITYIEN)) Q:'ETHNICITYIEN  D
 .Q:+$$INACTIVE^DGUTL4(ETHNICITYIEN,2)
 .S ETHNICITYCOUNT=ETHNICITYCOUNT+1
 .S DEMOGRAPHICS("Demographics","Ethnicity",ETHNICITYCOUNT)=$$PTR2TEXT^DGUTL4(ETHNICITYIEN,2)
 Q
 ;
BUILDMARITALSTAT(DEMOGRAPHICS) ;
 N MARITALIEN,MARITALCOUNT
 ;
 S MARITALIEN=0,MARITALCOUNT=0
 F  S MARITALIEN=$O(^DIC(11,MARITALIEN)) Q:'MARITALIEN  D
 .S MARITALCOUNT=MARITALCOUNT+1
 .S DEMOGRAPHICS("Demographics","MaritalStatus",MARITALCOUNT)=$$GET1^DIQ(11,MARITALIEN,.01,"E")
 Q
 ;