fhir_client_connector
Module fhir_client_connector
API
thishanidev/fhir_client_connector
Functions![](/images/permalink.svg)
extractResourceTypeNId![](/images/permalink.svg)
function extractResourceTypeNId(json|xml data, boolean extractId) returns ResourceTypeNId|error
validateBundleData![](/images/permalink.svg)
function validateBundleData(json|xml data, BundleType bundleType) returns boolean|error
Clients![](/images/permalink.svg)
fhir_client_connector: FhirConnector![](/images/permalink.svg)
This connector allows you to connect and interact with any FHIR server
Constructor![](/images/permalink.svg)
Initializes the FHIR client connector
init (FhirConnectorConfig connectorConfig, *ClientConfiguration httpClientConfig)
- connectorConfig FhirConnectorConfig - FHIR connector configurations
- httpClientConfig *ClientConfiguration - HTTP client configurations
getById![](/images/permalink.svg)
function getById(ResourceType|string 'type, string id, MimeType? returnMimeType, SummaryType? summary) returns FhirResponse|FhirError
Retrieves a FHIR Resource by the resource logical ID
Parameters
- 'type ResourceType|string - The name of the resource type
- id string - The logical id of the resource
- returnMimeType MimeType? (default ()) - The MIME type of the response
- summary SummaryType? (default ()) - The subset of the resource content to be returned
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
getByVersion![](/images/permalink.svg)
function getByVersion(ResourceType|string 'type, string id, string 'version, MimeType? returnMimeType, SummaryType? summary) returns FhirResponse|FhirError
Retrieves a version specific FHIR resource
Parameters
- 'type ResourceType|string - The name of the resource type
- id string - The logical id of the resource
- 'version string - the version id
- returnMimeType MimeType? (default ()) - The MIME type of the response
- summary SummaryType? (default ()) - The subset of the resource content to be returned
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
update![](/images/permalink.svg)
function update(json|xml data, MimeType? returnMimeType, PreferenceType returnPreference) returns FhirResponse|FhirError
Updates an existing resource or creates a new resource if the resource doesn't exists
Parameters
- data json|xml - Resource data
- returnMimeType MimeType? (default ()) - The MIME type of the response
- returnPreference PreferenceType (default MINIMAL) - To specify the content of the return response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
patch![](/images/permalink.svg)
function patch(ResourceType|string 'type, string id, json|xml data, MimeType? returnMimeType, MimeType|PatchContentType? patchContentType, PreferenceType returnPreference) returns FhirResponse|FhirError
Partially Updates an existing resource
Parameters
- 'type ResourceType|string - The name of the resource type
- id string - The logical id of the resource
- data json|xml - Resource data
- returnMimeType MimeType? (default ()) - The MIME type of the response
- patchContentType MimeType|PatchContentType? (default ()) - Content type of the patch payload
- returnPreference PreferenceType (default MINIMAL) - To specify the content of the return response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
delete![](/images/permalink.svg)
function delete(ResourceType|string 'type, string id) returns FhirResponse|FhirError
Deletes an existing resource
Parameters
- 'type ResourceType|string - The name of the resource type
- id string - The logical id of the resource
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
getInstanceHistory![](/images/permalink.svg)
function getInstanceHistory(ResourceType|string 'type, string id, HistorySearchParameters parameters, MimeType? returnMimeType) returns FhirResponse|FhirError
Retrieves the change history of particular resource
Parameters
- 'type ResourceType|string - The name of the resource type
- id string - The logical id of the resource
- parameters HistorySearchParameters (default {}) - The history search parameters
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
create![](/images/permalink.svg)
function create(json|xml data, MimeType? returnMimeType, PreferenceType returnPreference) returns FhirResponse|FhirError
Creates a new resource
Parameters
- data json|xml - Resource data
- returnMimeType MimeType? (default ()) - The MIME type of the response
- returnPreference PreferenceType (default MINIMAL) - To specify the content of the return response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
search![](/images/permalink.svg)
function search(ResourceType|string 'type, SearchParameters|map<string[]>? searchParameters, MimeType? returnMimeType) returns FhirResponse|FhirError
Searches all resources of a particular type
Parameters
- 'type ResourceType|string - The name of the resource type
- searchParameters SearchParameters|map<string[]>? (default ()) - The search parameters
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
getHistory![](/images/permalink.svg)
function getHistory(ResourceType|string 'type, HistorySearchParameters parameters, MimeType? returnMimeType) returns FhirResponse|FhirError
Retrieves the change history of a particular resource type.
Parameters
- 'type ResourceType|string - The name of the resource type
- parameters HistorySearchParameters (default {}) - The history search parameters
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
getConformance![](/images/permalink.svg)
function getConformance(ModeType mode, MimeType? returnMimeType, map<anydata>? uriParameters) returns FhirResponse|FhirError
Retrieves information about the server capabilities
Parameters
- mode ModeType (default FULL) - The information type required from the server
- returnMimeType MimeType? (default ()) - The MIME type of the response
- uriParameters map<anydata>? (default ()) - The additional parameters like _summary, _elements, refer the server capabilities
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
getAllHistory![](/images/permalink.svg)
function getAllHistory(HistorySearchParameters parameters, MimeType? returnMimeType) returns FhirResponse|FhirError
Retrieves the change history for all resources supported by the server.
Parameters
- parameters HistorySearchParameters (default {}) - The history search parameters
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
searchAll![](/images/permalink.svg)
function searchAll(SearchParameters|map<string[]> searchParameters, MimeType? returnMimeType) returns FhirResponse|FhirError
Searches across all resources types
Parameters
- searchParameters SearchParameters|map<string[]> - The search parameters that are common across all resources
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
batchRequest![](/images/permalink.svg)
function batchRequest(json|xml data, MimeType? returnMimeType) returns FhirResponse|FhirError
Submits a set of actions to perform on a server in a single request, actions will be performed independently as a batch
Parameters
- data json|xml - Resource data
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
'transaction![](/images/permalink.svg)
function 'transaction(json|xml data, MimeType? returnMimeType) returns FhirResponse|FhirError
Submits a set of actions to perform on a server in a single request,actions will be performed as a single atomic transaction
Parameters
- data json|xml - Resource data
- returnMimeType MimeType? (default ()) - The MIME type of the response
Return Type
- FhirResponse|FhirError - If successful, FhirResponse record else FhirError record
nextBundle![](/images/permalink.svg)
function nextBundle(FhirResponse|json|xml currentBundle) returns FhirResponse|FhirError?
Provides support to paginate through resources where applicable(ex: History, Search related bundle resources), retrieves the next bundle if it exists
Parameters
- currentBundle FhirResponse|json|xml - Current resource
Return Type
- FhirResponse|FhirError? - If successful, FhirResponse record else FhirError record
previousBundle![](/images/permalink.svg)
function previousBundle(FhirResponse|json|xml currentBundle) returns FhirResponse|FhirError?
Provides support to paginate through resources where applicable(ex: History, Search related bundle resources), retrieves the previous bundle if it exists
Parameters
- currentBundle FhirResponse|json|xml - Current resource
Return Type
- FhirResponse|FhirError? - If successful, FhirResponse record else FhirError record
Enums![](/images/permalink.svg)
fhir_client_connector: BundleType![](/images/permalink.svg)
Members
fhir_client_connector: MimeType![](/images/permalink.svg)
FHIR accepted MIME types
Members
fhir_client_connector: ModeType![](/images/permalink.svg)
Specifies the information that should return in the capability statement
Members
fhir_client_connector: PatchContentType![](/images/permalink.svg)
FHIR accepted PATCH content types
Members
fhir_client_connector: PreferenceType![](/images/permalink.svg)
Specifies the content that should return when performing create,update or patch
Members
fhir_client_connector: ResourceType![](/images/permalink.svg)
Types of resources
Members
fhir_client_connector: SummaryType![](/images/permalink.svg)
Specifies the subset of the resource to be returned
Members
Records![](/images/permalink.svg)
fhir_client_connector: BaseSearchParameters![](/images/permalink.svg)
Represents the common search parameters across all resources
Fields
- _id string? - Logical id of this artifact
- _lastUpdated string[]? - When the resource version last changed
- _list string? - All resources in nominated list (by id, Type/id, url or one of the magic List types)
- _profile string? - Profiles this resource claims to conform to
- _query string? - A custom search profile that describes a specific defined query operation
- _source string? - Identifies where the resource comes from
- _security string? - Security Labels applied to this resource
- _tag string? - Tags applied to this resource
- _text string? - Search on the narrative text (html) of the resource
- _type string? - Used when a search is performed in a context which doesn't limit the search to indicate which types are being searched. See the FHIR search page for further discussion
- _content string? - Search on the entire content of the resource
- _filter string? - Filter search parameter which supports a more sophisticated grammar for searching
- _has string? - Provides limited support for reverse chaining - that is, selecting resources based on the properties of resources that refer to them (instead of chaining where resources can be selected based on the properties of resources that they refer to)
fhir_client_connector: FhirConnectorConfig![](/images/permalink.svg)
Represents FHIR client connector configurations
Fields
- baseURL string - FHIR server base URL
- mimeType MimeType(default FHIR_JSON) - global MIME type of the return response, can be configured at method level as well
fhir_client_connector: FhirConnectorErrorDetail![](/images/permalink.svg)
Represent Connector related errors
Fields
- errorDetails error? - the full error
fhir_client_connector: FhirResponse![](/images/permalink.svg)
Represents a success response coming from the fhir server side
Fields
- httpStatusCode int - HTTP status code from the interaction
- 'resource json|xml - Field Description
fhir_client_connector: FhirServerErrorDetails![](/images/permalink.svg)
Represents the details of the error response that represents an unsuccessful interaction with the server
Fields
- httpStatusCode int - HTTP status code from the interaction
- 'resource json|xml - Field Description
fhir_client_connector: HistorySearchParameters![](/images/permalink.svg)
Represents parameters that can be used in a history interaction, add more name value pairs if necessary
Fields
- _count string(default "10") - The maximum number of search results on a single response
- _since string? - Only include resource versions that were created at or after the given instant in time
- _at string? - Only include resource versions that were current at some point during the specified time period
- _list string? - Only include resource versions that are referenced in the specified list
fhir_client_connector: ResourceTypeNId![](/images/permalink.svg)
Fields
- 'type string -
- id string -
fhir_client_connector: SearchParameters![](/images/permalink.svg)
Represents parameters that can be used in a search interaction, add more name value pairs if necessary
Fields
- Fields Included from *BaseSearchParameters
Errors![](/images/permalink.svg)
fhir_client_connector: FhirConnectorError![](/images/permalink.svg)
Represents the error type for connector side errors
fhir_client_connector: FhirError![](/images/permalink.svg)
Represents the errors that can be returned from the connector, of two types FhirServerError and FhirConnectorError
fhir_client_connector: FhirServerError![](/images/permalink.svg)
Represents the error type for an unsuccessful interaction with the server
Import
import thishanidev/fhir_client_connector;
Metadata
Released date: almost 2 years ago
Version: 0.1.0
Compatibility
Platform: any
Ballerina version: 2201.2.0
GraalVM compatible: Yes
Pull count
Total: 8
Current verison: 7
Weekly downloads
Other versions
0.1.0