spark icon indicating copy to clipboard operation
spark copied to clipboard

Regarding the storage of query parameter Code<T>.

Open whyfate opened this issue 2 years ago • 2 comments

https://github.com/FirelyTeam/spark/blob/d9889ad7003c91eabfc6a302416fdf1ef4de8766/src/Spark.Engine/Search/ElementIndexer.cs#L476-L479 https://github.com/FirelyTeam/spark/blob/d9889ad7003c91eabfc6a302416fdf1ef4de8766/src/Spark.Engine/Search/ElementIndexer.cs#L494-L507 Why is the storage design different between Code and Code<T>?

whyfate avatar Apr 18 '23 09:04 whyfate

That's a good question that I do not really have a good answer to. I see this is code that was written before my time, and generally I have just let the stuff that supposedly work just stay that way.

Have you verified that they do indeed get stored differently to the searchindex? Admittedly it has passed some time since I last looked at this part of the code.

kennethmyhra avatar Apr 18 '23 18:04 kennethmyhra

Yes, they are stored differently. In patient resource, gender is code<T> type, and the storage structure in searchindex is { gender : { code : "male" } }. In codesystem resource, the code of concept is code type, and the storage structure in searchindex is { code : [ "01" , "02"] }. In the search standard of fhir, the types of code and code<T> are both token types, so should the mode of code<T> be used when storing?

whyfate avatar Apr 20 '23 01:04 whyfate