Skip to content

Commit

Permalink
Merge pull request #307 from rcpch:eatyourpeas/issue304
Browse files Browse the repository at this point in the history
signpost the diabetes network in the UI
  • Loading branch information
eatyourpeas authored Oct 6, 2024
2 parents cd5b5b7 + 5548cfd commit 1d1df5f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions project/npda/general_functions/organisations_adapter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# python imports
from django.apps import apps
from django.db.models import F, Value, Case, When, CharField, Q
from django.db.models.functions import Concat
from django.db.models.functions import Concat, Upper
from .rcpch_nhs_organisations import (
get_all_nhs_organisations_affiliated_with_paediatric_diabetes_unit,
)
Expand Down Expand Up @@ -74,10 +74,16 @@ def paediatric_diabetes_units_to_populate_select_field(
Case(
When(
parent_name__isnull=False,
then=Concat(Value(" - "), F("parent_name")),
),
default=Value(""),
output_field=CharField(),
then=Concat(
Value(" - "),
F("parent_name"),
Value(" - "),
Upper(F("paediatric_diabetes_network_name")),
Value(" NETWORK"),
default=Value(""),
output_field=CharField(),
),
)
),
)
)
Expand Down

0 comments on commit 1d1df5f

Please sign in to comment.