Skip to content

Commit 9f2c073

Browse files
authored
Merge branch 'develop' into ryma2fhir-patch-2
2 parents feaaa19 + f10da7a commit 9f2c073

56 files changed

Lines changed: 170 additions & 247 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/update_IG.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,34 @@ jobs:
3030
run: python -u .github/python_scripts/update_IG.py
3131

3232
- name: Create or update PR
33-
uses: peter-evans/create-pull-request@v7
33+
id: cpr
34+
uses: peter-evans/create-pull-request@v8
3435
with:
36+
token: ${{ secrets.SIMPLIFIER_PAT }}
3537
branch: ${{ env.pr_branch }}
3638
base: develop
3739
title: "Automated Update from Simplifier"
3840
body: "This PR includes the latest daily changes from Simplifier."
3941
commit-message: "Automated update from Simplifier"
4042
sign-commits: true
43+
labels: automated
44+
45+
# Approve as a *different* actor (github-actions[bot]) to get around devlop branch needing an approver
46+
- name: Auto-approve
47+
if: steps.cpr.outputs.pull-request-number
48+
uses: hmarr/auto-approve-action@v4
49+
with:
50+
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
51+
# uses the default GITHUB_TOKEN => approver is github-actions[bot]
52+
# action requires permissions: pull-requests: write
53+
# https://github.com/marketplace/actions/auto-approve
54+
55+
# Enable auto-merge so it merges after checks pass
56+
- name: Enable auto-merge
57+
if: steps.cpr.outputs.pull-request-number
58+
uses: peter-evans/enable-pull-request-automerge@v3
59+
with:
60+
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
61+
merge-method: squash
62+
63+

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/Guidance/Lifecycle/Asset-Lifecycle.page.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# {{page-title}}
1+
## {{page-title}}
22

33
<div id="newAsset" markdown="span" class="alert alert-success" role="alert"><h4><i class="fa fa-star"></i> New Addition</h4>
44
The UK Core follows the HL7 publication-status value set.
@@ -17,3 +17,7 @@ The UK Core follows the HL7 publication-status value set.
1717

1818
- Feedback is encouraged on all assets, particularly those in draft status, to support their progression to a stable release. See ways to {{pagelink:Home/ContactUs.page.md}}
1919
</div>
20+
21+
22+
<br>
23+
<br>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# {{page-title}}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
- name: Index
2+
filename: Index.page.md
13
- name: Asset Lifecycle
24
filename: Asset-Lifecycle.page.md

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/ProfilesandExtensions/Derived-Profiles-Table-With-Purpose.page.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from
33
StructureDefinition
44
where
5-
kind = 'resource' and status = 'active' and id.length() - id.replaceMatches('-', '').length() > 1
5+
kind = 'resource' and (status = 'active' or status = 'draft') and id.length() - id.replaceMatches('-', '').length() > 1
66
select
7-
Profile:id, Purpose:purpose, status, Resource:type
7+
Profile:id, Purpose:purpose, Status:status, Resource:type
88
with
9-
no header
9+
header
1010
</fql>

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/ProfilesandExtensions/Derived-Profiles-Table.page.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from
33
StructureDefinition
44
where
5-
kind = 'resource' and status = 'active' and id.length() - id.replaceMatches('-', '').length() > 1
5+
kind = 'resource' and (status = 'active' or status = 'draft') and (id.length() - id.replaceMatches('-', '').length() > 1)
66
select
7-
Profile:id, status
7+
Profile:id, Status:status
88
with
9-
no header
9+
header
1010
</fql>

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/ProfilesandExtensions/Profiles-Table-With-Purpose.page.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from
44
where
55
kind = 'resource' and status = 'active' and id.length() - id.replaceMatches('-', '').length() = 1
66
select
7-
Profile:id, Purpose:purpose, status, Resource:type
7+
Profile:id, Purpose:purpose, Status:status, Resource:type
88
with
9-
no header
9+
header
1010
</fql>

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/ProfilesandExtensions/Profiles-Table.page.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from
33
StructureDefinition
44
where
5-
kind = 'resource' and status = 'active' and id.length() - id.replaceMatches('-', '').length() = 1
5+
kind = 'resource' and (status = 'active' or status = 'draft') and id.length() - id.replaceMatches('-', '').length() = 1
66
select
7-
Profile:id, status
7+
Profile:id, Status:status
88
with
9-
no header
9+
header
1010
</fql>

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/Terminology/Terminology-Index.page.md

Lines changed: 2 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Within this release of the UK Core, ValueSet expansions have been incorporated i
3939
<h3>CodeSystems</h3>
4040
{{page:CodeSystem-table}}
4141
</div>
42+
<!--
4243
4344
<script>
4445
let valueSetsProcessed = false;
@@ -170,113 +171,10 @@ $(document).ready(function () {
170171
processValueSetsTable(); // If ValueSets is shown by default
171172
});
172173
</script>
174+
-->
173175

