Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the storage of query parameter Code<T>. #551

Open
whyfate opened this issue Apr 18, 2023 · 2 comments
Open

Regarding the storage of query parameter Code<T>. #551

whyfate opened this issue Apr 18, 2023 · 2 comments

Comments

@whyfate
Copy link
Contributor

whyfate commented Apr 18, 2023

private List<Expression> ToExpressions(Code element)
{
return element != null ? ListOf(new StringValue(element.Value)) : null;
}

private List<Expression> ToExpressions<T>(Code<T> element) where T : struct, Enum
{
if (element != null && element.Value.HasValue)
{
var values = new List<IndexValue>
{
new IndexValue("code", new StringValue(_fhirModel.GetLiteralForEnum((element.Value.Value as Enum))))
};
return ListOf(new CompositeValue(values));
}
return null;
}

Why is the storage design different between Code and Code<T>?

@kennethmyhra
Copy link
Collaborator

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.

@whyfate
Copy link
Contributor Author

whyfate commented Apr 20, 2023

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 are both token types, so should the mode of code be used when storing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants