Skip to content

Commit

Permalink
Merge pull request #1012 from megin1989/main
Browse files Browse the repository at this point in the history
feat: add new tab HRSN Data Tracker under content menu #1004
  • Loading branch information
ratheesh-kr authored Jan 8, 2025
2 parents 70a35df + e882731 commit e79c502
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 2 deletions.
Binary file modified hub-prime/lib/techbd-udi-jooq-ingress.auto.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,16 @@ public String organizations(final Model model, final HttpServletRequest request)
return presentation.populateModel("page/content/organizations", model, request);
}


@GetMapping("/content/scn")
@RouteMapping(label = "SCN", title = "SCN", siblingOrder = 40)
public String scn(final Model model, final HttpServletRequest request) {
return presentation.populateModel("page/content/scn", model, request);
}

@GetMapping("/content/hrsn-data-tracker")
@RouteMapping(label = "HRSN Data Tracker", title = "HRSN Data Tracker", siblingOrder = 50)
public String hrsnDataTracker(final Model model, final HttpServletRequest request) {
return presentation.populateModel("page/content/hrsn-data-tracker", model, request);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/prime}">

<head>
<link rel="stylesheet" href="https://unpkg.com/ag-grid-community/styles/ag-grid.css">
<link rel="stylesheet" href="https://unpkg.com/ag-grid-community/styles/ag-theme-alpine.css">
<style>
.grid-description {
font-size: 14px;
margin: 5px 0px 8px 15px;
}

.grid-title {
font-size: 18px;
font-weight: bold;
margin: 12px 0px 11px 15px;
}
</style>
<!-- if JSON Viewer is not already in the layout, add the following -->
<!-- <script src="https://unpkg.com/@alenaksu/[email protected]/dist/json-viewer.bundle.js"></script> -->

<script src="https://unpkg.com/ag-grid-enterprise/dist/ag-grid-enterprise.js"></script>
<script type="module">
import { AGGridAide, AGGridAideBuilder } from '@presentation/shell/aggrid-aide.js';
import ModalAide from '@presentation/shell/modal-aide.js';

