-
Notifications
You must be signed in to change notification settings - Fork 32
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
Hashable resources #89
Comments
The current implementation of |
If you iterate on versions then it can be that How about using |
eq implementation discussion here as well #51 |
I agree, it makes sense. |
The problem is, should we use |
@BSVogler could you please give an example of a use case where having unversioned |
It seems logical to add Regarding |
Let's implement |
@BSVogler Line 94 in a14a36f
Line 79 in a14a36f
So you will be able to implement desired behavior when resourceType, id, and versionId are used for equality. We will add an example to the docs. |
Overwriting the class would be good although I would prefer to have it easier to configure. The _history is part of the FHIR standard. That begs the question whether fhirpy is intended to work against a full capabilities server or a limited implementation by default? When the server supports history just using resourceType + id will cause a lot of confusion. You can update a resource and it can be completely different and then using the equality operator will say that they are equal. (that is also what ruscoder said). |
In order to use resources in a set they should implement the
__hash__()
method. A resource is unique by the id + history version id, so putting this together would be the fastest way.The text was updated successfully, but these errors were encountered: