-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
At the moment pathways save the world which has lead to several surprising events.
pseudo code resolution looks like the below.
class Step:
def pre_save(self, data, raw_data, user, patient, episode):
return data[self.model.get_api_name()] = self.get_model_data(raw_data)
class Pathway:
def pre_save(self, data, raw_data, user, patient, episode): pass
def save(self, raw_data, user, patient, episode):
data = {}
for step in self.get_steps():
data = step.pre_save(data, raw_data, user, patient, episode)
data = self..pre_save(data, raw_data, user, patient, episode)
patient.bulk_update(data, user, episode)If a step does not have a model it should blow up.
We can probably run the has Pathway.remove_unchanged_subrecords function and compare the new to_save dictionary with the old one and make sure that we were not relying on some inference logic and explode if so.
Metadata
Metadata
Assignees
Labels
No labels