diff --git a/library/fhir2/fhir2_factory.pas b/library/fhir2/fhir2_factory.pas index bfc3eb553..fe2fd3f34 100644 --- a/library/fhir2/fhir2_factory.pas +++ b/library/fhir2/fhir2_factory.pas @@ -184,7 +184,7 @@ function TFHIRFactoryR2.buildOperationOutcome(i18n: TI18nSupport; langList: THTT finally iss.free; end; - op.link; + result := op.link; finally op.free; end; diff --git a/library/fhir3/fhir3_factory.pas b/library/fhir3/fhir3_factory.pas index d74bea402..6fbbf61cf 100644 --- a/library/fhir3/fhir3_factory.pas +++ b/library/fhir3/fhir3_factory.pas @@ -184,7 +184,7 @@ function TFHIRFactoryR3.buildOperationOutcome(i18n: TI18nSupport; langList: THTT finally iss.free; end; - op.link; + result := op.link; finally op.free; end; diff --git a/library/fhir4b/fhir4b_factory.pas b/library/fhir4b/fhir4b_factory.pas index 0dd18c883..f38ddabb3 100644 --- a/library/fhir4b/fhir4b_factory.pas +++ b/library/fhir4b/fhir4b_factory.pas @@ -185,7 +185,7 @@ function TFHIRFactoryR4B.buildOperationOutcome(i18n: TI18nSupport; langList: THT finally iss.free; end; - op.link; + result := op.link; finally op.free; end; diff --git a/library/fhir5/fhir5_factory.pas b/library/fhir5/fhir5_factory.pas index 9a51f52db..8e2dc2eaf 100644 --- a/library/fhir5/fhir5_factory.pas +++ b/library/fhir5/fhir5_factory.pas @@ -185,7 +185,7 @@ function TFHIRFactoryR5.buildOperationOutcome(i18n: TI18nSupport; langList: THTT finally iss.free; end; - op.link; + result := op.link; finally op.free; end; diff --git a/library/fsl/fsl_base.pas b/library/fsl/fsl_base.pas index 5a31827bc..1c5f1f6c3 100644 --- a/library/fsl/fsl_base.pas +++ b/library/fsl/fsl_base.pas @@ -1019,7 +1019,7 @@ procedure handleObjectTrackingFail(msg : String); f : System.text; begin // Application is pretty much cactus at this point, so we don't mind doing - // slow file operation inside such a system critical lock as GLock + // a slow file operation inside such a system critical lock as GLock try fn := 'c:\temp\object-tracking-errors.log'; diff --git a/library/ftx/fhir_codesystem_service.pas b/library/ftx/fhir_codesystem_service.pas index edb0bc240..0754ec6bc 100644 --- a/library/ftx/fhir_codesystem_service.pas +++ b/library/ftx/fhir_codesystem_service.pas @@ -329,6 +329,7 @@ constructor TFHIRCodeSystemEntry.Create(res : TFHIRResourceProxyV); begin inherited Create; FCodeSystemProxy := res; + FLoadingState := cseNotLoaded; end; constructor TFHIRCodeSystemEntry.Create(res: TFHIRCodeSystemW); @@ -336,7 +337,7 @@ constructor TFHIRCodeSystemEntry.Create(res: TFHIRCodeSystemW); inherited Create; FCodeSystem := res; LoadCodeSystem; - FLoadingState := cseNotLoaded; + FLoadingState := cseLoaded; end; destructor TFHIRCodeSystemEntry.Destroy; @@ -451,7 +452,8 @@ procedure TFHIRCodeSystemEntry.SetCodeSystem(const Value: TFHIRCodeSystemW); begin FCodeSystem.free; FCodeSystem := value; - LoadCodeSystem; + if FCodeSystem <> nil then + LoadCodeSystem; end; function TFHIRCodeSystemEntry.GetUrl: String; diff --git a/library/ftx/fhir_valuesets.pas b/library/ftx/fhir_valuesets.pas index 13b0efb92..263f06f68 100644 --- a/library/ftx/fhir_valuesets.pas +++ b/library/ftx/fhir_valuesets.pas @@ -3226,7 +3226,7 @@ function TFHIRValueSetExpander.processCode(cs : TCodeSystemProvider; parent : TF exit; - if (cs.expandLimitation > 0) then + if (cs <> nil) and (cs.expandLimitation > 0) then begin cnt := FCSCounter[cs.systemUri]; if (cnt = nil) then @@ -3345,7 +3345,7 @@ function TFHIRValueSetExpander.processCode(cs : TCodeSystemProvider; parent : TF end; end; end - else if csProps <> nil then + else if (csProps <> nil) and (cs <> nil) then begin for cp in csprops do begin