Skip to content

Commit

Permalink
Vacms 16144 VAMC service location paragraphs - and merge VBA (#1912)
Browse files Browse the repository at this point in the history
* Move to Service Location Paragraphs in VAMC

* merging of service_locations paragraphs

* Service Hours

* remove old service_location paragraphs

* remove consolelog

* typo on include

* conditions when to show Appointments

* show appointments simplification

* test not possible on paragraph

* testing

* naming

* spacing

* indent

* non-clinical

* clena up spacing

* spacing class

* improving spacing slowly

* spacing again

* working spacing

* more spacing

* correct order of phone numbers and h5 for appointment related phone numbers

* order

* borders were not showing

* bordered

* accidental vet center accordion border

* fix headers

* VA-15959: Update VBA Service Location query for int branch (#1936)

* fix for empty extensions

* v3 components added, built, updated

* remove extra vetcenter attributes to liquid

* fix testing on phone numbers now that using va-telephone component

* add more testing

* make use of regexes better

* explanation of matches

* allow for short codes

* additional info uswds

* spacing on Appointments header

* remove Vet Center tests from this branch

* remove Vet Center tests from this branch

* replace should have 2 args

* remove debugging

* remove extra div and strongs

* optional

* VACMS-17513: Remove unspecified referrals from front-end (#1982)

* shows main phone or appt phone numbers and shows main phone or contact phone numbers (#1993)

* Appointments top section visible when walkins unspecified and not remove_text (#2009)

* Appointments top section visible when walkins unspecified
* spacing
* simplify conditions -- no change in logic
* fix? works locally- did not push last time because of new package.json
* update to variables

* not elsif (#2002)

* VACMS 17632 no card on non-clinical service locations  (#2024)

* no card on non-clinical service locations
* remove comment
* updated spacing

* VACMS 17844 update service options values for office visits and virtual support (#2035)

* working values for updated office visits and virtual
* update comment

* VA-17710: Change Online Schedule link for VBA Services (#2026)

* memBefore memAfter

* trying graceful fs

* fix from VACMS-18069-EMFILE-error-memoryUsage

* VA-17598: Manage Benefits online link update (#2057)

* VA-17598: Add missing benefits paragraph (#2078)

* hasAddress default to false

---------

Co-authored-by: Max Antonucci <[email protected]>
Co-authored-by: Max Antonucci <[email protected]>
  • Loading branch information
3 people authored May 14, 2024
1 parent 9289066 commit 53d7f85
Show file tree
Hide file tree
Showing 22 changed files with 1,236 additions and 224 deletions.
2 changes: 1 addition & 1 deletion src/site/components/phone.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
{% endfor %}
{% endif %}
</div>
{% endif %}
{% endif %}
101 changes: 3 additions & 98 deletions src/site/facilities/health_care_local_health_service.drupal.liquid
Original file line number Diff line number Diff line change
@@ -1,102 +1,7 @@
<h4 data-template="facilities/health_care_local_health_service">Contact information</h4>

{% for location in locations %}
{% include "src/site/paragraphs/service_location.drupal.liquid" with
single = location.entity
isMentalHealth = isMentalHealthService
serviceLocationSubHeaderLevel = 5
single = location.entity
isMentalHealth = isMentalHealthService
serviceLocationSubHeaderLevel = 4
%}
{% endfor %}

{% if locationEntity.fieldReferralRequired or locationEntity.fieldWalkInsAccepted or locationEntity.fieldOnlineSchedulingAvailabl %}
<h5 data-template="facilities/health_care_local_health_service">Appointments</h5>

{% assign introText = 'Contact us to schedule, reschedule, or
cancel your appointment. If a referral is required, you’ll need to contact your
primary care provider first.'
%}

{% case locationEntity.fieldHserviceApptIntroSelect %}
{% when 'custom_intro_text' %}
{% if locationEntity.fieldHserviceApptLeadin != empty %}
{% assign introText = locationEntity.fieldHserviceApptLeadin %}
{% endif %}
{% when 'no_intro_text' %}
{% assign introText = '' %}
{% endcase %}

{% if introText != empty %}
<p class="vads-u-margin--0" data-template="facilities/health_care_local_health_service">
{{ introText }}
</p>
{% endif %}


{% comment %}
if fieldPhoneNumbersParagraph has values
use phone numbers from entities
{% endcomment %}
{% if locationEntity.fieldPhoneNumbersParagraph.length > 0 %}
<div class="vads-u-display--flex vads-u-flex-direction--column vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
{% for number in locationEntity.fieldPhoneNumbersParagraph %}
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = number.entity.fieldPhoneNumber
phoneExtension = number.entity.fieldPhoneExtension
phoneLabel = number.entity.fieldPhoneLabel
phoneHeaderLevel = 5
sms = false
fax = false
tty = false
%}
{% endfor %}
</div>
{% else %}
{% if isMentalHealthService and fieldMentalHealthPhone %}
{% assign localHealthServiceMainNumber = fieldMentalHealthPhone %}
{% else %}
{% assign localHealthServiceMainNumber = fieldPhoneNumber %}
{% endif %}

<div class="vads-u-display--flex vads-u-flex-direction--column vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = localHealthServiceMainNumber
phoneLabel = 'Main Phone'
phoneHeaderLevel = 5
sms = false
fax = false
tty = false
%}
</div>
{% endif %}

{% assign OMIT_REFERRAL_OR_WALKIN = "not_applicable, unknown" %}

{% if locationEntity.fieldReferralRequired %}
{% unless OMIT_REFERRAL_OR_WALKIN contains locationEntity.fieldReferralRequired %}
<p class="vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
<strong>Referral required?</strong>
{% if locationEntity.fieldReferralRequired == '1' %}Yes{% else %}No{% endif %}
</p>
{% endunless %}
{% endif %}

{% if locationEntity.fieldWalkInsAccepted %}
{% unless OMIT_REFERRAL_OR_WALKIN contains locationEntity.fieldWalkInsAccepted %}
<p class="vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
<strong>Walk-ins accepted?</strong>
{% if locationEntity.fieldWalkInsAccepted == '1' %}Yes{% else %}No{% endif %}
</p>
{% endunless %}
{% endif %}

{% if locationEntity.fieldOnlineSchedulingAvailabl == '1' %}
<a class="usa-button vads-u-margin-bottom--0"
data-entity-substitution="canonical"
data-entity-type="node"
data-template="facilities/health_care_local_health_service"
href="/health-care/schedule-view-va-appointments"
title="Schedule and manage health appointments">
Schedule an appointment online
</a>
{% endif %}
{% endif %}
41 changes: 25 additions & 16 deletions src/site/facilities/service_address.drupal.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{% assign hasAddress = false %}
{% if serviceLocationAddress.fieldUseFacilityAddress and facilityAddress %}
{% assign hasAddress = true %}
{% assign addressData = facilityAddress %}
{% elsif location.entity.fieldServiceLocationAddress %}
{% assign hasAddress = true %}
{% assign addressData = location.entity.fieldServiceLocationAddress.entity.fieldAddress %}
{% endif %}

{% if serviceLocationAddress.fieldClinicName or hasAddress or serviceLocationAddress.fieldBuildingNameNumber or serviceLocationAddress.fieldWingFloorOrRoomNumber %}
<div class="vads-u-display--flex vads-u-flex-direction--column">
{% if serviceLocationAddress.fieldClinicName %}
<h{{ serviceLocationAddressHeaderLevel }}>
Expand All @@ -9,34 +19,32 @@
</h{{ serviceLocationAddressHeaderLevel }}>
{% endif %}

{% comment %}
Include street address only if fieldUseFacilityAddress is false
{% endcomment %}
{% if serviceLocationAddress.fieldUseFacilityAddress == false %}
{% if serviceLocationAddress.fieldAddress.addressLine1 %}

{% if hasAddress %}
{% if addressData.addressLine1 %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldAddress.addressLine1 }}
{{ addressData.addressLine1 }}
</span>
{% endif %}

{% if serviceLocationAddress.fieldAddress.addressLine2 %}
{% if addressData.addressLine2 %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldAddress.addressLine2 }}
{{ addressData.addressLine2 }}
</span>
{% endif %}

{% if serviceLocationAddress.fieldAddress.locality %}
{% if serviceLocationAddress.fieldAddress.administrativeArea%}
{% if serviceLocationAddress.fieldAddress.postalCode %}
{% if addressData.locality %}
{% if addressData.administrativeArea%}
{% if addressData.postalCode %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldAddress.locality }},
{{ serviceLocationAddress.fieldAddress.administrativeArea }}
{{ serviceLocationAddress.fieldAddress.postalCode }}
{{ addressData.locality }},
{{ addressData.administrativeArea }}
{{ addressData.postalCode }}
</span>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endif %} {% comment %} hasAddress {% endcomment %}

{% comment %}
Always include building, wing, floor, etc.
Expand All @@ -45,11 +53,12 @@
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldBuildingNameNumber }}
</span>
{% assign marginTop = 0 %}
{% endif %}

{% if serviceLocationAddress.fieldWingFloorOrRoomNumber %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldWingFloorOrRoomNumber }}
</span>
{% endif %}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{% if facility.locations.length >= 1 %}
{% assign typeOfLocation = "nonclinical" %}
{% endif %}

{% for location in facility.locations %}
{% include "src/site/paragraphs/service_location.drupal.liquid" with
single = location.entity
fieldPhoneNumber = facility.fieldPhoneNumber
fieldOfficeHours = facility.fieldOfficeHours
serviceLocationSubHeaderLevel = serviceLocationSubHeaderLevel
typeOfLocation = typeOfLocation
%}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% if facilities %}
{% assign nonClinicalSubHeaderLevel = nonClinicalHeaderLevel | plus: 1 %}
{% for facility in facilities %}
<h3>
<h{{nonClinicalHeaderLevel}}>
<a href="{{ facility.entityUrl.path }}">
{{ facility.entityLabel }}
</a>
</h3>
</h{{nonClinicalHeaderLevel}}>

{% comment %}
Facility Address
Expand All @@ -25,15 +26,13 @@
{% endif %}
{% if facilityAddress.locality and facilityAddress.administrativeArea and facilityAddress.postalCode %}
<span class="vads-u-margin-bottom--0">
{{ facilityAddress.locality }}, {{ facilityAddress.administrativeArea}} {{ facilityAddress.postalCode }}
{{ facilityAddress.locality }}, {{ facilityAddress.administrativeArea }} {{ facilityAddress.postalCode }}
</span>
{% endif %}
</div>
{% endif %}

{% include "src/site/facilities/vha_facility_nonclinical_service.drupal.liquid" with
facility = facility
serviceLocationSubHeaderLevel = 4
{% include "src/site/facilities/vha_facility_nonclinical_service.drupal.liquid" with facility = facility serviceLocationSubHeaderLevel = nonClinicalSubHeaderLevel
%}
{% endfor %}
{% endif %}
{% endif %}
45 changes: 45 additions & 0 deletions src/site/filters/liquid.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,20 @@ module.exports = function registerFilters() {
}
return accordions;
};
liquid.filters.shouldShowIconDiv = (
fieldOfficeVisits,
fieldVirtualSupport,
fieldReferralRequired,
) => {
if (
(fieldOfficeVisits && fieldOfficeVisits !== 'no') ||
(fieldVirtualSupport && fieldVirtualSupport !== 'no') ||
fieldReferralRequired
) {
return true;
}
return false;
};

liquid.filters.processCentralizedUpdatesVBA = fieldCcGetUpdatesFromVba => {
if (!fieldCcGetUpdatesFromVba || !fieldCcGetUpdatesFromVba.fetched)
Expand Down Expand Up @@ -1696,6 +1710,37 @@ module.exports = function registerFilters() {

liquid.filters.deriveMostRecentDate = deriveMostRecentDate;

// from the matrix of when to show Service Location Appointments header and text
liquid.filters.shouldShowServiceLocationAppointments = serviceLocation => {
const {
fieldVirtualSupport: virtualSupport,
fieldOfficeVisits: officeVisits,
fieldApptIntroTextType: introTextType,
fieldApptIntroTextCustom: introTextCustom,
} = serviceLocation;
const baseYesConditions = ['yes_appointment_only'];
const yesOffice = [
...baseYesConditions,
'yes_walk_in_visits_only',
'yes_with_or_without_appointment',
];
const yesVirtual = [
...baseYesConditions,
'yes_veterans_can_call',
'virtual_visits_may_be_available',
];
const noVisitsAndCustomIntro =
!officeVisits && introTextType === 'customize_text' && introTextCustom;
const noVisitsAndDefaultInto =
!officeVisits && introTextType === 'use_default_text';
return (
yesVirtual.includes(virtualSupport) ||
yesOffice.includes(officeVisits) ||
noVisitsAndCustomIntro ||
noVisitsAndDefaultInto
);
};

// Given an array of services provided at a facility,
// return a flattened array of service locations that
// offer service of type `serviceType`
Expand Down
6 changes: 3 additions & 3 deletions src/site/includes/health_services_listing_services.liquid
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% assign servicesList = clinicalHealthServices | filterBy: "fieldServiceNameAndDescripti.entity.fieldServiceTypeOfCare", typeOfCare, false %}
{% assign servicesListOrderedByName = servicesList | sortObjectsBy: "fieldServiceNameAndDescripti.entity.name"%}
{% assign servicesListOrderedByName = servicesList | sortObjectsBy: "fieldServiceNameAndDescripti.entity.name" %}

{% if servicesListOrderedByName.length > 0 %}
<section data-label="{{typeOfCare}}">
<h2>{{typeOfCare}}</h2>
<h2>{{ typeOfCare }}</h2>
<div class="service-accordion-output">
<va-accordion bordered uswds="true">
{% for service in servicesListOrderedByName %}
Expand All @@ -16,4 +16,4 @@
</va-accordion>
</div>
</section>
{% endif %}
{% endif %}
8 changes: 7 additions & 1 deletion src/site/includes/vba_facilities/service_location.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@
{% endfor %}
{% endif %}

{% if typeOfLocation == "vba" %}
{% assign scheduleAppointmentLink = "https://va.my.site.com/VAVERA/s/" %}
{% else %}
{% assign scheduleAppointmentLink = "/health-care/schedule-view-va-appointments" %}
{% endif %}

<div class="vads-u-margin-bottom--3">
<a
class="vads-c-action-link--blue"
href="/health-care/schedule-view-va-appointments"
href="{{ scheduleAppointmentLink }}"
onclick="recordEvent(
{
'event': 'vba-regional-facility-service-location-schedule-appointment',
Expand Down
Loading

0 comments on commit 53d7f85

Please sign in to comment.