***********************************************************************************************;
*** ***;
*** PROGRAM: MDS3_FRAIL_vyyyymmdd.sas ***;
*** ***;
*** PURPOSE: To generate the FRAIL-NH scale (Fatigue, Resistance, Ambulation, ***;
*** Incontinence, Loss of weight, Nutritional approaches and Help with ***;
*** dressing) as defined for MDS 3.0. ***;
*** ***;
*** PROGRAMMERS: ***;
*** Natalia N. Nielsen, PhD student, CPHR, Morningside Graduate School of Biomedical ***;
*** Sciences, University of Massachusetts Chan Medical School, Worcester ***;
*** Emily Z. K. Lim, PhD candidate, University of Massachusetts, Boston ***;
*** Bill M. Jesdale, PhD. Population and Quantitative Health Sciences, Morningside ***;
*** Graduate School of Biomedical Sciences, University of Massachusetts Chan ***;
*** Medical School, Worcester ***;
*** ***;
*** ATTRIBUTION: This code was developed under the auspices of the PHARE Study Group ***;
*** (Pharmacy * Health sevices * Aging Research * Epidemiology) at the University of ***;
*** Massachusetts Morningside Graduate School of Biomedical Sciences, Worcester. ***;
*** The code is released for use under a Creative Commons CC-BY license ***;
*** (https://creativecommons.org/licenses/by/4.0/) meaning that the code is available ***;
*** to be shared and adapted for any purpose, including commerical uses, with the sole ***;
*** restriction being that the PHARE Group must be acknowledged as the source from ***;
*** which any direct or derived use is made. ***;
*** ***;
*** CITATION: Bill M. Jesdale, Natalia N. Nielsen, Emily Z. K. Lim, Kate L. Lapane, the ***;
*** PHARE Study Group (2024) MDS3_FRAIL_NH_v20231115.sas [SAS Program]. ***;
*** available at: http://umassmed.edu/PHARE ***;
*** ***;
***********************************************************************************************;
*** ***;
*** SOURCES: Ellen Kaehr, Renuka Visvanathan, Theodore K. Malmstrom, John E. Morley. ***;
*** (2015). Failty in nursing homes: The FRAIL-NH Scale. JAMDA 16:87-89. ***;
*** doi: 10.1016/j.jamda.2014.12.002 ***;
*** ***;
*** E.W. Kaehr, L.C. Pape, T.K. Malmstrom, J.E.Morley. (2016). FRAIL-NH ***;
*** predicts outcomes in long term care. J Nutr Health Aging 20(2):192-198. ***;
*** doi: 10.1007/s12603-016-0682-5 ***;
*** ***;
*** Carey Cowles. (2016). FRAIL-NH simplifies frailty screening. Caring for the ***;
*** Ages 17(11):19. doi: 10.1016/j.carage.2016.10.015 ***;
*** ***;
*** Hao Luo, Terry Y.S. Lum, Gloria H.Y. Wong, Joseph S.K. Kwan, Jennifer Y.M. ***;
*** Tang, Iris Chi. (2015). Predicting adverse health outcomes in nursing ***;
*** homes: A 9-year longitudinal study and development of the FRAIL-Minimum ***;
*** Data Set (MDS) Quick Streening Tool. JAMDA 16:1042-1047. ***;
*** doi: 10.1016/j.jamda.2015.09.006 ***;
*** ***;
*** Thanuja R. De Silva, Olga Theou, Bruno Vellas, Matteo Cesari, Renuka ***;
*** Visvanathan. (2018). Frailty screening (FRAIL-NH) and mortality in ***;
*** French nursing homes: Results from the Incidence of Pneumonia and ***;
*** Related Consequences in Nursing Home Residents Study. JAMDA 19:411-414. ***;
*** doi: 10.1016/j.jamda.2017.12.101 ***;
*** ***;
*** S.J. Liau, S. Lalic, R. Visvanathan, L.A. Dowd, J.S. Bell. (2021). The ***;
*** FRAIL-NH Scale: Systematic review of the use, validity and adaptations ***;
*** for frailty screening in nursing homes. J Nutr Health Aging 25(10:1205- ***;
*** 1216. doi: 10.1007/s12603-021-1694-3 ***;
*** ***;
*** INPUTS: Many variables used to define FRAIL-NH (descrfibed in more detail below). ***;
*** ***;
*** OUTPUTS: MDS3_FRAILNH, a 0-13 scale, where 0 is the least frail, and 13 is the most ***;
*** frail. ***;
*** ***;
***********************************************************************************************;
*** ***;
*** S C A L E C O N S T R U C T I O N ***;
*** ***;
*** The FRAIL-NH Scale combines 7 themes with 0-2 points each into a 0-13 scale. ***;
*** ***;
*** The scale is defined conceptually in the citations from Kaehr and colleagues above, ***;
*** and Cowles. However, a precise mapping to particular variables in MDS 3.0 is not ***;
*** provided in these sources. Thus, a large number of decisions need to be made in order ***;
*** to create an instantiation of FRAIL-NH. The article by Luo and colleagues helps to ***;
*** further describe the concepts included in FRAIL-NH, as well as giving some examples of ***;
*** specific variables and coding in at least one instantiation of FRAIL-NH. The article by ***;
*** De Silva also provides some conceptual and methodologic guidance to how to contruct ***;
*** FRAIL-NH in practice, although based on clinical data, rather than MDS 3.0. Finally, ***;
*** the recent review by Liau et al. links to multiple other examples of researchers ***;
*** implementing FRAIL-NH in a variety of settings. ***;
*** ***;
*** The FRAIL-NH items are: ***;
*** F - Fatigue (also refered to as lethargy, depression, energy) ***;
*** R - Resistance (also referred to as transfer ability) ***;
*** A - Ambulation (also referred to as ability to "walk in room", ability to "get out") ***;
*** I - Incontinence (defined as various combinations of bowel/bladder continence) ***;
*** L - Loss of weight (unclear what to do with intentional weight loss) ***;
*** N - Nutritional approaches (use of mechanically altered diet, or tube feeding, some ***;
*** authors address parenteral feeding, other make no mention of what to do) ***;
*** H - Help with dressing (ability to dress self) ***;
*** ***;
*** We adopted the following general approach: ***;
*** 1) We carefully reviewed of the articles by Kaehr, Cowles, Luo, and De Silva to ***;
*** identify the concept attached to each FRAIL-NH item. ***;
*** 2) We then mapped MDS 3.0 items as closely to these concepts as we could, with ***;
*** analogues where possible from the MDS 2 items described in Luo et al. ***;
*** 3) We developed flowcharts for how to combine information from these items for each of ***;
*** the FRAIL-NH items, including how to handle missing information. ***;
*** ***;
***********************************************************************************************;
***********************************************************************************************;
*** F A T I G U E ***;
*** The original specification in Kaehr 2015 was "Fatigue No Yes PHQ-9>=10" ***;
*** In Kaehr 2016, further specified as "F= Fatigue, based on MDS response to PHQ-9, No ***;
*** (never or 1 day=0), Yes (several days or everyday=1), Depressed (PHQ-9 of =10=2)" ***;
*** Luo 2015 defines this item as "Fatigue was measured by the presence of (1) periods of ***;
*** lethargy and (2) depressive symptoms in MDS. Participants scoring 3 or higher on ***;
*** the MDS Depression Rating Scale were classified as having depressive symptoms. ***;
*** Participants meeting only 1 of the 2 criteria were assigned 1 point, and both ***;
*** criteria 2 points. ***;
*** None of these sources addresses what to do when the PHQ-9 is missing, and it is ***;
*** ambiguous what to do when the depression score is high, but the fatigue item is not ***;
*** endorsed. We decided that a high score on the PHQ-9 should take precedence whether ***;
*** or not the fatigue item was endorsed, and that to include as many residents as ***;
*** possible, we would include both self-reported and staff-ascribed values for both ***;
*** the fatigue item and the PHQ-9 or the PHQ-10-OV. ***;
*** ***;
*** if PHQ-9>=10 or PHQ-10-OV>=10 then F = 2. ***;
*** else if 0<=PHQ-9<10 or 0<=PHQ-10-OV<10 then do; ***;
*** if { D02d1 (little energy-presence, self)=1 ***;
*** or D05d1 (little energy-presence, staff)=1 ***;
*** or D02d2 (little energy-frequency, self) in(1,2,3) ***;
*** or D05d2 (little energy-frequency, staff) in(1,2,3) } then F = 1. ***;
*** else if 0<=PHQ-9<10 or 0<=PHQ-10-OV<10 ***;
*** AND { D02d1 (little energy-presence, self)=0 ***;
*** or D05d1 (little energy-presence, staff)=0 ***;
*** or D02d2 (little energy-frequency, self)=0 ***;
*** or D05d2 (little energy-frequency, staff)=0 } then F = 0. ***;
*** ***;
***********************************************************************************************;
if '10'<=D0300_Mood_Scre_Num<='27' or '10'<=D0600_Stf_Mood_Scre_Num<='30' then temp_FRAIL_NH_F=2;
else if '00'<=D0300_Mood_Scre_Num<'10' or '00'<=D0600_Stf_Mood_Scre_Num<'10' then do;
if D0200d1_Ltl_Enrgy_Cd='1'
or D0500d1_Stf_Ltl_Enrgy_Cd='1'
or D0200d2_Ltl_Enrgy_Freq_Cd in('1','2','3')
or D0500d2_Stf_Ltl_Enrgy_Freq_Cd in('1','2','3') then temp_FRAIL_NH_F=1;
else if D0200d1_Ltl_Enrgy_Cd='0'
or D0500d1_Stf_Ltl_Enrgy_Cd='0'
or D0200d2_Ltl_Enrgy_Freq_Cd in('0')
or D0500d2_Stf_Ltl_Enrgy_Freq_Cd in('0') then temp_FRAIL_NH_F=0;
end;
***********************************************************************************************;
*** R E S I S T A N C E ( T R A N S F E R ) ***;
*** Kaehr 2015: "R = Resistance, Can patient transfer, Independently, Help with set up ***;
*** only, or Physical assistance" ***;
*** "Resistance 0:Independent transfer 1:Set up 3:Physical help" ***;
*** Kaehr 2016: "R=Resistance, Can patient transfer, Independent ± Supervision=0, Set Up ***;
*** Only=1, or Physical Assistance=2" ***;
*** Luo 2015: "Resistance was assessed using the “transfer” item in MDS, which is a proxy ***;
*** measure that reflects functional status of whether support was needed to move ***;
*** between surfaces (eg, to/from the bed, chair, wheelchair, or standing position). ***;
*** Performance was rated as 0, 1, and 2 for no help needed, set up help only, and ***;
*** physical assistance needed, respectively." ***;
*** These sources are consistent in describing the transfer ADL item, although there ***;
*** remains ambiguity with wording in some places consistent with the "self performance"***;
*** item, and in others with the "Support Provided" item. We decided to prioritize the ***;
*** higher coding available from either item. When the activity was performed only ***;
*** once or twice in the prior 7 days, and the support provided was missing, we felt ***;
*** it would be better to assume that the resident required support than to assume we ***;
*** should treat this instance as missing, given that performing transfer fewer than ***;
*** 3 times in a week would be more consistent with severe frailty, regardless of ***;
*** support provided for those transfers. ***;
*** ***;
*** if G0110b1_Trnsfr_Self_Cd in(2,3,4,8) OR G0110b2_Trnsfr_Sprt_Cd in(2,3,8) ***;
*** then R = 2. ***;
*** else if G0110b1_Trnsfr_Self_Cd=1 then R = 1; ***;
*** else if G0110b1_Trnsfr_Self_Cd=0 then R = 0; ***;
*** else if G0110b1_Trnsfr_Self_Cd=7 (activity occurred only once or twice), then do; ***;
*** if G0110b2_Trnsfr_Sprt_Cd=1 then R = 1; ***;
*** else if G0110b2_Trnsfr_Sprt_Cd=0 then R = 0; ***;
*** else if G0110b2_Trnsfr_Sprt_Cd=missing then R = 2; ***;
*** ***;
***********************************************************************************************;
if G0110b1_Trnsfr_Self_Cd in('2','3','4','8') OR G0110b2_Trnsfr_Sprt_Cd in('2','3','8') then temp_FRAIL_NH_R = 2; ***;
else if G0110b1_Trnsfr_Self_Cd='1' then temp_FRAIL_NH_R = 1;
else if G0110b1_Trnsfr_Self_Cd='0' then temp_FRAIL_NH_R = 0;
else if G0110b1_Trnsfr_Self_Cd='7' then do;
if G0110b2_Trnsfr_Sprt_Cd='1' then temp_FRAIL_NH_R = 1;
else if G0110b2_Trnsfr_Sprt_Cd='0' then temp_FRAIL_NH_R = 0;
else if G0110b2_Trnsfr_Sprt_Cd in('','-') then temp_FRAIL_NH_R = 2;
end;
***********************************************************************************************;
*** A M B U L A T I O N ***;
*** Kaehr 2015: "A = Ambulation, Independent, With assistive device, Not able" ***;
*** "Ambulation 0:Independent 1:Assistive device 2:Not able" ***;
*** Kaehr 2016: "A= Ambulation, Independent=0, Walker/Cane=1, Not Able/Wheelchair=2" ***;
*** Cowles 2016: "Ambuation 0:Independent 1:Walker 2:Not Able" ***;
*** Luo 2015: "Ambulation was measured using the “walk in room” item in the MDS, which ***;
*** records the person’s performance in walking between locations in a room. ***;
*** Performance was rated as 0, 1, or 2 for independence, supervision/limited ***;
*** assistance needed, and extensive assistance needed/total dependence, respectively." ***;
*** We followed Luo et al. in conceiving the "walk in room" ADL item as being closest to ***;
*** the concept of "ambulation" among the 6 ADL items related to mobility. We ***;
*** interpreted the ambiguity about assistive devices as follows: use of cane/walker=1, ***;
*** use of wheelchair=2. We employed the same method for combining self-performance and ***;
*** support for "walk in room" as specified above in 'R' for "transfer". ***;
*** We broke this 'A' item down into 2 "elements", A(1) for the "walk in room" ADL, and ***;
*** A(2) for the use of assistive devices, then applying the logic that the higher ***;
*** score should take precedence. ***;
*** ***;
*** if G0110c1_Wlk_Room_Self_Cd in(2,3,4,8) OR G0110c2_Wlk_Room_Sprt_Cd in(2,3,8) ***;
*** then A(1) = 2. ***;
*** else if G0110c1_Wlk_Room_Self_Cd=1 then A(1) = 1; ***;
*** else if G0110c1_Wlk_Room_Self_Cd=0 then A(1) = 0; ***;
*** else if G0110c1_Wlk_Room_Self_Cd=7 (activity occurred only once or twice), then do; ***;
*** if G0110c2_Wlk_Room_Sprt_Cd=1 then A(1) = 1; ***;
*** else if G0110c2_Wlk_Room_Sprt_Cd=0 then A(1) = 0; ***;
*** else if G0110c2_Wlk_Room_Sprt_Cd=missing then A(1) = 2; ***;
*** ***;
*** if G0600c_Whlchr_Cd='1' then A(2) = 2. ***;
*** else if G0600a_Cane_Cd='1' or G0600b_Wlkr_Cd='1' then A(2) = 1. ***;
*** else if G0600z_No_Mblty_Cd='1' ***;
*** or (G0600c_Whlchr_Cd='0' and G0600a_Cane_Cd='0' and G0600b_Wlkr_Cd='0') ***;
*** then A(2) = 0. ***;
*** ***;
*** if A(1)=2 or A(2)=2 then A = 2. ***;
*** else if A(1)=1 and A(2) in(0,1) then A = 1. ***;
*** else if A(1) in(0,1) and A(2)=1 then A = 1. ***;
*** else if A(1)=0 and A(2)=0 then A = 0. ***;
*** ***;
***********************************************************************************************;
if G0110c1_Wlk_Room_Self_Cd in('2','3','4','8') OR G0110c2_Wlk_Room_Sprt_Cd in('2','3','8') then temp_FRAIL_NH_A1 = 2; ***;
else if G0110c1_Wlk_Room_Self_Cd='1' then temp_FRAIL_NH_A1 = 1;
else if G0110c1_Wlk_Room_Self_Cd='0' then temp_FRAIL_NH_A1 = 0;
else if G0110c1_Wlk_Room_Self_Cd='7' then do;
if G0110c2_Wlk_Room_Sprt_Cd='1' then temp_FRAIL_NH_A1 = 1;
else if G0110c2_Wlk_Room_Sprt_Cd='0' then temp_FRAIL_NH_A1 = 0;
else if G0110c2_Wlk_Room_Sprt_Cd in('','-') then temp_FRAIL_NH_A1 = 2;
end;
if G0600c_Whlchr_Cd='1' then temp_FRAIL_NH_A2 = 2;
else if G0600a_Cane_Cd='1' or G0600b_Wlkr_Cd='1' then temp_FRAIL_NH_A2 = 1;
else if G0600z_No_Mblty_Cd='1'
or (G0600c_Whlchr_Cd='0' and G0600a_Cane_Cd='0' and G0600b_Wlkr_Cd='0') then temp_FRAIL_NH_A2 = 0;
if temp_FRAIL_NH_A1=2 or temp_FRAIL_NH_A2=2 then temp_FRAIL_NH_A = 2;
else if temp_FRAIL_NH_A1=1 and temp_FRAIL_NH_A2 in(0,1) then temp_FRAIL_NH_A = 1;
else if temp_FRAIL_NH_A1 in(0,1) and temp_FRAIL_NH_A2=1 then temp_FRAIL_NH_A = 1;
else if temp_FRAIL_NH_A1=0 and temp_FRAIL_NH_A2=0 then temp_FRAIL_NH_A = 0;
***********************************************************************************************;
*** I N C O N T I N E N C E ***;
*** Kaehr 2015: "I = Incontinence, None, Urinary incontinence, Bowel incontinence" ***;
*** "Incontinence 0:None 1:Bladder 2:Bowel" ***;
*** Kaehr 2016: "I= Incontinence, None=0, Urinary Incontinence=1, Bowel Incontinence=2" ***;
*** Luo 2015: "Incontinence was measured in terms of both urinary and bowel incontinence. ***;
*** A score of 0 indicates continence, 1 indicating only urinary or bowel incontinence, ***;
*** and 2 for both urinary and bowel incontinence. ***;
*** It remains ambiguous from these sources whether bowel incontinence trumps bladder ***;
*** continence to an automatic "2". We decided to treat bowel incontinence as a "2" ***;
*** regardless of bladder continence, under the assumptions that the Kaehr sources ***;
*** imply a hierarchy of bowel continence over bladder continence, although there is no ***;
*** direct statement of a preference for either approach in any of the sources. ***;
*** ***;
***********************************************************************************************;
if H0400_Bwl_Cntnc_Cd in('1','2','3','9') or H0100c_Ostmy_Cd='1' then temp_FRAIL_NH_I = 2;
else if H0300_Urnry_Cntnc_Cd in('1','2','3','9')
or H0100a_Indwlg_Cthtr_Cd='1'
or H0100b_Extrnl_Cthtr_Cd='1'
or H0100d_Intrmtnt_Cthtr_Cd='1' then temp_FRAIL_NH_I=1;
else if H0400_Bwl_Cntnc_Cd='0' or H0300_Urnry_Cntnc_Cd='0' then temp_FRAIL_NH_I=0;
***********************************************************************************************;
*** L O S S O F W E I G H T ***;
*** Kaehr 2015: "L = Loss of weight, None, 5% in 3 months, 10% in the past 6 months" ***;
*** "Loss of weight 0:None 1:5% in 3 mo 2:10% in 6 mo" ***;
*** Kaehr 2016: "L= Loss of Weight, defined by MDS as ***;
*** = 5% in 30 days or =10% in 180 days No=0, Yes=1" ***;
*** Cowles 2016: Loss of Weight 0:None 1:Yes" ***;
*** Luo 2015: Weight loss was measured using the “weight change” item in MDS, which ***;
*** captures whether there had been a weight loss of 5% or more in the past 30 days or ***;
*** 10% or more in the past 180 days. A score of 1 (meeting criterion) or 0 was given. ***;
*** The MDS 3.0 item (K03) assesses weight loss in a single item, thus this 'L' item can ***;
*** be "0" or "1", but not "2". Conceptually, it is clear that this item is about the ***;
*** unintentional loss of weight, and it is thus ambiguous what to do with residents ***;
*** who have intentionally lost weight, under the encouragement of a physician. We have ***;
*** decided to count unintentional weight loss as "1", and both no weight loss and ***;
*** physician-prescibed weight loss as "0". ***;
*** ***;
***********************************************************************************************;
if K0300_Wt_Loss_Cd='1' then temp_FRAIL_NH_L=1;
else if K0300_Wt_Loss_Cd in('0','2') then temp_FRAIL_NH_L=0;
***********************************************************************************************;
*** N U T R I T I O N A L A P P R O A C H E S ***;
*** Kaehr 2015: "N = Nutritional approach, Regular diet, Mechanically altered diet, Feeding ***;
*** tube" ***;
*** "Nutritional approach 0:Regular diet 1:Mechanically altered 2:Feeding tube" ***;
*** Kaehr 2016: "N= Nutritional Approach, Regular Diet=0, Altered Diet=1, Feeding Tube=2" ***;
*** Luo 2015: "Nutritional approach was assessed in MDS according to whether a resident had ***;
*** a mechanically altered diet or used a feeding tube. A score of 1 (meeting ***;
*** criterion) or 0 was given." ***;
*** None of these sources addresses parenteral feeding, although De Silva 2018 (with a ***;
*** shared co-author) does treat parenteral feeding as equivalent to use of a feeding ***;
*** tube. It is not clear why Luo flattened either mechanically altered diet or feeding ***;
*** tube into a 0/1 dichotomy. We treated use of a feeding tube and/or parentereal ***;
*** feeding as a "2", and a mechanically altered diet as a "1". We decided not to ***;
*** consider a "therapeutic diet" one way or another, because this did not seem to ***;
*** match the concept of frailty related to the ability to eat. ***;
*** ***;
***********************************************************************************************;
if K0500a_PEN_Cd='1' or K0510a2_PEN_Post_Cd='1'
or K0500b_Feedg_Tube_Cd='1' or K0510b2_Feedg_Tube_Post_Cd='1'
then temp_FRAIL_NH_N=2;
else if K0500c_Altr_Food_Cd='1' or K0510c2_Altr_Food_Post_Cd='1'
then temp_FRAIL_NH_N=1;
else if (K0500z_No_Feedg_Cd='1' or (K0500a_PEN_Cd='0' and K0500b_Feedg_Tube_Cd='0' and K0500c_Altr_Food_Cd='0'))
or (K0510z2_No_Feedg_Post_Cd='1' or (K0510a2_PEN_Post_Cd='0' and K0510b2_Feedg_Tube_Post_Cd='0' and K0510c2_Altr_Food_Post_Cd='0'))
then temp_FRAIL_NH_N=0;
***********************************************************************************************;
*** H E L P W I T H D R E S S I N G ***;
*** Kaehr 2015: "H = Help with dressing, Independent, Help with set up only, Physical help" ***;
*** "Help with dressing 0:Independent 1:Set up 2:Physical help" ***;
*** Kaehr 2016: "H=Help with dressing, Independent ± Supervision=0, Set Up only=1, Physical ***;
*** Assistance=2" ***;
*** Luo 2015: "Help with dressing was assessed using the “dressing” item in MDS, which ***;
*** reflects whether support was needed to put on, fasten, and take off all items of ***;
*** street clothing, including donning or removing a prosthesis. Performance was rated ***;
*** as 0, 1, and 2 for no help needed, set up help only, and physical assistance needed,***;
*** respectively. ***;
*** As with 'R' above, the various definitions are fairly consistent, but ambiguous about ***;
*** whether to use the "self Performance" or "Support Provided" items, with terms ***;
*** borrowed from both items. We decided to code this the same way as "transfer" for ***;
*** 'R', and "Walk in Room" for 'A'. ***;
*** ***;
***********************************************************************************************;
if G0110g1_Dress_Self_Cd in('2','3','4','8') OR G0110g2_Dress_Sprt_Cd in('2','3','8') then temp_FRAIL_NH_H = 2; ***;
else if G0110g1_Dress_Self_Cd='1' then temp_FRAIL_NH_H = 1;
else if G0110g1_Dress_Self_Cd='0' then temp_FRAIL_NH_H = 0;
else if G0110g1_Dress_Self_Cd='7' then do;
if G0110g2_Dress_Sprt_Cd='1' then temp_FRAIL_NH_H = 1;
else if G0110g2_Dress_Sprt_Cd='0' then temp_FRAIL_NH_H = 0;
else if G0110g2_Dress_Sprt_Cd in('','-') then temp_FRAIL_NH_H = 2;
end;
MDS3_FRAIL_NH = temp_FRAIL_NH_F + temp_FRAIL_NH_R + temp_FRAIL_NH_A + temp_FRAIL_NH_I + temp_FRAIL_NH_L
+ temp_FRAIL_NH_N + temp_FRAIL_NH_H;
if MDS3_FRAIL_NH=. then do;
if A0310b_PPS_Cd='08' or A0310f_Entry_Dschrg_Cd in('01','12')
or ( (MDS3_Target_DateMDY(03,31,2012)) and A0310f_Entry_Dschrg_Cd in('10','11') )
then MDS3_FRAIL_NH=.A;
else if A0310a_Fed_OBRA_Cd='99' and A0310b_PPS_Cd='99' and A0310f_Entry_Dschrg_Cd='99'
then MDS3_FRAIL_NH=.A;
else if B0100_Cmts_Cd='1' then MDS3_FRAIL_NH=.P;
else if /*(D0300_Mood_Scre_Num in('-','^') and D0600_Stf_Mood_Scre_Num in('-','^') and D0200d1_Ltl_Enrgy_Cd in('-','^') and D0200d2_Ltl_Enrgy_Freq_Cd in('-','^') and D0500d1_Stf_Ltl_Enrgy_Cd in('-','^') and D0500d2_Stf_Ltl_Enrgy_Freq_Cd in('-','^'))
or (G0110b1_Trnsfr_Self_Cd='-')
or (G0110c1_Wlk_Room_Self_Cd='-' and G0600c_Whlchr_Cd='-' and G0600a_Cane_Cd='-' and G0600b_Wlkr_Cd='-')
or (H0100a_Indwlg_Cthtr_Cd='-' and H0100b_Extrnl_Cthtr_Cd='-' and H0100c_Ostmy_Cd='-' and H0100d_Intrmtnt_Cd='-' and H0300_Urnry_Cntnc_Cd='-' and H0400_Bwl_Cntnc_Cd='-')
or (K0300_Wt_Loss_Cd='-' and K0310_Wt_Gain_Cd='-')
or ((K0500a_PEN_Cd='-' or K0510a2_PEN_Post_Cd='-') and (K0500b_Feedg_Tube_Cd='-' or K0510b2_Feedg_Tube_Post_Cd='-'))
or (G0110g1_Dress_Self_Cd='-')*/
D0300_Mood_Scre_Num in('-','^') or D0600_Stf_Mood_Scre_Num in('-','^') or D0200d1_Ltl_Enrgy_Cd in('-','^') or D0200d2_Ltl_Enrgy_Freq_Cd in('-','^') or D0500d1_Stf_Ltl_Enrgy_Cd in('-','^') or D0500d2_Stf_Ltl_Enrgy_Freq_Cd in('-','^')
or G0110b1_Trnsfr_Self_Cd='-'
or G0110c1_Wlk_Room_Self_Cd='-' or G0600c_Whlchr_Cd='-' or G0600a_Cane_Cd='-' or G0600b_Wlkr_Cd='-'
or H0100a_Indwlg_Cthtr_Cd='-' or H0100b_Extrnl_Cthtr_Cd='-' or H0100c_Ostmy_Cd='-' or H0100d_Intrmtnt_Cthtr_Cd='-' or H0300_Urnry_Cntnc_Cd='-' or H0400_Bwl_Cntnc_Cd='-'
or K0300_Wt_Loss_Cd='-' or K0310_Wt_Gain_Cd='-'
or K0500a_PEN_Cd='-' or K0510a2_PEN_Post_Cd='-' or K0500b_Feedg_Tube_Cd='-' or K0510b2_Feedg_Tube_Post_Cd='-'
or G0110g1_Dress_Self_Cd='-'
then MDS3_FRAIL_NH=.I;
end;
label
MDS3_FRAIL_NH = 'MDS3_FRAIL_NH|FRAIL-NH Scale (0-13), as coded by UMass PHARE Study Group'
;
drop temp_FRAIL_NH_F temp_FRAIL_NH_R temp_FRAIL_NH_A1 temp_FRAIL_NH_A2 temp_FRAIL_NH_A temp_FRAIL_NH_I temp_FRAIL_NH_L temp_FRAIL_NH_N temp_FRAIL_NH_H;