Esempio n. 1
0
 def _parse_all_forms(self):
     # used in questionnaire approval handling where all form data was being saved in one go
     # generated questionnaire gets fanned out to all forms
     for key in self.form_data:
         if key == "timestamp":
             self.global_timestamp = self.form_data[key]
         elif key.endswith("_timestamp"):
             self.form_timestamps[key] = self.form_data[key]
         elif key == "custom_consent_data":
             pass
         elif key == "PatientDataAddressSection":
             pass
         elif is_multisection(key):
             self._parse_multisection(key)
         elif is_delimited_key(key):
             form_model, section_model, cde_model = models_from_mongo_key(self.registry_model, key)
             value = self.form_data[key]
             self.parsed_data[(form_model, section_model, cde_model)] = self._parse_value(value)
Esempio n. 2
0
 def _get_multisection_code(self):
     # NB this assumes we're only parsing multisection forms one  at at time
     from rdrf.helpers.utils import is_multisection
     for key in self.form_data:
         if is_multisection(key):
             return key