diff --git a/health.json b/health.json index 0bff69b..7f1119b 100644 --- a/health.json +++ b/health.json @@ -48,53 +48,116 @@ " {% set value = tags.emergency %}", "{% elseif tags.healthcare %}", " {% set key = 'healthcare' %}", - " {% set value = tags.healthcare %}", + " {% set value = tags.healthcare|split(';')[0] %}", "{% else %}", " {% set key = 'amenity' %}", " {% set value = tags.amenity %}", - "{% endif %}" + "{% endif %}", + "{% set kv = key ~ '=' ~ value %}", + "{% set found = { sign: '' } %}", + "{% for data in const %}", + " {% if kv in data.types %}{% set found = data %}{% endif %}", + "{% endfor %}" ], "description": [ - "{{ tagTransList(key, value) }}", + "{{ tagTransList(key, attribute(tags, key)) }}", "{% if attribute(tags, 'healthcare:speciality') %}", "-", "{{ tagTransList('healthcare:speciality', attribute(tags, 'healthcare:speciality')) }}", "{% endif %}" ], - "markerSign": "{{ const[key ~ '=' ~ value]|raw }}" + "markerSign": "{{ found.sign|raw }}" }, "info": [ "", - "{% for value, sign in const %}", + "{% for data in const %}", " ", - " ", - " ", + " ", + " ", " ", "{% endfor %}", "
{{ markerCircle({})|raw }}
{{ sign|raw }}
{{ tagTrans(value|split('=')[0], value|split('=')[1]) }}{{ markerCircle({})|raw }}
{{ data.sign|raw }}
{{ tagTrans(data.types[0]|split('=')[0], data.types[0]|split('=')[1]) }}
" ], - "const": { - "amenity=baby_hatch": "🚼", - "healthcare=blood_bank": "", - "healthcare=blood_donation": "", - "healthcare=clinic": "🏥", - "emergency=defibrillator": "", - "healthcare=dentist": "", - "healthcare=doctor": "", - "amenity=doctors": "", - "amenity=hospital": "🏥", - "healthcare=hospital": "🏥", - "amenity=nursing_home": "", - "amenity=pharmacy": "", - "amenity=social_facility": "", - "amenity=veterinary": "" - }, + "const": [ + { + "types": [ + "amenity=baby_hatch" + ], + "sign": "🚼" + }, + { + "types": [ + "healthcare=blood_bank" + ], + "sign": "" + }, + { + "types": [ + "healthcare=blood_donation" + ], + "sign": "" + }, + { + "types": [ + "healthcare=clinic" + ], + "sign": "🏥" + }, + { + "types": [ + "emergency=defibrillator" + ], + "sign": "" + }, + { + "types": [ + "healthcare=dentist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=doctor", + "amenity=doctors" + ], + "sign": "" + }, + { + "types": [ + "amenity=hospital", + "healthcare=hospital" + ], + "sign": "🏥" + }, + { + "types": [ + "amenity=nursing_home" + ] + }, + { + "types": [ + "amenity=pharmacy" + ], + "sign": "" + }, + { + "types": [ + "amenity=social_facility" + ] + }, + { + "types": [ + "amenity=veterinary" + ], + "sign": "" + } + ], "filter": { "type": { "name": "{{ trans('filter:type') }}", "show_default": "true", "type": "select", - "values": "{% for k, v in const %}{% endfor %}" + "values": "{% for data in const %}{% endfor %}" } } }