Skip to content

Commit

Permalink
Merge pull request #758 from episphere/stage
Browse files Browse the repository at this point in the history
Stage -> Prod Sync (October 2024)
  • Loading branch information
anthonypetersen authored Oct 31, 2024
2 parents f338b4d + c17cd94 commit 5795505
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
26 changes: 15 additions & 11 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,10 @@ const collectionSubmission = async (participantData, biospecimenData, continueTo
// Make a deep copy. Check for changes at end of function prior to saving.
const originalSpecimenData = JSON.parse(JSON.stringify(biospecimenData));

if (getWorkflow() === 'research' && biospecimenData[conceptIds.collection.collectionTime] === undefined) biospecimenData[conceptIds.collection.collectionTime] = new Date().toISOString();

if (getWorkflow() === 'research' && biospecimenData[conceptIds.collection.collectionTime] === undefined) {
biospecimenData[conceptIds.collection.collectionTime] = new Date().toISOString();
}

const inputFields = Array.from(document.getElementsByClassName('input-barcode-id'));
const siteTubesList = getSiteTubesLists(biospecimenData);
Expand Down Expand Up @@ -1495,17 +1498,17 @@ const collectionSubmission = async (participantData, biospecimenData, continueTo
if (getWorkflow() === 'clinical') {
if (biospecimenData[conceptIds.collection.scannedTime] === undefined) biospecimenData[conceptIds.collection.scannedTime] = new Date().toISOString();
}
}

if (getWorkflow() === 'research') {
let initials = document.getElementById('collectionInitials')
if(initials && initials.value.trim().length == 0) {
errorMessage(initials.id, 'This field is required. Please enter the phlebotomist\'s initials.', focus);
focus = false;
return;
}
else {
biospecimenData[conceptIds.collection.phlebotomistInitials] = initials.value.trim();
}
if (getWorkflow() === 'research') {
let initials = document.getElementById('collectionInitials')
if(initials && initials.value.trim().length == 0) {
errorMessage(initials.id, 'This field is required. Please enter the phlebotomist\'s initials.', focus);
focus = false;
return;
}
else {
biospecimenData[conceptIds.collection.phlebotomistInitials] = initials.value.trim();
}
}

Expand Down Expand Up @@ -1534,6 +1537,7 @@ const collectionSubmission = async (participantData, biospecimenData, continueTo
}
}


/**
* Handle case where form has been updated but specimen is already finalized.
* If specimen has already been finalized, alert user that changes will update the specimen.
Expand Down
14 changes: 12 additions & 2 deletions src/pages/specimen.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,30 @@ export const specimenTemplate = async (data, formData) => {
const siteAcronym = getSiteAcronym();

if(siteLocations[workflow] && siteLocations[workflow][siteAcronym]) {


// For the purposes of 1008 we are filtering out some locations.
// This will require more discussion for a long-term implementation
let siteLocationArray = siteLocations[workflow][siteAcronym]; // Form of [{location, concept}]
siteLocationArray = siteLocationArray.filter(loc =>
['River East', 'South Loop', 'Orland Park', 'Henry Ford West Bloomfield Hospital'].indexOf(loc.location) === -1
// 'Henry Ford Medical Center- Fairlane' has inconsistent spacing across environments: play it safe by omitting any combination of "Henry Ford" and "Fairlane"
&& (!loc.location.includes('Fairlane') || !loc.location.includes('Henry Ford'))
);

template += `
<label class="col-md-4 col-form-label" for="collectionLocation">Select Collection Location</label>
<select class="form-control col-md-5" id="collectionLocation">
<option value='none'>Please Select Location</option>`

if (siteAcronym === 'BSWH') {
const siteLocationArray = siteLocations[workflow][siteAcronym];
const sortedBSWHLocations = siteLocationArray.sort((a, b) => a.location.localeCompare(b.location));

sortedBSWHLocations.forEach(site => {
template += `<option ${locationSelection === site.concept.toString() ? 'selected="selected"' : ""} value='${site.concept}'>${site.location}</option>`
});
} else {
siteLocations[workflow][siteAcronym].forEach(site => {
siteLocationArray.forEach(site => {
template += `<option ${locationSelection === site.concept.toString() ? 'selected="selected"' : ""} value='${site.concept}'>${site.location}</option>`
});
}
Expand Down
7 changes: 7 additions & 0 deletions src/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,13 @@ export const getLocationsInstitute = async () => {
if (siteAcronym === 'BSWH') locations.sort((a, b) => a.localeCompare(b));

logAPICallEndDev('getLocationsInstitute');
// For the purposes of 1008 we are filtering out some locations.
// This will require more discussion for a long-term implementation
locations = locations.filter(loc =>
['River East', 'South Loop', 'Orland Park', 'Henry Ford West Bloomfield Hospital', 'Henry Ford Medical Center- Fairlane'].indexOf(loc) === -1
// 'Henry Ford Medical Center- Fairlane' has inconsistent spacing across environments: play it safe by omitting any combination of "Henry Ford" and "Fairlane"
&& (!loc.includes('Fairlane') || !loc.includes('Henry Ford'))
);
return locations;
}

Expand Down

0 comments on commit 5795505

Please sign in to comment.