DISC4.0 Algorithm - Module B - Parent Elimination Disorder
Diagnostic criteria for 307.6 Enuresis
- Repeated voiding of urine into bed or clothes (whether involuntary or intentional).
- The behavior is clinically significant as manifested by either a frequency of twice a week for at least 3 consecutive months or the presence of clinically significant distress or impairment in social, academic (occupational), or other important areas of functioning.
- Chronological age is at least 5 years (or equivalent developmental level).
- The behavior is not due exclusively to the direct physiological effect of a substance (e.g., a diuretic) or a general medical condition (e.g., diabetes, spina bifida, a seizure disorder).
Diagnostic criteria for Encopresis
- Repeated passage of feces into inappropriate places (e.g., clothing or floor) whether involuntary or intentional.
- At least one such event a month for at least 3 months.
- Chronological age is at least 4 years (or equivalent developmental level).
- The behavior is not due exclusively to the direct physiological effects of a substance (e.g., laxatives) or a general medical condition except through a mechanism involving constipation.
DISC4.0 Algorithm - Module B - Parent Elimination Disorder - Data Definition
libname sds "&path";
filename discp "&filein";
data sds.pel0;
infile discp end = last pad;
input id $ 1-10 card $ 11-14 @;
testid = id;
%huid;
do until (testid ne id);
select(card);
when ('B201') do;
input id $ 1-10
pel001 16
pel001a 17
pel001b 18
pel001c 19
pel001d 20
pel001e 21
pel001f 22
pel001g 23
pel001h 24
pel001i 25
pel001j 26
pel001k 27
pel001l 28
pel002 29
pel002a 30-31
pel002b 32
pel003 33
pel003ay 34-35
pel003az 36-37
pel003b 38
pel004 39
pel004a 40
pel005 41
pel005a 42
pel006 43
pel006a 44
pel007 45
pel007a 46
pel008 47
pel008a 48
pel009 49
pel009a 50
pel010 51
pel010a 52
pel011 53-54
pel011a 55-56
pel012 57
pel012a 58-59
pel013 60
pel013a 61
pel013b 62
pel013c 63
pel013d 64
pel013ey 65-66
pel013ez 67-68
pel013f 69
pel013gy 70-71
pel013gz 72-73;
end;
when ('B202') do;
input id $ 1-10
pel014 16
pel014a 17
pel014b 18
pel014c 19
pel014d 20
pel014e 21
pel014f 22
pel014g 23
pel014h 24
pel014i 25
pel014j 26
pel014k 27
pel014l 28
pel015 29
pel015a 30-31
pel015b 32
pel016 33
pel016ay 34-35
pel016az 36-37
pel016b 38
pel017 39
pel017a 40
pel018 41
pel018a 42
pel019 43
pel019a 44
pel020 45
pel020a 46
pel021 47
pel021a 48
pel022 49
pel022a 50
pel023 51
pel023a 52
pel024 53-54
pel024a 55-56
pel025 57
pel025a 58-59
pel026 60
pel026a 61
pel026b 62
pel026c 63
pel026d 64
pel026ey 65-66
pel026ez 67-68
pel026f 69
pel026gy 70-71
pel026gz 72-73;
end;
when('B203') do;
input id $ 1-10
pel027 16
pel027a 17
pel027b 18
pel027c 19
pel027d 20
pel027e 21
pel028 22
pel028a 23-24
pel028b 25
pel029 26
pel029ay 27-28
pel029az 29-30
pel029b 31
pel030 32
pel030a 33
pel031 34
pel031a 35
pel032 36
pel032a 37
pel033 38
pel033a 39
pel034 40
pel034a 41
pel035 42
pel035a 43
pel036 44
pel036a 45
pel036b 46
pel037 47-48
pel037a 49-50
pel038 51
pel038a 52-53
pel039 54
pel039a 55
pel039b 56
pel039c 57
pel039d 58
pel039ey 59-60
pel039ez 61-62
pel039f 63
pel039gy 64-65
pel039gz 66-67;
end; /* end WHEN ... DO */
otherwise input;
end; /* end SELECT */
testid = id;
if (last) then id = ' ';
else input id $ 1-10 card $ 11-14 @@;
end; /* end DO UNTIL */
id = testid;
LABEL
PEL001 = 'Ever wet the bed since age of 5'
PEL002 = 'Suffered from any medical condition in past year causing bed wetting'
PEL003 = 'In whole life ever gone an entire year without wetting the bed'
PEL004 = 'Caretakers annoyed/upset by constant bed wetting when at its worst'
PEL005 = 'Bed wetting prevented going places/doing things with family'
PEL006 = 'Bed wetting prevented going places/doing things with peers'
PEL007 = 'Bed wetting made schoolwork difficult/caused problems with grades at school'
PEL008 = 'Bed wetting caused teachers/Boss to become annoyed/upset'
PEL009 = 'Felt bad/upset about bed wetting when at its worst'
PEL010 = 'Been to get help at a hospital/clinic/at work for help with bed wetting'
PEL011 = 'Name and information of person seen for help (OPTIONAL)'
PEL012 = 'Taken medication for bedwetting in past year'
PEL013 = 'Was there ever a time since age 5 when bed wetting happened twice a week or more'
PEL014 = 'Ever wet pants during the day since age 5'
PEL015 = 'Medical condition caused bedwetting in past year'
PEL016 = 'Gone whole year without bedwetting, entire life'
PEL017 = 'When wetting pants was worst, caretakers became upset'
PEL018 = 'Wetting pants prevented doing things/going places with family'
PEL019 = 'Wettng pants prevented doing things/going places with peers'
PEL020 = 'Wetting pants made schoolwork/work difficult'
PEL021 = 'Pants wetting caused teacher/boss to become annoyed/upset'
PEL022 = 'Felt very bad/upset about wetting pants'
PEL023 = 'In last year been to get help from a hospital/clinic/at their office'
PEL024 = 'Name, Profession, Address of person seen for help (OPTIONAL)'
PEL025 = 'Taken medication for wetting pants during the day in last year'
PEL026 = 'Ever wet pants twice a week since age of 5'
PEL027 = 'Had a bowel movement not in toilet since age 4'
PEL028 = 'Medical condition caused soiling of pants in past year'
PEL029 = 'Gone an entire year without soiling self'
PEL030 = 'At time when soiling pants was at its worst, caretakers became upset/annoyed'
PEL031 = 'Soiling of pants prevented doing other things with family'
PEL032 = 'Soiling of pants prevedted doint things with peers'
PEL033 = 'Soiling of pants created problems in school/made work/schoolwork difficult'
PEL034 = 'Soiling self caused teacher/boss to become upset/annoyed'
PEL035 = 'Felt very bad/upset about soiling self'
PEL036 = 'Seen hospital/clinic/someone at work for help in last year'
PEL037 = 'Name, address, position of person seen for help (OPTIONAL)'
PEL038 = 'Taken any medication for soiling pants in last year'
PEL039 = 'Ever a time since age 4 when soiled self once a month or more';
pel004un=pel004 ;
pel017un=pel017 ;
pel030un=pel030 ;
run;
DISC4.0 Algorithm - Module B - Parent Elimination Disorder - Data Recoding
Data Recoding
77, 7 -> .
99, 9, 88, 8 -> 0
data sds.pel1;
set sds.pel0;
array pelvar (*)
pel001 pel001a pel001b pel001c pel001d pel001e pel001f
pel001g pel001h pel001i pel001j pel001k pel001l
pel002 pel002b
pel003 pel003b
pel010 pel010a
pel012
pel013 pel013a pel013b pel013c pel013d pel013f
pel014 pel014a pel014b pel014c pel014d pel014e pel014f
pel014g pel014h pel014i pel014j pel014k pel014l
pel015 pel015b
pel016 pel016b
pel023 pel023a
pel025
pel026 pel026a pel026b pel026c pel026d pel026f
pel027 pel027a pel027b pel027c pel027d pel027e
pel028 pel028b
pel029 pel029b
pel036 pel036a pel036b
pel038
pel039 pel039a pel039b pel039c pel039d pel039f
pel004 pel005 pel006 pel007 pel008 pel009 pel017 pel018
pel019 pel020 pel021 pel022 pel030 pel031 pel032 pel033
pel034 pel035 ;
do i = 1 to dim(pelvar);
if (pelvar(i) = 9) then pelvar(i) = 0;
else if (pelvar(i) = 7) then pelvar(i) = .;
end;
array double(*)
pel003ay pel003az
pel011 pel011a
pel012a
pel013ey pel013ez pel013gy pel013gz
pel016ay pel016az
pel024 pel024a
pel025a
pel026ey pel026ez pel026gy pel026gz
pel029ay pel029az
pel037 pel037a
pel038a
pel039ey pel039ez pel039gy pel039gz; /* Q2a,Q15a and Q28a recoded different */
do i = 1 to dim(double);
if (double(i) = 77) then double(i) = .;
if (double(i) = 99 or double(i) = 88) then double(i) = 0;
end;
array a(*)
pel002a pel015a pel028a; /* For Q2a, Q28a, and Q15a, 88 not recoded */
do i = 1 to dim(a);
if (a(i) = 77) then a(i) = .;
if (a(i) = 99) then a(i) = 0;
end;
array eight(*)
pel007
pel008
pel020
pel021
pel033
pel034;
do i = 1 to dim(eight);
if (eight(i) = 8) then eight(i) = 0;
end;
run;
DISC4.0 Algorithm - Module B - Parent Elimination Disorder - Algorithms
data sds.pel2
(keep = id huid penday pendby penddy pendy pendam pendbm penddm pendm pennay
pennby penndy penny pennam pennbm penndm pennm pecay pecby pecdy pecy pecam
pecbm pecdm pecm penncy penncm pendcy pendcm peccy peccm pelima1 pelima2 pelima3
pelima4 pelima5 pelima6 pelnima pennyima pennmima pelnimb pennyimb pennmimb
pelimc1 pelimc2 pelimc3 pelimc4 pelimc5 pelimc6 pelnimc pennyimc pennmimc pennyimd pennmimd
pedima1 pedima2 pedima3 pedima4 pedima5 pedima6 pednima pendyima pendmima
pednimb pendyimb pendmimb pedimc1 pedimc2 pedimc3 pedimc4 pedimc5 pedimc6
pednimc pendyimc pendmimc pendyimd pendmimd pecima1 pecima2 pecima3 pecima4 pecima5 pecima6
pecnima pecyima pecmima pecnimb pecyimb pecmimb pecimc1 pecimc2 pecimc3
pecimc4 pecimc5 pecimc6 pecnimc pecyimc pecmimc pecyimd pecmimd
pennw pendw pecw
pel001a pel014 pel027 pelnmr pennyr pennysubt
pennysubtima pennysubtimb pennysubtimc pennysubtimd pendysubt pendysubtima pendysubtimb
pendysubtimc pendysubtimd pecysubt pecysubtima pecysubtimb pecysubtimc pecysubtimd);
set sds.pel1;
****** Criteria for Enuresis *******;
array elim1(*) pel002-pel010 pel012;
if pel001 = 0 then do; do i=1 to dim(elim1); elim1(i) = 0; pel013=0;end; end;
if pel001a=0 or pel001b=0 or pel001c=0 then do; do i=1 to dim(elim1); elim1(i)=0;end;end;
if pel001e=2 then pel013=0;
array elim2(*) pel015-pel023 pel025;
if pel014 = 0 then do; do i=1 to dim(elim2); elim2(i)=0; pel026=0; end; end;
if pel014a=0 or pel014b=0 or pel014c=0 then do; do i = 1 to dim(elim2); elim2(i)=0; end; end;
if pel014e=2 then pel026=0;
array elim3(*) pel028-pel036 pel038;
if pel027=0 then do; do i=1 to dim(elim3); elim3(i)=0; pel039=0;end;end;
if pel027a=0 or pel027b=2 or (pel027c=0 and pel027d=0) then do; do i=1 to dim(elim3); elim3(i)=0;end; end;
array impair(*) pel004 pel005 pel006 pel007 pel008 pel009 pel017 pel018
pel019 pel020 pel021 pel022 pel030 pel031 pel032 pel033
pel034 pel035 ;
array impaira(*) pel004a pel005a pel006a pel007a pel008a pel009a
pel017a pel018a pel019a pel020a pel021a pel022a pel030a
pel031a pel032a pel033a pel034a pel035a;
do i=1 to dim(impair);
if impair[i]=0 then impaira[i]=1;
end;
*-----A;
*-----Past Year;
if (pel001b = 2) then pennay = 1; /* Nocturnal */
else if (pel001 = 0 or pel001a = 0 or pel001b = 0) then pennay = 0;
if (pel014b = 2) then penday = 1; /* Diurnal */
else if (pel014 = 0 or pel014a = 0 or pel014b = 0) then penday = 0;
*-----Past Month;
if (pel001f = 2) then pennam = 1; /* Nocturnal */
else if (pel001 = 0 or pel001a = 0 or pel001b = 0 or pel001c = 0 or pel001d = 0
or pel001e = 0 or pel001f = 0) then pennam = 0;
if (pel014f = 2) then pendam = 1; /* Diurnal */
else if (pel014 = 0 or pel014a = 0 or pel014b = 0 or pel014c = 0 or pel014d = 0
or pel014e = 0 or pel014f = 0) then pendam = 0;
*-----B;
*-----Past Year;
if (pel001e = 2) then pennby = 1; /* Nocturnal */
else if (pel001 = 0 or pel001a = 0 or pel001b = 0 or pel001c = 0 or pel001d = 0 or
pel001e = 0) then pennby = 0;
if (pel014e = 2) then pendby = 1; /* Diurnal */
else if (pel014 = 0 or pel014a = 0 or pel014b = 0 or pel014c = 0 or pel014d = 0
or pel014e = 0) then pendby = 0;
*-----Past Month;
if (pel001f = 2) then pennbm = 1; /* Nocturnal */
else if (pel001 = 0 or pel001a = 0 or pel001b = 0 or pel001c = 0 or pel001d = 0
or pel001e = 0 or pel001f = 0) then pennbm = 0;
if (pel014f = 2) then pendbm = 1; /* Diurnal */
else if (pel014 = 0 or pel014a = 0 or pel014b = 0 or pel014c = 0 or pel014d = 0
or pel014e = 0 or pel014f = 0) then pendbm = 0;
*-----C; /* by definition */
penncy = 1; penncm = 1; pendcy = 1; pendcm = 1;
*-----D;
*-----Past Year;
if (pel002 = 0 or pel002a = 88 or pel002b = 0) then penndy = 1; /* Nocturnal */
else if (pel002 = 2 and pel002a ne 88 and pel002b = 2) then penndy = 0;
if (pel015 = 0 or pel015a = 88 or pel015b = 0) then penddy = 1; /* Diurnal */
else if (pel015 = 2 and pel015a ne 88 and pel015b = 2) then penddy = 0;
*-----Past Month;
if ((pel002 = 0 or pel002a = 88 or pel002b = 0) and pel001f = 2) then penndm = 1;
/* Nocturnal */
else if (pel002 = 2 and pel002a ne 88 and pel002b = 2) or (pel001=0 or pel001a=0 or
pel001b=0 or pel001c=0 or pel001d=0 or pel001e=0 or pel001f = 0)
then penndm = 0;
if ((pel015 = 0 or pel015a = 88 or pel015b = 0) and pel014f = 2) then penddm = 1;
/* Diurnal */
else if (pel015 = 2 and pel015a ne 88 and pel015b = 2) or (pel014=0 or pel014a=0 or
pel014c=0 or pel014d=0 or pel014e=0 or pel014f = 0)
then penddm = 0;
****** Diagnosis for Nocturnal and Diurnal Enuresis ******;
/*----- Nocturnal ----- */
*----- Past Year;
if (pennay = 1 and pennby = 1 and penndy = 1) then penny = 1;
else if (pennay = 0 or pennby = 0 or penndy = 0) then penny = 0;
*-----Past Month;
if (pennam = 1 and pennbm = 1 and penndm = 1) then pennm = 1;
else if (pennam = 0 or pennbm = 0 or penndm = 0) then pennm = 0;
/*------ Diurnal ----- */
*-----Past Year;
if (penday = 1 and pendby = 1 and penddy = 1) then pendy = 1;
else if (penday = 0 or pendby = 0 or penddy = 0) then pendy = 0;
*-------Past Month;
if (pendam = 1 and pendbm = 1 and penddm = 1) then pendm = 1;
else if (pendam = 0 or pendbm = 0 or penddm = 0) then pendm = 0;
****** Variable Labels ******;
label pennay = 'Repeated voiding'
pennby = 'Frequency of twice a week for 3 months or distress'
penncy = 'Age is at least 5 years'
penndy = 'Not due to substance or medical condition'
penny = 'Past year: diagnosis for nocturnal enuresis'
penday = 'Repeated voiding'
pendby = 'Frequendy of twice a week for 3 months or distress'
pendcy = 'Age is at least 5 years'
penddy = 'Not due to substance or medical condition'
pendy = 'Past year: diagnosis for diurnal enuresis'
pennam = 'Repeated voiding'
pennbm = 'Frequency of twice a week for 3 months or distress'
penncm = 'Age is at least 5 years'
penndm = 'Not due to substance or medical condition'
pennm = 'Past month: diagnosis for nocturnal enuresis'
pendam = 'Repeated voiding'
pendbm = 'Frequendy of twice a week for 3 months or distress'
pendcm = 'Age is at least 5 years'
penddm = 'Not due to substance or medical condition'
pendm = 'Past month: diagnosis for diurnal enuresis'
;
****** Criteria for Encopresis ******;
*-----A;
*-----Past Year;
if (pel027b = 0) then pecay = 1;
else if (pel027 = 0 or pel027a = 0 or pel027b = 2) then pecay = 0;
*-----Past Month;
if (pel027e = 2) then pecam = 1;
else if (pecay = 0 or pel027c = 0 or pel027d = 0 or pel027e = 0) then pecam = 0;
*-----B;
*-----Past Year;
if (pel027c = 2 or pel027d = 2) then pecby = 1;
else if (pel027 = 0 or pel027a = 0 or pel027b = 2 or (pel027c = 0 and pel027d = 0))
then pecby = 0;
*-----Past Month;
if (pecby = 1 and pel027e = 2) then pecbm = 1;
else if (pecby = 0 or pel027e = 0) then pecbm = 0;
*------C; /* by definition */
peccy = 1; peccm = 1;
*------D;
*-----Past Year;
if (pel028 = 0 or pel028a = 88 or pel028b = 0) then pecdy = 1;
else if (pel028 = 2 and pel028a ne 88 and pel028b = 2) then pecdy = 0;
*-----Past Month;
if (pecdy = 1 and pel027e = 2) then pecdm = 1;
else if pecdy = 0 or (pel027=0 or pel027a=0 or pel027b=0 or (pel027c=0 and pel027d=0)
or pel027e = 0) then pecdm = 0;
****** Diagnosis for Encopresis ******;
*-----Past Year;
if (pecay = 1 and pecby = 1 and pecdy = 1) then pecy = 1;
else if ( pecay = 0 or pecby = 0 or pecdy = 0) then pecy = 0;
*-----Past Month;
if (pecam = 1 and pecbm = 1 and pecdm = 1) then pecm = 1;
else if ( pecam = 0 or pecbm = 0 or pecdm = 0) then pecm = 0;
****** Variable Labels ******;
label pecay = 'Repeated passage of feces'
pecby = 'One a month for 3 months'
peccy = 'Age is at least 4 years'
pecdy = 'Not due to substance or medical condition'
pecy = 'Past year: diagnosis for encopresis'
pecam = 'Repeated passage of feces'
pecbm = 'One a month for 3 months'
peccm = 'Age is at least 4 years'
pecdm = 'Not due to substance or medical condition'
pecm = 'Past month: diagnosis for encopresis'
;
*------ IMPAIRMENT ALGORITHMS; /* Criteria for Nocturnal Enuresis */
*----A; /* One intermediate rating of impairment or distress */
if pel004a = 2 or pel004a = 3 then pelima1 = 1;
else if pel004a = 1 or pel004a = 7 or pel004a = 9 then pelima1 = 0;
if pel005a = 2 or pel005a = 3 then pelima2 = 1;
else if pel005a = 1 or pel005a = 7 or pel005a = 9 then pelima2 = 0;
if pel006a = 2 or pel006a = 3 then pelima3 = 1;
else if pel006a = 1 or pel006a = 7 or pel006a = 9 then pelima3 = 0;
if pel007a = 2 or pel007a = 3 then pelima4 = 1;
else if pel007a = 1 or pel007a = 7 or pel007a = 9 then pelima4 = 0;
if pel008a = 2 or pel008a = 3 then pelima5 = 1;
else if pel008a = 1 or pel008a = 7 or pel008a = 9 then pelima5 = 0;
if pel009a = 2 or pel009a = 3 then pelima6 = 1;
else if pel009a = 1 or pel009a = 7 or pel009a = 9 then pelima6 = 0;
if (sum(pelima1, pelima2, pelima3, pelima4, pelima5, pelima6) ge 1)
then pelnima = 1;
else if ((n(pelima1, pelima2, pelima3, pelima4, pelima5, pelima6) - sum(pelima1,
pelima2, pelima3, pelima4, pelima5, pelima6)) ge 6) then pelnima = 0;
if penny = 1 and pelnima = 1 then pennyima = 1;
else if penny = 0 or pelnima = 0 then pennyima = 0;
if pennm = 1 and pelnima = 1 then pennmima = 1;
else if pennm = 0 or pelnima = 0 then pennmima = 0;
*------B; /* Two intermediate ratings of impairment or distress */
if (sum(pelima1, pelima2, pelima3, pelima4, pelima5, pelima6) ge 2)
then pelnimb = 1;
else if ((n(pelima1, pelima2, pelima3, pelima4, pelima5, pelima6) - sum(pelima1,
pelima2, pelima3, pelima4, pelima5, pelima6)) ge 5) then pelnimb = 0;
if penny = 1 and pelnimb = 1 then pennyimb = 1;
else if penny = 0 or pelnimb = 0 then pennyimb = 0;
if pennm = 1 and pelnimb = 1 then pennmimb = 1;
else if pennm = 0 or pelnimb = 0 then pennmimb = 0;
*-----C; /* One severe rating of impairment or distress */
if pel004a = 3 then pelimc1 = 1;
else if pel004a = 1 or pel004a = 2 or pel004a = 7 or pel004a = 9 then pelimc1 = 0;
if pel005a = 3 then pelimc2 = 1;
else if pel005a = 1 or pel005a = 2 or pel005a = 7 or pel005a = 9 then pelimc2 = 0;
if pel006a = 3 then pelimc3 = 1;
else if pel006a = 1 or pel006a = 2 or pel006a = 7 or pel006a = 9 then pelimc3 = 0;
if pel007a = 3 then pelimc4 = 1;
else if pel007a = 1 or pel007a = 2 or pel007a = 7 or pel007a = 9 then pelimc4 = 0;
if pel008a = 3 then pelimc5 = 1;
else if pel008a = 1 or pel008a = 2 or pel008a = 7 or pel008a = 9 then pelimc5 = 0;
if pel009a = 3 then pelimc6 = 1;
else if pel009a = 1 or pel009a = 2 or pel009a = 7 or pel009a = 9 then pelimc6 = 0;
if (sum(pelimc1, pelimc2, pelimc3, pelimc4, pelimc5, pelimc6) ge 1)
then pelnimc = 1;
else if ((n(pelimc1, pelimc2, pelimc3, pelimc4, pelimc5, pelimc6) - sum(pelimc1,
pelimc2, pelimc3, pelimc4, pelimc5, pelimc6)) ge 6) then pelnimc = 0;
if penny = 1 and pelnimc = 1 then pennyimc = 1;
else if penny = 0 or pelnimc = 0 then pennyimc = 0;
if pennm = 1 and pelnimc = 1 then pennmimc = 1;
else if pennm = 0 or pelnimc = 0 then pennmimc = 0;
*------D; /* Impairment D: present when impairment B or C are satisified */
If pennyimb = 1 or pennyimc = 1 then pennyimd = 1;
else if pennyimb = 0 and pennyimc = 0 then pennyimd = 0;
If pennmimb = 1 or pennmimc = 1 then pennmimd = 1;
else if pennmimb = 0 and pennmimc = 0 then pennmimd = 0;
/* Alternative diagnosis of nocturnal enuresis by Prudence, corrections made by Steven, July 2001
Commented out until alternative diagnosis is certified
Demo run August 16, 2001 */
if pelnima=1 and (pel001f=2 or pel001g=2 or pel001h=2 or pel001j=2 or pel001k=2 or pel001l=2)
then pelnmr=1;else pelnmr=0;
if pelnima=1 then pennyr=1;else pennyr=0;
*comment out ends here
****------ IMPAIRMENT ALGORITHMS; /* Criteria for Diurnal Enuresis */
*----A; /* One intermediate rating of impairment or distress */
if pel017a = 2 or pel017a = 3 then pedima1 = 1;
else if pel017a = 1 or pel017a = 7 or pel017a = 9 then pedima1 = 0;
if pel018a = 2 or pel018a = 3 then pedima2 = 1;
else if pel018a = 1 or pel018a = 7 or pel018a = 9 then pedima2 = 0;
if pel019a = 2 or pel019a = 3 then pedima3 = 1;
else if pel019a = 1 or pel019a = 7 or pel019a = 9 then pedima3 = 0;
if pel020a = 2 or pel020a = 3 then pedima4 = 1;
else if pel020a = 1 or pel020a = 7 or pel020a = 9 then pedima4 = 0;
if pel021a = 2 or pel021a = 3 then pedima5 = 1;
else if pel021a = 1 or pel021a = 7 or pel021a = 9 then pedima5 = 0;
if pel022a = 2 or pel022a = 3 then pedima6 = 1;
else if pel022a = 1 or pel022a = 7 or pel022a = 9 then pedima6 = 0;
if (sum(pedima1, pedima2, pedima3, pedima4, pedima5, pedima6) ge 1)
then pednima = 1;
else if ((n(pedima1, pedima2, pedima3, pedima4, pedima5, pedima6) - sum(pedima1,
pedima2, pedima3, pedima4, pedima5, pedima6)) ge 6) then pednima = 0;
if pendy = 1 and pednima = 1 then pendyima = 1;
else if pendy = 0 or pednima = 0 then pendyima = 0;
if pendm = 1 and pednima = 1 then pendmima = 1;
else if pendm = 0 or pednima = 0 then pendmima = 0;
*------B; /* Two intermediate ratings of impairment or distress */
if (sum(pedima1, pedima2, pedima3, pedima4, pedima5, pedima6) ge 2)
then pednimb = 1;
else if ((n(pedima1, pedima2, pedima3, pedima4, pedima5, pedima6) - sum(pedima1,
pedima2, pedima3, pedima4, pedima5, pedima6)) ge 5) then pednimb = 0;
if pendy = 1 and pednimb = 1 then pendyimb = 1;
else if pendy = 0 or pednimb = 0 then pendyimb = 0;
if pendm = 1 and pednimb = 1 then pendmimb = 1;
else if pendm = 0 or pednimb = 0 then pendmimb = 0;
*-----C; /* One severe rating of impairment or distress */
if pel017a = 3 then pedimc1 = 1;
else if pel017a = 1 or pel017a = 2 or pel017a = 7 or pel017a = 9 then pedimc1 = 0;
if pel018a = 3 then pedimc2 = 1;
else if pel018a = 1 or pel018a = 2 or pel018a = 7 or pel018a = 9 then pedimc2 = 0;
if pel019a = 3 then pedimc3 = 1;
else if pel019a = 1 or pel019a = 2 or pel019a = 7 or pel019a = 9 then pedimc3 = 0;
if pel020a = 3 then pedimc4 = 1;
else if pel020a = 1 or pel020a = 2 or pel020a = 7 or pel020a = 9 then pedimc4 = 0;
if pel021a = 3 then pedimc5 = 1;
else if pel021a = 1 or pel021a = 2 or pel021a = 7 or pel021a = 9 then pedimc5 = 0;
if pel022a = 3 then pedimc6 = 1;
else if pel022a = 1 or pel022a = 2 or pel022a = 7 or pel022a = 9 then pedimc6 = 0;
if (sum(pedimc1, pedimc2, pedimc3, pedimc4, pedimc5, pedimc6) ge 1)
then pednimc = 1;
else if ((n(pedimc1, pedimc2, pedimc3, pedimc4, pedimc5, pedimc6) - sum(pedimc1,
pedimc2, pedimc3, pedimc4, pedimc5, pedimc6)) ge 6) then pednimc = 0;
if pendy = 1 and pednimc = 1 then pendyimc = 1;
else if pendy = 0 or pednimc = 0 then pendyimc = 0;
if pendm = 1 and pednimc = 1 then pendmimc = 1;
else if pendm = 0 or pednimc = 0 then pendmimc = 0;
*------D; /* Impairment D: present when impairment B or C are satisified */
If pendyimb = 1 or pendyimc = 1 then pendyimd = 1;
else if pendyimb = 0 and pendyimc = 0 then pendyimd = 0;
If pendmimb = 1 or pendmimc = 1 then pendmimd = 1;
else if pendmimb = 0 and pendmimc = 0 then pendmimd = 0;
/* Alternative diagnosis of diurnal enuresis by Prudence, corrections made by Steven, July 2001
Commented out until alternative diagnosis is certified
if peldima=1 and (pel014f=2 or pel014g=2 or pel014h=2 or pel014j=2 or pel014k=2 or pel014l=2)
then pendmr=1;else pendmr=0;
if peldima=1 then pendyr=1;else pendyr=0;
comment out ends here */
****------ IMPAIRMENT ALGORITHMS; /* Criteria for Encopresis */
*----A; /* One intermediate rating of impairment or distress */
if pel030a = 2 or pel030a = 3 then pecima1 = 1;
else if pel030a = 1 or pel030a = 7 or pel030a = 9 then pecima1 = 0;
if pel031a = 2 or pel031a = 3 then pecima2 = 1;
else if pel031a = 1 or pel031a = 7 or pel031a = 9 then pecima2 = 0;
if pel032a = 2 or pel032a = 3 then pecima3 = 1;
else if pel032a = 1 or pel032a = 7 or pel032a = 9 then pecima3 = 0;
if pel033a = 2 or pel033a = 3 then pecima4 = 1;
else if pel033a = 1 or pel033a = 7 or pel033a = 9 then pecima4 = 0;
if pel034a = 2 or pel034a = 3 then pecima5 = 1;
else if pel034a = 1 or pel034a = 7 or pel034a = 9 then pecima5 = 0;
if pel035a = 2 or pel035a = 3 then pecima6 = 1;
else if pel035a = 1 or pel035a = 7 or pel035a = 9 then pecima6 = 0;
if (sum(pecima1, pecima2, pecima3, pecima4, pecima5, pecima6) ge 1)
then pecnima = 1;
else if ((n(pecima1, pecima2, pecima3, pecima4, pecima5, pecima6) - sum(pecima1,
pecima2, pecima3, pecima4, pecima5, pecima6)) ge 6) then pecnima = 0;
if pecy = 1 and pecnima = 1 then pecyima = 1;
else if pecy = 0 or pecnima = 0 then pecyima = 0;
if pecm = 1 and pecnima = 1 then pecmima = 1;
else if pecm = 0 or pecnima = 0 then pecmima = 0;
*------B; /* Two intermediate ratings of impairment or distress */
if (sum(pecima1, pecima2, pecima3, pecima4, pecima5, pecima6) ge 2)
then pecnimb = 1;
else if ((n(pecima1, pecima2, pecima3, pecima4, pecima5, pecima6) - sum(pecima1,
pecima2, pecima3, pecima4, pecima5, pecima6)) ge 5) then pecnimb = 0;
if pecy = 1 and pecnimb = 1 then pecyimb = 1;
else if pecy = 0 or pecnimb = 0 then pecyimb = 0;
if pecm = 1 and pecnimb = 1 then pecmimb = 1;
else if pecm = 0 or pecnimb = 0 then pecmimb = 0;
*-----C; /* One severe rating of impairment or distress */
if pel030a = 3 then pecimc1 = 1;
else if pel030a = 1 or pel030a = 2 or pel030a = 7 or pel030a = 9 then pecimc1 = 0;
if pel031a = 3 then pecimc2 = 1;
else if pel031a = 1 or pel031a = 2 or pel031a = 7 or pel031a = 9 then pecimc2 = 0;
if pel032a = 3 then pecimc3 = 1;
else if pel032a = 1 or pel032a = 2 or pel032a = 7 or pel032a = 9 then pecimc3 = 0;
if pel033a = 3 then pecimc4 = 1;
else if pel033a = 1 or pel033a = 2 or pel033a = 7 or pel033a = 9 then pecimc4 = 0;
if pel034a = 3 then pecimc5 = 1;
else if pel034a = 1 or pel034a = 2 or pel034a = 7 or pel034a = 9 then pecimc5 = 0;
if pel035a = 3 then pecimc6 = 1;
else if pel035a = 1 or pel035a = 2 or pel035a = 7 or pel035a = 9 then pecimc6 = 0;
if (sum(pecimc1, pecimc2, pecimc3, pecimc4, pecimc5, pecimc6) ge 1)
then pecnimc = 1;
else if ((n(pecimc1, pecimc2, pecimc3, pecimc4, pecimc5, pecimc6) - sum(pecimc1,
pecimc2, pecimc3, pecimc4, pecimc5, pecimc6)) ge 6) then pecnimc = 0;
if pecy = 1 and pecnimc = 1 then pecyimc = 1;
else if pecy = 0 or pecnimc = 0 then pecyimc = 0;
if pecm = 1 and pecnimc = 1 then pecmimc = 1;
else if pecm = 0 or pecnimc = 0 then pecmimc = 0;
*------D; /* Impairment D: present when impairment B or C are satisified */
If pecyimb = 1 or pecyimc = 1 then pecyimd = 1;
else if pecyimb = 0 and pecyimc = 0 then pecyimd = 0;
If pecmimb = 1 or pecmimc = 1 then pecmimd = 1;
else if pecmimb = 0 and pecmimc = 0 then pecmimd = 0;
***** Whole life *****;
**Enuresis Nocturnal**;
if pel013=0 then do;
array n1(*) pel013a pel013b pel013c pel013d pel013f;
do i=1 to dim(n1); n1[i]=0; end;
end;
else if pel013=2 and pel013a=0 then do;
array n2(*) pel013b pel013c pel013d pel013f;
do i=1 to dim(n2); n2[i]=0; end;
end;
if penny ne 1 then do;
if pel013a=2 or pel013b=2 or pel013c=2 or pel013d=2 then pennw=1;
else if pel013a=0 and pel013b=0 and pel013c=0 and pel013d=0 then pennw=0;
end;
else pennw=1;
**Enuresis diurnal**;
if pel026=0 then do;
array a1(*) pel026a pel026b pel026c pel026d pel026f;
do i=1 to dim(a1); a1[i]=0; end;
end;
else if pel026=2 and pel026a=0 then do;
array a2(*) pel026b pel026c pel026d pel026f;
do i=1 to dim(a2); a2[i]=0; end;
end;
if pendy ne 1 then do;
if pel026a=2 or pel026b=2 or pel026c=2 or pel026d=2 then pendw=1;
else if pel026a=0 and pel026b=0 and pel026c=0 and pel026d=0 then pendw=0;
end;
else pendw=1;
**Encopresis**;
if pecy ne 1 then do;
if pel039a=2 then pecw=1;
else if pel039=0 or pel039a=0 then pecw=0;
end;
else pecw=1;
****** Variable Labels ******;
Label pendw = 'Diurnal enuresis lifetime'
pennw = 'Nocturnal enuresis lifetime'
pecw = 'Encopresis lifetime';
******Subthreshold diagnosis in last year******;
*------nocturnal enuresis;
if (penny=0 and pel004un >=0)then pennysubt=1;
else if penny=. then pennysubt=.;
else pennysubt=0;
if pennysubt = 1 and pelnima = 1 then pennysubtima = 1;
else if pennysubt = 0 or pelnima = 0 then pennysubtima = 0;
if pennysubt = 1 and pelnimb = 1 then pennysubtimb = 1;
else if pennysubt = 0 or pelnimb = 0 then pennysubtimb = 0;
if pennysubt = 1 and pelnimc = 1 then pennysubtimc = 1;
else if pennysubt = 0 or pelnimc = 0 then pennysubtimc = 0;
If pennysubtimb = 1 or pennysubtimc = 1 then pennysubtimd = 1;
else if pennysubtimb = 0 and pennysubtimc = 0 then pennysubtimd = 0;
label pennysubt = 'Subthreshold diagnosis for nocturnal enuresis in last year'
pennysubtima = 'Subthreshold diagnosis for nocturnal enuresis with impairment A in last year'
pennysubtimb = 'Subthreshold diagnosis for nocturnal enuresis with impairment B in last year'
pennysubtimc = 'Subthreshold diagnosis for nocturnal enuresis with impairment C in last year'
pennysubtimd = 'Subthreshold diagnosis for nocturnal enuresis with impairment D in last year';
*------diurnal enuresis;
if (pendy=0 and pel017un >=0)then pendysubt=1;
else if pendy=. then pendysubt=.;
else pendysubt=0;
if pendysubt = 1 and pednima = 1 then pendysubtima = 1;
else if pendysubt = 0 or pednima = 0 then pendysubtima = 0;
if pendysubt = 1 and pednimb = 1 then pendysubtimb = 1;
else if pendysubt = 0 or pednimb = 0 then pendysubtimb = 0;
if pendysubt = 1 and pednimc = 1 then pendysubtimc = 1;
else if pendysubt = 0 or pednimc = 0 then pendysubtimc = 0;
If pendysubtimb = 1 or pendysubtimc = 1 then pendysubtimd = 1;
else if pendysubtimb = 0 and pendysubtimc = 0 then pendysubtimd = 0;
label pendysubt = 'Subthreshold diagnosis for diurnal enuresis in last year'
pendysubtima = 'Subthreshold diagnosis for diurnal enuresis impairment A in last year'
pendysubtimb = 'Subthreshold diagnosis for diurnal enuresis impairment B in last year'
pendysubtimc = 'Subthreshold diagnosis for diurnal enuresis impairment C in last year'
pendysubtimd = 'Subthreshold diagnosis for diurnal enuresis impairment D in last year';
*------Encopresis;
if (pecy=0 and pel030un >=0)then pecysubt=1;
else if pecy=. then pecysubt=.;
else pecysubt=0;
if pecysubt = 1 and pecnima = 1 then pecysubtima = 1;
else if pecysubt = 0 or pecnima = 0 then pecysubtima = 0;
if pecysubt = 1 and pecnimb = 1 then pecysubtimb = 1;
else if pecysubt = 0 or pecnimb = 0 then pecysubtimb = 0;
if pecysubt = 1 and pecnimc = 1 then pecysubtimc = 1;
else if pecysubt = 0 or pecnimc = 0 then pecysubtimc = 0;
If pecysubtimb = 1 or pecysubtimc = 1 then pecysubtimd = 1;
else if pecysubtimb = 0 and pecysubtimc = 0 then pecysubtimd = 0;
label pecysubt = 'Subthreshold diagnosis for encopresis in last year'
pecysubtima = 'Subthreshold diagnosis for encopresis with impairment A in last year'
pecysubtimb = 'Subthreshold diagnosis for encopresis with impairment B in last year'
pecysubtimc = 'Subthreshold diagnosis for encopresis with impairment C in last year'
pecysubtimd = 'Subthreshold diagnosis for encopresis with impairment D in last year';
run;