const schemaName = 'techbd_udi_ingress';
const viewName = 'hrsn_data_tracker';
document.addEventListener('DOMContentLoaded', function () {
const modalAide = new ModalAide();
const agGridInstance = new AGGridAideBuilder()
.withColumnDefs([
{
headerName: "Encountered Time",
field: "interaction_date",
sortable: true,
sort: "desc",
filter: "agDateColumnFilter",
tooltipField: "interaction_date",
tooltipComponentParams: { tooltipText: "Date when the interaction occurred." }
},
{
headerName: "TechBD Tenant ID",
field: "qe_name",
filter: "agTextColumnFilter",
tooltipField: "qe_name",
tooltipComponentParams: { tooltipText: "Identifier for the TechBD tenant." }
},
{
headerName: "IT Vendor",
field: "it_vendor",
filter: "agTextColumnFilter",
tooltipField: "it_vendor",
tooltipComponentParams: { tooltipText: "Name of the associated IT Vendor." }
},
{
headerName: "SCN",
field: "scn",
filter: "agTextColumnFilter",
tooltipField: "scn",
tooltipComponentParams: { tooltipText: "Service Coordination Network for the interaction." }
},
{
headerName: "Bundle Resource Type",
field: "type",
filter: "agNumberColumnFilter",
tooltipField: "type",
tooltipComponentParams: { tooltipText: "Resource type categorized as Referral, Screening, or Assessment." }
},
{
headerName: "Count",
field: "count",
filter: "agNumberColumnFilter",
tooltipField: "count",
tooltipComponentParams: { tooltipText: "Total count of interactions." }
}
])
.withServerSideDatasource(
window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/${viewName}.json`),
(data, valueCols) => {
return valueCols.map(col => ({
headerName: col.displayName,
field: col.field
}));
},
)
.withModalAide(modalAide)
.withGridDivStyles({ height: "750px", width: "100%" })
.build();

agGridInstance.init('serverDataGrid');
});
</script>
</head>

<body>
<div layout:fragment="content">
<div class="grid-description">
This widget offers an overview of interactions processed through the system. It includes columns such as Encountered Time, TechBD Tenant ID, IT Vendor, SCN, Bundle Resource Type, and Count. Users can filter and sort the data to analyze interactions effectively. The widget helps in identifying trends and patterns based on tenant-specific and SCN-specific details.
</div>
<div id="serverDataGrid" class="ag-theme-alpine"></div>
</div>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3972,4 +3972,70 @@ WHERE
'/flatfile/csv/Bundle/$validate/'::text
])
AND (((((sifcr.validation_result_payload -> 'validationResults'::text) -> 'report'::text) -> 'stats'::text) ->> 'errors'::text)::integer) > 0
order by sifcr.created_at DESC ;
order by sifcr.created_at DESC ;



/*****************************************
This query retrieves interaction details from the techbd_udi_ingress.sat_interaction_fhir_request table. It includes interaction date, tenant ID (QE), IT vendor, SCN, type, and the count of interactions.

SCN is determined based on tenant_id and patient_mrn_source_system, defaulting to NULL if patient_mrn_source_system is NULL.
Filters exclude invalid bundles and specific URIs.
Results are grouped by key fields and sorted in ascending order.
*****************************************/

drop view if exists techbd_udi_ingress.hrsn_data_tracker cascade;
create or replace view techbd_udi_ingress.hrsn_data_tracker as
SELECT
htt_req.created_at::date AS interaction_date,
htt_req.tenant_id AS qe_name,
case
WHEN htt_req.patient_mrn_source_system IS NULL THEN NULL
WHEN tenant_id_lower = 'healtheconn' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HAHRSN' THEN 'Healthy Alliance'
WHEN tenant_id_lower = 'hixny' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HAHRSN' THEN 'Healthy Alliance Foundation Inc.'
WHEN tenant_id_lower = 'healtheconn' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HVCCHRSN' THEN 'Hudson Valley Care Coalition, Inc.'
WHEN tenant_id_lower = 'healtheconn' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'CCHRSN' THEN 'Care Compass'
WHEN tenant_id_lower = 'healthix' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HWCLI' THEN 'Health and Welfare Council of LI'
WHEN tenant_id_lower = 'healthix' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'PHS' THEN 'Public Health Solutions'
WHEN tenant_id_lower = 'healthix' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'SIPPS' THEN 'Staten Island PPS'
WHEN tenant_id_lower = 'bronxrhio' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'SOMOSFH' THEN 'Somos Healthcare Providers, Inc.'
WHEN tenant_id_lower = 'grrhio' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'FLIPAFH' THEN 'Finger Lakes IPA Inc.'
WHEN tenant_id_lower = 'grrhio' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'FLIPATN' THEN 'Finger Lakes IPA Inc. (Monroe County Only)'
WHEN tenant_id_lower = 'healthelink' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'WNYICCFH' THEN 'Western New York Integrated Care Collaborative, Inc.'
ELSE SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5)
END AS scn,
-- Determine IT Vendor based on SCN and QE
case
WHEN tenant_id_lower = 'healtheconn' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HAHRSN' THEN 'Unite Us'
WHEN tenant_id_lower = 'hixny' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HAHRSN' THEN 'UniteUs'
WHEN tenant_id_lower = 'healtheconn' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HVCCHRSN' THEN 'Unite Us'
WHEN tenant_id_lower = 'healtheconn' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'CCHRSN' THEN 'Unite Us'
WHEN tenant_id_lower = 'healthix' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'HWCLI' THEN 'UniteUs'
WHEN tenant_id_lower = 'healthix' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'PHS' THEN 'UniteUs'
WHEN tenant_id_lower = 'healthix' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'SIPPS' THEN 'Channels360'
WHEN tenant_id_lower = 'bronxrhio' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'SOMOSFH' THEN 'FindHelp'
WHEN tenant_id_lower = 'grrhio' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'FLIPAFH' THEN 'FindHelp'
WHEN tenant_id_lower = 'grrhio' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'FLIPATN' THEN 'TogetherNow'
WHEN tenant_id_lower = 'healthelink' AND SPLIT_PART(htt_req.patient_mrn_source_system, '/', 5) = 'WNYICCFH' THEN 'FindHelp'
ELSE ''
END AS it_vendor,
CASE
WHEN 'ServiceRequest' = ANY(string_to_array(htt_req.resource_type_set, ', '))
OR 'Task' = ANY(string_to_array(htt_req.resource_type_set, ', '))
THEN 'Referral'
WHEN 'Consent' = ANY(string_to_array(htt_req.resource_type_set, ', '))
THEN 'Screening'
WHEN 'Condition' = ANY(string_to_array(htt_req.resource_type_set, ', '))
THEN 'Assessment'
ELSE NULL
END AS type,
COUNT(*) AS count
FROM techbd_udi_ingress.sat_interaction_fhir_request htt_req
WHERE
htt_req.uri = ANY (ARRAY['/Bundle/', '/Bundle', '/flatfile/csv/Bundle', '/flatfile/csv/Bundle/'])
AND htt_req.is_bundle_valid = true
AND htt_req.nature = 'Forwarded HTTP Response'
GROUP BY
interaction_date, qe_name, it_vendor, scn, type
ORDER BY
interaction_date DESC;

0 comments on commit e79c502

Please sign in to comment.