Stream: dotnet
Topic: polymorph member validation error
Sean McIlvenna (Nov 22 2016 at 00:19):
I am getting an error "Encountered polymorph member patient, but is does not specify the type used". Can someone explain this to me?
Sean McIlvenna (Nov 22 2016 at 00:46):
ok... it seems to be related to Claim.patient
Sean McIlvenna (Nov 22 2016 at 00:46):
After I removed "patient" from claim, it parsed by fhir-net-api just fine
Sean McIlvenna (Nov 22 2016 at 00:46):
Debugging the code a bit, it seems that it thinks Claim.patient is a choice data type
Sean McIlvenna (Nov 22 2016 at 00:47):
And is looking for it to be something like "patientReference" instead of "patient"
Sean McIlvenna (Nov 22 2016 at 00:47):
I believe "patient" is correct, though... The spec shows it should be "patient" and always should be a data-type of "reference"
Sean McIlvenna (Nov 22 2016 at 00:47):
so I think this *might* be a bug in the fhir-net-api
Sean McIlvenna (Nov 22 2016 at 00:48):
@Ewout Kramer , can you comment when you get a chance?
Sean McIlvenna (Nov 22 2016 at 14:06):
perhaps it is just that I am using the wrong branch? I am using the ft-connectathon-sep2016 branch
Sean McIlvenna (Nov 22 2016 at 14:06):
should I switch branches to the ft-connectathon-jan2017 branch?
Sean McIlvenna (Nov 22 2016 at 14:07):
it seems there are some very recent commits to that branch, maybe it matches the build.fhir.org spec more than sep2016?
Brian Postlethwaite (Nov 23 2016 at 05:55):
That jan2017 branch is a 1.7 build, which is the current continuous build one (from a week or 2 back) so depending on the server you connect to, you'll get different results.
Brian Postlethwaite (Nov 23 2016 at 05:56):
The sep2016 is the correct branch there, but it's not being maintained anymore.
Ewout Kramer (Dec 01 2016 at 12:41):
@Ewout Kramer , can you comment when you get a chance?
I did some research and the only way this error can be reached is then Claim.patient is a choice type. Which is when the element in the Claim class file is marked with a [FhirElement] attribute which has a Choice=ChoiceType.DatatypeChoice argument. This is not the case in the DSTU2 generated files
Ewout Kramer (Dec 01 2016 at 12:45):
@Brian Postlethwaite , can you see whether this is the case in the STU3 stuff?
Ewout Kramer (Dec 05 2016 at 16:53):
Ok, just so we don't forget to check this issue, I have added it to the issues list on github: https://github.com/ewoutkramer/fhir-net-api/issues/274
Last updated: Apr 12 2022 at 19:14 UTC