-
Notifications
You must be signed in to change notification settings - Fork 108
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
Why is Address Line inputted as a List? #65
Comments
First of all, welcome to arena of FHIR. |
@nazrulworld Thank you for teaching me that. Just curious, when would you ever want to have multiple addresses (other fields I can understand I'm sure). Also, thank you for this wonderful package as well. |
It completely depends on the use case, One person could have work and home together and also an Organization could have separate postal and physical address. |
When searching for a search for a patient by an identifier, I am returned a Bundle that contains a single Patient. The Patient's address field looks as follows: {
"use": "old",
"line": [
"100 LaSalle St",
""
],
"city": "Chicago",
"district": "Cook",
"state": "IL",
"postalCode": "60606",
"country": "USA"
}, When converting the JSON into a Bundle, I get a pydantic error because the empty string in |
As far as I see |
Totally understand that an empty string is not valid according to FHIR, but this is what is coming out of a production Epic instance. It's unfortunate that real-world use cases do not comply with the spec, but it's to be expected since data is messy. Do you have suggestions on how to reconcile messy data with the FHIR specification? Great library BTW! Makes parsing FHIR payloads straight-forward =D |
One easy solution could be to patch (depends on which fhir version you are using) https://github.com/nazrulworld/fhir.resources/blob/main/fhir/resources/fhirtypes.py#L99 |
But maybe in the future, we could make the constraint configurable for String type like https://github.com/nazrulworld/fhir.resources/blob/main/fhir/resources/fhirtypes.py#L170 Id |
@alysivji if you follow the referenced commit, now String type is configurable!
|
Thank you for adding this in! 🙏 |
I'm new to FHIR, but I'm confused why the address "line" is required to be a list? According to the official documentation it should be a string.
https://www.hl7.org/fhir/datatypes-definitions.html#Address.line
The text was updated successfully, but these errors were encountered: