-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Member Match and Bulk Export Client Prebuilt Services #85
base: main
Are you sure you want to change the base?
Conversation
@isuruh15 let's add read me to the pre-built services. |
org = "wso2" | ||
name = "bulk_export_client_service" | ||
version = "0.1.0" | ||
distribution = "2201.8.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's upgrade to Bal 10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Related issue: wso2-enterprise/open-healthcare#1553 formatting add content for demo setup Add bulk data export client implementation. fix:wso2-enterprise/open-healthcare#1554 adding unit tests minor fixes add single patient and group export support format code restructure codebase
restucture code
* add endpoints * update dependancies * add endpoints * hardcode port * remove context * add component configs * add file fetch operation * update openapi * add error log * added error payload * add info logs * add service level isolation * remove locked block - tmp * refactor
|
||
final isolated map<ExportTask> exportTasks = {}; | ||
|
||
isolated function addExportTasktoMemory(map<ExportTask> taskMap, ExportTask exportTask) returns boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have interface with the defined set of functions to implement and InmemoryStorage is an implementation class of if. So that we can plug the implentation as needed.
return true; | ||
} | ||
|
||
isolated function addPollingEventToMemory(map<ExportTask> taskMap, PollingEvent pollingEvent) returns boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When adding these functions to interface, generify the names. i.e: addPollingEvent
} | ||
} | ||
lock { | ||
boolean _ = updateExportTaskStatusInMemory(taskMap = exportTasks, exportTaskId = exportId, newStatus = "Downloaded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plug the function for the relevant implementation
Refer: https://github.com/wso2/open-healthcare-prebuilt-services/pull/85/files#r1957674248
|
||
log:printInfo("Bulk export client Service is started...", port = clientServiceConfig.port); | ||
} | ||
isolated resource function get export(string? _outputFormat, string? _since, string? _type) returns json|error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply formatter
|
||
} | ||
|
||
isolated resource function get export/group/[string group_id](string? _outputFormat, string? _since, string? _type) returns json|error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's have bal docs
isolated resource function get status(string exportId) returns json|error { | ||
|
||
return getExportTaskFromMemory(exportId).toJson(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unwanted new line
|
||
} | ||
|
||
isolated resource function get download(string location) returns http:STATUS_ACCEPTED|http:STATUS_INTERNAL_SERVER_ERROR { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add bal docs. Check other places as well
@@ -0,0 +1,54 @@ | |||
import ballerina/http; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing licence
@@ -0,0 +1,66 @@ | |||
import ballerina/test; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing licence. Check other places as well
configurable string consentServiceUrl = ?; | ||
configurable AuthConfig? consentServiceAuthConfig = (); | ||
configurable map<string|string[]>? consentServiceRequestHeaders = (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's bundle this into one record
configurable string coverageServiceUrl = ""; | ||
configurable AuthConfig? coverageServiceAuthConfig = (); | ||
configurable map<string|string[]>? coverageServiceRequestHeaders = (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's bundle these into one record?
Purpose
Security checks