Skip to content

Commit

Permalink
fix(fhir): Update flattened questionnaire method to return authored d…
Browse files Browse the repository at this point in the history
…ate separately

Merge pull request #6 from hms-dbmi/PPM-485
  • Loading branch information
b32147 authored Feb 9, 2019
2 parents f541939 + c84ba15 commit 244583f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ppmutils/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -2489,7 +2489,9 @@ def flatten_participant(bundle):
_questionnaire_id = FHIR.questionnaire_id(participant['project'])

# Parse out the responses
participant['questionnaire'] = FHIR.flatten_questionnaire_response(bundle, _questionnaire_id)
questionnaire_responses, questionnaire_authored_date = FHIR.flatten_questionnaire_response(bundle, _questionnaire_id)
participant['questionnaire'] = questionnaire_responses
participant['questionnaire_authored'] = questionnaire_authored_date

# Flatten points of care
participant['points_of_care'] = FHIR.flatten_list(bundle, 'Organization')
Expand Down Expand Up @@ -2618,7 +2620,7 @@ def flatten_questionnaire_response(bundle_dict, questionnaire_id):
authored_date = questionnaire_response.authored.origval
formatted_authored_date = FHIR._format_date(authored_date, '%m/%d/%Y')

return response
return response, formatted_authored_date

@staticmethod
def _questions(items):
Expand Down

0 comments on commit 244583f

Please sign in to comment.