-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from OHDSI/observation-period-added-definition
Observation period added definition
- Loading branch information
Showing
13 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...amework/org.ohdsi.cdm.framework.etl/Transformation/CDM/Definitions/Observation_period.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<QueryDefinition> | ||
<Query> | ||
SELECT distinct | ||
op.observation_period_id, | ||
op.person_id, | ||
op.observation_period_start_date, | ||
op.observation_period_end_date, | ||
op.period_type_concept_id | ||
FROM {sc}.observation_period op | ||
JOIN {ch_sc}._chunks ch ON ch.ChunkId = {0} AND op.PERSON_ID = ch.PERSON_ID | ||
order by 1 | ||
</Query> | ||
<ObservationPeriods> | ||
<ObservationPeriodDefinition> | ||
<Id>observation_period_id</Id> | ||
<PersonId>person_id</PersonId> | ||
<StartDate>observation_period_start_date</StartDate> | ||
<EndDate>observation_period_end_date</EndDate> | ||
<TypeConceptId>period_type_concept_id</TypeConceptId> | ||
</ObservationPeriodDefinition> | ||
</ObservationPeriods> | ||
</QueryDefinition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
sources/Framework/org.ohdsi.cdm.framework/Common/Definitions/ObservationPeriodDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using org.ohdsi.cdm.framework.common.Builder; | ||
using org.ohdsi.cdm.framework.common.Extensions; | ||
using org.ohdsi.cdm.framework.common.Omop; | ||
using System.Data; | ||
|
||
namespace org.ohdsi.cdm.framework.common.Definitions | ||
{ | ||
public class ObservationPeriodDefinition : EntityDefinition | ||
{ | ||
public string TypeConceptId { get; set; } | ||
|
||
public IEnumerable<EraEntity> GetObservationPeriods(Concept concept, IDataRecord reader, | ||
KeyMasterOffsetManager offset) | ||
{ | ||
yield return new EraEntity | ||
{ | ||
Id = reader.GetLong(Id) ?? 0, | ||
PersonId = reader.GetLong(PersonId) ?? 0, | ||
TypeConceptId = reader.GetLong(TypeConceptId) ?? 0, | ||
StartDate = reader.GetDateTime(StartDate), | ||
EndDate = reader.GetDateTime(EndDate), | ||
}; | ||
} | ||
|
||
public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataRecord reader, KeyMasterOffsetManager offset) | ||
{ | ||
throw new NotImplementedException("ObservationPeriodDefinition.GetConcepts()"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters