curedao / health-reference-data

Standard health reference databases including units of measurement, biomarkers, medical codes, medications, side-effects, supplements, foods, ingredients, and more.
https://curedao.org
GNU General Public License v3.0
9 stars 7 forks source link

What is the shared ID for a variable across the ecosystem? #7

Open vincenzodomina opened 2 years ago

vincenzodomina commented 2 years ago

Requirements to the variables schema and the reference database

The API response should contain this:

.../api/variables/blood_testosterone ->

// Testosterone
{
    id: 'blood_testosterone',   // used also as api property if needed, snake case
    slug: 'blood-testosterone', // used for urls
    category: 'laboratory',
    ref_loinc_id: '2986-8',
    // With the loinc id there is an assay/measurement method definition attached, would be evtl. needed with other biomarkers e.g. heartrate with ppg sensor or manually including the mean error
    abbreviated_name: 'T',
    name: 'Testosterone',
    description: "This is a custom OpenCures description tailored to the specific feature i use this for",
    unit: 'ng/dL',
    synonyms: ['Testosterone, Total', 'Testosterone, Serum', 'Testosteron ges.', 'Testosteron gesamt'],
    references: ['https://www.labcorp.com/tests/004226/testosterone-total', 'https://www.netdoktor.de/Diagnostik+Behandlungen/Laborwerte/Testosteron-1522.html'],
    ranges: {
        male: {
            norm: {
                0: [0, 0, 5, 5, 495, 495, 2000, 2000],
                1: [0, 0, 3, 3, 32, 32, 2000, 2000],
                7: [0, 0, 3, 3, 32, 32, 2000, 2000],
                8: [0, 0, 2, 2, 882, 882, 2000, 2000],
                18: [0, 0, 2, 2, 882, 882, 2000, 2000],
                19: [0, 0, 280, 280, 800, 800, 2000, 2000],
                20: [0, 0, 132, 132, 906, 906, 2000, 20000],
                60: [0, 0, 132, 132, 906, 906, 2000, 2000],
            }
        },
        female: {
            norm: {
                0: [0, 0, 3, 3, 161, 161, 2000, 2000],
                1: [0, 0, 3, 3, 32, 32, 2000, 2000],
                7: [0, 0, 3, 3, 32, 32, 2000, 2000],
                8: [0, 0, 4, 4, 38, 38, 2000, 2000],
                18: [0, 0, 4, 4, 38, 38, 2000, 2000],
                19: [0, 0, 6, 6, 82, 82, 2000, 2000],
                20: [0, 0, 2, 2, 52, 52, 2000, 2000],
            }
        },
    },

    // And the other already agreed stuff of course, not subject of this discussion
    created_at: "timestamp",
    updated_at: "timestamp",
    version_first_released: "",
    version_last_changed: "",
    // ...
};
mikepsinn commented 2 years ago

Requested changes

{
    id: 'blood_testosterone',   // used also as api property if needed, snake case
    slug: 'blood-testosterone', // used for urls
    variable_category_name: 'Laboratory Results', // Maybe use tags 
    ref_loinc_id: '2986-8',
    // With the loinc id there is an assay/measurement method definition attached, would be evtl. needed with other biomarkers e.g. heartrate with ppg sensor or manually including the mean error
    abbreviated_name: 'T',
    name: 'Testosterone',
    description: "This is a custom OpenCures description tailored to the specific feature i use this for",
    unit_abbreviated_name: 'ng/dL',
    synonyms: ['Testosterone, Total', 'Testosterone, Serum', 'Testosteron ges.', 'Testosteron gesamt'],
    references: ['https://www.labcorp.com/tests/004226/testosterone-total', 'https://www.netdoktor.de/Diagnostik+Behandlungen/Laborwerte/Testosteron-1522.html'],
    ranges: {
        male: {
            norm: {
                0: [0, 0, 5, 5, 495, 495, 2000, 2000],
                1: [0, 0, 3, 3, 32, 32, 2000, 2000],
                7: [0, 0, 3, 3, 32, 32, 2000, 2000],
                8: [0, 0, 2, 2, 882, 882, 2000, 2000],
                18: [0, 0, 2, 2, 882, 882, 2000, 2000],
                19: [0, 0, 280, 280, 800, 800, 2000, 2000],
                20: [0, 0, 132, 132, 906, 906, 2000, 20000],
                60: [0, 0, 132, 132, 906, 906, 2000, 2000],
            }
        },
        female: {
            norm: {
                0: [0, 0, 3, 3, 161, 161, 2000, 2000],
                1: [0, 0, 3, 3, 32, 32, 2000, 2000],
                7: [0, 0, 3, 3, 32, 32, 2000, 2000],
                8: [0, 0, 4, 4, 38, 38, 2000, 2000],
                18: [0, 0, 4, 4, 38, 38, 2000, 2000],
                19: [0, 0, 6, 6, 82, 82, 2000, 2000],
                20: [0, 0, 2, 2, 52, 52, 2000, 2000],
            }
        },
    },

    // And the other already agreed stuff of course, not subject of this discussion
    created_at: "timestamp", // When the DB record was updated
    updated_at: "timestamp", // When the DB record was updated
    version_first_released: "", // We'll have to use a DB migration system
    version_last_changed: "", // We'll have to use a DB migration system
    // ...
};