Skip to content

Commit

Permalink
Added Concept Set criteria attributes to editor and viewer.
Browse files Browse the repository at this point in the history
Performed additional cleanup of unused dependencies or formatting.
  • Loading branch information
chrisknoll committed Jan 23, 2025
1 parent d6c7c27 commit da8dedc
Show file tree
Hide file tree
Showing 85 changed files with 2,236 additions and 388 deletions.
2 changes: 1 addition & 1 deletion js/components/cohortbuilder/CriteriaGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ define(function (require, exports, module) {

if (data.DemographicCriteriaList && data.DemographicCriteriaList.length > 0) {
data.DemographicCriteriaList.forEach(function (d) {
self.DemographicCriteriaList.push(new DemographicCriteria(d));
self.DemographicCriteriaList.push(new DemographicCriteria(d, conceptSets));
});
}

Expand Down
5 changes: 3 additions & 2 deletions js/components/cohortbuilder/CriteriaTypes/ConditionEra.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['knockout', './Criteria', '../InputTypes/Range', 'conceptpicker/InputTypes/Concept'], function (ko, Criteria, Range, Concept) {
define(['knockout', './Criteria', '../InputTypes/Range', 'conceptpicker/InputTypes/Concept', '../InputTypes/ConceptSetSelection'], function (ko, Criteria, Range, Concept, ConceptSetSelection) {

function ConditionEra(data, conceptSets) {
var self = this;
Expand All @@ -20,7 +20,6 @@ define(['knockout', './Criteria', '../InputTypes/Range', 'conceptpicker/InputTyp

// Verbatim fields
self.CodesetId = ko.observable(data.CodesetId);
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

self.EraStartDate = ko.observable(data.EraStartDate && new Range(data.EraStartDate));
self.EraEndDate = ko.observable(data.EraEndDate && new Range(data.EraEndDate));
Expand All @@ -36,6 +35,8 @@ define(['knockout', './Criteria', '../InputTypes/Range', 'conceptpicker/InputTyp
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

}

ConditionEra.prototype = new Criteria();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text'], function (ko, Criteria, Range, Concept, Text) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text', '../InputTypes/ConceptSetSelection'
], function (ko, Criteria, Range, Concept, Text,ConceptSetSelection) {

function ConditionOccurrence(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -29,11 +30,14 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
return new Concept(d);
})));
self.ConditionTypeExclude = ko.observable(data.ConditionTypeExclude || null);
self.ConditionTypeCS = ko.observable(data.ConditionTypeCS && new ConceptSetSelection(data.ConditionTypeCS, conceptSets));

self.StopReason = ko.observable(data.StopReason && new Text(data.StopReason));
self.ConditionSourceConcept = ko.observable(data.ConditionSourceConcept != null ? ko.observable(data.ConditionSourceConcept) : null);
self.ConditionStatus = ko.observable(data.ConditionStatus && ko.observableArray(data.ConditionStatus.map(function (d) {
return new Concept(d);
})));
self.ConditionStatusCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.ConditionStatusCS, conceptSets));

// Derived Fields
self.First = ko.observable(data.First || null);
Expand All @@ -43,14 +47,17 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

self.ProviderSpecialty = ko.observable(data.ProviderSpecialty && ko.observableArray(data.ProviderSpecialty.map(function (d) {
return new Concept(d);
})));
self.ProviderSpecialtyCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.ProviderSpecialtyCS, conceptSets));

self.VisitType = ko.observable(data.VisitType && ko.observableArray(data.VisitType.map(function (d) {
return new Concept(d);
})));
self.VisitTypeCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.VisitTypeCS, conceptSets));

}

Expand Down
10 changes: 5 additions & 5 deletions js/components/cohortbuilder/CriteriaTypes/Death.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text'], function (ko, Criteria, Range, Concept, Text) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/ConceptSetSelection'],
function (ko, Criteria, Range, Concept, ConceptSetSelection) {

function Death(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -28,6 +29,8 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
return new Concept(d);
})));
self.DeathTypeExclude = ko.observable(data.DeathTypeExclude || null);
self.DeathTypeCS = ko.observable(data.DeathTypeCS && new ConceptSetSelection(data.DeathTypeCS, conceptSets));

self.DeathSourceConcept = ko.observable(data.DeathSourceConcept != null ? ko.observable(data.DeathSourceConcept) : null);
// Derived Fields
self.Age = ko.observable(data.Age && new Range(data.Age));
Expand All @@ -36,11 +39,8 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

/* Do we still need prior enroll days inside the individual criteria?
self.PriorEnrollDays = ko.observable((typeof data.PriorEnrollDays == "number") ? data.PriorEnrollDays : null);
self.AfterEnrollDays = ko.observable((typeof data.AfterEnrollDays == "number") ? data.AfterEnrollDays : null);
*/
}

