Пример #1
0
def mk_consent(data_id, data):  # measurement group 6
    """
    transforms a a-consent.json form into the triples used by insertMeasurementGroup to
        store each measurement that is in the form
    :param data_id: unique id from the json form
    :param data: data array from the json form
    :return: The list of (typeid,valType,value) triples that are used by insertMeasurementGroup to add the measurements
    """
    return [
        mobilise_data_id_field(data_id),
        lwh.mk_boolean(40, data, 'pis'),
        lwh.mk_boolean(41, data, 'consent')
    ]
Пример #2
0
def mk_comorbidity(data_id, data):  # measurement group 26
    """
    transforms a c-comorbidity.json form into the triples used by insertMeasurementGroup to
        store each measurement that is in the form
    :param data_id: unique id from the json form
    :param data: data array from the json form
    :return: The list of (typeid,valType,value) triples that are used by insertMeasurementGroup to add the measurements
    """
    return [mobilise_data_id_field(data_id),
                lwh.mk_boolean(202, data, 'copd-sdiag'),
                lwh.mk_boolean(203, data, 'copd-sdiagfx'),
                lwh.mk_boolean(204, data, 'chf-sdiag'),
                lwh.mk_boolean(205, data, 'chf-sdiagfx'),
                lwh.mk_boolean(206, data, 'ms-sdiag'),
                lwh.mk_boolean(207, data, 'ms-sdiagfx'),
                lwh.mk_boolean(208, data, 'pd-sdiag'),
                lwh.mk_boolean(209, data, 'pd-sdiagfx'),
                lwh.mk_boolean(210, data, 'pff-sdiag'),
                lwh.mk_boolean(211, data, 'pff-sdiagfx')] + \
                lwh.mk_optional_boolean(212, data, 'pffq') + \
                lwh.mk_optional_boolean(213, data, 'pffx')
Пример #3
0
def mk_e_screening_pd(data_id, data):  # measurement group 30
    """
    transforms a e-screening-pd json form into the triples used by insertMeasurementGroup to
            store each measurement that is in the form
    :param data_id: unique id from the json form
    :param data: data array from the json form
    :return: The list of (typeid,valType,value) triples that are used by insertMeasurementGroup to add the measurements
    """
    return [
        mobilise_data_id_field(data_id),
        lwh.mk_boolean(191, data, 'metre'),
        lwh.mk_boolean(193, data, 'ageval'),
        lwh.mk_boolean(195, data, 'willing'),
        lwh.mk_boolean(197, data, 'available'),
        lwh.mk_boolean(198, data, 'diagnosis'),
        lwh.mk_boolean(199, data, 'history'),
        lwh.mk_boolean(200, data, 'literate'),
        lwh.mk_boolean(194, data, 'impaired'),
        lwh.mk_boolean(196, data, 'eligible'),
        lwh.mk_boolean(201, data, 'shoe')
    ]