Skip to content

Commit

Permalink
feat: add details tabs in needs attention screen tech-by-design#668
Browse files Browse the repository at this point in the history
  • Loading branch information
megin1989 committed Nov 11, 2024
1 parent 6afa75b commit 0fbdc0e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

const schemaName = 'techbd_udi_ingress';
const viewName = 'fhir_needs_attention';
const detailTableViewName = 'fhir_needs_attention_details';
const datalakeSubmissionDetails = 'fhir_needs_attention_details';
const missingSubmissionDetails = 'missing_datalake_submission_details';
document.addEventListener('DOMContentLoaded', function () {
const helpers = new Helpers();
const modalAide = new ModalAide();
Expand All @@ -56,9 +57,16 @@
button.innerText = params.data.qe_total_submissions;
button.style.marginLeft = '5px';

// container.appendChild(arrow);
container.appendChild(arrow);
container.appendChild(button);

container.addEventListener('click', () => {
// Set buttonPressed before expanding
params.node.data.buttonPressed = 'qe_total_submissions';
params.node.setExpanded(!params.node.expanded);
arrow.innerText = params.node.expanded ? '▼' : '▶';
});

return container;
}

Expand Down Expand Up @@ -137,6 +145,14 @@
{
headerName: "QE to Tech by Design",
field: "qe_total_submissions",
// cellRenderer: cellRenderer1,
// cellStyle: function (params) {
// console.log(params.data.shinny_datalake_submissions_failed)
// if (params.data.qe_total_submissions != (params.data.shinny_datalake_submissions + params.data.shinny_datalake_submissions_failed)) {
// return { color: 'red' };
// }
// return null;
// },
filter: "agTextColumnFilter",
headerTooltip: "FHIR File count from QE to Tech by Design"
},
Expand All @@ -146,7 +162,7 @@
filter: "agTextColumnFilter",
cellRenderer: cellRenderer2,
cellStyle: function (params) {
if (params.data.qe_total_submissions !== params.data.shinny_datalake_submissions) {
if (params.data.qe_total_submissions !== params.data.shinny_datalake_submissions ) {
return { color: 'red' };
}
return null;
Expand All @@ -157,12 +173,12 @@
masterDetail: true,
detailCellRendererParams: (params) => {


if (params.data.buttonPressed === 'shinny_datalake_submissions') {
return {
detailGridOptions: detailGridOptions2,
getDetailRowData: function (params) {
const value = params.data.qe_name;
fetch(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/${detailTableViewName}/qe_name/${value}.json`))
fetch(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/${datalakeSubmissionDetails}/qe_name/${value}.json`))
.then(response => {
if (response.url.includes('/?timeout=true')) {
window.location.href = '/?timeout=true'; // Redirect to login page
Expand All @@ -179,6 +195,23 @@
},
};

} else if (params.data.buttonPressed === 'qe_total_submissions') {
return {
detailGridOptions: detailGridOptions2,
getDetailRowData: function (params) {
const value = params.data.qe_name;
fetch(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/${missingSubmissionDetails}/qe_name/${value}.json`))
.then(response => response.json())
.then(data => {
params.successCallback(data);
});
}, defaultColDef: {
flex: 1,
filter: true,
},
};
}

}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
const urlParams = new URLSearchParams(queryString);
const qeName = urlParams.get('qeName');
const schemaName = 'techbd_udi_ingress';
const viewName = 'fhir_needs_attention_detailss';
const viewName = 'missing_datalake_submission_details';
const detailTableViewName = 'interaction_http_request_failed_needs_attention';


Expand Down Expand Up @@ -116,19 +116,12 @@
const sat_interaction_http_request_id = params.data.sat_interaction_http_request_id;
const button = document.createElement('button');
button.innerText = hub_interaction_id;
button.addEventListener('click', () => {
if (error_type == 'Data Submission Error') {
modalAide.viewFetchedJsonValueCustom(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/interaction_http_request_failed_needs_attention/sat_interaction_http_request_id/${sat_interaction_http_request_id}.json`));
} else if (error_type == 'Data Validation Error') {
modalAide.viewFetchedJsonValueCustom(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/interaction_http_fhir_request_needs_attention/sat_interaction_http_request_id/${sat_interaction_http_request_id}.json`));
} else {
console.error('hub_interaction_id is undefined');
}
button.addEventListener('click', () => {
modalAide.viewFetchedJsonValue(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/interaction_http_fhir_request/sat_interaction_http_request_id/${sat_interaction_http_request_id}.json`));
});
return button;
}
},
{ headerName: "Error type", field: "error_type", filter: "agTextColumnFilter", flex: 1 },
},
{ headerName: "Submission Date", field: "created_at", filter: "agDateColumnFilter", flex: 1 },
])
.withServerSideDatasourceGET(
Expand Down Expand Up @@ -159,8 +152,7 @@
}
return response.json();
})
.then(response => {
console.log(response);
.then(response => {
params.successCallback(response);
})
.catch(error => {
Expand All @@ -177,18 +169,8 @@

.build();

// agGridInstance.init('serverDataGrid');

// Add date-range text
// Inject the date range into the HTML
//helpers.injectDateRangeText('tenant', qeName );

// let lastBreadcrumb = document.querySelector('#nav-breadcrumbs ol li:last-child span');
agGridInstance.init('serverDataGrid');

// // Append the text "healthlink" to the existing text
// if (lastBreadcrumb) {
// lastBreadcrumb.textContent += ' (' + qeName + ')';
// }



Expand All @@ -201,13 +183,13 @@
<body>
<div layout:fragment="content">
<div class="grid-title"> <span id="tenant"> </span></div>
<div class="grid-description">
<!-- <h1 class="assemtion">Between TechBD and Scoring Engine</h1> -->
<!-- This widget displays details about data that has not been received by the Scoring Engine from TechBD, as
well as records with errors that have not been processed or passed on to the Scoring Engine.
Click on an interaction, a popup will open containing the error details. -->
<div class="grid-description">
This widget displays data interactions that did not successfully pass to the SHIN-NY Data Lake.
This may indicate issues such as processing failures, delivery issues, or errors encountered during the transaction.
</br>
Users can click on an individual interaction to open a popup with specific error details.
</div>
<div id="serverDataGrid" class="ag-theme-alpine" style="display:none"></div>
<div id="serverDataGrid" class="ag-theme-alpine" ></div>

</div>

Expand Down
10 changes: 2 additions & 8 deletions hub-prime/src/main/resources/templates/page/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ <h3 class="text-xl font-bold mb-4">Production (flat files)</h3>
sequenceDiagram
participant QE as QE
participant Tech by Design as Tech by Design
participant SHIN-NY Data Lake as SHIN-NY Data Lake
participant MDW as MDW
participant SHIN-NY Data Lake as SHIN-NY Data Lake
QE ->> Tech by Design: HEALTHeLINK Proxy FHIR JSON (${healthelink})
QE ->> Tech by Design: Healtheconnections Proxy FHIR JSON (${healtheconnections})
Expand All @@ -262,12 +261,7 @@ <h3 class="text-xl font-bold mb-4">Production (flat files)</h3>
Tech by Design ->> SHIN-NY Data Lake: Healtheconnections Proxy Validated FHIR JSON (${healtheconnections_shinny_datalake_submissions})
Tech by Design ->> SHIN-NY Data Lake: Healthix Proxy Validated FHIR JSON (${healthix_shinny_datalake_submissions})
Tech by Design ->> SHIN-NY Data Lake: Rochester Proxy Validated FHIR JSON (${grrhio_shinny_datalake_submissions})
Tech by Design ->> SHIN-NY Data Lake: HixNY Proxy Validated FHIR JSON (${hixny_shinny_datalake_submissions})
SHIN-NY Data Lake ->> MDW: HEALTHeLINK Proxy Submit to MDW (?)
SHIN-NY Data Lake ->> MDW: Healtheconnections Proxy Submit to MDW (?)
SHIN-NY Data Lake ->> MDW: Healthix Proxy Submit to MDW (?)
SHIN-NY Data Lake ->> MDW: Rochester Proxy Submit to MDW (?)
SHIN-NY Data Lake ->> MDW: HixNY Proxy Submit to MDW (?)
Tech by Design ->> SHIN-NY Data Lake: HixNY Proxy Validated FHIR JSON (${hixny_shinny_datalake_submissions})
`;

// Inject the Mermaid code into the HTML
Expand Down

0 comments on commit 0fbdc0e

Please sign in to comment.