<jupyter_start><jupyter_text>Fields: siteid, loinc, days_since_positive, num_patients, mean_value, stdev_valueNotes:1. One row per loinc and days_since_positive2. days_since_positive = 1 on the date the patient has a positive COVID test result3. Start the table at days_since_positive = -6 (seven days before the positive test)4. Go for as many days as you have data: days_since_positive = 5, 6, 7, ...5. Map your local loinc codes to the loinc code in Gabe's list6. Only use Gabe's loinc codes in this list, not your local codes7. Obfuscate small counts with "-1" as required by your institutionExamples: (Labs-BIDMC.csv)BIDMC, 1920-8, -2, -1, 27.0, -1BIDMC, 1920-8, -1, 4, 41.2, 23.567BIDMC, 1920-8, 0, 4, 47.1, 17.876BIDMC, 1920-8, 1, 38, 59.2, 40.152BIDMC, 1920-8, 2, 35, 52.2, 35.432BIDMC, 1920-8, 3, 12, 40.4, 25.678BIDMC, 1920-8, 4, -1, 52.8, -1BIDMC, 1975-2, 1, 37, 39.5, 20.100<jupyter_code>def make_labs_row(site_id, loinc, dsp, num_p, mean, stdev):
    return {
        COLUMNS.SITE_ID: site_id,
        COLUMNS.LOINC: loinc,
        COLUMNS.DAYS_SINCE_POSITIVE: dsp,
        COLUMNS.NUM_PATIENTS: num_p,
        COLUMNS.MEAN_VALUE: mean,
        COLUMNS.STDEV_VALUE: stdev
    }
for site_id in site_ids:
    output_filepath = join(SITE_DATA_DIR, site_id, f"2020-03-29_Labs-{site_id}.csv")
    labs_at_site = np.random.choice(loinc_codes, 8, replace=False)
    data = []
    for days_since_positive in range(-6, 20):
        for loinc in labs_at_site:
            num_patients = np.random.randint(100, 1000)
            mean_value = np.random.uniform(2, 10) + loinc_df.at[loinc, "change"] * days_since_positive
            stdev_value = np.random.normal(4, 1) + (loinc_df.at[loinc, "change"]/2) * days_since_positive
            data.append(make_labs_row(site_id, loinc, days_since_positive, num_patients, mean_value, stdev_value))
            
            
    df = pd.DataFrame(data=data)
    df.to_csv(output_filepath, index=False, header=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11714429361488185, 'fraction_numerical': 0.07742584213172449, 'mean_word_length': 3.522727272727273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '385681', 'license': 'MIT', 'n_tokens_mistral': 891, 'n_tokens_neox': 760, 'n_words': 194, 'path': 'fakedata/src/generate_fake_labs_data.ipynb', 'repo_name': 'trang1618/c19i2b2-notebooks', 'size': '1989'}