Skip to content

Commit

Permalink
Merge pull request #180 from HealthIntersections/gg-202112-package-ve…
Browse files Browse the repository at this point in the history
…rsioning

Gg 202112 package versioning
  • Loading branch information
grahamegrieve authored Dec 20, 2021
2 parents 38e9c64 + 2e93d44 commit 563ebbf
Show file tree
Hide file tree
Showing 14 changed files with 2,124 additions and 1,859 deletions.
8 changes: 4 additions & 4 deletions install/install-tk.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
; AppID can never be changed as subsequent installations require the same installation ID each time
AppID=FHIRToolkit
AppName=Health Intersections FHIR Toolkit
AppVerName=FHIRToolkit v2.0.9
AppVerName=FHIRToolkit v2.0.10

; compilation control
OutputDir=..\install\build
OutputBaseFilename=fhirtoolkit-win64-2.0.9
OutputBaseFilename=fhirtoolkit-win64-2.0.10
Compression=lzma2/ultra64

; 64 bit
Expand All @@ -32,11 +32,11 @@ UninstallFilesDir={app}\uninstall
; win2000+ add/remove programs support
AppPublisher=Health Intersections P/L
AppPublisherURL=http://www.healthintersections.com.au
AppVersion=2.0.9
AppVersion=2.0.10
AppSupportURL=https://github.com/grahamegrieve/fhirserver
AppUpdatesURL=https://github.com/grahamegrieve/fhirserver
AppCopyright=Copyright (c) Health Intersections Pty Ltd 2020+
VersionInfoVersion=2.0.9.0
VersionInfoVersion=2.0.10.0

; dialog support
LicenseFile=..\license
Expand Down
8 changes: 4 additions & 4 deletions install/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
; AppID can never be changed as subsequent installations require the same installation ID each time
AppID=FHIRServer
AppName=Health Intersections FHIR Server
AppVerName=FHIRServer v2.0.9
AppVerName=FHIRServer v2.0.10

; compilation control
OutputDir=..\install\build
OutputBaseFilename=fhirserver-win64-2.0.9
OutputBaseFilename=fhirserver-win64-2.0.10
Compression=lzma2/ultra64

; 64 bit
Expand All @@ -34,11 +34,11 @@ UninstallFilesDir={app}\uninstall
; win2000+ add/remove programs support
AppPublisher=Health Intersections P/L
AppPublisherURL=http://www.healthintersections.com.au
AppVersion=2.0.9
AppVersion=2.0.10
AppSupportURL=https://github.com/grahamegrieve/fhirserver
AppUpdatesURL=https://github.com/grahamegrieve/fhirserver
AppCopyright=Copyright (c) Health Intersections Pty Ltd 2011+
VersionInfoVersion=2.0.9.0
VersionInfoVersion=2.0.10.0

