Skip to content

Commit

Permalink
better handling of default snomed versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Jun 29, 2024
1 parent 34955f7 commit caab685
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion server/endpoint_snomed.pas
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ function TSnomedWebServer.chooseSnomedRelease: String;
for ss in FTx.Snomed do
begin
html.StartTableRow;
html.AddTableCellURL(ss.EditionName, '/snomed/'+ss.editionId+'-'+ss.VersionDate);
if (ss = FTx.DefSnomed) then
html.AddTableCellURL(ss.EditionName+' (default)', '/snomed/'+ss.editionId+'-'+ss.VersionDate)
else
html.AddTableCellURL(ss.EditionName, '/snomed/'+ss.editionId+'-'+ss.VersionDate);
html.AddTableCell(ss.VersionUri);
html.AddTableCell(ss.VersionDate);
html.AddTableCell(inttostr(ss.UseCount));
Expand Down
9 changes: 5 additions & 4 deletions server/tx_manager.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ procedure TCommonTerminologies.load(txlist: TFHIRServerConfigSection; testing :
s : string;
sn: TSnomedServices;
sp : TSnomedProviderFactory;
// def : boolean;
def : boolean;
p : TUriServices;
function fixFile(name, fn : String) : String;
begin
Expand Down Expand Up @@ -1795,9 +1795,10 @@ procedure TCommonTerminologies.load(txlist: TFHIRServerConfigSection; testing :
sn.Load(fixFile('sct', tx['source'].value));
sp := TSnomedProviderFactory.Create(sn.link, FI18n.link);
try
add(sp, tx['default'].readAsBool);
if not FProviderClasses.ContainsKey(sn.systemUri()+URI_VERSION_BREAK+sn.EditionUri) then
FProviderClasses.Add(sn.systemUri()+URI_VERSION_BREAK+sn.EditionUri, sp.link);
def := tx['default'].readAsBool;
add(sp, def);
if not FProviderClasses.ContainsKey(sn.systemUri()+URI_VERSION_BREAK+sn.EditionUri) or def then
FProviderClasses.AddOrSetValue(sn.systemUri()+URI_VERSION_BREAK+sn.EditionUri, sp.link);
finally
sp.free;
end;
Expand Down

0 comments on commit caab685

Please sign in to comment.