def test_ok(self): from meta_lists.list_data import list_data PreloadData(list_data=list_data) data = {k: v for k, v in self.get_options().items()} form = PatientHistoryForm(data=data) form.is_valid() pprint(form._errors) self.assertEqual(form._errors, {})
list_data = { 'trainee_prn.deathcauseinfo': [('No information will ever be available', 'No information will ever be available'), ('Other, specify', 'Other, specify'), ('Autopsy', 'Autopsy'), ('Clinical record', 'Clinical record'), ('Information from physician/nurse/other health care provider', 'Information from physician/nurse/other health care provider'), ('Information from participant\u2019s relatives or friends', 'Information from participant\u2019s relatives or friends'), ('Information requested, still pending', 'Information requested, still pending')], 'trainee_prn.causecategory': [('No information will ever be available', 'No information will ever be available'), ('Other, specify', 'Other, specify'), ('Cancer', 'Cancer'), ('HIV infection or HIV/AIDS-related diagnosis', 'HIV infection or HIV/AIDS-related diagnosis'), ('Disease/injury unrelated to cancer or HIV', 'Disease/injury unrelated to cancer or HIV'), ('Toxicity from cancer treatment (complications of chemotherapy, radiation, or surgery)', 'Toxicity from cancer treatment (complications of chemotherapy, radiation, or surgery)' ), ('Toxicity from HIV/AIDS treatment (HAART or treatment of HIV/AIDS-related diagnosis)', 'Toxicity from HIV/AIDS treatment (HAART or treatment of HIV/AIDS-related diagnosis)' )] } preload_data = PreloadData(list_data=list_data)
('no_treatment', '- No treatment'), (OTHER, '- Other, specify') ], 'ambition_ae.meningitissymptom': [ ('headache', 'Headache'), ('vomiting', 'Vomiting'), ('fever', 'Fever'), ('seizures', 'Seizures'), ('neck_pain', 'Neck pain'), ('no_symptoms', '- No symptoms'), (OTHER, '- Other, specify') ], 'ambition_ae.neurological': [ ('meningism', 'Meningism'), ('papilloedema', ' Papilloedema'), ('focal_neurologic_deficit', 'Focal neurologic deficit'), ('CN_VI_palsy', 'Cranial Nerve VI palsy'), ('CN_III_palsy', 'Cranial Nerve III palsy'), ('CN_IV_palsy', 'Cranial Nerve IV palsy'), ('CN_VII_palsy', 'Cranial Nerve VII palsy'), ('CN_VIII_palsy', 'Cranial Nerve VIII palsy'), ('no_symptoms', '- No symptoms'), (OTHER, '- Other CN palsy'), ], } preload_data = PreloadData( list_data=list_data, model_data={}, unique_field_data=None)
from edc_list_data import PreloadData model_data = { "edc_lab.consignee": [{ "name": "The META Trial", "contact_name": "Sokoine Kivuyo", "address": "NIMR Tanzania", "postal_code": "-", "city": "Dar es Salaam", "state": None, "country": "Tanzania", "telephone": "+255763244779", "mobile": "+255763244779", "fax": None, "email": "*****@*****.**", }] } unique_field_data = {"edc_lab.consignee": {"name": ("-", "-")}} preload_data = PreloadData(list_data=None, model_data=model_data, unique_field_data=unique_field_data)
def handle(self, *args, **kwargs): PreloadData(list_data=list_data) self.stdout.write( self.style.SUCCESS(f'List data successfully loaded.'))