; dialog support
LicenseFile=..\license
Expand Down
4 changes: 4 additions & 0 deletions library/fhir/fhir_icao.pas
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ function TICAOCardImporter.processVaccineCode(ve : TJsonObject) : String;
result := '210'
else if (nam = 'Pfizer Comirnaty') or (nam.ToLower.Contains('pfizer')) then
result := '208'
else if (nam = 'Moderna Spikevax') or (nam.ToLower.Contains('moderna')) then
result := '207'
else
raise EFHIRException.Create('Unknown vaccine code '+ve['des']+'/"'+nam+'"');
end;
Expand All @@ -207,6 +209,8 @@ function TICAOCardImporter.displayCvx(code : String) : String;
result := 'AstraZeneca Vaxzevria'
else if code = '208' then
result := 'Pfizer Comirnaty'
else if code = '207' then
result := 'Moderna Spikevax'
else
result := '??';
end;
Expand Down
6 changes: 3 additions & 3 deletions library/version.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FHIR_CODE_FULL_VERSION = '2.0.10-SNAPSHOT';
FHIR_CODE_RELEASE_DATE = '2021-12-10';
FHIR_CODE_RELEASE_DATETIME = '20211210232324.981Z';
FHIR_CODE_FULL_VERSION = '2.0.11-SNAPSHOT';
FHIR_CODE_RELEASE_DATE = '2021-12-13';
FHIR_CODE_RELEASE_DATETIME = '20211213104406.266Z';
50 changes: 32 additions & 18 deletions server/endpoint_packages.pas
Original file line number Diff line number Diff line change
Expand Up @@ -625,37 +625,51 @@ function TFHIRPackageWebServer.logId: string;
procedure TFHIRPackageWebServer.serveDownload(id, version : String; response : TIdHTTPResponseInfo);
var
conn : TFDBConnection;
procedure sendRow;
var
pvk : integer;
begin
response.ResponseNo := 200;
response.ResponseText := 'OK';
response.ContentType := 'application/tar+gzip';
response.ContentStream := TBytesStream.Create(conn.GetColBlobByName('Content'));
response.ContentDisposition := 'attachment; filename="'+id+'#'+version+'.tgz"';
response.FreeContentStream := true;
pvk := conn.GetColIntegerByName('PackageVersionKey');
conn.Terminate;
conn.SQL := 'Update PackageVersions set DownloadCount = DownloadCount + 1 where PackageVersionKey = '+inttostr(pvk);
conn.Prepare;
conn.Execute;
conn.Terminate;
conn.SQL := 'Update Packages set DownloadCount = DownloadCount + 1 where Id = '''+SQLWrapString(id)+'''';
conn.Prepare;
conn.Execute;
end;
begin
conn := FDB.getConnection('Package.server.download');
try
conn.SQL := 'Select Content from PackageVersions where Id = '''+SQLWrapString(id)+''' and Version = '''+SQLWrapString(version)+'''';
conn.SQL := 'Select PackageVersionKey, Content from PackageVersions where Id = '''+SQLWrapString(id)+''' and Version = '''+SQLWrapString(version)+'''';
conn.Prepare;
conn.Execute;
if conn.FetchNext then
sendRow
else
begin
conn.Terminate;
conn.SQL := 'Select PackageVersionKey, Content from PackageVersions where Id = '''+SQLWrapString(id)+''' and Version like '''+SQLWrapString(version)+'-%'' order by PubDate desc';
conn.Prepare;
conn.Execute;
if conn.FetchNext then
begin
response.ResponseNo := 200;
response.ResponseText := 'OK';
response.ContentType := 'application/tar+gzip';
response.ContentStream := TBytesStream.Create(conn.GetColBlobByName('Content'));
response.ContentDisposition := 'attachment; filename="'+id+'#'+version+'.tgz"';
response.FreeContentStream := true;
conn.Terminate;
conn.SQL := 'Update PackageVersions set DownloadCount = DownloadCount + 1 where Id = '''+SQLWrapString(id)+''' and Version = '''+SQLWrapString(version)+'''';
conn.Prepare;
conn.Execute;
conn.Terminate;
conn.SQL := 'Update Packages set DownloadCount = DownloadCount + 1 where Id = '''+SQLWrapString(id)+'''';
conn.Prepare;
conn.Execute;
end
sendRow
else
begin
response.ResponseNo := 404;
response.ResponseText := 'Not found';
response.ContentType := 'text/plain';
response.ContentText := 'The package "'+id+'#'+version+'" is not known by this server';
end;
conn.Terminate;
end;
conn.Terminate;
conn.release;
except
on e : Exception do
Expand Down
2 changes: 1 addition & 1 deletion server/fhirconsole.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
<VersionInfo>
<MajorVersionNr Value="2"/>
<MinorVersionNr Value="0"/>
<RevisionNr Value="9"/>
<RevisionNr Value="10"/>
<Attributes pvaDebug="False"/>
</VersionInfo>
</ProjectOptions>
Expand Down
Loading

0 comments on commit 563ebbf

Please sign in to comment.