HL7 / fhir-shorthand

FHIR Shorthand
44 stars 8 forks source link

Clarify use of indices with slice paths #150

Closed cmoesel closed 1 year ago

cmoesel commented 1 year ago

This PR adds some language and an example to clarify how to use hard and soft indices to reference items in a slice.

cmoesel commented 1 year ago

did we want/need an example including how ordering would work with different slices that each used indices, such as entry[medications][+] and entry[conditions][+]?

I'm not sure I understand the question. Are you talking about whether slices remain contiguous or we break them up? E.g., if we do entry[medications][+] then entry[conditions][+] then entry[medications][+], is the last one at overall index 1 (grouped w/ other medications) or overall index 2 (split from other medications)? Is that what you're referring to?

jafeltra commented 1 year ago

I'm not sure I understand the question. Are you talking about whether slices remain contiguous or we break them up? E.g., if we do entry[medications][+] then entry[conditions][+] then entry[medications][+], is the last one at overall index 1 (grouped w/ other medications) or overall index 2 (split from other medications)? Is that what you're referring to?

Similar, but I think maybe that's even more complex than I was thinking. I was just thinking about a case like:

entry[medications] // first element
entry[medications][1] // second element
entry[medications][+] // third element
entry[conditions][+] // fourth element

But I think now that I wrote it out, I think this is pretty easily inferred from the examples you have, and it isn't worth getting into more complex scenarios, like the one you described.

And that was my only question, so I approve.