Skip to content

Commit

Permalink
add resource parameter formating
Browse files Browse the repository at this point in the history
  • Loading branch information
LanaBot committed Nov 7, 2023
1 parent 4d3e480 commit 58ead76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kairos/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ def format_positive_outcome(positive_outcome):
item.pop('unit')
return prcore_outcome

def format_additional_info(additional_info):
if not additional_info: return None
prcore_additional_info = copy.deepcopy(additional_info)

treatment_duration = prcore_additional_info['plugin_causallift_resource_allocation']['treatment_duration']
prcore_additional_info['plugin_causallift_resource_allocation']['treatment_duration'] = f'{treatment_duration.get("value")}{treatment_duration.get("unit")}'
prcore_additional_info['plugin-causallift-resource-allocation'] = prcore_additional_info.pop('plugin_causallift_resource_allocation')
return prcore_additional_info

def update_case_prescriptions(my_case,new_activity,activity_column):
new_activities = my_case.get('activities')
last_activity = new_activities[-1]
Expand Down

0 comments on commit 58ead76

Please sign in to comment.