From 3ae62cfe60a10157a503b00e4f05d3558f2cd100 Mon Sep 17 00:00:00 2001 From: Michael Pelz-Sherman Date: Thu, 29 Apr 2021 18:14:43 -0400 Subject: [PATCH] Filter out unpublished services from VAMC location pages (#17012) * Filter out unpublished services from VAMC location pages * Add status filter check to unit test --- .../health_care_local_facility.drupal.liquid | 2 +- ...h_care_local_facility_no_phone_mental.json | 128 ++++++++++++++++++ ...thCareRegionHealthServices.node.graphql.js | 1 + .../healthCareLocalFacilityPage.graphql.js | 2 + .../healthServicesListingPage.graphql.js | 1 + .../serviceLocation.paragraph.graphql.js | 1 + 6 files changed, 134 insertions(+), 1 deletion(-) diff --git a/src/site/layouts/health_care_local_facility.drupal.liquid b/src/site/layouts/health_care_local_facility.drupal.liquid index 7954e586096d..a22fe8d013eb 100644 --- a/src/site/layouts/health_care_local_facility.drupal.liquid +++ b/src/site/layouts/health_care_local_facility.drupal.liquid @@ -174,7 +174,7 @@ {% assign localHealthServices = fieldLocalHealthCareService | sortObjectsBy: 'entity.fieldRegionalHealthService.entity.fieldServiceNameAndDescripti.entity.name' %} {% for localService in localHealthServices %} {% assign localHealthService = localService.entity | featureFieldRegionalHealthService %} - {% if localHealthService != empty %} + {% if localHealthService != empty and localService.entity.status == true %} {% include "src/site/facilities/facility_health_service.drupal.liquid" with healthService = localHealthService diff --git a/src/site/layouts/tests/vamc/fixtures/health_care_local_facility_no_phone_mental.json b/src/site/layouts/tests/vamc/fixtures/health_care_local_facility_no_phone_mental.json index 29cf7f3c58d2..6f2142b2c9d0 100644 --- a/src/site/layouts/tests/vamc/fixtures/health_care_local_facility_no_phone_mental.json +++ b/src/site/layouts/tests/vamc/fixtures/health_care_local_facility_no_phone_mental.json @@ -311,6 +311,7 @@ "fieldLocalHealthCareService": [ { "entity": { + "status": true, "fieldBody": { "processed": "

Location and contact information

\n\n


\n901 South East Washington Street
Phone: 580-920-7200
Hours:
\nMonday - 8:00 a.m. to 4:30 p.m. CT
\nTuesday - 8:00 a.m. to 4:30 p.m. CT
\nWednesday - 8:00 a.m. to 4:30 p.m. CT
\nThursday - 8:00 a.m. to 4:30 p.m. CT
\nFriday - 8:00 a.m. to 4:30 p.m. CT
\nSaturday - Closed
\nSunday - Closed

\n\n

Appointments

\n\n

Contact us to schedule, reschedule, or cancel your appointment. If a referral is required, you will need to contact your primary care provider first.

\n\n

Referral needed? Y
Walk-ins accepted? N
Phone: 580-920-7200

" }, @@ -426,6 +427,7 @@ }, { "entity": { + "status": true, "fieldBody": { "processed": "

Location and contact information

\n\n


\n901 South East Washington Street
Phone: 580-920-7200
Hours:
\nMonday - 8:00 a.m. to 4:30 p.m. CT
\nTuesday - 8:00 a.m. to 4:30 p.m. CT
\nWednesday - 8:00 a.m. to 4:30 p.m. CT
\nThursday - 8:00 a.m. to 4:30 p.m. CT
\nFriday - 8:00 a.m. to 4:30 p.m. CT
\nSaturday - Closed
\nSunday - Closed

\n\n

Appointments

\n\n

Contact us to schedule, reschedule, or cancel your appointment. If a referral is required, you will need to contact your primary care provider first.

\n\n

Referral needed? N
Walk-ins accepted? Y
Phone: 580-920-7200

" }, @@ -541,6 +543,7 @@ }, { "entity": { + "status": true, "fieldBody": { "processed": "

Location and contact information

\n\n


\n901 South East Washington Street
Phone: 580-920-7200
Hours:
\nMonday - 8:00 a.m. to 4:30 p.m. CT
\nTuesday - 8:00 a.m. to 4:30 p.m. CT
\nWednesday - 8:00 a.m. to 4:30 p.m. CT
\nThursday - 8:00 a.m. to 4:30 p.m. CT
\nFriday - 8:00 a.m. to 4:30 p.m. CT
\nSaturday - Closed
\nSunday - Closed

\n\n

Appointments

\n\n

Contact us to schedule, reschedule, or cancel your appointment. If a referral is required, you will need to contact your primary care provider first.

\n\n

Referral needed? N
Walk-ins accepted? Y
Phone: 580-920-7200

" }, @@ -664,6 +667,131 @@ }, { "entity": { + "status": false, + "fieldBody": { + "processed": "

Location and contact information

\n\n


\n901 South East Washington Street
Phone: 580-920-7200
Hours:
\nMonday - 8:00 a.m. to 4:30 p.m. CT
\nTuesday - 8:00 a.m. to 4:30 p.m. CT
\nWednesday - 8:00 a.m. to 4:30 p.m. CT
\nThursday - 8:00 a.m. to 4:30 p.m. CT
\nFriday - 8:00 a.m. to 4:30 p.m. CT
\nSaturday - Closed
\nSunday - Closed

\n\n

Appointments

\n\n

Contact us to schedule, reschedule, or cancel your appointment. If a referral is required, you will need to contact your primary care provider first.

\n\n

Referral needed? N
Walk-ins accepted? Y
Phone: 580-920-7200

" + }, + "fieldServiceLocation": [ + { + "entity": { + "fieldServiceLocationAddress": { + "entity": { + "fieldUseFacilityAddress": true, + "fieldClinicName": null, + "fieldBuildingNameNumber": null, + "fieldWingFloorOrRoomNumber": null, + "fieldAddress": { + "addressLine1": "", + "addressLine2": null, + "additionalName": null, + "administrativeArea": "", + "postalCode": "", + "locality": "", + "organization": null, + "dependentLocality": null, + "countryCode": "US", + "sortingCode": null + } + } + }, + "fieldEmailContacts": [], + "fieldFacilityServiceHours": { + "value": [ + [ + "Mon", + "" + ], + [ + "Tue", + "" + ], + [ + "Wed", + "" + ], + [ + "Thu", + "" + ], + [ + "Fri", + "" + ], + [ + "Sat", + "" + ], + [ + "Sun", + "" + ] + ], + "caption": null, + "format": "plain_text" + }, + "fieldHours": "0", + "fieldAdditionalHoursInfo": null, + "fieldPhone": [], + "fieldUseMainFacilityPhone": true + } + } + ], + "fieldHserviceApptLeadin": null, + "fieldHserviceApptIntroSelect": null, + "fieldOnlineSchedulingAvailabl": "0", + "fieldReferralRequired": "0", + "fieldWalkInsAccepted": "1", + "fieldPhoneNumbersParagraph": [ + { + "entity": { + "fieldPhoneExtension": null, + "fieldPhoneLabel": "Appointments", + "fieldPhoneNumber": "888-397-8387", + "fieldPhoneNumberType": "tel" + } + }, + { + "entity": { + "fieldPhoneExtension": null, + "fieldPhoneLabel": "Appointments", + "fieldPhoneNumber": "580-920-7200", + "fieldPhoneNumberType": "tel" + } + } + ], + "fieldRegionalHealthService": { + "entity": { + "entityBundle": "regional_health_care_service_des", + "fieldBody": { + "processed": "

Care we provide at VA Eastern Oklahoma health care

A strong network of family and internal medicine specialists and services can offer you the best possible care. Internal medicine doctors (internists) prevent, diagnose, and treat adult diseases. Doctors who specialize in family medicine provide primary health care to the entire family. Your primary care team can coordinate the many services you receive such as:

'" + }, + "fieldServiceNameAndDescripti": { + "entity": { + "entityId": "37", + "entityBundle": "health_care_service_taxonomy", + "fieldAlsoKnownAs": "Family and internal medicine", + "fieldCommonlyTreatedCondition": null, + "name": "Primary care", + "description": { + "processed": "

Your VA primary care provider will work closely with you to plan for all the care you need to stay healthy and well throughout your life. They will also work with family members or caregivers who support you.

" + }, + "parent": [ + { + "entity": { + "name": "Primary care" + } + } + ], + "fieldHealthServiceApiId": "primaryCare" + } + } + } + } + } + }, + { + "entity": { + "status": true, "fieldBody": { "processed": "

Location and contact information

\n\n


\n901 South East Washington Street
Phone: 580-920-7200
Hours:
\nMonday - 8:00 a.m. to 4:30 p.m. CT
\nTuesday - 8:00 a.m. to 4:30 p.m. CT
\nWednesday - 8:00 a.m. to 4:30 p.m. CT
\nThursday - 8:00 a.m. to 4:30 p.m. CT
\nFriday - 8:00 a.m. to 4:30 p.m. CT
\nSaturday - Closed
\nSunday - Closed

\n\n

Appointments

\n\n

Contact us to schedule, reschedule, or cancel your appointment. If a referral is required, you will need to contact your primary care provider first.

\n\n

Referral needed? N
Walk-ins accepted? Y
Phone: 580-920-7200

" }, diff --git a/src/site/stages/build/drupal/graphql/facilities-fragments/healthCareRegionHealthServices.node.graphql.js b/src/site/stages/build/drupal/graphql/facilities-fragments/healthCareRegionHealthServices.node.graphql.js index fef67f26dbee..3c1d2e5fca7c 100644 --- a/src/site/stages/build/drupal/graphql/facilities-fragments/healthCareRegionHealthServices.node.graphql.js +++ b/src/site/stages/build/drupal/graphql/facilities-fragments/healthCareRegionHealthServices.node.graphql.js @@ -13,6 +13,7 @@ const HEALTH_SERVICES_RESULTS = ` fieldLocalHealthCareService { entity { ...on NodeHealthCareLocalHealthService { + status fieldFacilityLocation { entity { ... on NodeHealthCareLocalFacility { diff --git a/src/site/stages/build/drupal/graphql/healthCareLocalFacilityPage.graphql.js b/src/site/stages/build/drupal/graphql/healthCareLocalFacilityPage.graphql.js index cee694da9a83..fe735cf70156 100644 --- a/src/site/stages/build/drupal/graphql/healthCareLocalFacilityPage.graphql.js +++ b/src/site/stages/build/drupal/graphql/healthCareLocalFacilityPage.graphql.js @@ -79,6 +79,7 @@ const healthCareLocalFacilityPageFragment = ` fieldLocalHealthCareService { entity { ... on NodeHealthCareLocalHealthService { + status fieldBody { processed } @@ -88,6 +89,7 @@ const healthCareLocalFacilityPageFragment = ` { entity { ... on NodeRegionalHealthCareServiceDes { + status entityBundle fieldBody { processed diff --git a/src/site/stages/build/drupal/graphql/healthServicesListingPage.graphql.js b/src/site/stages/build/drupal/graphql/healthServicesListingPage.graphql.js index 3659fa3972e1..22a25df70607 100644 --- a/src/site/stages/build/drupal/graphql/healthServicesListingPage.graphql.js +++ b/src/site/stages/build/drupal/graphql/healthServicesListingPage.graphql.js @@ -48,6 +48,7 @@ const healthServicesListingPage = ` fieldLocalHealthCareService { entity { ... on NodeHealthCareLocalHealthService { + status entityUrl { path } diff --git a/src/site/stages/build/drupal/graphql/paragraph-fragments/serviceLocation.paragraph.graphql.js b/src/site/stages/build/drupal/graphql/paragraph-fragments/serviceLocation.paragraph.graphql.js index da5479e7e633..c922fff4b0a2 100644 --- a/src/site/stages/build/drupal/graphql/paragraph-fragments/serviceLocation.paragraph.graphql.js +++ b/src/site/stages/build/drupal/graphql/paragraph-fragments/serviceLocation.paragraph.graphql.js @@ -7,6 +7,7 @@ module.exports = ` fieldServiceLocation { entity { ... on ParagraphServiceLocation { + status fieldServiceLocationAddress { entity { ... on ParagraphServiceLocationAddress {