/// <summary> /// This code uses the RXNORM code plus the provider to remove duplication /// </summary> private void RemoveDuplicatesByCodeAndProvider() { for (int i = _medicationRule1Entries.Count - 1; i > -1; i--) { if (_medicationRule1Entries.Count(x => x.Code == _medicationRule1Entries[i].Code && x.CodeSystem == _medicationRule1Entries[i].CodeSystem && x.Provider == _medicationRule1Entries[i].Provider) == 1 || _medicationRule1Entries[i].Code == "") { continue; } var xcount = _medicationRule1Entries.Count(x => x.Code == _medicationRule1Entries[i].Code && x.CodeSystem == _medicationRule1Entries[i].CodeSystem && x.Provider == _medicationRule1Entries[i].Provider); Discarded.Add(_medicationRule1Entries[i].Element); _medicationRule1Entries.RemoveAt(i); medicationDedupCount++;// counting overall number of deduplation } }
public void Discard(Card card) { Hand.Remove(card); Discarded.Add(card); }