{% for pharmid in rule.pharmacy_id %}{% if pharmid == 0 %}All{% else %}{% for pharm in pharmacy_list %}{% if pharmid == pharm.id %}{% if not forloop.parentloop.first %}, {% endif %}{{ pharm.description }}{% endif %}{% endfor %}{% endif %}{% endfor %} {% for facid in rule.facility_id %}{% if facid == 0 %}All{% else %}{% for fac in facility_list %}{% if facid == fac.id %}{% if not forloop.parentloop.first %}, {% endif %}{% firstof fac.label_id fac.label_name %}{% endif %}{% endfor %}{% endif %}{% endfor %} {% for subfacid in rule.facility_sub_id %}{% if subfacid == 0 %}All{% else %}{% for subfac in sub_facility_list %}{% if subfacid == subfac.id %}{% if not forloop.parentloop.first %}, {% endif %} {% firstof subfac.facility.label_id subfac.facility.label_name %} (Wing: {% if subfac.wing %}{{ subfac.wing }}{% else %}*{% endif %} / Floor: {% if subfac.floor %}{{ subfac.floor }}{% else %}*{% endif %} / Room: {% if subfac.room %}{{ subfac.room }}{% else %}*{% endif %} / Bed: {% if subfac.bed %}{{ subfac.bed }}{% else %}*{% endif %}){% endif %}{% endfor %}{% endif %}{% endfor %} {{ rule.card_method }} {{ rule.day_supply }} {% if rule.rx_batch_type %}{{ rule.rx_batch_type }}{% else %}*{% endif %} {% if rule.rx_new_refill %}{{ rule.rx_new_refill }}{% else %}*{% endif %} {% if rule.rx_controlled %}{{ rule.rx_controlled }}{% elif rule.rx_controlled == False %}{{ rule.rx_controlled }}{% else %}*{% endif %} {% if rule.rx_prn %}{{ rule.rx_prn }}{% elif rule.rx_prn == False %}{{ rule.rx_prn }}{% else %}*{% endif %}