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

Add a new filter - splitDataBySegments #344

Merged

Conversation

yankunhuang-pku
Copy link
Contributor

No description provided.

var result = new Hl7v2Data();
var segmentIds = segmentIdSeparators.Split(@"|", StringSplitOptions.RemoveEmptyEntries);

if (segmentIdSeparators == string.Empty || segmentIds.Intersect(hl7v2Data.Meta).ToList().Count == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use .any() instead of .count==0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it.


for (var i = 0; i < hl7v2Data.Meta.Count; ++i)
{
if (segmentIds.Contains(hl7v2Data.Meta[i]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to use hashset instead of array of string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it. It would be better.

@yankunhuang-pku yankunhuang-pku merged commit fc949c7 into dotliquid Dec 21, 2021
@yankunhuang-pku yankunhuang-pku deleted the personal/yankhuan/add-filter-splitDataBySegments branch December 21, 2021 07:19
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

Successfully merging this pull request may close these issues.

3 participants