Death.prototype = new Criteria();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['knockout', '../InputTypes/Range', 'conceptpicker/InputTypes/Concept'], function (ko, Range, Concept) {
define(['knockout', '../InputTypes/Range', 'conceptpicker/InputTypes/Concept', '../InputTypes/ConceptSetSelection'], function (ko, Range, Concept, ConceptSetSelection) {

function DemographicCriteria(data, conceptSets) {
var self = this;
Expand All @@ -9,14 +9,17 @@ define(['knockout', '../InputTypes/Range', 'conceptpicker/InputTypes/Concept'],
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

self.Race = ko.observable(data.Race && ko.observableArray(data.Race.map(function (d) {
return new Concept(d);
})));
self.RaceCS = ko.observable(data.RaceCS && new ConceptSetSelection(data.RaceCS, conceptSets));

self.Ethnicity = ko.observable(data.Ethnicity && ko.observableArray(data.Ethnicity.map(function (d) {
return new Concept(d);
})));
self.EthnicityCS = ko.observable(data.EthnicityCS && new ConceptSetSelection(data.EthnicityCS, conceptSets));


self.OccurrenceStartDate = ko.observable(data.OccurrenceStartDate && new Range(data.OccurrenceStartDate));
Expand Down
13 changes: 7 additions & 6 deletions js/components/cohortbuilder/CriteriaTypes/DeviceExposure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text'], function (ko, Criteria, Range, Concept, Text) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text', '../InputTypes/ConceptSetSelection'], function (ko, Criteria, Range, Concept, Text, ConceptSetSelection) {

function DeviceOccurence(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -29,6 +29,8 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
return new Concept(d);
})));
self.DeviceTypeExclude = ko.observable(data.DeviceTypeExclude || null);
self.DeviceTypeCS = ko.observable(data.DeviceTypeCS && new ConceptSetSelection(data.DeviceTypeCS, conceptSets));

self.UniqueDeviceId = ko.observable(data.UniqueDeviceId && new Text(data.StopReason));
self.Quantity = ko.observable(data.Quantity && new Range(data.Quantity));
self.DeviceSourceConcept = ko.observable(data.DeviceSourceConcept != null ? ko.observable(data.DeviceSourceConcept) : null);
Expand All @@ -41,18 +43,17 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

/* Do we still need prior enroll days inside the individual criteria?
self.PriorEnrollDays = ko.observable((typeof data.PriorEnrollDays == "number") ? data.PriorEnrollDays : null);
self.AfterEnrollDays = ko.observable((typeof data.AfterEnrollDays == "number") ? data.AfterEnrollDays : null);
*/

self.ProviderSpecialty = ko.observable(data.ProviderSpecialty && ko.observableArray(data.ProviderSpecialty.map(function (d) {
return new Concept(d);
})));
self.ProviderSpecialtyCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

self.VisitType = ko.observable(data.VisitType && ko.observableArray(data.VisitType.map(function (d) {
return new Concept(d);
})));
self.VisitTypeCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.VisitTypeCS, conceptSets));

}

Expand Down
6 changes: 5 additions & 1 deletion js/components/cohortbuilder/CriteriaTypes/DoseEra.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept'], function (ko, Criteria, Range, Concept) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/ConceptSetSelection'], function (ko, Criteria, Range, Concept, ConceptSetSelection) {

function DoseEra(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -26,6 +26,8 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Unit = ko.observable(data.Unit && ko.observableArray(data.Unit.map(function (d) {
return new Concept(d);
})));
self.UnitCS = ko.observable(data.UnitCS && new ConceptSetSelection(data.UnitCS, conceptSets));

self.DoseValue = ko.observable(data.DoseValue && new Range(data.DoseValue));
self.EraLength = ko.observable(data.EraLength && new Range(data.EraLength));

Expand All @@ -38,6 +40,8 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

}

DoseEra.prototype = new Criteria();
Expand Down
3 changes: 2 additions & 1 deletion js/components/cohortbuilder/CriteriaTypes/DrugEra.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept'], function (ko, Criteria, Range, Concept) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/ConceptSetSelection'], function (ko, Criteria, Range, Concept, ConceptSetSelection) {

function DrugEra(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -36,6 +36,7 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));
}

DrugEra.prototype = new Criteria();
Expand Down
15 changes: 9 additions & 6 deletions js/components/cohortbuilder/CriteriaTypes/DrugExposure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text'], function (ko, Criteria, Range, Concept, Text) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text','../InputTypes/ConceptSetSelection'
], function (ko, Criteria, Range, Concept, Text, ConceptSetSelection) {

function DrugExposure(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -29,17 +30,20 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
return new Concept(d);
})));
self.DrugTypeExclude = ko.observable(data.DrugTypeExclude || null);
self.DrugTypeCS = ko.observable(data.DrugTypeCS && new ConceptSetSelection(data.DrugTypeCS, conceptSets));
self.StopReason = ko.observable(data.StopReason && new Text(data.StopReason));
self.Refills = ko.observable(data.Refills && new Range(data.Refills));
self.Quantity = ko.observable(data.Quantity && new Range(data.Quantity));
self.DaysSupply = ko.observable(data.DaysSupply && new Range(data.DaysSupply));
self.RouteConcept = ko.observable(data.RouteConcept && ko.observableArray(data.RouteConcept.map(function (d) {
return new Concept(d);
})));
self.RouteConceptCS = ko.observable(data.RouteConceptCS && new ConceptSetSelection(data.RouteConceptCS, conceptSets));
self.EffectiveDrugDose = ko.observable(data.EffectiveDrugDose && new Range(data.EffectiveDrugDose));
self.DoseUnit = ko.observable(data.DoseUnit && ko.observableArray(data.DoseUnit.map(function (d) {
return new Concept(d);
})));
self.DoseUnitCS = ko.observable(data.DoseUnitCS && new ConceptSetSelection(data.DoseUnitCS, conceptSets));
self.LotNumber = ko.observable(data.LotNumber && new Text(data.LotNumber));
self.DrugSourceConcept = ko.observable(data.DrugSourceConcept != null ? ko.observable(data.DrugSourceConcept) : null);

