Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a59c10a
Update linux-docker-build.yml
costateixeira Mar 4, 2025
a5ab5b3
Update linux-docker-build.yml
costateixeira Mar 4, 2025
f409bdd
Update linux-docker-build.yml
costateixeira Mar 4, 2025
46165b4
Use lowercase for ghcr
costateixeira Mar 4, 2025
11987c6
fix lowercase usage of repo org names
costateixeira Mar 4, 2025
7421495
add debug step
costateixeira Mar 4, 2025
fce27bc
Update linux-docker-build.yml
costateixeira Mar 4, 2025
607864e
(WIP) include html content
costateixeira Mar 13, 2025
0899b6b
Merge branch 'HealthIntersections:master' into master
costateixeira Mar 13, 2025
ac055ee
Merge branch 'HealthIntersections:master' into master
costateixeira Mar 18, 2025
1a20137
Merge branch 'HealthIntersections:master' into master
costateixeira Mar 20, 2025
80e23e9
Merge branch 'HealthIntersections:master' into master
costateixeira Apr 6, 2025
ae0d94f
Merge branch 'HealthIntersections:master' into master
costateixeira Apr 11, 2025
38abf46
Merge branch 'HealthIntersections:master' into master
costateixeira Apr 12, 2025
c6a378a
Merge branch 'HealthIntersections:master' into master
costateixeira Apr 13, 2025
45a02c5
Merge branch 'HealthIntersections:master' into master
costateixeira May 3, 2025
64d932f
Merge branch 'HealthIntersections:master' into master
costateixeira May 10, 2025
68d6a4b
Merge branch 'HealthIntersections:master' into master
costateixeira May 24, 2025
a596cb0
Merge branch 'HealthIntersections:master' into master
costateixeira May 30, 2025
1184320
Merge branch 'HealthIntersections:master' into master
costateixeira Jun 2, 2025
2a224ac
Merge branch 'HealthIntersections:master' into master
costateixeira Jun 7, 2025
c29d0ce
Merge branch 'HealthIntersections:master' into master
costateixeira Jul 8, 2025
0e5fa6e
Merge branch 'HealthIntersections:master' into master
costateixeira Jul 15, 2025
6b9f8ec
Merge branch 'HealthIntersections:master' into master
costateixeira Jul 31, 2025
af79b45
Merge branch 'HealthIntersections:master' into master
costateixeira Aug 13, 2025
8e9a8d7
add cs
costateixeira Aug 19, 2025
aee03c1
fix quicksort
costateixeira Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/linux-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ jobs:
steps:
# Step 1: Check out the repository code
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Debug Repository Names
run: |
echo "ORG_NAME=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
echo "REPO_NAME=$(basename "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"


# Step 2: Log in to GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub

