Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…erver into HealthIntersections-master
  • Loading branch information
costateixeira committed Dec 14, 2023
2 parents 35ee74f + fa3fe9e commit 18550a7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build/windows-fhirserver.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ echo ## compile server

echo ## compile toolkit
%tmp%\tools\lazarus\lazbuild.exe toolkit2/fhirtoolkit.lpr --build-mode=win64-release -q -q

copy exec\64\*.exe "C:\Users\graha\Health Intersections Dropbox\Health Intersections Team Folder\executables\win64"

chdir /d %FSDIR%
2 changes: 0 additions & 2 deletions build/windows-toolchain.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ curl -L https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/wincro
powershell -command "Expand-Archive -Force tools\CrossLibsLinuxx64.zip tools"
powershell -command "Expand-Archive -Force tools\WinCrossBinsLinuxx64.zip tools"

pause

rem -- run the installer- will finish with a full install of Lazarus

tools\fpclazup --fpcVersion="stable.gitlab" --lazVersion="stable.gitlab" --installdir=tools --noconfirm --include=anchordocking,lazprojectgroups,virtualtreeview,fpdebug
Expand Down
12 changes: 10 additions & 2 deletions library/fsl/fsl_npm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ TNpmPackage = class (TNpmPackageObject)
function isValidPackageId(id : String) : boolean;
function isMoreRecentVersion(test, base : String) : boolean;


function readZLibHeader(stream : TStream) : TBytes; overload;
function readZLibHeader(b : TBytes) : TBytes; overload;

implementation

function isValidPackagePart(part : String) : boolean;
Expand Down Expand Up @@ -1077,12 +1081,16 @@ function TNpmPackage.presentation: String;
end;

function readZLibHeader(stream : TStream) : TBytes;
begin
result := readZLibHeader(StreamToBytes(stream));

end;

function readZLibHeader(b : TBytes) : TBytes;
var
b : TBytes;
p : int64;
i : integer;
begin
b := StreamToBytes(stream);
if (length(b) < 10) or (b[0] <> $1F) or (b[1] <> $8B) then
result := b
else
Expand Down
5 changes: 3 additions & 2 deletions library/web/fsl_npm_cache.pas
Original file line number Diff line number Diff line change
Expand Up @@ -733,13 +733,14 @@ function TFHIRPackageManager.loadArchive(content: TBytes): TDictionary<String, T
fn : String;
b : TBytes;
begin
BytesToFile(content, '/Users/grahamegrieve/temp/package.tgz');
Logging.log('Loading Package ('+DescribeBytes(length(content))+')');
work(0, false, 'Loading Package ('+DescribeBytes(length(content))+')');
try
result := TDictionary<String, TBytes>.Create;
bo := TBytesStream.Create(content);
bo := TBytesStream.Create(readZLibHeader(content));
try
z := TZDecompressionStream.Create(bo, false); // 15+16);
z := TZDecompressionStream.Create(bo, true); // 15+16);
try
work(trunc(bo.Position / bo.Size * 100), false, 'Loading Package');
tar := TTarArchive.Create(z);
Expand Down
7 changes: 5 additions & 2 deletions server/endpoint_txsvr.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,11 @@ procedure TTerminologyServerEndPoint.Load;

procedure TTerminologyServerEndPoint.Unload;
begin
FServerContext.Unload;
FServerContext.free;
if FServerContext <> nil then
begin
FServerContext.Unload;
FServerContext.free;
end;
FServerContext := nil;
FStore.free;
FStore := nil;
Expand Down
6 changes: 5 additions & 1 deletion server/fhirserver.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="50">
<Exceptions Count="51">
<Item1>
<Name Value="EAbort"/>
</Item1>
Expand Down Expand Up @@ -975,6 +975,7 @@
</Item46>
<Item47>
<Name Value="Edecompressionerror"/>
<Enabled Value="False"/>
</Item47>
<Item48>
<Name Value="EJsonParserException"/>
Expand All @@ -985,6 +986,9 @@
<Item50>
<Name Value="EPackageCrawlerException"/>
</Item50>
<Item51>
<Name Value="&lt;Unknown Class>"/>
</Item51>
</Exceptions>
</Debugging>
</CONFIG>
3 changes: 2 additions & 1 deletion server/server_context.pas
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ procedure TFHIRServerContext.getCacheInfo(ci: TCacheInformation);

procedure TFHIRServerContext.UnLoad;
begin
FStorage.UnLoad;
if FStorage <> nil then
FStorage.UnLoad;
FQuestionnaireCache.clearCache;
FValidatorContext.UnLoad;
FValidator.Unload;
Expand Down

0 comments on commit 18550a7

Please sign in to comment.