174176

175-
<!--<fql>
176-
from
177-
ValueSet
178-
where
179-
status !='retired'
180-
select
181-
ValueSet: id, Status: status, CodeSystem: compose.include.system, ValueSets: compose.include.valueSet
182-
order by
183-
id
184-
distinct
185-
</fql>
186177

187-
<script>
188-
$(document).ready(function () {
189-
const queryString = window.location.search || "?version=current";
190-
191-
// Detect if we're in an unpublished guide (which uses .page.md links)
192-
const isUnpublished = window.location.search.includes("version=current");
193-
const pageSuffix = isUnpublished ? ".page.md" : "";
194-
195-
// Convert {{guide-title}} into URL-safe form
196-
const guideTitleUrl = "{{guide-title}}"
197-
.replace(/[^a-zA-Z0-9 ]/g, "") // remove special characters
198-
.replace(/\s+/g, "-"); // convert spaces to hyphens
199-
200-
const baseUrl = `https://simplifier.net/guide/${guideTitleUrl}/Home/`;
201-
const vsBase = `${baseUrl}terminology/valuesets/valueset-`;
202-
const csBase = `${baseUrl}terminology/codesystems/codesystem-`;
203-
204-
const $table = $("table.table-bordered");
205-
if ($table.length === 0) return;
206-
207-
// Update header
208-
const $headerCells = $table.find("thead tr th");
209-
if ($headerCells.length >= 4) {
210-
$headerCells.eq(2).text("Composed of");
211-
$headerCells.eq(3).remove(); // remove 4th column (valueSet)
212-
}
213-
214-
// Process each row
215-
$table.find("tbody tr").each(function () {
216-
const $cells = $(this).find("td");
217-
if ($cells.length < 4) return;
218-
219-
const $nameTd = $cells.eq(0);
220-
const $statusTd = $cells.eq(1);
221-
const $systemTd = $cells.eq(2);
222-
const $valueSetTd = $cells.eq(3);
223-
224-
// --- Linkify name column if UKCore ---
225-
const nameText = $nameTd.text().trim();
226-
if (nameText.startsWith("UKCore")) {
227-
const assetLower = nameText.toLowerCase();
228-
const href = `${vsBase}${assetLower}${pageSuffix}${queryString}`;
229-
$nameTd.html(`<a href="${href}">${nameText}</a>`);
230-
}
231-
232-
// --- Merge & linkify systems and valueSets ---
233-
const combinedLinks = [];
234-
235-
const linkify = (text) => {
236-
text.split(";").forEach(item => {
237-
const trimmed = item.trim();
238-
if (!trimmed) return;
239-
240-
let displayText = trimmed;
241-
let href = trimmed;
242-
243-
if (trimmed.startsWith("https://fhir.hl7.org.uk/")) {
244-
const parts = trimmed.split("/");
245-
const assetType = parts[3];
246-
const assetName = parts[4];
247-
248-
if (assetType && assetName) {
249-
const section = assetType.toLowerCase() === "codesystem" ? csBase
250-
: assetType.toLowerCase() === "valueset" ? vsBase
251-
: null;
252-
253-
if (section) {
254-
const lowerAsset = assetName.toLowerCase();
255-
href = `${section}${lowerAsset}${pageSuffix}${queryString}`;
256-
}
257-
}
258-
}
259-
260-
combinedLinks.push(`<a href="${href}">${displayText}</a>`);
261-
});
262-
};
263-
264-
linkify($systemTd.text());
265-
linkify($valueSetTd.text());
266-
267-
// Remove duplicates (based on text shown)
268-
const uniqueLinks = Array.from(
269-
new Map(combinedLinks.map(link => {
270-
const textMatch = link.match(/>(.*?)</);
271-
return textMatch ? [textMatch[1], link] : null;
272-
}).filter(Boolean))
273-
).map(pair => pair[1]);
274-
275-
$systemTd.html(uniqueLinks.join("<br>"));
276-
$valueSetTd.remove(); // cleanup 4th column
277-
});
278-
});
279-
</script>-->
280178

281179

282180

