Skip to content

Differentiating Partial Penn CNB Data from Missing Data #95

Description

@kcho

def get_cnb_status():
interview_date=get_value(timepoint,'chrpenn_interview_date')
if interview_date=='':
return {'cnb_data':'', 'cnb_protocol':'', 'cnb_date':'', 'cnb_missing':''}
if get_value(timepoint,'chrpenn_missing')=='1':
missing_code=get_value(timepoint,'chrpenn_missing_spec')
return {'cnb_data':'', 'cnb_protocol':'', 'cnb_date':interview_date, 'cnb_missing':missing_code}
scan_minus_consent=str_date_minus_str_date(consent_date,interview_date)
days_since_scan=str_date_minus_str_date(interview_date,today)
# populate Data Transferred row
# load .UPENN.json
# check if interview_date exists twice among all session_date
data=-days_since_scan
upenn=s.replace(f'.{network}.json','.UPENN.json')
if isfile(upenn):
with open(upenn) as f:
dict1=json.load(f)
count=0
for d in dict1:
if abs(str_date_minus_str_date(d['session_date'],interview_date))<=30:
count+=1
# NOTE some subjects may have just one session
if count==2:
data=1
# populate Protocol Followed row
protocol=1
if get_value(timepoint,f'chrpenn_complete')!='0':
protocol=0
dict2={'cnb_data':data, 'cnb_protocol':protocol, 'cnb_date':interview_date,
'cnb_missing':''}
return dict2

In the get_cnb_status function, for the data variable to be assigned a value of 1, dict1 must contain two specific items: SPLLT and NOSPLLT. However, there are instances where only one of these items is present. These cases should be distinctly labeled, setting them apart from situations where data equals 0.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions