-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
ArrayList<JSONObject> resourceObjects = new ArrayList<>(); | ||
for(String f: resourceFiles){ | ||
FctFile inputFile = FctUtils.readFile(f); | ||
// TODO check if file contains valid fhir resource |
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.
Thinking of adding a prompt here to let the publisher continue or stop once they see if their file is valid or not
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.
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"
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.
cool, created separate issue for this
if(resource.has("id")){ | ||
resourceID = resource.getString("id"); | ||
} else { | ||
resourceID = UUID.randomUUID().toString(); |
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.
generate a random UUID incase this is not provided
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.
do we need to seed Java's random lib when before calling this? I don't remember
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.
no, it works as is
ArrayList<JSONObject> resourceObjects = new ArrayList<>(); | ||
for(String f: resourceFiles){ | ||
FctFile inputFile = FctUtils.readFile(f); | ||
// TODO check if file contains valid fhir resource |
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.
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"
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #29
Engineer Checklist
./gradlew spotlessApply
to check my code follows the project's style guide