Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev -> Stage Sync (May 2024 Release) #705

Merged
merged 25 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
775465a
Requested changes for 987
amber-emmes Apr 30, 2024
355c95f
Added numeric input validation to shipping number inputs in assignKit…
amber-emmes May 1, 2024
16ed362
UCM now has prod access to clinical dashboard (967)
amber-emmes May 1, 2024
e0cb0e7
Merge pull request #696 from episphere/967-fix
amber-emmes May 1, 2024
0d3cfb8
In progress: language changes and confirm inputs added
amber-emmes May 1, 2024
fda36f7
Merge pull request #698 from episphere/987-fix
amber-emmes May 1, 2024
30beb0f
Auto-tabbing between inputs on enter added for kit tabs; screenreader…
amber-emmes May 2, 2024
90f7307
kits receipt page clears error message for collection ID when correct…
amber-emmes May 2, 2024
d533219
UCM River East and South Loop moved from research site to clinical si…
amber-emmes May 2, 2024
92724b2
Merge pull request #700 from episphere/999-fix
amber-emmes May 3, 2024
3a2cc81
Removed erroneous console logs; refactored automatic tabbing logic to…
amber-emmes May 3, 2024
1a848fa
Added UCM clinical vial values per 998
amber-emmes May 3, 2024
de70f82
Merge pull request #702 from episphere/998-fix
amber-emmes May 3, 2024
a7f91ba
Merge pull request #701 from episphere/988+981-fix
amber-emmes May 6, 2024
75a0376
add bswh dev sso config
Gbarra9 May 7, 2024
328e6ae
remove semicolon and add line break after last conditional
Gbarra9 May 7, 2024
757f84a
Merge pull request #703 from episphere/bswh-add-devSSOConfig
Gbarra9 May 7, 2024
5533d79
Fixed issue with csvFileReceipt vialMapping object using wrong key fo…
amber-emmes May 9, 2024
d6c4d35
Merge pull request #704 from episphere/998-update
amber-emmes May 9, 2024
a78ca2f
Addressed feedback in dev on 988
amber-emmes May 14, 2024
f82ff37
Merge pull request #707 from episphere/988-followup
amber-emmes May 14, 2024
7cb26eb
remove second tracking number input field and styling
Gbarra9 May 17, 2024
d7b30a9
add mouthwash condition back to original else if condition
Gbarra9 May 17, 2024
0a23a81
add try catch block
Gbarra9 May 17, 2024
d5e1faa
Merge pull request #708 from episphere/i#1018-bptl-clear-tracking-num…
Gbarra9 May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions src/dev/identityProvider.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
export const devSSOConfig = (tenantID, provider, inputValue) => {
if(/nih.gov/i.test(inputValue)) {
if (/nih.gov/i.test(inputValue)) {
tenantID = 'NIH-SSO-qfszp';
provider = 'saml.nih-sso';
};
if(/healthpartners.com/i.test(inputValue)) {
}
if (/healthpartners.com/i.test(inputValue)) {
tenantID = 'HP-SSO-wb1zb';
provider = 'saml.healthpartner';
};
if(/hfhs.org/i.test(inputValue)) {
}
if (/hfhs.org/i.test(inputValue)) {
tenantID = 'HFHS-SSO-ay0iz';
provider = 'saml.connect-hfhs';
};
if(/sanfordhealth.org/i.test(inputValue)) {
}
if (/sanfordhealth.org/i.test(inputValue)) {
tenantID = 'SFH-SSO-cgzpj';
provider = 'saml.connect-sanford';
};
if(/uchicago.edu/i.test(inputValue)) {
}
if (/uchicago.edu/i.test(inputValue)) {
tenantID = 'UCM-SSO-tovai';
provider = 'saml.connect-uchicago';
};
if(/norc.org/i.test(inputValue)) {
}
if (/norc.org/i.test(inputValue)) {
tenantID = 'NORC-SSO-dilvf';
provider = 'saml.connect-norc';
};
if(/kp.org/i.test(inputValue)) {
}
if (/kp.org/i.test(inputValue)) {
tenantID = 'KP-SSO-wulix';
provider = 'saml.connect-kp';
};
if(/marshfieldresearch.org/i.test(inputValue) || /marshfieldclinic.org/i.test(inputValue)) {
}
if (/marshfieldresearch.org/i.test(inputValue) || /marshfieldclinic.org/i.test(inputValue)) {
tenantID = 'MFC-SSO-fljvd';
provider = 'saml.connect-mfc'
};
return {tenantID, provider}
}
if (/bswhealth.org/i.test(inputValue)) {
tenantID = 'BSWH-SSO-y2jj3';
provider = 'saml.connect-bswh';
}

return { tenantID, provider }
}
4 changes: 2 additions & 2 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ const checkFormAndSave = async (participantData, biospecimenData, shouldNavigate
const inputFields = Array.from(document.getElementsByClassName('input-barcode-id'));
const isFormDataValid = inputFields.every(input => validateFormInputField(input, biospecimenData, true));

isFormDataValid ?
isFormDataValid || !shouldNavigateToReview ?
await collectionSubmission(participantData, biospecimenData, shouldNavigateToReview) :
showTimedNotifications({ title: 'Data Errors Exist!', body: 'Please correct data entry errors in red before saving.' });
} catch (error) {
Expand Down Expand Up @@ -1342,7 +1342,7 @@ const validateFormInputField = (inputTube, biospecimenData) => {
if (!isTubeIDEntryValid) {
const errorMessageText = isBagID ?
`Invalid entry. Bag ID must be ${validationID}` :
`Invalid entry. Specimen ID must be ${validationID}. Replacement labels 0050-0054 are valid.`;
`Invalid entry. Specimen ID must be ${validationID}.`;
errorMessage(inputTube.id, errorMessageText);
return false;
}
Expand Down
46 changes: 40 additions & 6 deletions src/pages/homeCollection/assignKits.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { homeCollectionNavbar } from "./homeCollectionNavbar.js";
import { getIdToken, showAnimation, hideAnimation, triggerErrorModal, triggerSuccessModal, baseAPI, processResponse, checkTrackingNumberSource, appState } from "../../shared.js";
import { getIdToken, showAnimation, hideAnimation, triggerErrorModal, triggerSuccessModal, baseAPI, processResponse, checkTrackingNumberSource, appState, numericInputValidator, errorMessage, removeAllErrors, autoTabAcrossArray } from "../../shared.js";
import { nonUserNavBar } from "./../../navbar.js";
import { activeHomeCollectionNavbar } from "./homeCollectionNavbar.js";
import { conceptIds } from '../../fieldToConceptIdMapping.js';
Expand Down Expand Up @@ -54,10 +54,16 @@ const assignKitsTemplate = async (name) => {
</div>
</div>
<div class="form-group row">
<label for="scannedBarcode" class="col-md-4 col-form-label">Tracking Number</label>
<div class="col-md-8">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode">
<span id="showMsg" style="font-size: 14px;"></span>
<label for="scannedBarcode" class="col-md-4 col-form-label">Supply Kit Tracking Number</label>
<div class="col-md-8">
<div class="form-group row">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode">
<span id="showMsg" style="font-size: 14px;"></span>
</div>
<div class="form-group row">
<label for="scannedBarcode2" class="sr-only">Confirm Supply Kit Tracking Number</label>
<input autocomplete="off" type="text" class="form-control" id="scannedBarcode2" placeholder="Re-Enter (scan/type) Barcode">
</div>
</div>
</div>
</form>
Expand All @@ -74,6 +80,26 @@ const assignKitsTemplate = async (name) => {

document.getElementById("navbarNavAltMarkup").innerHTML = nonUserNavBar(name);
contentBody.innerHTML = template;

const scannedBarcode2 = document.getElementById('scannedBarcode2');
scannedBarcode2.onpaste = e => e.preventDefault();
scannedBarcode2.addEventListener("input", (e) => {
const scannedBarcodeValue = document.getElementById('scannedBarcode').value.trim();
const scannedBarcode2Value = e.target.value.trim();

if(scannedBarcodeValue && scannedBarcode2Value && scannedBarcodeValue !== scannedBarcode2Value) {
const msg = 'Supply Kit Tracking Number doesn\'t match';
errorMessage('scannedBarcode2', msg, true, false);
} else {
removeAllErrors();
}
});

// Set up automatic tabbing between inputs upon scanning (assuming the scanner automatically inputs the enter key at the end)
autoTabAcrossArray(['fullName', 'address', 'Connect_ID', 'scanSupplyKit', 'scannedBarcode', 'scannedBarcode2']);

numericInputValidator(['scannedBarcode', 'scannedBarcode2']);

activeHomeCollectionNavbar();
appState.setState({ participants: response.data });
populateSidePaneRows();
Expand Down Expand Up @@ -129,10 +155,18 @@ const confirmAssignment = () => {
confirmAssignmentInAction = true;
try {
e.preventDefault();
removeAllErrors();
const scannedBarcode = document.getElementById('scannedBarcode').value.trim();
const scannedBarcode2 = document.getElementById('scannedBarcode2').value.trim();
if(scannedBarcode && scannedBarcode2 && scannedBarcode !== scannedBarcode2) {
const msg = 'Supply Kit Tracking Number doesn\'t match';
errorMessage('scannedBarcode2', msg, true, false);
throw new Error(msg);
}
let participantObj = {};
participantObj['fullName'] = document.getElementById('fullName').value;
participantObj['address'] = document.getElementById('address').value;
participantObj[conceptIds.supplyKitTrackingNum] = document.getElementById('scannedBarcode').value.trim();
participantObj[conceptIds.supplyKitTrackingNum] = scannedBarcode;
participantObj[conceptIds.supplyKitId] = document.getElementById('scanSupplyKit').value.trim();
participantObj['Connect_ID'] = document.getElementById('Connect_ID')?.value;
const assignmentStatus = await processConfirmedAssignment(participantObj);
Expand Down
49 changes: 25 additions & 24 deletions src/pages/homeCollection/kitAssembly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { homeCollectionNavbar } from "./homeCollectionNavbar.js";
import { getIdToken, showAnimation, hideAnimation, appState, baseAPI, triggerErrorModal, processResponse, checkTrackingNumberSource } from "../../shared.js";
import { getIdToken, showAnimation, hideAnimation, appState, baseAPI, triggerErrorModal, processResponse, checkTrackingNumberSource, numericInputValidator, autoTabAcrossArray, performQCcheck } from "../../shared.js";
import { nonUserNavBar } from "./../../navbar.js";
import { activeHomeCollectionNavbar } from "./homeCollectionNavbar.js";
import { conceptIds } from '../../fieldToConceptIdMapping.js';
Expand Down Expand Up @@ -32,10 +32,16 @@ const kitAssemblyTemplate = async (name) => {
<div id="alert_placeholder"></div>
<form>
<div class="form-group row">
<label for="scannedBarcode" class="col-md-4 col-form-label">Tracking Number</label>
<label for="scannedBarcode" class="col-md-4 col-form-label">Return Kit Tracking Number</label>
<div class="col-md-8">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode" required />
<span id="showMsg" style="font-size: 14px;"></span>
<div class="form-group row">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode" required />
</div>
<label for="scannedBarcode2" class="sr-only">Confirm Return Kit Tracking Number</label>
<div class="form-group row">
<input autocomplete="off" type="text" class="form-control" id="scannedBarcode2" placeholder="Re-Enter (scan/type) Barcode" required />
<span id="showMsg" style="font-size: 14px;"></span>
</div>
</div>
</div>
<div class="form-group row">
Expand Down Expand Up @@ -90,11 +96,18 @@ const kitAssemblyTemplate = async (name) => {

document.getElementById("navbarNavAltMarkup").innerHTML = nonUserNavBar(name);
contentBody.innerHTML = template;

// Set up automatic tabbing between inputs upon scanning (assuming the scanner automatically inputs the enter key at the end)
autoTabAcrossArray(['scannedBarcode', 'scannedBarcode2', 'supplyKitId', 'returnKitId', 'cupId', 'cardId']);

document.getElementById('scannedBarcode2').onpaste = e => e.preventDefault();
numericInputValidator(['scannedBarcode', 'scannedBarcode2']);
activeHomeCollectionNavbar();
processAssembledKit();
enableEnterKeystroke();
dropdownTrigger('Select Kit Type');
checkTrackingNumberSource();
performQCcheck('scannedBarcode2', 'scannedBarcode', 'showMsg', `Return Tracking Number doesn't match`);
performQCcheck('returnKitId', 'supplyKitId', 'showReturnKitErrorMsg', `Supply Kit & Return Kit need to be same`);
performQCcheck('cardId', 'cupId', 'showCardIdErrorMsg', `Cup ID & Card ID need to be same`);
};
Expand All @@ -108,25 +121,6 @@ const enableEnterKeystroke = () => {
});
}

const performQCcheck = (inputBox2, inputBox1, errorTag, errorMsg) => {
const checkInputBox2 = document.getElementById(inputBox2);
if (errorMsg === "") {
document.getElementById(errorTag).innerHTML = ``
}
if (checkInputBox2) {
checkInputBox2.addEventListener("input", (e) => {
const checkInputBox2Value = e.target.value.trim();
const checkInputBox1Value = document.getElementById(inputBox1).value.trim();
if (checkInputBox2Value !== checkInputBox1Value) {
document.getElementById(errorTag).innerHTML = `<i class="fa fa-exclamation-circle" style="font-size: 14px; color: red;"></i> ${errorMsg}`
}
else {
document.getElementById(errorTag).innerHTML = ``
}
})
}
}

const processAssembledKit = () => {
const saveKitButton = document.getElementById('saveKit');
if (saveKitButton) {
Expand All @@ -135,6 +129,8 @@ const processAssembledKit = () => {
const queryScannedBarcodeValue = document.getElementById('scannedBarcode')?.value?.trim();
const scannedBarcodeValue = (queryScannedBarcodeValue !== undefined) ? queryScannedBarcodeValue : 0;

const confirmScannedBarcodeValue = document.getElementById('scannedBarcode2')?.value?.trim();

const querySupplyKitIdValue = document.getElementById('supplyKitId').value.trim();
const supplyKitIdValue = (querySupplyKitIdValue !== undefined) ? querySupplyKitIdValue: 0;

Expand All @@ -147,7 +143,11 @@ const processAssembledKit = () => {
const queryCollectionCardIdValue = document.getElementById('cardId')?.value?.trim();
const collectionCardIdValue = (queryCollectionCardIdValue !== undefined) ? queryCollectionCardIdValue : 0;

if (scannedBarcodeValue.length === 0 || supplyKitIdValue.length === 0 || returnKitIdValue.length === 0 ||
if (queryScannedBarcodeValue !== confirmScannedBarcodeValue) {
triggerErrorModal('Return tracking number doesn\'t match.');
return;
}
else if (scannedBarcodeValue.length === 0 || supplyKitIdValue.length === 0 || returnKitIdValue.length === 0 ||
collectionCupIdValue.length === 0 || collectionCardIdValue.length === 0 || document.getElementById('dropdownSites').innerHTML !== 'Mouthwash') {
triggerErrorModal('One or more fields are missing.');
return
Expand Down Expand Up @@ -297,6 +297,7 @@ const storeAssembledKit = async (kitData) => {
const alertTemplate = (message, status = "warn", duration = 3000) => {
if (status === "success") {
performQCcheck('returnKitId', 'supplyKitId', 'showReturnKitErrorMsg', ``);
performQCcheck('scannedBarcode2', 'scannedBarcode', 'showMsg', ``);
performQCcheck('cardId', 'cupId', 'showCardIdErrorMsg', ``);
alert = `
<div id="alert-success" class="alert alert-success alert-dismissible fade show" role="alert">
Expand Down
5 changes: 3 additions & 2 deletions src/pages/homeCollection/kitShipment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { nonUserNavBar } from "./../../navbar.js";
import { homeCollectionNavbar } from "./homeCollectionNavbar.js";
import { showAnimation, hideAnimation, getIdToken, baseAPI, convertDateReceivedinISO, triggerSuccessModal, triggerErrorModal, sendClientEmail, processResponse, checkTrackingNumberSource } from "../../shared.js";
import { showAnimation, hideAnimation, getIdToken, baseAPI, convertDateReceivedinISO, triggerSuccessModal, triggerErrorModal, sendClientEmail, processResponse, checkTrackingNumberSource, numericInputValidator } from "../../shared.js";
import { activeHomeCollectionNavbar } from "./homeCollectionNavbar.js";
import { baselineMWKitRemainderTemplate } from "../../emailTemplates.js";
import { conceptIds } from '../../fieldToConceptIdMapping.js';
Expand All @@ -26,7 +26,7 @@ const kitShipmentTemplate = async (name) => {
<div class="container-fluid" style="padding-top: 50px;">
<div class="card">
<div class="card-body">
<span> <h3 style="text-align: center; margin: 0 0 1rem;">Scan tracking number</h3> </span>
<span> <h3 style="text-align: center; margin: 0 0 1rem;">Scan Supply Kit Tracking Number</h3> </span>
<div style="text-align: center; padding-bottom: 25px; ">
<span id="fieldModified"> Scan Barcode</span> : <input required type="text" name="scannedBarcode" id="scannedBarcode" />
<span id="showMsg" style="font-size: 14px;"></span>
Expand All @@ -37,6 +37,7 @@ const kitShipmentTemplate = async (name) => {
</div>
</div>`;
document.getElementById("contentBody").innerHTML = template;
numericInputValidator(['scannedBarcode']);
document.getElementById("navbarNavAltMarkup").innerHTML = nonUserNavBar(name);
activeHomeCollectionNavbar();
};
Expand Down
11 changes: 9 additions & 2 deletions src/pages/homeCollection/kitsReceipt.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { homeCollectionNavbar } from "./homeCollectionNavbar.js";
import { getIdToken, showAnimation, hideAnimation, convertDateReceivedinISO, baseAPI, triggerSuccessModal, triggerErrorModal, sendClientEmail, processResponse, checkTrackingNumberSource, getCurrentDate } from "../../shared.js";
import { getIdToken, showAnimation, hideAnimation, convertDateReceivedinISO, baseAPI, triggerSuccessModal, triggerErrorModal, sendClientEmail, processResponse, checkTrackingNumberSource, getCurrentDate, numericInputValidator, autoTabAcrossArray } from "../../shared.js";
import { baselineMWSurveyRemainderTemplate, baselineMWThankYouTemplate } from "../../emailTemplates.js";
import { nonUserNavBar } from "./../../navbar.js";
import { activeHomeCollectionNavbar } from "./homeCollectionNavbar.js";
Expand Down Expand Up @@ -33,7 +33,7 @@ const kitsReceiptTemplate = async (name) => {
<div class="mt-3" >
<br />
<div class="row form-group">
<label class="col-form-label col-md-4" for="scannedBarcode">Scan Barcode</label>
<label class="col-form-label col-md-4" for="scannedBarcode">Scan Return Kit Tracking Number</label>
<div style="display:inline-block;">
<input autocomplete="off" required="" class="col-md-8" type="text" id="scannedBarcode" style="width: 600px;" placeholder="Scan Barcode">
<span id="showMsg" style="padding-left: 10px;"></span>
Expand Down Expand Up @@ -110,6 +110,11 @@ template += `<div class="modal fade" id="modalShowMoreData" data-keyboard="false

document.getElementById("navbarNavAltMarkup").innerHTML = nonUserNavBar(name);
contentBody.innerHTML = template;

// Set up automatic tabbing between inputs upon scanning (assuming the scanner automatically inputs the enter key at the end)
autoTabAcrossArray(['scannedBarcode', 'packageCondition', 'receivePackageComments', 'dateReceived', 'collectionCheckBox', 'collectionId', 'dateCollectionCard', 'timeCollectionCard', 'collectionComments']);

numericInputValidator(['scannedBarcode']);
activeHomeCollectionNavbar();
checkTrackingNumberSource();
performCollectionIdcheck();
Expand All @@ -121,6 +126,8 @@ const performCollectionIdcheck = () => {
collectionIdField.addEventListener("input", (e) => {
if (collectionIdField.value.length < 14) {
document.getElementById('showCollectionErrorMsg').innerHTML = `<i class="fa fa-exclamation-circle" style="font-size: 14px; color: red;"></i> Enter Correct Collection ID`
} else {
document.getElementById('showCollectionErrorMsg').innerHTML = ``
}
})
}
Expand Down
8 changes: 8 additions & 0 deletions src/pages/receipts/csvFileReceipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ const vialMapping = {
'0024': ['3 ml Vacutainer', 'EDTA = K2', 'WHOLE BL', '3'],
'0006': ['10 ml Vacutainer', 'No Additive', 'Urine', '10']
},
uOfChicagoMed: {
'0001': ['10 ml Serum separator tube', 'SST', 'Serum', '10'],
'0002': ['10 ml Serum separator tube', 'SST', 'Serum', '10'],
'0003': ['10 ml Vacutainer', 'Lithium Heparin', 'WHOLE BL', '10'],
'0004': ['10 ml Vacutainer', 'EDTA = K2', 'WHOLE BL', '10'],
'0060': ['Streck Tube', 'Streck DNA', 'WHOLE BL', '10'],
'0006': ['10 ml Vacutainer', 'No Additive', 'Urine', '10']
},
default: {
'0001': ['5 ml Serum separator tube', 'SST', 'Serum', '5'],
'0002': ['5 ml Serum separator tube', 'SST', 'Serum', '5'],
Expand Down
Loading