Expand All @@ -51,18 +55,17 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

/* Do we still need prior enroll days inside the individual criteria?
self.PriorEnrollDays = ko.observable((typeof data.PriorEnrollDays == "number") ? data.PriorEnrollDays : null);
self.AfterEnrollDays = ko.observable((typeof data.AfterEnrollDays == "number") ? data.AfterEnrollDays : null);
*/

self.ProviderSpecialty = ko.observable(data.ProviderSpecialty && ko.observableArray(data.ProviderSpecialty.map(function (d) {
return new Concept(d);
})));
self.ProviderSpecialtyCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.ProviderSpecialtyCS, conceptSets));

self.VisitType = ko.observable(data.VisitType && ko.observableArray(data.VisitType.map(function (d) {
return new Concept(d);
})));
self.VisitTypeCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.VisitTypeCS, conceptSets));

}

Expand Down
16 changes: 10 additions & 6 deletions js/components/cohortbuilder/CriteriaTypes/Measurement.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/Text'], function (ko, Criteria, Range, Concept, Text) {
define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputTypes/Concept', '../InputTypes/ConceptSetSelection'
], function (ko, Criteria, Range, Concept, ConceptSetSelection) {

function Measurement(data, conceptSets) {
var self = this;
Expand Down Expand Up @@ -28,16 +29,20 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
return new Concept(d);
})));
self.MeasurementTypeExclude = ko.observable(data.MeasurementTypeExclude || null);
self.MeasurementTypeCS = ko.observable(data.MeasurementTypeCS && new ConceptSetSelection(data.MeasurementTypeCS, conceptSets));
self.Operator = ko.observable(data.Operator && ko.observableArray(data.Operator.map(function (d) {
return new Concept(d);
})));
self.OperatorCS = ko.observable(data.OperatorCS && new ConceptSetSelection(data.OperatorCS, conceptSets));
self.ValueAsNumber = ko.observable(data.ValueAsNumber && new Range(data.ValueAsNumber));
self.ValueAsConcept = ko.observable(data.ValueAsConcept && ko.observableArray(data.ValueAsConcept.map(function (d) {
return new Concept(d);
})));
self.ValueAsConceptCS = ko.observable(data.ValueAsConceptCS && new ConceptSetSelection(data.ValueAsConceptCS, conceptSets));
self.Unit = ko.observable(data.Unit && ko.observableArray(data.Unit.map(function (d) {
return new Concept(d);
})));
self.UnitCS = ko.observable(data.UnitCS && new ConceptSetSelection(data.UnitCS, conceptSets));
self.RangeLow = ko.observable(data.RangeLow && new Range(data.RangeLow));
self.RangeHigh = ko.observable(data.RangeHigh && new Range(data.RangeHigh));
self.MeasurementSourceConcept = ko.observable(data.MeasurementSourceConcept != null ? ko.observable(data.MeasurementSourceConcept) : null);
Expand All @@ -52,18 +57,17 @@ define(['knockout', './Criteria', '../InputTypes/Range','conceptpicker/InputType
self.Gender = ko.observable(data.Gender && ko.observableArray(data.Gender.map(function (d) {
return new Concept(d);
})));
self.GenderCS = ko.observable(data.GenderCS && new ConceptSetSelection(data.GenderCS, conceptSets));

/* Do we still need prior enroll days inside the individual criteria?
self.PriorEnrollDays = ko.observable((typeof data.PriorEnrollDays == "number") ? data.PriorEnrollDays : null);
self.AfterEnrollDays = ko.observable((typeof data.AfterEnrollDays == "number") ? data.AfterEnrollDays : null);
*/

self.ProviderSpecialty = ko.observable(data.ProviderSpecialty && ko.observableArray(data.ProviderSpecialty.map(function (d) {
return new Concept(d);
})));
self.ProviderSpecialtyCS = ko.observable(data.ProviderSpecialtyCS && new ConceptSetSelection(data.ProviderSpecialtyCS, conceptSets));

self.VisitType = ko.observable(data.VisitType && ko.observableArray(data.VisitType.map(function (d) {
return new Concept(d);
})));
self.VisitTypeCS = ko.observable(data.VisitTypeCS && new ConceptSetSelection(data.VisitTypeCS, conceptSets));

}

Expand Down
Loading

0 comments on commit da8dedc

Please sign in to comment.