# Step 3: Cache terminology files (optional, to avoid re-downloading terminology files)
- name: Cache terminology files
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/terminology
key: terminology-${{ github.sha }}
Expand Down Expand Up @@ -83,4 +89,10 @@ jobs:
# Step 9: Push the Docker image to GitHub Container Registry (GHCR)
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/${{ env.org_name }}/fhirserver:nightly
ORG_NAME=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
REPO_NAME=$(basename "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
IMAGE_TAG="nightly"

echo "Pushing to ghcr.io/${ORG_NAME}/${REPO_NAME}:${IMAGE_TAG}"
docker push ghcr.io/${ORG_NAME}/${REPO_NAME}:${IMAGE_TAG}

69 changes: 52 additions & 17 deletions library/ftx/ftx_sct_importer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -766,59 +766,94 @@ function LoadFile(filename : String):TBytes;
End;
TIndexArray = array of TIndex;


Procedure QuickSortIndex(var a : TIndexArray);

Function MedianOfThree(L, M, R: Integer): Integer;
Begin
If a[L].id <= a[M].id Then
Begin
If a[M].id <= a[R].id Then
Result := M // L <= M <= R
Else If a[L].id <= a[R].id Then
Result := R // L <= R < M
Else
Result := L // R < L <= M
End
Else
Begin
If a[L].id <= a[R].id Then
Result := L // M < L <= R
Else If a[M].id <= a[R].id Then
Result := R // M <= R < L
Else
Result := M // R < M < L
End;
End;

Procedure QuickSort(L, R: Integer);
Var
I, J, K : Integer;
t : TIndex;
Begin
// QuickSort routine (Recursive)
// * Items is the default indexed property that returns a pointer, subclasses
// specify these return values as their default type.
// * The Compare routine used must be aware of what this pointer actually means.

Repeat
While L < R Do
Begin
I := L;
J := R;
K := (L + R) Shr 1;

// BETTER PIVOT SELECTION - median of three
K := MedianOfThree(L, (L + R) Shr 1, R);

// Move pivot to middle position for consistency
If K <> ((L + R) Shr 1) Then
Begin
t := a[K];
a[K] := a[(L + R) Shr 1];
a[(L + R) Shr 1] := t;
K := (L + R) Shr 1;
End;

Repeat
While a[I].id < a[K].id Do
Inc(I);

While a[J].id > a[K].id Do
Dec(J);

If I <= J Then
Begin
t := a[i];
a[i] := a[j];
a[j] := t;

// Keep K as the index of the original middle element as it might get exchanged.
If I = K Then
K := J
Else If J = K Then
K := I;

Inc(I);
Dec(J);
End;
Until I > J;

If L < J Then
QuickSort(L, J);

L := I;
Until I >= R;
// Recurse on smaller partition
If (J - L) < (R - I) Then
Begin
If L < J Then
QuickSort(L, J);
L := I;
End
Else
Begin
If I < R Then
QuickSort(I, R);
R := J;
End;
End;
End;

Begin
If length(a) > 1 Then
QuickSort(0, length(a) - 1);
End;


procedure TSnomedImporter.ReadDescriptionsFile;
var
s : TBytes;
Expand Down
7 changes: 7 additions & 0 deletions library/ftx/ftx_sct_services.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2113,6 +2113,7 @@ function TSnomedServices.GetEditionName: String;
else if FEditionId = '11000172109' then result := 'Belgian Edition'
else if FEditionId = '20621000087109' then result := 'Canadian English Edition'
else if FEditionId = '20611000087101' then result := 'Canadian Canadian French Edition'
else if FEditionId = '11000279109' then result := 'Czech Edition'
else if FEditionId = '554471000005108' then result := 'Danish Edition'
else if FEditionId = '11000181102' then result := 'Estonian Edition'
else if FEditionId = '11000229106' then result := 'Finnish Edition'
Expand Down Expand Up @@ -4703,6 +4704,8 @@ function readLang(s : String) : byte;
result := 7
else if (s = 'it') then
result := 8
else if (s = 'cs') then
result := 9
else
raise ETerminologyError.create('Unknown SCT Lang "'+s+'"', itInvalid);
end;
Expand All @@ -4718,6 +4721,7 @@ function codeForLang(lang : byte):String;
6 : result := 'da';
7 : result := 'de';
8 : result := 'it';
9 : result := 'cs';
else
result := '??';
end;
Expand All @@ -4741,6 +4745,8 @@ function langForCode(s: String): byte;
result := 7
else if (s = 'it') or (s.startsWith('it-')) then
result := 8
else if (s = 'cs') or (s.startsWith('cs-')) then
result := 9
else
result := 0;
end;
Expand All @@ -4756,6 +4762,7 @@ function describeLangs(langs: integer): string;
if (langs and (1 shl 6) > 0) then CommaAdd(result, 'da');
if (langs and (1 shl 7) > 0) then CommaAdd(result, 'de');
if (langs and (1 shl 8) > 0) then CommaAdd(result, 'it');
if (langs and (1 shl 9) > 0) then CommaAdd(result, 'cs');
end;

function TSnomedExpressionContext.sizeInBytesV(magic : integer) : cardinal;
Expand Down
1 change: 1 addition & 0 deletions server/console_form.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -3170,6 +3170,7 @@ object MainConsoleForm: TMainConsoleForm
'Belgian'
'Canadian English'
'Canadian French'
'Czech'
'Danish'
'Estonian'
'Finnish'
Expand Down
1 change: 1 addition & 0 deletions server/console_form.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3225,6 +3225,7 @@ function TMainConsoleForm.getSnomedModule: String;
25: { US (with ICD-10-CM maps) } result := '5991000124107';
26: { IPS Terminology } result := '827022005';
27: { Combined } result := inttostr(COMBINED_MODULE_ID);
28: { Czech } result := '11000279109';
end;
end;

Expand Down
13 changes: 8 additions & 5 deletions server/fhirconsole.lpi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
Expand All @@ -19,7 +20,6 @@
<MajorVersionNr Value="3"/>
<MinorVersionNr Value="8"/>
<RevisionNr Value="6"/>
<Attributes pvaDebug="False"/>
</VersionInfo>
<BuildModes Count="8">
<Item1 Name="default" Default="True"/>
Expand Down Expand Up @@ -126,7 +126,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\library"/>
<Libraries Value="\usr\local\lib64\"/>
<Libraries Value="\usr\local\lib64"/>
<OtherUnitFiles Value="admin;tx;..\library\fsl\tests;..\library\fhir\tests;..\library\fhir4\tests;..\library\fhir4b\tests;..\library\fhir5\tests;..\library\ftx\tests;..\library\fxver\tests;..\library\cda\tests;..\library\v2\tests;..\library\fdb\tests;modules;tests;..\library\fcomp\tests"/>
<UnitOutputDirectory Value="lib\console\$(BuildMode)"/>
</SearchPaths>
Expand Down Expand Up @@ -219,7 +219,10 @@
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-WM10.15&#10;-XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk&#10;-gw2&#10;-gw3"/>
<CustomOptions Value="-WM10.15
-XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-gw2
-gw3"/>
</Other>
</CompilerOptions>
</Item6>
Expand Down Expand Up @@ -276,7 +279,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\library"/>
<Libraries Value="\usr\local\lib64\"/>
<Libraries Value="\usr\local\lib64"/>
<OtherUnitFiles Value="admin;tx;..\library\fsl\tests;..\library\fhir\tests;..\library\fhir4\tests;..\library\fhir4b\tests;..\library\fhir5\tests;..\library\ftx\tests;..\library\fxver\tests;..\library\cda\tests;..\library\v2\tests;..\library\fdb\tests;modules;tests;..\library\fcomp\tests"/>
<UnitOutputDirectory Value="lib\console\$(BuildMode)"/>
</SearchPaths>
Expand Down Expand Up @@ -508,7 +511,7 @@
<Name Value="ELibraryException"/>
</Item3>
<Item4>
<Name Value="&lt;Unknown Class&gt;"/>
<Name Value="&lt;Unknown Class>"/>
</Item4>
<Item5>
<Name Value="0000000eEIdSocketError"/>
Expand Down
2 changes: 2 additions & 0 deletions server/web/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ <h2>Welcome to the FHIR Server</h2>
[%endpoints%]
</ul>

[%host_include links.html%]

<p>
GDPR-Disclosure: All access to this server is logged as AuditEvent Resources, and these store your ip address
(and logged in user, if one exists). Also, your IP address is logged with Google Analytics for building geomaps
Expand Down
17 changes: 16 additions & 1 deletion server/web_server.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1531,8 +1531,23 @@ procedure TFhirWebServer.ReturnProcessedFile(sender : TObject; request : TIdHTTP
end;

function TFhirWebServer.insertValue(n : String; secure: boolean; variables: TFslMap<TFHIRObject>) : String;
var localfilePath:string;
begin
if n.startsWith('include ') then
if n.StartsWith('host_include ') then
begin
localfilePath := filePath(['/root/fhirserver/web_files',n.Substring(13).Trim]);
try
if FileExists(localfilePath) then
result := FileToString(localfilePath, TEncoding.UTF8)
else
result := '';
except
on E: Exception do
result := '';
//Logging.Log('Error reading host file: '+E.Message);
end;
end
else if n.startsWith('include ') then
result := SourceProvider.getSource(n.subString(8))
else if n = 'id' then
result := Common.Name
Expand Down
Loading