Class TbsFHIRClient

Unit

Declaration

type TbsFHIRClient = class(TComponent)

Description

Creates a new client using a default url

Parameters
AURL
The URL of the server to connect to.
If the trailing '/' is not present, then it will be appended automatically

Hierarchy

  • TComponent
  • TbsFHIRClient

Overview

Methods

Public constructor Create(AOwner: TComponent); overload; override;
Public constructor Create(const AURL:String); overload;
Public destructor Destroy; override;
Public function CreateResource(AResourceName:String; AData:String ):String; overload;
Public function CreateResource(AResource:TBSFHIRObject):String; overload;
Public function ReadResource(AResource:TBSFHIRObject; AId:String): TBSFHIRObject; overload;
Public function ReadResource(AParams:String): TBSFHIRObject; overload;
Public function ReadResource(AResourceName:String; AId:String): TBSFHIRObject; overload;
Public function ReadResourceV(AResourceName:String; AId,AVersionNo:String): TBSFHIRObject;
Public function UpdateResource(AResource:TBSFHIRObject): Boolean; overload;
Public function DeleteResource(AResource:TBSFHIRObject):Boolean; overload;
Public function DeleteResource(AResourceName:String; AId:String): Boolean; overload;
Public function DeleteResource(AResource:String; AConditionalParams: TStringList):Boolean; overload;
Public function Search(AResourceName:String; AConditionalParams: TStrings): TBSFHIRObject; overload;
Public function Search(AResourceName:String; AParam:String): TBSFHIRObject; overload;

Properties

Public property IndyHttp: TIdHTTP read FIndy write SetIndy;
Public property LastResponseCode: Integer read FLastResponseCode;
Public property LastResponseText : String Read FLastResponseText;
Public property ResponseHeaders: TStringList read FResponseHeaders;

Description

Methods

Public constructor Create(AOwner: TComponent); overload; override;
 
Public constructor Create(const AURL:String); overload;
 
Public destructor Destroy; override;
 
Public function CreateResource(AResourceName:String; AData:String ):String; overload;
 
Public function CreateResource(AResource:TBSFHIRObject):String; overload;
 
Public function ReadResource(AResource:TBSFHIRObject; AId:String): TBSFHIRObject; overload;
 
Public function ReadResource(AParams:String): TBSFHIRObject; overload;
 
Public function ReadResource(AResourceName:String; AId:String): TBSFHIRObject; overload;
 
Public function ReadResourceV(AResourceName:String; AId,AVersionNo:String): TBSFHIRObject;
 
Public function UpdateResource(AResource:TBSFHIRObject): Boolean; overload;

For the Create interaction you can have the server check if an equivalent resource already exists, based on the search parameters: var created_pat_A = client.Create<Patient>(pat, conditions); If no matches are found, the resource will be created. If one match is found, the server will not create the resource and will return an HTTP 200 (OK). In both cases created_pat_A will contain the resource that was sent back by the server, unless you set the FhirClient to ask for the minimal representation. When multiple resources match the conditions, the server will return an error.

procedure Create(AResource:String; AConditionalParams: TStringList); overload

Public function DeleteResource(AResource:TBSFHIRObject):Boolean; overload;
 
Public function DeleteResource(AResourceName:String; AId:String): Boolean; overload;
 
Public function DeleteResource(AResource:String; AConditionalParams: TStringList):Boolean; overload;

The conditional Delete takes a string as first argument, indicating the resource type. The search parameters are passed as second argument: client.Delete("Patient", AConditionalParams); When no match is found, the server will return an error. If one match is found, that resource will be deleted. The server may choose to delete all resources if multiple instances match, or it may return an error.

Returns

Is Deleted

Public function Search(AResourceName:String; AConditionalParams: TStrings): TBSFHIRObject; overload;

Search for Resources based on criteria specified in a Query resource

Parameters
AResourceName
The type of resource to filter on (optional). If not specified, will search on all resource types.
AConditionalParams
The Query resource containing the search parameters
Returns

A Bundle with all resources found by the search, or an empty Bundle if none were found.

Public function Search(AResourceName:String; AParam:String): TBSFHIRObject; overload;
 

Properties

Public property IndyHttp: TIdHTTP read FIndy write SetIndy;
 
Public property LastResponseCode: Integer read FLastResponseCode;
 
Public property LastResponseText : String Read FLastResponseText;
 
Public property ResponseHeaders: TStringList read FResponseHeaders;
 

Generated by PasDoc 0.15.0.