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
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.
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?
Yes, this is not yet implemented and is a TODO: https://github.com/smart-on-fhir/Swift-FHIR/blob/master/Sources/Models/FHIREnum.swift#L40