forked from tech-by-design/polyglot-prime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tech-by-design#238 from anoopvarma-2000-p/main
feat: added organization tab in the content tech-by-design#205
- Loading branch information
Showing
7 changed files
with
217 additions
and
26 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
hub-prime/src/main/resources/templates/page/content/organizations.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<!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"> | ||
|
||
<!-- 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 src="https://www.jsviews.com/download/jsrender.js"></script> | ||
<script type="module"> | ||
import { AGGridAide, AGGridAideBuilder } from '@presentation/shell/aggrid-aide.js'; | ||
import ModalAide from '@presentation/shell/modal-aide.js'; | ||
import { FhirViewer } from '@presentation/shell/fhir-view.js'; | ||
customElements.define('fhir-viewer', FhirViewer); | ||
const schemaName = 'techbd_udi_ingress'; | ||
const viewName = 'fhir_screening_organization'; | ||
const detailTableViewName = 'fhir_screening_info'; | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
const modalAide = new ModalAide(); | ||
const agGridInstance = new AGGridAideBuilder() | ||
.withColumnDefs([ | ||
{ headerName: "Organization ID", field: "org_id", filter: "agTextColumnFilter", hide: true }, | ||
{ headerName: "Organization Name", field: "org_name", filter: "agTextColumnFilter", cellRenderer: 'agGroupCellRenderer' }, | ||
{ headerName: "QE Name", field: "qe_name", filter: "agTextColumnFilter" }, | ||
{ headerName: "Active", field: "org_active", filter: "agTextColumnFilter" }, | ||
{ headerName: "Address", field: "org_address", filter: "agTextColumnFilter" }, | ||
{ headerName: "City", field: "org_city", filter: "agTextColumnFilter" }, | ||
{ headerName: "State", field: "org_state", filter: "agTextColumnFilter" }, | ||
{ headerName: "Postal Code", field: "org_postal_code", filter: "agTextColumnFilter" } | ||
]) | ||
.withServerSideDatasource( | ||
window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/${viewName}.json`), | ||
(data, valueCols) => { | ||
return valueCols.map(col => ({ | ||
headerName: col.displayName, | ||
field: col.field | ||
})); | ||
}, | ||
) | ||
.withDetailCellRendererParams({// provide the Grid Options to use on the Detail Grid | ||
detailGridOptions: { | ||
columnDefs: [ | ||
{ headerName: "QE Name", field: "qe_name", filter: "agTextColumnFilter" }, | ||
{ | ||
headerName: "Patient MRN", | ||
field: "patient_mrn", | ||
filter: "agTextColumnFilter" | ||
}, | ||
{ | ||
headerName: "Survey Date", | ||
field: "survey_date_time", | ||
filter: "agNumberColumnFilter", | ||
valueFormatter: AGGridAide.isoDateTimeValueFormatter() | ||
}, | ||
|
||
{ headerName: "Areas of Interest ", field: "areas_of_interest", filter: "agTextColumnFilter" }, | ||
{ headerName: "Total Safety Score", field: "total_safety_score", filter: "agTextColumnFilter" }, | ||
{ | ||
headerName: "Submission Date", | ||
field: "submitted_date_time", | ||
sort: "desc", | ||
filter: "agNumberColumnFilter", | ||
valueFormatter: AGGridAide.dateTimeValueFormatter() | ||
} | ||
], | ||
defaultColDef: { | ||
flex: 1 | ||
} | ||
}, | ||
getDetailRowData: params => { | ||
const value = params.data.org_id; | ||
fetch(window.shell.serverSideUrl(`/api/ux/tabular/jooq/${schemaName}/${detailTableViewName}/org_id/${value}.json`)) | ||
.then(response => response.json()) | ||
.then(response => { | ||
params.successCallback(response); | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching details data' + error); | ||
}); | ||
} | ||
}) | ||
.withMasterDetail(true) | ||
.withModalAide(modalAide) | ||
.withGridDivStyles({ height: "750px", width: "100%" }) | ||
.build(); | ||
agGridInstance.init('serverDataGrid'); | ||
}); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div layout:fragment="content"> | ||
<div id="serverDataGrid" class="ag-theme-alpine"></div> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters