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 [(220, 2, data_id), (40, 4, lwh.mk_01(data['pis'])), (41, 4, lwh.mk_01(data['consent']))]
def mk_e_screening_ms(data_id, data): # measurement group 29 """ transforms a e-screening-ms 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 [(220, 2, data_id), (191, 4, lwh.mk_01(data['metre'])), (193, 4, lwh.mk_01(data['ageval'])), (195, 4, lwh.mk_01(data['willing'])), (197, 4, lwh.mk_01(data['available'])), (198, 4, lwh.mk_01(data['diagnosis'])), (199, 4, lwh.mk_01(data['history'])), (200, 4, lwh.mk_01(data['literate'])), (194, 4, lwh.mk_01(data['impaired'])), (196, 4, lwh.mk_01(data['eligible'])), (201, 4, lwh.mk_01(data['shoe']))]
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 """ val_list = [(220, 2, data_id), (202, 4, lwh.mk_01(data['copd-sdiag'])), (203, 4, lwh.mk_01(data['copd-sdiagfx'])), (204, 4, lwh.mk_01(data['chf-sdiag'])), (205, 4, lwh.mk_01(data['chf-sdiagfx'])), (206, 4, lwh.mk_01(data['ms-sdiag'])), (207, 4, lwh.mk_01(data['ms-sdiagfx'])), (208, 4, lwh.mk_01(data['pd-sdiag'])), (209, 4, lwh.mk_01(data['pd-sdiagfx'])), (210, 4, lwh.mk_01(data['pff-sdiag'])), (211, 4, lwh.mk_01(data['pff-sdiagfx']))] for sublist in lwh.mk_optional_boolean(212, 222, data, 'pffq'): val_list.append(sublist) for sublist in lwh.mk_optional_boolean(213, 223, data, 'pffx'): val_list.append(sublist) return val_list