Skip to content

Instantly share code, notes, and snippets.

@fredkingham
Last active December 17, 2019 10:27
Show Gist options
  • Save fredkingham/5bca707ce80d23580b3000220bd86de0 to your computer and use it in GitHub Desktop.
Save fredkingham/5bca707ce80d23580b3000220bd86de0 to your computer and use it in GitHub Desktop.
FIELDS = [
"treatment_category",
"urgent_treatment",
"regulation_11_replacement_appliance",
"prescription_only",
"denture_repairs",
"bridge_repairs",
"arrest_of_bleeding",
"removal_of_sutures",
]
def get_multiple_treatments(episode):
treatment = episode.fp17treatmentcategory_set.get()
result = []
count = 0
for field in FIELDS:
if getattr(treatment, field) == True:
result.append(field)
if len(result) > 1:
return (episode, result,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment