-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
241 lines (201 loc) · 10.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FHIR Implementation Guides</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" type="text/css"
href="https://cdn.datatables.net/v/dt/jq-3.6.0/dt-1.11.5/datatables.min.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-3.6.0/dt-1.11.5/datatables.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="semi-transparent">
<div class="d-flex justify-content-between align-items-start">
<a href="http://hl7belgium.org">
<img src="leftlogo.png" alt="Left Link" height="100" />
</a>
<a href="http://hl7.org/fhir">
<img src="rightlogo.png" alt="Right Link" height="100" />
</a>
</div>
<div class="text-center mt-3">
<h3>HL7 Belgium FHIR Community Specifications</h3>
<p>
These are the FHIR Implementation Guides that are validated and published for the Belgian community.
These are complementary to the official Implementation Guides published by the Federal eHealth
agency, which can be found <a href="https://ehealth.fgov.be/standards/fhir">here</a>.
</p>
<br />
<h2 style="text-align: left;">FHIR Specifications</h2>
</div>
<!-- Tab navigation -->
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active nav-tab custom-nav-tab" id="ig-list-tab" data-target="packageInfo">IG
List</a>
</li>
<li class="nav-item">
<a class="nav-link nav-tab custom-nav-tab" id="artifacts-tab" data-target="artifacts">Artifacts</a>
</li>
</ul>
<!-- Tab content -->
<div class="tab-content">
<!-- Package Information -->
<div id="packageInfo" class="row row-cols-1 row-cols-md-1 gx-4"></div>
<!-- Artifacts -->
<div id="artifacts" class="d-none">
<br />
<p> This is a list of all artifacts published across all Implementation Guides:</p>
<br />
<table id="artifacts-table" class="display">
<thead>
<tr>
<th>Id</th>
<th>Type</th>
<th>Name</th>
<th>Version</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha256-3jOxLI54oGxS0Jpay+dHb/IyKbRloIzKq6/VBLBVc+A=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.min.js"
integrity="sha512-OvBgP9A2JBgiRad/mM36mkzXSXaJE9BEIENnVEmeZdITvwT09xnxLtT4twkCa8m/loMbPHsvPl0T8lRGVBwjlQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
async function fetchJSON(url) {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
}
const showTable = getComputedStyle(document.documentElement).getPropertyValue('--show-table').trim();
if (showTable === 'true') {
document.body.classList.add('show-table');
}
document.addEventListener('DOMContentLoaded', () => {
const tabs = document.querySelectorAll('.nav-tab');
const tabContent = document.querySelectorAll('.tab-content > div');
function changeTab(e) {
e.preventDefault();
tabs.forEach(tab => {
tab.classList.remove('active');
});
e.target.classList.add('active');
const targetContent = e.target.getAttribute('data-target');
tabContent.forEach(content => {
if (content.id === targetContent) {
content.classList.remove('d-none');
} else {
content.classList.add('d-none');
}
});
}
tabs.forEach(tab => {
tab.addEventListener('click', changeTab);
});
// Initialize the DataTable with search enabled
$('#artifacts-table').DataTable({
searching: true,
});
// Initialize the DataTable with search enabled and custom data loading
const artifactsTable = $('#artifacts-table').DataTable({
destroy: true,
searching: true,
columns: [
{ data: 'id', render: (data, type, row) => `<a href="${row.url}">${data}</a>` },
{ data: 'type' },
{ data: 'name' },
{ data: 'version' },
],
});
(async function () {
const publishSetup = await fetchJSON('publish-setup.json');
const websiteUrl = publishSetup.website.url;
// Fetch and load the package information
async function loadPackageInfo() {
try {
const packageRegistry = await fetchJSON('package-registry.json');
const packageInfoContainer = document.getElementById('packageInfo');
for (const pkg of packageRegistry.packages) {
const packageListURL = getRelativePath(pkg.path, websiteUrl);
const packageList = await fetchJSON(packageListURL);
const title = packageList.title.trim();
const description = packageList.introduction.trim();
const latestEntry = packageList.list.find(entry => entry.status !== 'ci-build' && entry.current === true);
const ciEntry = packageList.list.find(item => item.status === 'ci-build');
const repo = ciEntry.path.substring(ciEntry.path.lastIndexOf("/") + 1);
const org = ciEntry.path.split("/")[ciEntry.path.split("/").length - 2];
const packageDiv = document.createElement('div');
packageDiv.classList.add('col');
packageDiv.innerHTML = `
<div class="card full-width">
<div class="card-body">
<h2 class="card-title">${title}</h2>
<p class="card-text">${description}</p>
</div>
<div class="card-footer d-flex justify-content-end">
<a href="${packageList.canonical}" class="btn btn-primary me-3 discrete-button">Implementation Guide</a>
<a href="${ciEntry.path}" class="btn btn-primary me-3 discrete-button">Current Development Version</a> <!-- New button -->
<a href="https://github.com/${org}/${repo}" class="btn btn-primary me-3 discrete-button">GitHub</a>
<a href="${packageList.canonical}/history.html" class="btn btn-primary discrete-button">Publication History</a>
</div>
</div>
`;
packageInfoContainer.appendChild(packageDiv);
}
} catch (error) {
console.error('Error fetching package information:', error);
}
}
// Fetch and load the artifact information
async function loadArtifacts() {
try {
const packageRegistry = await fetchJSON('package-registry.json');
const artifactsTable = $('#artifacts-table').DataTable({
destroy: true,
searching: true,
columns: [
{ data: 'id', render: (data, type, row) => `<a href="${row.url}">${data}</a>` },
{ data: 'type' },
{ data: 'name' },
{ data: 'version' },
],
});
for (const pkg of packageRegistry.packages) {
const packageListURL = getRelativePath(pkg.path, websiteUrl);
const packageList = await fetchJSON(packageListURL);
const canonicalsURL = packageList.list.find(entry => entry.status !== 'ci-build').path;
const relCanonicalsURL = getRelativePath(canonicalsURL, websiteUrl);
console.log(relCanonicalsURL);
const canonicals = await fetchJSON('.' + relCanonicalsURL + "/canonicals.json");
artifactsTable.rows.add(canonicals).draw();
}
} catch (error) {
console.error('Error fetching artifact information:', error);
}
}
function getRelativePath(path, websiteUrl) {
const cleanedPath = path.replace(/\/$/, ''); // Remove trailing slash
const cleanedWebsiteUrl = websiteUrl.replace(/\/$/, ''); // Remove trailing slash
const relativePath = cleanedPath.replace(cleanedWebsiteUrl, '');
return relativePath;
}
// Call the functions
loadPackageInfo();
loadArtifacts();
})();
});
</script>
</body>