Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
FHIR: Output NPM format #511
base: main
Are you sure you want to change the base?
FHIR: Output NPM format #511
Changes from all commits
8b0ca88
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
fhirjson_conf.json
setup (@cmungall review)@cmungall Harder to review as time goes on as fades in back of memory. TLDR this is a minor choice; I think its (a) dynamically generate
.gitignore
d conf JSONs , or (b) commit them as static files intest/input/
. Existing / current pattern is(a).Details 2023/11/26
We were also discussing in this comment. I set it up to write to a file. I think I followed an existing pattern you were using. I think I would prefer just statically saving as JSON and loading that way.
ontology-access-kit/tests/test_cli.py
Lines 503 to 507 in b42d286
ontology-access-kit/tests/test_cli.py
Line 525 in b42d286
Details 2023/04/05
@hrshdhgd I should have made a 'review comment' earlier when tagging you. I like being able to hit 'resolve' to clean the page up a bit.
Regarding
fhirjson_conf.json
, I located the source. It's from a (very helpful) unit test that @cmungall added in another PR recently. Basically, in order to keep the CLI clean, we're planning on having some dumpers, etc, pull their parameters from a config file rather than declaring them incli.py
in the normalclick
way. Right now, the only such dumperoutput_type
that has such a config isfhirjson
.ontology-access-kit/tests/test_cli.py
Lines 477 to 479 in 22eebdf
@cmungall It does look like this probably should be in the
.gitignore
, so I've added the following entry (though let me know if you actually do want to have these committed):tests/input/*_conf.json
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.
CLI & documenting config @joeflack4
I think this may still need:
Details
Tasks
1. CLI
It can call the dumper for
fhirnpm
, but need to settle on the params for it first.2. Docs about the FHIR config JSON
Should probably document the config for that as with the
fhirjson
dumper.Discussion
Joe 4/5/2023:
I haven't actually properly set up these yet.
Joe 9/2023:
You may consider this a blocker, the fact that there's no CLI. Since I didn't do it back in April, I'm thinking it's because I wanted your input on the params for some reason. If this is needed for merge, I can put this back into draft mode, look into it and let you know if/where I need feedback.
Joe 11/26/2023:
I think I may have time to do this in this PR now.
This comment was marked as duplicate.
Sorry, something went wrong.
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.
OboGraphToFhirNpmConverter
structure and pattern differences (@cmungall review)Details
@cmungall Basically the review I want here is that the nature of the FHIR output is now starting to deviate from what is standard in OAK. It's not just 1 file in, 1 file out for this. FHIR will now output a number of files, and if they're using the
fhirnpm
format, it'll be 1 zip.@cmungall I followed your suggestion and made a
fhirnpm
output_type
. Given the architecture of OAK, I think aOboGraphToFhirNpmConverter
is expected. And it seemed to make sense to subclass it fromOboGraphToFhirJsonConverter
.Non-standard
dump()
and alternative ideaAll it needs to do is override
dump()
and do some extra things. But this might violate your intentions of standardization around thedump()
methods in these classes. Is it OK how I've done this? Or do you want me to create some kind of intermediate method, say,package()
which comes after the inheritedOboGraphToFhirJsonConverter.convert()
and then returns back todump()
? If so, perhapspackage()
could do everything up to creating the actual zip file.Required
dump()
paramsSome other non-standard changes that I've made to
OboGraphToFhirNpmConverter.dump()
given its special case:target
is now a required param, and in this case represents the output directory. I could change this to be the output path of the zip file. However, it seems that it must be required, because the other methods print the output to the terminal, and I imagine we don't want to do that with a zip file.manifest_path
a required parameter. If you like my idea of creating apackage()
method, I could pass this down and require it there instead.kwargs["code_system_id"]
: I didn't make this a required param (yet), but it is technically required.kwargs["code_system_url"]
: I didn't make this a required param (yet), but it is technically required.PyCharm signature method warning
I have a warning:
It's unhappy that I made
target
a required param by removing= None
. But I don't see why this is invalid / bad. The code seems to run fine.I can't seem to put a JetBrains
noinspection
comment to ignore the warning, either.This comment was marked as duplicate.
Sorry, something went wrong.
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.
StreamingFhirJsonWriter
.dumps()
bug? @cmungallDetails
This isn't code I wrote. I'm on not even sure how
StreamingFhirJsonWriter
is used, but I noticed it dumps like this:self.file.write(json_dumper.dumps(code_system))
But I would expect it to do something like this:
OboGraphToFhirJsonConverter.dump(...)
Should I create an issue?
I could maybe try to evaluate it as well.
This comment was marked as duplicate.
Sorry, something went wrong.
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.
StreamingFhirNpmWriter
(@cmungall question)Details
@cmungall I didn't even notice these "streaming writers" existed until a short time ago. Do you need me to implement
StreamingFhirNpmWriter
? Does it make sense to?edit: If so, I don't have a lot of time so it would be better for me to do in multiple PRs and track progress in an issue.