fhir_client_connector
Module fhir_client_connector
API
thishanidev/fhir_client_connector
Functions
extractResourceTypeNId
function extractResourceTypeNId(json|xml data, boolean extractId) returns ResourceTypeNId|error
validateBundleData
function validateBundleData(json|xml data, BundleType bundleType) returns boolean|error
Clients
fhir_client_connector: FhirConnector
This connector allows you to connect and interact with any FHIR server
Constructor
Initializes the FHIR client connector
init (FhirConnectorConfig connectorConfig, *ClientConfiguration httpClientConfig)
- connectorConfig FhirConnectorConfig - FHIR connector configurations
- httpClientConfig *ClientConfiguration - HTTP client configurations
getById
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
fhir_client_connector: BundleType
Members
fhir_client_connector: MimeType
FHIR accepted MIME types
Members
fhir_client_connector: ModeType
Specifies the information that should return in the capability statement
Members
fhir_client_connector: PatchContentType
FHIR accepted PATCH content types
Members
fhir_client_connector: PreferenceType
Specifies the content that should return when performing create,update or patch
Members
fhir_client_connector: ResourceType
Types of resources
Members
fhir_client_connector: SummaryType
Specifies the subset of the resource to be returned
Members
Records
fhir_client_connector: BaseSearchParameters
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
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
Represent Connector related errors
Fields
- errorDetails error? - the full error
fhir_client_connector: FhirResponse
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
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
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
Fields
- 'type string -
- id string -
fhir_client_connector: SearchParameters
Represents parameters that can be used in a search interaction, add more name value pairs if necessary
Fields
- Fields Included from *BaseSearchParameters
Errors
fhir_client_connector: FhirConnectorError
Represents the error type for connector side errors
fhir_client_connector: FhirError
Represents the errors that can be returned from the connector, of two types FhirServerError and FhirConnectorError
fhir_client_connector: FhirServerError
Represents the error type for an unsuccessful interaction with the server
Import
import thishanidev/fhir_client_connector;
Metadata
Released date: about 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