A little help required regarding FHIR DSTU2 #87
abdulazizibrahim
started this conversation in
General
Replies: 1 comment 1 reply
-
|
@abdulazizibrahim I see it's not your fault in any way, it's a bug. Please open an issue, we will look into it. Actuality DTU2 package is not properly tested. If possible You can check other classes as well. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi fellows,
I am new to the whole health-tech world and I had to work FHIR DSTU2 version. I was using this library to test out stuff and I faced some issues which I will addressing below and I hope you guys can help me out here.
`
from fhir.resources.DSTU2.subscription import Subscription
data = {
"reason": "callback",
}
sub = Subscription(**data)
When I receive a subscription request (json), I want to create an FHIR Subscription object but when I try to do that I get the following error.ValidationError Traceback (most recent call last)
in
----> 1 sub = Subscription(**data)
~/.local/lib/python3.9/site-packages/fhir/resources/DSTU2/fhirabstractmodel.py in init(pydantic_self, **data)
134 )
135 if errors:
--> 136 raise ValidationError(errors, pydantic_self.class)
137
138 BaseModel.init(pydantic_self, **data)
ValidationError: 1 validation error for Subscription
resource_type
Wrong ResourceType:
fhir.resources.DSTU2.subscription.Subscriptionexpects resource typeSubstance, but gotSubscription. Make sure resource type name is correct and right ModelClass has been chosen. (type=value_error.wrong.resource_type; error=fhir.resources.DSTU2.subscription.Subscriptionexpects resource typeSubstance, but gotSubscription. Make sure resource type name is correct and right ModelClass has been chosen.)`
I would really appreciate if you could help me out here. @nazrulworld
Beta Was this translation helpful? Give feedback.
All reactions