Skip to content

Commit

Permalink
Merge pull request #716 from episphere/dev
Browse files Browse the repository at this point in the history
Dev -> Stage Sync (June 2024)
  • Loading branch information
anthonypetersen authored Jun 17, 2024
2 parents 9725ca6 + e0faca5 commit e86aa95
Show file tree
Hide file tree
Showing 15 changed files with 496 additions and 446 deletions.
58 changes: 19 additions & 39 deletions src/dev/identityProvider.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,20 @@
export const devSSOConfig = (tenantID, provider, inputValue) => {
if (/nih.gov/i.test(inputValue)) {
tenantID = 'NIH-SSO-qfszp';
provider = 'saml.nih-sso';
}
if (/healthpartners.com/i.test(inputValue)) {
tenantID = 'HP-SSO-wb1zb';
provider = 'saml.healthpartner';
}
if (/hfhs.org/i.test(inputValue)) {
tenantID = 'HFHS-SSO-ay0iz';
provider = 'saml.connect-hfhs';
}
if (/sanfordhealth.org/i.test(inputValue)) {
tenantID = 'SFH-SSO-cgzpj';
provider = 'saml.connect-sanford';
}
if (/uchicago.edu/i.test(inputValue)) {
tenantID = 'UCM-SSO-tovai';
provider = 'saml.connect-uchicago';
}
if (/norc.org/i.test(inputValue)) {
tenantID = 'NORC-SSO-dilvf';
provider = 'saml.connect-norc';
}
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)) {
tenantID = 'MFC-SSO-fljvd';
provider = 'saml.connect-mfc'
}
if (/bswhealth.org/i.test(inputValue)) {
tenantID = 'BSWH-SSO-y2jj3';
provider = 'saml.connect-bswh';
}

return { tenantID, provider }
export const devSSOConfig = (email) => {
const ssoConfigs = [
{ tenantID: 'NIH-SSO-qfszp', provider: 'saml.nih-sso', regex: /nih.gov/i },
{ tenantID: 'HP-SSO-wb1zb', provider: 'saml.healthpartner', regex: /healthpartners.com/i },
{ tenantID: 'HFHS-SSO-ay0iz', provider: 'saml.connect-hfhs', regex: /hfhs.org/i },
{ tenantID: 'SFH-SSO-cgzpj', provider: 'saml.connect-sanford', regex: /sanfordhealth.org/i },
{ tenantID: 'UCM-SSO-tovai', provider: 'saml.connect-uchicago', regex: /uchicago.edu/i },
{ tenantID: 'NORC-SSO-dilvf', provider: 'saml.connect-norc', regex: /norc.org/i },
{ tenantID: 'KP-SSO-wulix', provider: 'saml.connect-kp', regex: /kp.org/i },
{ tenantID: 'MFC-SSO-fljvd', provider: 'saml.connect-mfc', regex: /(marshfieldresearch.org|marshfieldclinic.org)/i },
{ tenantID: 'BSWH-SSO-y2jj3', provider: 'saml.connect-bswh', regex: /bswhealth.org/i }
];

for (const ssoConfig of ssoConfigs) {
if (ssoConfig.regex.test(email)) {
return { tenantID: ssoConfig.tenantID, provider: ssoConfig.provider };
}
}
return { tenantID: '', provider: '' };
}
136 changes: 0 additions & 136 deletions src/emailTemplates.js

This file was deleted.

77 changes: 48 additions & 29 deletions src/fieldToConceptIdMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export const conceptIds = {
refusedAllFutureActivities: 458508122,
deceased: 618686157
},
authenticationEmail: 421823980,
authenticationPhone: 348474836,
signInMechanism: 995036844,
preferredEmail: 869588347,
preferredLanguage: 255077064,
english: 163149180,
spanish: 773342525,

// Individual yes/no properties on the data
withdrewConsent: 747006172,
Expand Down Expand Up @@ -132,6 +139,7 @@ export const conceptIds = {
},
checkOutDateTime: 343048998,
checkInDateTime: 840048338,
checkInComplete: 135591601,

// not shipped specimen deviation id
brokenSpecimenDeviation: 472864016,
Expand Down Expand Up @@ -262,36 +270,42 @@ export const conceptIds = {
},

collectionLocationMapping: {
777644826 : 'UC-DCAM',
692275326 : 'Marshfield',
813701399 : 'Weston',
698283667 : 'Lake Hallie',
834825425 : 'HP Research Clinic',
574368418 : "HP Park Nicollet",
736183094 : 'HFH K-13 Research Clinic',
886364332 : 'HFH Cancer Pavilion Research Clinic',
706927479 : 'HFH Livonia Research Clinic',
322059622 : "HFH Pop-Up",
589224449 : 'Sioux Falls Imagenetics',
127626388 : "Bismarck Medical Center",
777644826: 'UC-DCAM',
692275326: 'Marshfield',
813701399: 'Weston',
698283667: 'Lake Hallie',
834825425: 'HP Research Clinic',
574368418: "HP Park Nicollet",
736183094: 'HFH K-13 Research Clinic',
886364332: 'HFH Cancer Pavilion Research Clinic',
706927479: 'HFH Livonia Research Clinic',
322059622: "HFH Pop-Up",
589224449: 'Sioux Falls Imagenetics',
127626388: "Bismarck Medical Center",
246137578: 'Sioux Falls Sanford Center',
145191545 : 'Ingalls Harvey',
489380324 : 'River East',
319518299 : 'UCM Pop-Up',
940329442 : 'Orland Park',
567969985 : 'MF Pop-Up',
120264574 : 'South Loop',
691714762 : 'Rice Lake',
487512085 : 'Wisconsin Rapids',
983848564 : 'Colby Abbotsford',
261931804 : 'Minocqua',
665277300 : 'Merrill',
467088902 : 'Fargo South University',
111111111 : 'NIH/NCI',
807835037 : 'Other'
145191545: 'Ingalls Harvey',
489380324: 'River East',
319518299: 'UCM Pop-Up',
940329442: 'Orland Park',
567969985: 'MF Pop-Up',
120264574: 'South Loop',
691714762: 'Rice Lake',
487512085: 'Wisconsin Rapids',
983848564: 'Colby Abbotsford',
261931804: 'Minocqua',
665277300: 'Merrill',
467088902: 'Fargo South University',
111111111: 'NIH/NCI',
807835037: 'Other',
723351427: 'BCC- HWC',
807443231: 'FW All Saints',
475614532: 'BCC- Plano',
809370237: 'BCC- Worth St',
856158129: 'BCC- Irving',
436956777: 'NTX Biorepository'
},

nameToKeyObj : {
nameToKeyObj: {
'ucDcam': 777644826,
'marshfield': 692275326,
'weston': 813701399,
Expand Down Expand Up @@ -319,8 +333,13 @@ export const conceptIds = {
"ucmPopUp": 319518299,
"orPark": 940329442,
"mfPopUp": 567969985,
'bccHwc': 723351427,
'bccAllSaints': 807443231,
'bccPlano': 475614532,
'bccWorthSt': 809370237,
'bccIrving': 856158129,
'ntxBiorepo': 436956777,
'all': 1000

},
boxedStatus: 771580890,
notBoxed: 657483796,
Expand Down Expand Up @@ -395,4 +414,4 @@ export const packageConditionConversion = {
"541085383": "Incorrect Material Type Returned",
"427719697": "Collection Cup Not Returned",
"100618603": "Other"
}
};
9 changes: 8 additions & 1 deletion src/pages/homeCollection/assignKits.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ const assignKitsTemplate = async (name) => {
scannedBarcode2.onpaste = e => e.preventDefault();
scannedBarcode2.addEventListener("input", (e) => {
const scannedBarcodeValue = document.getElementById('scannedBarcode').value.trim();
const scannedBarcode2Value = e.target.value.trim();
let scannedBarcode2Value = e.target.value.trim();

// Trim FedEx tracking numbers (1033)
// Already done for the scannedBarcode input in checkTrackingNumberSource
if (scannedBarcode2Value.length === 34) {
scannedBarcode2Value = scannedBarcode2Value.slice(-12);
e.target.value = scannedBarcode2Value;
}

if(scannedBarcodeValue && scannedBarcode2Value && scannedBarcodeValue !== scannedBarcode2Value) {
const msg = 'Supply Kit Tracking Number doesn\'t match';
Expand Down
19 changes: 15 additions & 4 deletions src/pages/homeCollection/kitAssembly.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ const kitAssemblyTemplate = async (name) => {
<div class="col-md-8">
<div class="form-group row">
<input type="text" class="form-control" id="scannedBarcode" placeholder="Scan Barcode" required />
<span id="showMsg" style="font-size: 14px;"></span>
</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>
<span id="showErrorMsg" style="font-size: 14px;"></span>
</div>
</div>
</div>
Expand Down Expand Up @@ -100,14 +101,23 @@ const kitAssemblyTemplate = async (name) => {
// 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();
const scannedBarcode2 = document.getElementById('scannedBarcode2');
scannedBarcode2.onpaste = e => e.preventDefault();
numericInputValidator(['scannedBarcode', 'scannedBarcode2']);
activeHomeCollectionNavbar();
processAssembledKit();
enableEnterKeystroke();
dropdownTrigger('Select Kit Type');
checkTrackingNumberSource();
performQCcheck('scannedBarcode2', 'scannedBarcode', 'showMsg', `Return Kit Tracking Number doesn't match`);
// Trim FedEx tracking numbers (1033)
// Already done for the scannedBarcode input in checkTrackingNumberSource
scannedBarcode2.addEventListener("input", (e) => {
const input = e.target.value.trim();
if (input.length === 34) {
e.target.value = input.slice(-12);
}
});
performQCcheck('scannedBarcode2', 'scannedBarcode', 'showErrorMsg', `Return Kit 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 Down Expand Up @@ -167,6 +177,7 @@ const processAssembledKit = () => {
document.getElementById('cupId').value = ``;
document.getElementById('cardId').value = ``;
document.getElementById("showMsg").innerHTML = ``;
document.getElementById("showErrorMsg").innerHTML = ``;
}
} catch (error) {
console.error(error);
Expand Down Expand Up @@ -310,7 +321,7 @@ const storeAssembledKit = async (kitData) => {
const alertTemplate = (message, status = "warn", duration = 3000) => {
if (status === "success") {
performQCcheck('returnKitId', 'supplyKitId', 'showReturnKitErrorMsg', ``);
performQCcheck('scannedBarcode2', 'scannedBarcode', 'showMsg', ``);
performQCcheck('scannedBarcode2', 'scannedBarcode', 'showErrorMsg', ``);
performQCcheck('cardId', 'cupId', 'showCardIdErrorMsg', ``);
alert = `
<div id="alert-success" class="alert alert-success alert-dismissible fade show" role="alert">
Expand Down
Loading

0 comments on commit e86aa95

Please sign in to comment.