smart-on-fhir/Swift-FHIR

Question: Is it possible to access "_primitive" fields using SwiftFHIR?

nishadh opened this issue · 6 comments

Hi,

I'm using Swift-FHIR version 2.8 to parse FHIR models in our project. I've come across an API that uses this technique (as described here http://hl7.org/fhir/DSTU2/json.html#primitive) for passing additional data for a primitive type.

More specifically, I've access to Dstu2 FHIR 1.0 "MedicationStatement.status" which is an Optional String type. However, the API also exposes "MedicationStatement._status" which contains an extension with additional data.

I was wondering, if there was any way to access this field using SwiftFHIR.

Many thanks,
Nishadh

p2 commented

This is only possible in version 3.0 and newer, i.e. the STU-3 data models I'm afraid.

cool, thanks for the information.

Hi @p2

After discussions with the team, it seems like we'll have to figure out a way to do this using SwiftFHIR 2.8, as we can't go to STU3.

I was hoping to ask, whether it would be a recommended approach for us to back port this functionality from 2.9 to 2.8 then raise a PR for 2.8.x. However, I found that "MedicationStatement._status" isn't supported on 2.9 as well. I've seen this is supported in Observation.comment (which is FHIRString type) so, I was just wondering why it's not supported for MedicationStatement._status in SwiftFHIR 2.9?

Thanks very much for your help.

p2 commented

Yes you're right, this capability has been added with commits 4632294 and a7576da, which was right after version 2.10 (FHIR version 1.8, 2017Jan). So if you want to backport, you'll have to backport version 3.0 I'm afraid.

Thanks again @p2.

One more thing, I see that the "code" types do not support this functionality yet and I take that the intension is for the "code" types to support it in future?