@@ -43,7 +43,7 @@ TTerminologyOperationContext = class (TTxOperationContext)
4343 procedure clearContexts ;
4444
4545 procedure log (note : String); override;
46- procedure addNote (vs : TFHIRValueSetW; note : String);
46+ procedure addNote (vs : TFHIRValueSetW; note : String; indentCount : integer );
4747 function diagnostics : String;
4848 property OnGetCurrentRequestCount : TGetCurrentRequestCountEvent read FOnGetCurrentRequestCount write FOnGetCurrentRequestCount;
4949
@@ -53,6 +53,7 @@ TTerminologyOperationContext = class (TTxOperationContext)
5353 class function renderCoded (system, version, code, display : String) : String; overload;
5454 class function renderCoded (code : TFhirCodingW) : String; overload;
5555 class function renderCoded (code : TFhirCodeableConceptW) : String; overload;
56+ class function renderInclude (inc : TFhirValueSetComposeIncludeW) : String; overload;
5657 end ;
5758
5859 { TFHIRCachedMetadataResource }
@@ -244,6 +245,7 @@ TFHIRTxOperationParams = class (TFslObject)
244245
245246 TTerminologyWorker = class (TFslObject)
246247 protected
248+ FIndentCount : integer;
247249 FOpContext : TTerminologyOperationContext;
248250 FFactory : TFHIRFactory;
249251 FOnGetCSProvider : TGetProviderEvent;
@@ -313,7 +315,6 @@ constructor TTerminologyOperationContext.Create(i18n: TI18nSupport; id : String;
313315 FTimeTracker := TFslTimeTracker.create
314316 else
315317 FTimeTracker := tt;
316- FTimeTracker.step(' tx-op' );
317318end ;
318319
319320destructor TTerminologyOperationContext.Destroy;
@@ -387,11 +388,12 @@ procedure TTerminologyOperationContext.log(note: String);
387388 FTimeTracker.step(s);
388389end ;
389390
390- procedure TTerminologyOperationContext.addNote (vs : TFHIRValueSetW; note : String);
391+ procedure TTerminologyOperationContext.addNote (vs : TFHIRValueSetW; note : String; indentCount : integer );
391392var
392393 s : string;
393394begin
394- s := inttostr(GetTickCount64 - FStartTime)+' ms ' +vs.vurl+' : ' +note;
395+ s := StringPadRight(inttostr(GetTickCount64 - FStartTime)+' ms' , ' ' , 4 )+' ' +
396+ StringPadLeft(' ' , ' ' , indentCount*2 )+' #' +inttostr(SerialNumber)+' : ' +note;
395397 // if UnderDebugger then
396398 // Logging.log(s);
397399 FTimeTracker.step(s);
@@ -442,6 +444,62 @@ class function TTerminologyOperationContext.renderCoded(code: TFhirCodeableConce
442444 result := ' [' +result+' ]' ;
443445end ;
444446
447+ class function TTerminologyOperationContext.renderInclude (inc: TFhirValueSetComposeIncludeW): String;
448+ var
449+ first : boolean;
450+ cc : TFhirValueSetComposeIncludeConceptW;
451+ ci : TFhirValueSetComposeIncludeFilterW;
452+ s : String;
453+ begin
454+ if inc.systemUri <> ' ' then
455+ begin
456+ result := ' (' +inc.systemUri+' )' ;
457+ if inc.hasConcepts then
458+ begin
459+ result := result + ' (' ;
460+ first := true;
461+ for cc in inc.concepts.forEnum do
462+ begin
463+ if first then
464+ first := false
465+ else
466+ result := result + ' ,' ;
467+ result := result + cc.code;
468+ end ;
469+ result := result+' )' ;
470+ end ;
471+ if (inc.hasFilters) then
472+ begin
473+ result := result + ' (' ;
474+ first := true;
475+ for ci in inc.filters.forEnum do
476+ begin
477+ if first then
478+ first := false
479+ else
480+ result := result + ' ,' ;
481+ result := result + ci.prop+CODES_TFhirFilterOperatorVCL[ci.op]+ci.value ;
482+ end ;
483+ result := result+' )' ;
484+ end ;
485+ end
486+ else
487+ begin
488+ result := ' ' ;
489+ result := result + ' (' ;
490+ first := true;
491+ for s in inc.valueSets do
492+ begin
493+ if first then
494+ first := false
495+ else
496+ result := result + ' ,' ;
497+ result := result + ' ^' +s;
498+ end ;
499+ result := result+' )' ;
500+ end ;
501+ end ;
502+
445503{ TFHIRCachedMetadataResource }
446504
447505procedure TFHIRCachedMetadataResource.SetLoadedCS (AValue: TFHIRCodeSystemEntry);
@@ -773,7 +831,7 @@ procedure TTerminologyWorker.deadCheck(place: String);
773831 SetThreadStatus(ClassName+' .' +place);
774832 if FOpContext.deadCheck(time) then
775833 begin
776- FOpContext.addNote(vsHandle, ' Operation took too long @ ' +place+' (' +className+' )' );
834+ FOpContext.addNote(vsHandle, ' Operation took too long @ ' +place+' (' +className+' )' , FIndentCount );
777835 Logging.log(' Operation took too long @ ' +place+' (' +className+' )' );
778836 raise costDiags(ETooCostly.create(FI18n.translate(' VALUESET_TOO_COSTLY_TIME' , FParams.HTTPlanguages, [' ??' , inttostr(time), opName])));
779837 end ;
@@ -1306,7 +1364,7 @@ function TFhirExpansionParamsVersionRule.link: TFhirExpansionParamsVersionRule;
13061364
13071365function TFhirExpansionParamsVersionRule.asString : String;
13081366begin
1309- result := Fsystem+ ' # ' +Fversion+ ' / ' +inttostr(ord(FMode)) ;
1367+ result := NAMES_TFhirExpansionParamsVersionRuleMode[FMode]+ ' : ' +Fsystem+ ' # ' +Fversion ;
13101368end ;
13111369
13121370function TFhirExpansionParamsVersionRule.asParam : String;
0 commit comments