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

Feature/reject multiple #388

Merged
merged 3 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- IsIdentifiable Reviewer 'Symbols' rule factory now supports digits only or characters only mode (e.g. use `\d` for digits but leave characters verbatim)
- IsIdentifiable Reviewer 'symbols' option when building Regex now builds capture groups and matches only the failing parts of the input string not the full ProblemValue. For example `MR Head 12-11-20` would return `(\d\d-\d\d-\d\d)$`
- Added caching of values looked up in NLP/rulesbase for IsIdentifiable tool
- Added new rejector that throws out patients whose IDs are stored in a database table. Set `RejectPatientsIn` option in yaml to enable this
- Added new rejector that throws out values (e.g. patient IDs) whose IDs are stored in a database table. Set `RejectColumnInfos` option in yaml to enable this

## [1.11.1] - 2020-08-12

Expand Down
13 changes: 5 additions & 8 deletions data/microserviceConfigs/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,14 @@ CohortExtractorOptions:
QoSPrefetchCount: 10000
AutoAck: false
AllCatalogues: true
OnlyCatalogues: [1,2,3]

# Set this to the ID of a ColumnInfo that contains patient IDs you want forbidden
#RejectPatientsIn: 1234

# List of IDs of Catalogues to extract from (in ascending order).
# Ignored if "AllCatalogues == true"
# - 2
# - 4
# - 5
# also doable on a single line with [2,4,5] :)
OnlyCatalogues: [1,2,3]

# ID(s) of ColumnInfo that contains a list of values which should not have data extracted for them. e.g. opt out. The name of the column referenced must match a column in the extraction table
#RejectColumnInfos: [105,110]

AuditorType: 'Microservices.CohortExtractor.Audit.NullAuditExtractions'
RequestFulfillerType: 'Microservices.CohortExtractor.Execution.RequestFulfillers.FromCataloguesExtractionRequestFulfiller'
ProjectPathResolverType: 'Microservices.CohortExtractor.Execution.ProjectPathResolvers.DefaultProjectPathResolver'
Expand Down
4 changes: 2 additions & 2 deletions src/common/Smi.Common/Options/GlobalOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ public string AuditorType
public ProducerOptions ExtractFilesInfoProducerOptions { get; set; }

/// <summary>
/// ID of a ColumnInfo that contains a list of patients who should not have data extracted for them. e.g. opt out
/// ID(s) of ColumnInfo that contains a list of values which should not have data extracted for them. e.g. opt out. The name of the column referenced must match a column in the extraction table
/// </summary>
public int? RejectPatientsIn { get; set; }
public List<int> RejectColumnInfos { get; set; }

public override string ToString()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ private void InitializeExtractionSources(IRDMPPlatformRepositoryServiceLocator r
if(!string.IsNullOrWhiteSpace(_consumerOptions.RejectorType))
_fulfiller.Rejectors.Add(ObjectFactory.CreateInstance<IRejector>(_consumerOptions.RejectorType,typeof(IRejector).Assembly));

if(_consumerOptions.RejectPatientsIn.HasValue)
_fulfiller.Rejectors.Add(new ColumnInfoValuesRejector(repositoryLocator.CatalogueRepository.GetObjectByID<ColumnInfo>(_consumerOptions.RejectPatientsIn.Value)));
if(_consumerOptions.RejectColumnInfos != null)
foreach(var id in _consumerOptions.RejectColumnInfos)
_fulfiller.Rejectors.Add(new ColumnInfoValuesRejector(repositoryLocator.CatalogueRepository.GetObjectByID<ColumnInfo>(id)));

if(_consumerOptions.Blacklists != null)
foreach (int id in _consumerOptions.Blacklists)
Expand Down