Skip to content

Commit d301d34

Browse files
author
Grahame Grieve
committed
fix redundant designation check
1 parent ae3a9fa commit d301d34

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

library/ftx/fhir_valuesets.pas

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,10 +3081,12 @@ function getPropUrl(cs : TCodeSystemProvider; pcode : String) : String;
30813081

30823082
function TFHIRValueSetExpander.redundantDisplay(n : TFhirValueSetExpansionContainsW; lang : TIETFLang; use : TFHIRCodingW; value : TFHIRPrimitiveW) : boolean;
30833083
begin
3084-
if ((lang = nil) or lang.code.StartsWith(FValueSet.language)) and ((use = nil) or (use.code = 'display')) then
3085-
result := value.AsString = n.display
3084+
if not ((lang = nil) and (FValueSet.language = '')) or ((lang <> nil) and lang.code.StartsWith(FValueSet.language)) then
3085+
result := false
3086+
else if not ((use = nil) or (use.code = 'display')) then
3087+
result := false
30863088
else
3087-
result := false;
3089+
result := value.AsString = n.display;
30883090
end;
30893091

30903092
function TFHIRValueSetExpander.includeCode(cs : TCodeSystemProvider; parent : TFhirValueSetExpansionContainsW; system, version, code : String;

server/package_spider.pas

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,13 @@ function TPackageUpdater.fetchUrl(url, mimetype: string): TBytes;
242242
end;
243243

244244
function TPackageUpdater.fetchXml(url: string): TMXmlElement;
245+
var
246+
cnt : TBytes;
245247
begin
246248
if Logging.shuttingDown then
247249
Abort;
248-
result := TMXmlParser.Parse(fetchUrl(url, 'application/xml'), [xpResolveNamespaces, xpDropWhitespace, xpDropComments, xpHTMLEntities]);
250+
cnt := fetchUrl(url, 'application/xml');
251+
result := TMXmlParser.Parse(cnt, [xpResolveNamespaces, xpDropWhitespace, xpDropComments, xpHTMLEntities]);
249252
end;
250253

251254
function TPackageUpdater.hasStored(guid: String): boolean;
@@ -358,7 +361,7 @@ procedure TPackageUpdater.store(source, url, guid: String; date : TFslDateTime;
358361
raise EPackageCrawlerException.Create('NPM Version "'+version+'" is not valid from '+source);
359362
if (canonical = '') then
360363
begin
361-
log('Warning processing '+idver+': No canonical found in npm (from '+url+')', source, true);
364+
// log('Warning processing '+idver+': No canonical found in npm (from '+url+')', source, true);
362365
clog(clItem, 'warning', 'No canonical found in npm (from '+url+')');
363366
canonical := 'http://simplifier.net/packages/fictitious/'+id;
364367
end;
@@ -631,12 +634,12 @@ function TPackageRestrictions.isOk(package, feed: String; var list : String): bo
631634
begin
632635
result := true;
633636
list := '';
637+
p := fix(package);
634638
if FJson <> nil then
635639
begin
636640
for e in FJson do
637641
begin
638642
eo := e as TJsonObject;
639-
p := fix(package);
640643
m := fix(eo.str['mask']);
641644
if matches(p, m) then
642645
begin
@@ -658,10 +661,15 @@ function TPackageRestrictions.matches(package, mask: String): boolean;
658661
var
659662
i : integer;
660663
begin
661-
i := mask.IndexOf('*');
662-
package := package.Substring(0, i);
663-
mask := mask.Substring(0, i);
664-
result := package = mask;
664+
if (mask.contains('*')) then
665+
begin
666+
i := mask.IndexOf('*');
667+
package := package.Substring(0, i);
668+
mask := mask.Substring(0, i);
669+
result := package = mask;
670+
end
671+
else
672+
result := mask = package;
665673
end;
666674

667675
{ TZulipTracker }

0 commit comments

Comments
 (0)