Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

isuruh15
Copy link
Contributor

Purpose

  • Add member match and bulk export client prebuilt services under regulation/cms-0057-f
  • fix minor issues identified in the review

Security checks

@sameeragunarathne
Copy link
Contributor

@isuruh15 let's add read me to the pre-built services.

@isuruh15
Copy link
Contributor Author

org = "wso2"
name = "bulk_export_client_service"
version = "0.1.0"
distribution = "2201.8.6"
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

chamajay and others added 7 commits February 11, 2025 08:52
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
* 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 {
Copy link
Contributor

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 {
Copy link
Contributor

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");
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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();

Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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

Comment on lines +23 to +25
configurable string consentServiceUrl = ?;
configurable AuthConfig? consentServiceAuthConfig = ();
configurable map<string|string[]>? consentServiceRequestHeaders = ();
Copy link
Contributor

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

Comment on lines +28 to +30
configurable string coverageServiceUrl = "";
configurable AuthConfig? coverageServiceAuthConfig = ();
configurable map<string|string[]>? coverageServiceRequestHeaders = ();
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants