health.fhir.r4.terminology
Module health.fhir.r4.terminology
API
Declarations
ballerinax/health.fhir.r4.terminology Ballerina library
Functions![](/images/permalink.svg)
addCodeSystem![](/images/permalink.svg)
function addCodeSystem(CodeSystem codeSystem) returns FHIRError?
Add a new CodeSystem.
Parameters
- codeSystem CodeSystem - ValueSet to be added, data in the Ballerina record format
Return Type
- FHIRError? - Return FHIRError
addCodeSystems![](/images/permalink.svg)
function addCodeSystems(CodeSystem[] codeSystems) returns FHIRError[]?
Add a list of new CodeSystems.
Parameters
- codeSystems CodeSystem[] - List CodeSystems
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addCodeSystemsAsJson![](/images/permalink.svg)
function addCodeSystemsAsJson(json[] codeSystemJsonArray) returns FHIRError[]?
Add a list of new CodeSystems as a json or json array.
Parameters
- codeSystemJsonArray json[] - CodeSystem data in the JSON format
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addValueSet![](/images/permalink.svg)
Add a new ValueSet.
Parameters
- valueSet ValueSet - ValueSet to be added, data in the Ballerina record format
Return Type
- FHIRError? - Return FHIRError
addValueSets![](/images/permalink.svg)
Add a list of new ValueSets.
Parameters
- valueSets ValueSet[] - List ValueSets in the Ballerina record format
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addValueSetsAsJson![](/images/permalink.svg)
function addValueSetsAsJson(json[] valueSetJsonArray) returns FHIRError[]?
Add a list of new ValueSet as a json or json array.
Parameters
- valueSetJsonArray json[] - Json ValueSet data in the JSON format
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
codeSystemLookUp![](/images/permalink.svg)
function codeSystemLookUp(code|Coding|CodeableConcept codeValue, CodeSystem? cs, uri? system, string? version) returns CodeSystemConcept[]|CodeSystemConcept|FHIRError
Extract the respective concepts from a given CodeSystem based on the give code or Coding or CodeableConcept data. This method was implemented based on : http://hl7.org/fhir/R4/terminology-service.html#lookup.
Parameters
- codeValue code|Coding|CodeableConcept - Code or Coding or CodeableConcept data type value to process with the CodeSystem
- cs CodeSystem? (default ()) - CodeSystem record to be processed. If system parameter is not supplied, this value shoud be mandatory,
else this is an optional field
- system uri? (default ()) - System URL of the CodeSystem to be processed, if system CodeSystem(cs) is not supplied,
this value shoud be mandatory
- version string? (default ()) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystemConcept[]|CodeSystemConcept|FHIRError - Return list of Concepts if processing is successful, return FHIRError if fails
createCodeableConcept![](/images/permalink.svg)
function createCodeableConcept(uri system, code code, string? version) returns CodeableConcept|FHIRError
Create CodeableConcept data type for given code in a given system.
Parameters
- system uri - system uri of the code system or value set
- code code - code interested
- version string? (default () ) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeableConcept|FHIRError - Created CodeableConcept record or FHIRError if not found
createCoding![](/images/permalink.svg)
Create Coding data type for given code in a given system.
getCodeSystemMap![](/images/permalink.svg)
function getCodeSystemMap() returns map<CodeSystem>
Get all the CodeSystem records.
Return Type
- map<CodeSystem> - Map of CodeSystem records
getValueSetMap![](/images/permalink.svg)
Get all the ValueSet records.
readCodeSystemById![](/images/permalink.svg)
function readCodeSystemById(string id, string? version) returns CodeSystem|FHIRError
Find a Code System based on the provided Id and version.
Parameters
- id string - Id of the CodeSystem to be retrieved
- version string? (default ()) - Version of the CodeSystem to be retrieved and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystem|FHIRError - Return CodeSystem data if the request is successful, return FHIR error if no data found for the provided Id
readCodeSystemByUrl![](/images/permalink.svg)
function readCodeSystemByUrl(uri url, string? version) returns CodeSystem|FHIRError
Find a CodeSystem based on the provided URL and version.
Parameters
- url uri - URL of the CodeSystem to be retrieved
- version string? (default ()) - Version of the CodeSystem to be retrieved and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystem|FHIRError - Return CodeSystem data if the request is successful, return FHIR error if no data found for the provided URL
readValueSetById![](/images/permalink.svg)
Find a ValueSet for a provided Id and version.
readValueSetByUrl![](/images/permalink.svg)
Find a ValueSet for a provided URL and version.
searchCodeSystems![](/images/permalink.svg)
function searchCodeSystems(map<RequestSearchParameter[]> searchParameters) returns CodeSystem[]|FHIRError
Search for Code systems based on the provided search parameters. Allowed search parameters are name, title, url, version, status and so on.
Parameters
- searchParameters map<RequestSearchParameter[]> - List of search parameters, should be passed as map of string arrays
Return Type
- CodeSystem[]|FHIRError - Return array of CodeSystem data if success, return FHIR error if the request contains unsupported search parameters and for any other processing errors
searchValueSets![](/images/permalink.svg)
function searchValueSets(map<RequestSearchParameter[]> searchParameters) returns FHIRError|ValueSet[]
Search for Value Sets for the provided search parameters. Allowed search parameters: are name, title, url, version, status and son on.
Parameters
- searchParameters map<RequestSearchParameter[]> - List of search parameters, should be passed as map of string arrays
setFinder![](/images/permalink.svg)
function setFinder(Finder finder)
Set the external terminology retriever function.
Parameters
- finder Finder - Implementation of the external terminology retriever class
subsumes![](/images/permalink.svg)
function subsumes(code|Coding conceptA, code|Coding conceptB, CodeSystem? cs, uri? system, string? version) returns Parameters|FHIRError
This method with compare concepts. This method was implemented based on: http://hl7.org/fhir/R4/terminology-service.html#subsumes.
Parameters
- cs CodeSystem? (default ()) - CodeSystem value
- system uri? (default ()) - System uri of the codeSystem
- version string? (default ()) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- Parameters|FHIRError - Return Values either equivalent or not-subsumed if processing is successful, FHIRError processing fails
valueSetExpansion![](/images/permalink.svg)
function valueSetExpansion(map<RequestSearchParameter[]> searchParameters, ValueSet? vs, uri? system) returns ValueSet|FHIRError
Extract all the concepts from a given valueSet based on the given filter parameters. This method was implemented based on : http://hl7.org/fhir/R4/terminology-service.html#expand.
Parameters
- searchParameters map<RequestSearchParameter[]> - List of search parameters to filter concepts, should be passed as map of string arrays
- vs ValueSet? (default ()) - ValueSet record to be processed. If system parameter is not supplied, this value shoud be mandatory, else this is an optional field
- system uri? (default ()) - System URL of the ValueSet to be processed, if system ValueSet(vs) is not supplied then
this value shoud be mandatory
valueSetLookUp![](/images/permalink.svg)
function valueSetLookUp(code|Coding|CodeableConcept codeValue, ValueSet? vs, uri? system, string? version) returns CodeSystemConcept[]|CodeSystemConcept|FHIRError
Extract the respective concepts from a given ValueSet based on the give code or Coding or CodeableConcept data. This method was implemented based on : http://hl7.org/fhir/R4/terminology-service.html#validation.
Parameters
- codeValue code|Coding|CodeableConcept - Code or Coding or CodeableConcept data type value to process with the ValueSet
- vs ValueSet? (default ()) - vs - ValueSet record to be processed. If system parameter is not supplied, this value shoud be mandatory,
else this is an optional field
- system uri? (default ()) - System URL of the ValueSet to be processed, if system ValueSet(vs) is not supplied then
this value shoud be mandatory
- version string? (default ()) - Version of the ValueSet and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystemConcept[]|CodeSystemConcept|FHIRError - Return list of Concepts if processing is successful, return FHIRError if fails
Classes![](/images/permalink.svg)
health.fhir.r4.terminology: TerminologyProcessor![](/images/permalink.svg)
A processor to process terminology data and create relevant data elements.
initTerminology![](/images/permalink.svg)
function initTerminology(map<CodeSystem> codeSystems, map<ValueSet> valueSets)
It will initialize the Terminology map. It will delete the existing records if it is re-initialized. It will be used during the package initialization.
setFinder![](/images/permalink.svg)
function setFinder(Finder finder)
Parameters
- finder Finder -
addCodeSystems![](/images/permalink.svg)
function addCodeSystems(CodeSystem[] codeSystems) returns FHIRError[]?
Add list of new CodeSystems.
Parameters
- codeSystems CodeSystem[] - List CodeSystems
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addCodeSystemsAsJson![](/images/permalink.svg)
function addCodeSystemsAsJson(json[] codeSystemJsonArray) returns FHIRError[]?
Add list of new CodeSystems as a json or json array.
Parameters
- codeSystemJsonArray json[] - CodeSystem data in the JSON format
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addValueSets![](/images/permalink.svg)
Add list of new ValueSets.
Parameters
- valueSets ValueSet[] - List ValueSets in the Ballerina record format
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addValueSetsAsJson![](/images/permalink.svg)
function addValueSetsAsJson(json[] valueSetJsonArray) returns FHIRError[]?
Add list of new ValueSet as a json or json array.
Parameters
- valueSetJsonArray json[] - Json ValueSet data in the JSON format
Return Type
- FHIRError[]? - Return List of FHIRErrors if any
addCodeSystem![](/images/permalink.svg)
function addCodeSystem(CodeSystem codeSystem) returns FHIRError?
Add a new CodeSystem.
Parameters
- codeSystem CodeSystem - ValueSet to be added, data in the Ballerina record format
Return Type
- FHIRError? - Return FHIRError
addValueSet![](/images/permalink.svg)
Add a new ValueSet.
Parameters
- valueSet ValueSet - ValueSet to be added, data in the Ballerina record format
Return Type
- FHIRError? - Return FHIRError
readCodeSystemById![](/images/permalink.svg)
function readCodeSystemById(string id, string? version) returns CodeSystem|FHIRError
Find a Code System based on the provided Id and version.
Parameters
- id string - Id of the CodeSystem to be retrieved
- version string? (default ()) - Version of the CodeSystem to be retrieved and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystem|FHIRError - Return CodeSystem data if the request is successful, return FHIR error if no data found for the provided Id
readValueSetById![](/images/permalink.svg)
Find a ValueSet for a provided Id and version.
Parameters
- id string - Id of the Value Set to be retrieved
- version string? (default ()) - Version of the ValueSet to be retrieved and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
searchCodeSystems![](/images/permalink.svg)
function searchCodeSystems(map<RequestSearchParameter[]> params) returns CodeSystem[]|FHIRError
Search for Code systems based on the provided search parameters. Allowed search parameters are name, title, url, version, status and so on.
Parameters
- params map<RequestSearchParameter[]> - List of search parameters, should be passed as map of string arrays
Return Type
- CodeSystem[]|FHIRError - Return array of CodeSystem data if success, return FHIR error if the request contains unsupported search parameters and for any other processing errors
searchValueSets![](/images/permalink.svg)
function searchValueSets(map<RequestSearchParameter[]> params) returns FHIRError|ValueSet[]
Search for Value Sets for the provided search parameters. Allowed search parameters: are name, title, url, version, status and son on.
Parameters
- params map<RequestSearchParameter[]> - List of search parameters, should be passed as map of string arrays
Return Type
codeSystemLookUp![](/images/permalink.svg)
function codeSystemLookUp(code|Coding|CodeableConcept codeValue, CodeSystem? cs, uri? system, string? version) returns CodeSystemConcept[]|CodeSystemConcept|FHIRError
Extract the respective concepts from a given CodeSystem based on the give code or Coding or CodeableConcept data. This method was implemented based on : http://hl7.org/fhir/R4/terminology-service.html#lookup.
Parameters
- codeValue code|Coding|CodeableConcept - Code or Coding or CodeableConcept data type value to process with the CodeSystem
- cs CodeSystem? (default ()) - CodeSystem record to be processed. If system parameter is not supplied, this value shoud be mandatory,
else this is an optional field
- system uri? (default ()) - System URL of the CodeSystem to be processed, if system CodeSystem(cs) is not supplied,
this value shoud be mandatory
- version string? (default ()) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystemConcept[]|CodeSystemConcept|FHIRError - Return list of Concepts if processing is successful, return FHIRError if fails
valueSetLookUp![](/images/permalink.svg)
function valueSetLookUp(code|Coding|CodeableConcept codeValue, ValueSet? vs, uri? system, string? version) returns CodeSystemConcept[]|CodeSystemConcept|FHIRError
Extract the respective concepts from a given ValueSet based on the give code or Coding or CodeableConcept data. This method was implemented based on : http://hl7.org/fhir/R4/terminology-service.html#validation.
Parameters
- codeValue code|Coding|CodeableConcept - Code or Coding or CodeableConcept data type value to process with the ValueSet
- vs ValueSet? (default ()) - vs - ValueSet record to be processed. If system parameter is not supplied, this value shoud be mandatory,
else this is an optional field
- system uri? (default ()) - System URL of the ValueSet to be processed, if system ValueSet(vs) is not supplied then
this value shoud be mandatory
- version string? (default ()) - Version of the ValueSet and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystemConcept[]|CodeSystemConcept|FHIRError - Return list of Concepts if processing is successful, return FHIRError if fails
valueSetExpansion![](/images/permalink.svg)
function valueSetExpansion(map<RequestSearchParameter[]> searchParams, ValueSet? vs, uri? system) returns ValueSet|FHIRError
Extract all the concepts from a given valueSet based on the given filter parameters. This method was implemented based on : http://hl7.org/fhir/R4/terminology-service.html#expand.
Parameters
- searchParams map<RequestSearchParameter[]> - List of search parameters to filter concepts, should be passed as map of string arrays
- vs ValueSet? (default ()) - ValueSet record to be processed. If system parameter is not supplied, this value shoud be mandatory, else this is an optional field
- system uri? (default ()) - System URL of the ValueSet to be processed, if system ValueSet(vs) is not supplied then
this value shoud be mandatory
subsumes![](/images/permalink.svg)
function subsumes(code|Coding conceptA, code|Coding conceptB, CodeSystem? cs, uri? system, string? version) returns Parameters|FHIRError
This method with compare concepts. This method was implemented based on: http://hl7.org/fhir/R4/terminology-service.html#subsumes.
Parameters
- cs CodeSystem? (default ()) - CodeSystem value
- system uri? (default ()) - System uri of the codeSystem
- version string? (default ()) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- Parameters|FHIRError - Return Values either equivalent or not-subsumed if processing is successful, FHIRError processing fails
readCodeSystemByUrl![](/images/permalink.svg)
function readCodeSystemByUrl(uri url, string? version) returns CodeSystem|FHIRError
Find a CodeSystem based on the provided URL and version.
Parameters
- url uri - URL of the CodeSystem to be retrieved
- version string? (default ()) - Version of the CodeSystem to be retrieved and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
Return Type
- CodeSystem|FHIRError - Return CodeSystem data if the request is successful, return FHIR error if no data found for the provided URL
readValueSetByUrl![](/images/permalink.svg)
createCodeableConcept![](/images/permalink.svg)
function createCodeableConcept(uri system, code code, string? version, Finder? finder) returns CodeableConcept|FHIRError
Create CodeableConcept data type for given code in a given system.
Parameters
- system uri - system uri of the code system or value set
- code code - code interested
- version string? (default ()) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
- finder Finder? (default ()) - (optional) custom code system function (utility will used this function to find code
system in a external source system)
Return Type
- CodeableConcept|FHIRError - Created CodeableConcept record or FHIRError if not found
createCoding![](/images/permalink.svg)
function createCoding(uri system, code code, string? version, Finder? finder) returns Coding|FHIRError
Create Coding data type for given code in a given system.
Parameters
- system uri - System uri of the CodeSystem or valueSet
- code code - code interested
- version string? (default ()) - Version of the CodeSystem and it should be provided with system parameter, if this version parameter is not supplied then the latest version of CodeSystem will picked up.
- finder Finder? (default ()) - (optional) custom code system function (utility will used this function to find code
system in a external source system)
getCodeSystemMap![](/images/permalink.svg)
function getCodeSystemMap() returns map<CodeSystem>
Get all the CodeSystem records.
Return Type
- map<CodeSystem> - Map of CodeSystem records
getValueSetMap![](/images/permalink.svg)
Get all the ValueSet records.
Constants![](/images/permalink.svg)
health.fhir.r4.terminology: CODESYSTEMS_SEARCH_PARAMS![](/images/permalink.svg)
This is a map of implemented search params for CodeSystems. These are defined as a map because to make the search process ease.
health.fhir.r4.terminology: DEFAULT_VERSION![](/images/permalink.svg)
health.fhir.r4.terminology: DEFINITION![](/images/permalink.svg)
health.fhir.r4.terminology: DISPLAY![](/images/permalink.svg)
health.fhir.r4.terminology: EQUIVALENT![](/images/permalink.svg)
health.fhir.r4.terminology: FILTER![](/images/permalink.svg)
health.fhir.r4.terminology: NOT_SUBSUMED![](/images/permalink.svg)
health.fhir.r4.terminology: OUTCOME![](/images/permalink.svg)
health.fhir.r4.terminology: SEARCH_COUNT_ATTRIBUTE![](/images/permalink.svg)
health.fhir.r4.terminology: SEARCH_OFFSET_ATTRIBUTE![](/images/permalink.svg)
health.fhir.r4.terminology: TERMINOLOGY_SEARCH_DEFAULT_COUNT![](/images/permalink.svg)
health.fhir.r4.terminology: TERMINOLOGY_SEARCH_MAXIMUM_COUNT![](/images/permalink.svg)
health.fhir.r4.terminology: VALUESETS_EXPANSION_PARAMS![](/images/permalink.svg)
This is a map of implemented search params for ValueSets. These define as a map because to make the search process ease
health.fhir.r4.terminology: VALUESETS_SEARCH_PARAMS![](/images/permalink.svg)
This is a map of implemented search params for ValueSets. These define as a map because to make the search process ease
Variables![](/images/permalink.svg)
health.fhir.r4.terminology: terminologyProcessor![](/images/permalink.svg)
health.fhir.r4.terminology: DEFAULT_FHIR_CODE_SYSTEMS![](/images/permalink.svg)
health.fhir.r4.terminology: DEFAULT_FHIR_VALUE_SETS![](/images/permalink.svg)
Object types![](/images/permalink.svg)
health.fhir.r4.terminology: Finder![](/images/permalink.svg)
Defines the interface Finder
object.
This should be implemented and provided to the Terminology service operations if external source systems is used.
For instance DB or external API server.
addCodeSystems![](/images/permalink.svg)
function addCodeSystems(CodeSystem[] codeSystems) returns FHIRError[]?
To persist the CodeSystem data in the database.
Parameters
- codeSystems CodeSystem[] - CodeSystem array to be persisted.
Return Type
- FHIRError[]? - Error array if any.
findCodeSystem![](/images/permalink.svg)
function findCodeSystem(uri? system, string? id, string? version) returns CodeSystem|FHIRError
The function definition for Concept finder implementations.
Parameters
- system uri? (default ()) - CodeSystem URL to be searched.
- id string? (default ()) - Id of the CodeSystem to be searched.
- version string? (default ()) - Version of the CodeSystem to be searched.
Return Type
- CodeSystem|FHIRError - CodeSystem if found or else FHIRError.
searchCodeSystem![](/images/permalink.svg)
function searchCodeSystem(map<RequestSearchParameter[]> params, int? offset, int? count) returns CodeSystem[]|FHIRError
The function definition for Concept finder implementations.
Parameters
- params map<RequestSearchParameter[]> - Search parameters.
- offset int? (default ()) - Offset value for the search.
- count int? (default ()) - Count value for the search.
Return Type
- CodeSystem[]|FHIRError - CodeSystem array if found or else FHIRError.
addConcepts![](/images/permalink.svg)
function addConcepts(uri system, CodeSystemConcept[] concepts, string? version) returns FHIRError[]?
The function definition for add Concepts implementations.
Parameters
- system uri - System URL of the CodeSystem to be added.
- concepts CodeSystemConcept[] - Concept array to be added.
- version string? (default ()) - version of the CodeSystem to be added.
Return Type
- FHIRError[]? - Error array if any.
findConcept![](/images/permalink.svg)
function findConcept(uri system, code code, string? version) returns CodeSystemConcept|FHIRError
The function definition for Concept finder implementations.
Parameters
- system uri - System URL of the CodeSystem to be searched.
- code code - Code of the Concept to be searched.
- version string? (default ()) - version of the CodeSystem to be searched.
Return Type
- CodeSystemConcept|FHIRError - CodeSystemConcept if found or else FHIRError.
addValueSets![](/images/permalink.svg)
The function definition for add ValueSets implementations.
Parameters
- valueSets ValueSet[] - ValueSet array to be added.
Return Type
- FHIRError[]? - Error array if any.
findValueSet![](/images/permalink.svg)
The function definition for ValueSet finder implementations.
Parameters
- system uri? (default ()) - System URL of the ValueSet to be searched.
- id string? (default ()) - Id of the ValueSet to be searched.
- version string? (default ()) - version of the ValueSet to be searched.
searchValueSet![](/images/permalink.svg)
function searchValueSet(map<RequestSearchParameter[]> params, int? offset, int? count) returns ValueSet[]|FHIRError
Search ValueSets.
Parameters
- params map<RequestSearchParameter[]> - Search parameters.
- offset int? (default ()) - Offset value for the search.
- count int? (default ()) - Count value for the search.
Function types![](/images/permalink.svg)
health.fhir.r4.terminology: TerminologyRetriever![](/images/permalink.svg)
function(uri, code) returns (CodeSystem|ValueSet|FHIRError)
TerminologyRetriever
Function type which will be used to extend and retrieve CodeSystem or ValueSet by external source
Import
import ballerinax/health.fhir.r4.terminology;
Metadata
Released date: 9 months ago
Version: 4.0.0
Compatibility
Platform: any
Ballerina version: 2201.7.0
Pull count
Total: 49
Current verison: 10
Weekly downloads
Keywords
Healthcare
FHIR
R4
Terminology
Contributors