guides/UK-Core-Implementation-Guide-STU3-Sequence/Home/Terminology/ValueSet-table.page.md

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,30 @@ distinct
1313
<script>
1414
$(document).ready(function () {
1515
const queryString = window.location.search || "?version=current";
16-
17-
// Detect if we're in an unpublished guide (which uses .page.md links)
1816
const isUnpublished = window.location.search.includes("version=current");
1917
const pageSuffix = isUnpublished ? ".page.md" : "";
2018

2119
// Convert {{guide-title}} into URL-safe form
2220
const guideTitleUrl = "{{guide-title}}"
23-
.replace(/[^a-zA-Z0-9 ]/g, "") // remove special characters
24-
.replace(/\s+/g, "-"); // convert spaces to hyphens
21+
.replace(/[^a-zA-Z0-9 ]/g, "")
22+
.replace(/\s+/g, "-");
2523

2624
const baseUrl = `https://simplifier.net/guide/${guideTitleUrl}/Home/`;
2725
const vsBase = `${baseUrl}terminology/valuesets/valueset-`;
2826
const csBase = `${baseUrl}terminology/codesystems/codesystem-`;
2927

28+
// Target the specific table rendered by FQL
3029
const $table = $("table.table-bordered");
3130
if ($table.length === 0) return;
3231

33-
// Update header
32+
// 1. Fix Headers
3433
const $headerCells = $table.find("thead tr th");
3534
if ($headerCells.length >= 4) {
3635
$headerCells.eq(2).text("Composed of");
37-
$headerCells.eq(3).remove(); // remove 4th column (valueSet)
36+
$headerCells.eq(3).hide(); // Hide the redundant 4th column
3837
}
3938

40-
// Process each row
39+
// 2. Process Rows
4140
$table.find("tbody tr").each(function () {
4241
const $cells = $(this).find("td");
4342
if ($cells.length < 4) return;
@@ -47,59 +46,55 @@ $(document).ready(function () {
4746
const $systemTd = $cells.eq(2);
4847
const $valueSetTd = $cells.eq(3);
4948

50-
// --- Linkify name column if UKCore ---
49+
// --- Linkify the ValueSet Name (Column 1) ---
5150
const nameText = $nameTd.text().trim();
52-
if (nameText.startsWith("UKCore")) {
51+
if (nameText.toLowerCase().includes("ukcore")) {
5352
const assetLower = nameText.toLowerCase();
5453
const href = `${vsBase}${assetLower}${pageSuffix}${queryString}`;
5554
$nameTd.html(`<a href="${href}">${nameText}</a>`);
5655
}
5756

58-
// --- Merge & linkify systems and valueSets ---
59-
const combinedLinks = [];
57+
// --- Handle the "Composed of" logic (Columns 3 and 4) ---
58+
let combinedLinks = [];
59+
60+
// Helper to extract URLs from comma-separated text in cells
61+
const extractAndLink = ($td) => {
62+
const rawText = $td.text().trim();
63+
if (!rawText) return;
6064

61-
const linkify = (text) => {
62-
text.split(";").forEach(item => {
65+
// SPLIT BY COMMA is the fix for Simplifier FQL output
66+
rawText.split(",").forEach(item => {
6367
const trimmed = item.trim();
6468
if (!trimmed) return;
6569

66-
let displayText = trimmed;
6770
let href = trimmed;
71+
let displayText = trimmed;
6872

69-
if (trimmed.startsWith("https://fhir.hl7.org.uk/")) {
73+
// Check if it's a UK Core URL that needs internal mapping
74+
if (trimmed.includes("fhir.hl7.org.uk")) {
7075
const parts = trimmed.split("/");
71-
const assetType = parts[3];
72-
const assetName = parts[4];
73-
74-
if (assetType && assetName) {
75-
const section = assetType.toLowerCase() === "codesystem" ? csBase
76-
: assetType.toLowerCase() === "valueset" ? vsBase
77-
: null;
78-
79-
if (section) {
80-
const lowerAsset = assetName.toLowerCase();
81-
href = `${section}${lowerAsset}${pageSuffix}${queryString}`;
82-
}
76+
const assetType = parts[3] ? parts[3].toLowerCase() : "";
77+
const assetName = parts[4] ? parts[4].toLowerCase() : "";
78+
79+
if (assetType === "codesystem") {
80+
href = `${csBase}${assetName.toLowerCase()}${pageSuffix}${queryString}`;
81+
} else if (assetType === "valueset") {
82+
href = `${vsBase}${assetName.toLowerCase()}${pageSuffix}${queryString}`;
8383
}
8484
}
85-
85+
8686
combinedLinks.push(`<a href="${href}">${displayText}</a>`);
8787
});
8888
};
8989

90-
linkify($systemTd.text());
91-
linkify($valueSetTd.text());
92-
93-
// Remove duplicates (based on text shown)
94-
const uniqueLinks = Array.from(
95-
new Map(combinedLinks.map(link => {
96-
const textMatch = link.match(/>(.*?)</);
97-
return textMatch ? [textMatch[1], link] : null;
98-
}).filter(Boolean))
99-
).map(pair => pair[1]);
90+
extractAndLink($systemTd);
91+
extractAndLink($valueSetTd);
10092

93+
// Remove duplicates and join with line breaks
94+
const uniqueLinks = [...new Set(combinedLinks)];
95+
10196
$systemTd.html(uniqueLinks.join("<br>"));
102-
$valueSetTd.remove(); // cleanup 4th column
97+
$valueSetTd.hide(); // Hide the extra column we merged
10398
});
10499
});
105100
</script>

0 commit comments

Comments
 (0)