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

Upload FHIR resources #86

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Upload FHIR resources #86

merged 3 commits into from
Dec 13, 2023

Conversation

Wambere
Copy link
Contributor

@Wambere Wambere commented Dec 7, 2023

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #29

Engineer Checklist

  • I have run ./gradlew spotlessApply to check my code follows the project's style guide
  • I have built and run the efsity jar to verify my change fixes the issue and/or does not break the application

ArrayList<JSONObject> resourceObjects = new ArrayList<>();
for(String f: resourceFiles){
FctFile inputFile = FctUtils.readFile(f);
// TODO check if file contains valid fhir resource
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking of adding a prompt here to let the publisher continue or stop once they see if their file is valid or not

Copy link
Member

Choose a reason for hiding this comment

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

Yea I think we should default stop if any file is not valid and fail everything before upload start if any is not valid, but you can pass a flag on invocation that's like "do not validate"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cool, created separate issue for this

if(resource.has("id")){
resourceID = resource.getString("id");
} else {
resourceID = UUID.randomUUID().toString();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

generate a random UUID incase this is not provided

Copy link
Member

Choose a reason for hiding this comment

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

do we need to seed Java's random lib when before calling this? I don't remember

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, it works as is

@Wambere Wambere changed the title WIP: upload resources Upload FHIR resources Dec 11, 2023
ArrayList<JSONObject> resourceObjects = new ArrayList<>();
for(String f: resourceFiles){
FctFile inputFile = FctUtils.readFile(f);
// TODO check if file contains valid fhir resource
Copy link
Member

Choose a reason for hiding this comment

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

Yea I think we should default stop if any file is not valid and fail everything before upload start if any is not valid, but you can pass a flag on invocation that's like "do not validate"

@Wambere Wambere merged commit 7f085cd into main Dec 13, 2023
4 checks passed
@Wambere Wambere deleted the 29-upload-resources branch December 13, 2023 07:54
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.

Add support for uploading/artifact management on Efsity
3 participants