repo stringclasses 1k
values | file_url stringlengths 96 373 | file_path stringlengths 11 294 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 6
values | commit_sha stringclasses 1k
values | retrieved_at stringdate 2026-01-04 14:45:56 2026-01-04 18:30:23 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/check/validator/criteria/CriteriaGroupValidator.java | src/main/java/org/ohdsi/webapi/check/validator/criteria/CriteriaGroupValidator.java | package org.ohdsi.webapi.check.validator.criteria;
import org.ohdsi.circe.cohortdefinition.CriteriaGroup;
import org.ohdsi.webapi.check.validator.Context;
import org.ohdsi.webapi.check.validator.Path;
import org.ohdsi.webapi.check.warning.WarningSeverity;
import java.util.Objects;
public class CriteriaGroupValidator<T extends CriteriaGroup> extends AbstractCriteriaValidator<T> {
public CriteriaGroupValidator(Path path, WarningSeverity severity, String errorMessage) {
super(path, severity, errorMessage);
}
@Override
public boolean validate(T value, Context context) {
boolean result = true;
if (Objects.nonNull(value.demographicCriteriaList)) {
result = getDemographicCriteriaValidator().validate(value, context) && result;
}
if (Objects.nonNull(value.groups)) {
result = getCriteriaGroupArrayValidator().validate(value, context) && result;
}
if (Objects.nonNull(value.criteriaList)) {
result = getCorelatedCriteriaValidator().validate(value, context) && result;
}
return result;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/check/validator/criteria/CorelatedCriteriaValidator.java | src/main/java/org/ohdsi/webapi/check/validator/criteria/CorelatedCriteriaValidator.java | package org.ohdsi.webapi.check.validator.criteria;
import org.ohdsi.circe.cohortdefinition.CorelatedCriteria;
import org.ohdsi.webapi.check.validator.Context;
import org.ohdsi.webapi.check.validator.Path;
import org.ohdsi.webapi.check.warning.WarningSeverity;
import java.util.Objects;
public class CorelatedCriteriaValidator<T extends CorelatedCriteria> extends AbstractCriteriaValidator<T> {
public CorelatedCriteriaValidator(Path path, WarningSeverity severity, String errorMessage) {
super(path, severity, errorMessage);
}
@Override
public boolean validate(T value, Context context) {
boolean result = true;
if (Objects.nonNull(value.criteria)) {
result = getCriteriaValidator().validate(value, context) && result;
}
return result;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/check/validator/criteria/CriteriaValidator.java | src/main/java/org/ohdsi/webapi/check/validator/criteria/CriteriaValidator.java | package org.ohdsi.webapi.check.validator.criteria;
import org.ohdsi.circe.cohortdefinition.Criteria;
import org.ohdsi.webapi.check.validator.Context;
import org.ohdsi.webapi.check.validator.Path;
import org.ohdsi.webapi.check.warning.WarningSeverity;
import java.util.Objects;
public class CriteriaValidator<T extends Criteria> extends AbstractCriteriaValidator<T> {
public CriteriaValidator(Path path, WarningSeverity severity, String errorMessage) {
super(path, severity, errorMessage);
}
@Override
public boolean validate(T value, Context context) {
boolean result = true;
if (Objects.nonNull(value.CorrelatedCriteria)) {
result = getCriteriaGroupValidator().validate(value, context) && result;
}
return result;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/check/validator/conceptset/ConceptSetSelectionValidator.java | src/main/java/org/ohdsi/webapi/check/validator/conceptset/ConceptSetSelectionValidator.java | package org.ohdsi.webapi.check.validator.conceptset;
import org.ohdsi.circe.cohortdefinition.ConceptSetSelection;
import org.ohdsi.circe.vocabulary.Concept;
import org.ohdsi.webapi.check.validator.Context;
import org.ohdsi.webapi.check.validator.Path;
import org.ohdsi.webapi.check.validator.Validator;
import org.ohdsi.webapi.check.warning.WarningSeverity;
import java.util.Objects;
public class ConceptSetSelectionValidator<T extends ConceptSetSelection> extends Validator<T> {
private static final String EMPTY = "empty";
public ConceptSetSelectionValidator(Path path, WarningSeverity severity, String errorMessage) {
super(path, severity, errorMessage);
}
@Override
public boolean validate(T value, Context context) {
boolean isValid = true;
if (Objects.nonNull(value) && Objects.isNull(value.codesetId)) {
context.addWarning(getSeverity(), getErrorMessage(value), path);
isValid = false;
}
return isValid;
}
protected String getDefaultErrorMessage() {
return EMPTY;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/check/validator/tag/MandatoryTagValidator.java | src/main/java/org/ohdsi/webapi/check/validator/tag/MandatoryTagValidator.java | package org.ohdsi.webapi.check.validator.tag;
import org.ohdsi.webapi.check.validator.Context;
import org.ohdsi.webapi.check.validator.Path;
import org.ohdsi.webapi.check.validator.Validator;
import org.ohdsi.webapi.check.warning.WarningSeverity;
import org.ohdsi.webapi.tag.TagService;
import org.ohdsi.webapi.tag.domain.Tag;
import org.ohdsi.webapi.tag.dto.TagDTO;
import org.ohdsi.webapi.tag.repository.TagRepository;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
public class MandatoryTagValidator<T extends Collection<? extends TagDTO>> extends Validator<T> {
private static final String INVALID = "no assigned tags from mandatory groups %s";
private final TagService tagService;
public MandatoryTagValidator(Path path, WarningSeverity severity, String errorMessage,
TagService tagService) {
super(path, severity, errorMessage);
this.tagService = tagService;
}
@Override
public boolean validate(T value, Context context) {
boolean isValid = true;
if (Objects.nonNull(value)) {
Set<Integer> groupIds = new HashSet<>();
value.forEach(tagDTO -> {
Set<Integer> ids = tagService.getAllGroupsForTag(tagDTO.getId());
groupIds.addAll(ids);
});
List<Tag> mandatoryTags = tagService.findMandatoryTags();
List<Tag> absentTags = mandatoryTags.stream()
.filter(t -> !groupIds.contains(t.getId()))
.collect(Collectors.toList());
isValid = absentTags.size() == 0;
if (!isValid) {
String absentTagNames = absentTags.stream()
.map(Tag::getName)
.collect(Collectors.joining("], [", "[", "]"));
context.addWarning(getSeverity(), getErrorMessage(value, absentTagNames), path);
}
} else {
isValid = tagService.findMandatoryTags().size() == 0;
}
return isValid;
}
@Override
protected String getDefaultErrorMessage() {
return INVALID;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/converter/BaseConversionServiceAwareConverter.java | src/main/java/org/ohdsi/webapi/converter/BaseConversionServiceAwareConverter.java |
package org.ohdsi.webapi.converter;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.support.GenericConversionService;
public abstract class BaseConversionServiceAwareConverter<From, To> implements Converter<From, To>, InitializingBean {
protected To createResultObject() {
return null;
}
protected To createResultObject(From from) {
return createResultObject();
}
@Autowired
protected GenericConversionService conversionService;
@Override
public void afterPropertiesSet() throws Exception {
conversionService.addConverter(this);
}
protected void proceedAdditionalFields(To to, final From from) {}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IRExecutionInfoRepository.java | src/main/java/org/ohdsi/webapi/ircalc/IRExecutionInfoRepository.java | package org.ohdsi.webapi.ircalc;
import org.ohdsi.webapi.GenerationStatus;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface IRExecutionInfoRepository extends CrudRepository<ExecutionInfo, ExecutionInfoId> {
List<ExecutionInfo> findByStatus(GenerationStatus status);
List<ExecutionInfo> findByStatusIn(List<GenerationStatus> statuses);
@Query("SELECT ei FROM IRAnalysisGenerationInfo ei JOIN Source s ON s.id = ei.source.id AND s.deletedDate IS NULL WHERE ei.analysis.id = :analysisId")
List<ExecutionInfo> findByAnalysisId(@Param("analysisId") Integer analysisId);
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisRepository.java | src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisRepository.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph;
import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphCrudRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Optional;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public interface IncidenceRateAnalysisRepository extends EntityGraphCrudRepository<IncidenceRateAnalysis, Integer> {
@Query("SELECT ira FROM IncidenceRateAnalysis AS ira LEFT JOIN FETCH ira.details AS d")
Iterable<IncidenceRateAnalysis> findAll();
@Query("SELECT ira FROM IncidenceRateAnalysis AS ira LEFT JOIN ira.executionInfoList e LEFT JOIN Source s ON s.id = e.source.id AND s.deletedDate = NULL WHERE ira.id = ?1")
IncidenceRateAnalysis findOneWithExecutionsOnExistingSources(int id, EntityGraph entityGraph);
@Query("SELECT COUNT(ira) FROM IncidenceRateAnalysis ira WHERE ira.name = :name and ira.id <> :id")
int getCountIRWithSameName(@Param("id") Integer id, @Param("name") String name);
@Query("SELECT ira FROM IncidenceRateAnalysis ira WHERE ira.name LIKE ?1 ESCAPE '\\'")
List<IncidenceRateAnalysis> findAllByNameStartsWith(String pattern);
Optional<IncidenceRateAnalysis> findByName(String name);
@Query("SELECT DISTINCT ira FROM IncidenceRateAnalysis ira JOIN FETCH ira.tags t WHERE lower(t.name) in :tagNames")
List<IncidenceRateAnalysis> findByTags(@Param("tagNames") List<String> tagNames);
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IRAnalysisTasklet.java | src/main/java/org/ohdsi/webapi/ircalc/IRAnalysisTasklet.java | /*
* Copyright 2015 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import com.odysseusinc.arachne.commons.types.DBMSType;
import org.ohdsi.sql.SqlSplit;
import org.ohdsi.sql.SqlTranslate;
import org.ohdsi.webapi.common.generation.CancelableTasklet;
import org.ohdsi.webapi.source.SourceService;
import org.ohdsi.webapi.source.Source;
import org.ohdsi.webapi.util.CancelableJdbcTemplate;
import org.ohdsi.webapi.util.PreparedStatementRenderer;
import org.ohdsi.webapi.util.SourceUtils;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.transaction.support.TransactionTemplate;
import java.util.*;
import static org.ohdsi.webapi.Constants.Params.*;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class IRAnalysisTasklet extends CancelableTasklet {
private final IRAnalysisQueryBuilder analysisQueryBuilder;
private final IncidenceRateAnalysisRepository incidenceRateAnalysisRepository;
private final SourceService sourceService;
private final ObjectMapper objectMapper;
public IRAnalysisTasklet(
final CancelableJdbcTemplate jdbcTemplate,
final TransactionTemplate transactionTemplate,
final IncidenceRateAnalysisRepository incidenceRateAnalysisRepository,
final SourceService sourceService,
final IRAnalysisQueryBuilder analysisQueryBuilder,
final ObjectMapper objectMapper) {
super(LoggerFactory.getLogger(IRAnalysisTasklet.class), jdbcTemplate, transactionTemplate);
this.incidenceRateAnalysisRepository = incidenceRateAnalysisRepository;
this.sourceService = sourceService;
this.analysisQueryBuilder = analysisQueryBuilder;
this.objectMapper = objectMapper;
}
protected String[] prepareQueries(ChunkContext chunkContext, CancelableJdbcTemplate jdbcTemplate) {
Map<String, Object> jobParams = chunkContext.getStepContext().getJobParameters();
Integer sourceId = Integer.parseInt(jobParams.get(SOURCE_ID).toString());
Source source = sourceService.findBySourceId(sourceId);
String oracleTempSchema = SourceUtils.getTempQualifier(source);
Integer analysisId = Integer.valueOf(jobParams.get(ANALYSIS_ID).toString());
String sessionId = jobParams.get(SESSION_ID).toString();
try {
IncidenceRateAnalysis analysis = this.incidenceRateAnalysisRepository.findOne(analysisId);
IncidenceRateAnalysisExpression expression = objectMapper.readValue(analysis.getDetails().getExpression(), IncidenceRateAnalysisExpression.class);
IRAnalysisQueryBuilder.BuildExpressionQueryOptions options = new IRAnalysisQueryBuilder.BuildExpressionQueryOptions();
options.cdmSchema = SourceUtils.getCdmQualifier(source);
options.resultsSchema = SourceUtils.getResultsQualifier(source);
options.vocabularySchema = SourceUtils.getVocabularyQualifier(source);
options.tempSchema = SourceUtils.getTempQualifier(source);
options.cohortTable = jobParams.get(TARGET_TABLE).toString();
String delete = "DELETE FROM @tableQualifier.ir_strata WHERE analysis_id = @analysis_id;";
PreparedStatementRenderer psr = new PreparedStatementRenderer(source, delete, "tableQualifier",
options.resultsSchema, "analysis_id", analysisId);
jdbcTemplate.update(psr.getSql(), psr.getSetter());
String insert = "INSERT INTO @results_schema.ir_strata (analysis_id, strata_sequence, name, description) VALUES (@analysis_id,@strata_sequence,@name,@description)";
String [] params = {"analysis_id", "strata_sequence", "name", "description"};
List<StratifyRule> strataRules = expression.strata;
for (int i = 0; i< strataRules.size(); i++)
{
StratifyRule r = strataRules.get(i);
psr = new PreparedStatementRenderer(source, insert, "results_schema",
options.resultsSchema, params, new Object[] { analysisId, i, r.name, r.description});
jdbcTemplate.update(psr.getSql(), psr.getSetter());
}
String expressionSql = analysisQueryBuilder.buildAnalysisQuery(analysis, options);
String translatedSql = SqlTranslate.translateSql(expressionSql, source.getSourceDialect(), sessionId, oracleTempSchema);
return SqlSplit.splitSql(translatedSql);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} | java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysis.java | src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysis.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.ohdsi.webapi.model.CommonEntity;
import org.ohdsi.webapi.model.CommonEntityExt;
import org.ohdsi.webapi.tag.domain.Tag;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
@Entity(name = "IncidenceRateAnalysis")
@Table(name="ir_analysis")
@NamedEntityGraphs({
@NamedEntityGraph(
name = "IncidenceRateAnalysis.withExecutionInfoList",
attributeNodes = @NamedAttributeNode("executionInfoList")
)
})
public class IncidenceRateAnalysis extends CommonEntityExt<Integer> implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GenericGenerator(
name = "ir_analysis_generator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {
@Parameter(name = "sequence_name", value = "ir_analysis_sequence"),
@Parameter(name = "increment_size", value = "1")
}
)
@GeneratedValue(generator = "ir_analysis_generator")
@Column(name="id")
@Access(AccessType.PROPERTY)
private Integer id;
@Column(name="name")
private String name;
@Column(name="description")
private String description;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional=true, orphanRemoval = true, mappedBy="analysis")
@JoinColumn(name="id")
private IncidenceRateAnalysisDetails details;
@OneToMany(fetch= FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "analysis", orphanRemoval=true)
private Set<ExecutionInfo> executionInfoList = new HashSet<>();
@ManyToMany(targetEntity = Tag.class, fetch = FetchType.LAZY)
@JoinTable(name = "ir_tag",
joinColumns = @JoinColumn(name = "asset_id", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name = "tag_id", referencedColumnName = "id"))
private Set<Tag> tags;
@Override
public Integer getId() {
return id;
}
public IncidenceRateAnalysis setId(Integer id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public IncidenceRateAnalysis setName(String name) {
this.name = name;
return this;
}
public String getDescription() {
return description;
}
public IncidenceRateAnalysis setDescription(String description) {
this.description = description;
return this;
}
public IncidenceRateAnalysisDetails getDetails() {
return details;
}
public IncidenceRateAnalysis setDetails(IncidenceRateAnalysisDetails details) {
this.details = details;
return this;
}
public Set<ExecutionInfo> getExecutionInfoList() {
return executionInfoList;
}
public IncidenceRateAnalysis setExecutionInfoList(Set<ExecutionInfo> executionInfoList) {
this.executionInfoList = executionInfoList;
return this;
}
@Override
public Set<Tag> getTags() {
return tags;
}
@Override
public void setTags(Set<Tag> tags) {
this.tags = tags;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisExpression.java | src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisExpression.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.ohdsi.circe.cohortdefinition.ConceptSet;
import org.ohdsi.webapi.cohortdefinition.dto.CohortDTO;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class IncidenceRateAnalysisExpression {
@JsonProperty("ConceptSets")
public ConceptSet[] conceptSets = new ConceptSet[0];
@JsonProperty("targetIds")
public List<Integer> targetIds = new ArrayList<>();
@JsonProperty("outcomeIds")
public List<Integer> outcomeIds = new ArrayList<>();
@JsonProperty("timeAtRisk")
public TimeAtRisk timeAtRisk;
@JsonProperty("studyWindow")
public DateRange studyWindow;
@JsonProperty("strata")
public List<StratifyRule> strata = new ArrayList<>();
public IncidenceRateAnalysisExpression() {
}
public <T extends IncidenceRateAnalysisExpression> IncidenceRateAnalysisExpression(T source) {
this.conceptSets = source.conceptSets;
this.targetIds = source.targetIds;
this.outcomeIds = source.outcomeIds;
this.timeAtRisk = source.timeAtRisk;
this.studyWindow = source.studyWindow;
this.strata = source.strata;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/AnalysisReport.java | src/main/java/org/ohdsi/webapi/ircalc/AnalysisReport.java | /*
* Copyright 2015 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class AnalysisReport {
@XmlType(name="Summary", namespace="http://ohdsi.org/webapi/ircalc")
public static class Summary {
public int targetId;
public int outcomeId;
public long totalPersons;
public long timeAtRisk;
public long cases;
}
public static class StrataStatistic
{
public int targetId;
public int outcomeId;
public int id;
public String name;
public long totalPersons;
public long cases;
public long timeAtRisk;
}
public Summary summary;
public List<StrataStatistic> stratifyStats;
public String treemapData;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisDetails.java | src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisDetails.java | /*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
/**
*
* Stores the LOB/CLOB portion of the cohort definition expression.
*/
@Entity(name = "IncidenceRateAnalysisDetails")
@Table(name="ir_analysis_details")
public class IncidenceRateAnalysisDetails implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private Integer id;
@MapsId
@OneToOne
@JoinColumn(name="id")
private IncidenceRateAnalysis analysis;
@Lob
@Type(type = "org.hibernate.type.TextType")
private String expression;
protected IncidenceRateAnalysisDetails() {}
public IncidenceRateAnalysisDetails(IncidenceRateAnalysis analysis) {
this.analysis = analysis;
}
public String getExpression() {
return expression;
}
public IncidenceRateAnalysisDetails setExpression(String expression) {
this.expression = expression;
return this;
}
public IncidenceRateAnalysis getAnalysis() {
return this.analysis;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfoId.java | src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfoId.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
@Embeddable
public class ExecutionInfoId implements Serializable {
private static final long serialVersionUID = 1L;
public ExecutionInfoId() {
}
public ExecutionInfoId(Integer analysisId, Integer sourceId) {
this.analysisId = analysisId;
this.sourceId = sourceId;
}
@Column(name = "analysis_id", insertable = false, updatable = false)
private Integer analysisId;
@Column(name = "source_id")
private Integer sourceId;
public Integer getAnalysisId() {
return analysisId;
}
public void setAnalysisId(Integer analysisId) {
this.analysisId = analysisId;
}
public Integer getSourceId() {
return sourceId;
}
public void setSourceId(Integer sourceId) {
this.sourceId = sourceId;
}
public boolean equals(Object o) {
return ((o instanceof ExecutionInfoId)
&& analysisId.equals(((ExecutionInfoId) o).getAnalysisId())
&& sourceId.equals(((ExecutionInfoId) o).getSourceId()) );
}
public int hashCode() {
return analysisId + sourceId;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IRAnalysisQueryBuilder.java | src/main/java/org/ohdsi/webapi/ircalc/IRAnalysisQueryBuilder.java | /*
* Copyright 2015 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.ohdsi.circe.cohortdefinition.CohortExpressionQueryBuilder;
import org.ohdsi.circe.cohortdefinition.CriteriaGroup;
import org.ohdsi.circe.helper.ResourceHelper;
import org.ohdsi.circe.vocabulary.ConceptSetExpressionQueryBuilder;
import java.util.ArrayList;
import org.ohdsi.webapi.Constants;
import org.ohdsi.webapi.util.SqlUtils;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class IRAnalysisQueryBuilder {
private final static ConceptSetExpressionQueryBuilder conceptSetQueryBuilder = new ConceptSetExpressionQueryBuilder();
private final static CohortExpressionQueryBuilder cohortExpressionQueryBuilder = new CohortExpressionQueryBuilder();
private final static String PERFORM_ANALYSIS_QUERY_TEMPLATE = ResourceHelper.GetResourceAsString("/resources/incidencerate/sql/performAnalysis.sql");
private final static String STRATA_QUERY_TEMPLATE = ResourceHelper.GetResourceAsString("/resources/incidencerate/sql/strata.sql");
public static class BuildExpressionQueryOptions {
@JsonProperty("cdmSchema")
public String cdmSchema;
@JsonProperty("resultsSchema")
public String resultsSchema;
@JsonProperty("vocabularySchema")
public String vocabularySchema;
@JsonProperty("tempSchema")
public String tempSchema;
@JsonProperty("cohortTable")
public String cohortTable;
}
private final ObjectMapper objectMapper;
public IRAnalysisQueryBuilder(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}
private String getStrataQuery(CriteriaGroup strataCriteria)
{
String resultSql = STRATA_QUERY_TEMPLATE;
String additionalCriteriaQuery = "\nJOIN (\n" + cohortExpressionQueryBuilder.getCriteriaGroupQuery(strataCriteria, "#analysis_events") + ") AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id";
additionalCriteriaQuery = StringUtils.replace(additionalCriteriaQuery,"@indexId", "" + 0);
resultSql = StringUtils.replace(resultSql, "@additionalCriteriaQuery", additionalCriteriaQuery);
return resultSql;
}
public String buildAnalysisQuery(IncidenceRateAnalysisExpression analysisExpression, Integer analysisId, BuildExpressionQueryOptions options) {
String resultSql = PERFORM_ANALYSIS_QUERY_TEMPLATE;
// target and outcome statements for analysis
ArrayList<String> cohortIdStatements = new ArrayList<>();
for (int targetId : analysisExpression.targetIds) {
cohortIdStatements.add(String.format("SELECT %d as cohort_id, 0 as is_outcome", targetId));
}
for (int outcomeId : analysisExpression.outcomeIds) {
cohortIdStatements.add(String.format("SELECT %d as cohort_id, 1 as is_outcome", outcomeId));
}
resultSql = StringUtils.replace(resultSql,"@cohortInserts", StringUtils.join(cohortIdStatements,"\nUNION\n"));
// apply adjustments
String adjustmentExpression = "DATEADD(day,%d,%s)";
String adjustedStart = String.format(adjustmentExpression,
analysisExpression.timeAtRisk.start.offset,
analysisExpression.timeAtRisk.start.dateField == FieldOffset.DateField.StartDate ? "cohort_start_date" : "cohort_end_date");
resultSql = StringUtils.replace(resultSql,"@adjustedStart", adjustedStart);
String adjustedEnd = String.format(adjustmentExpression,
analysisExpression.timeAtRisk.end.offset,
analysisExpression.timeAtRisk.end.dateField == FieldOffset.DateField.StartDate ? "cohort_start_date" : "cohort_end_date");
resultSql = StringUtils.replace(resultSql,"@adjustedEnd", adjustedEnd);
// apply study window WHERE clauses
ArrayList<String> studyWindowClauses = new ArrayList<>();
if (analysisExpression.studyWindow != null)
{
if (analysisExpression.studyWindow.startDate != null && analysisExpression.studyWindow.startDate.length() > 0)
studyWindowClauses.add(String.format("t.cohort_start_date >= %s", SqlUtils.dateStringToSql(analysisExpression.studyWindow.startDate)));
if (analysisExpression.studyWindow.endDate != null && analysisExpression.studyWindow.endDate.length() > 0)
studyWindowClauses.add(String.format("t.cohort_start_date <= %s", SqlUtils.dateStringToSql(analysisExpression.studyWindow.endDate)));
}
if (studyWindowClauses.size() > 0)
resultSql = StringUtils.replace(resultSql, "@cohortDataFilter", "AND " + StringUtils.join(studyWindowClauses," AND "));
else
resultSql = StringUtils.replace(resultSql, "@cohortDataFilter", "");
// add end dates if study window end is defined
if (analysisExpression.studyWindow != null && analysisExpression.studyWindow.endDate != null && analysisExpression.studyWindow.endDate.length() > 0)
{
StringBuilder endDatesQuery = new StringBuilder(
String.format("UNION\nselect combos.target_id, combos.outcome_id, t.subject_id, t.cohort_start_date, %s as followup_end, 0 as is_case",
SqlUtils.dateStringToSql(analysisExpression.studyWindow.endDate))
);
endDatesQuery.append("\nFROM #cteCohortCombos combos");
endDatesQuery.append("\nJOIN #cteCohortData t on combos.target_id = t.target_id and combos.outcome_id = t.outcome_id");
resultSql = StringUtils.replace(resultSql, "@EndDateUnions", endDatesQuery.toString());
}
else
resultSql = StringUtils.replace(resultSql, "@EndDateUnions", "");
String codesetQuery = cohortExpressionQueryBuilder.getCodesetQuery(analysisExpression.conceptSets);
resultSql = StringUtils.replace(resultSql, "@codesetQuery", codesetQuery);
ArrayList<String> strataInsert = new ArrayList<>();
for (int i = 0; i < analysisExpression.strata.size(); i++)
{
CriteriaGroup cg = analysisExpression.strata.get(i).expression;
String stratumInsert = getStrataQuery(cg);
stratumInsert = StringUtils.replace(stratumInsert, "@strata_sequence", "" + i);
strataInsert.add(stratumInsert);
}
resultSql = StringUtils.replace(resultSql,"@strataCohortInserts", StringUtils.join(strataInsert,"\n"));
if (options != null)
{
// replease query parameters with tokens
resultSql = StringUtils.replace(resultSql, Constants.SqlSchemaPlaceholders.CDM_DATABASE_SCHEMA_PLACEHOLDER, options.cdmSchema);
resultSql = StringUtils.replace(resultSql, Constants.SqlSchemaPlaceholders.RESULTS_DATABASE_SCHEMA_PLACEHOLDER, options.resultsSchema);
resultSql = StringUtils.replace(resultSql, Constants.SqlSchemaPlaceholders.VOCABULARY_DATABASE_SCHEMA_PLACEHOLDER, options.vocabularySchema);
resultSql = StringUtils.replace(resultSql, Constants.SqlSchemaPlaceholders.TEMP_DATABASE_SCHEMA_PLACEHOLDER, options.tempSchema);
resultSql = StringUtils.replace(resultSql, "@cohort_table", options.cohortTable);
}
resultSql = StringUtils.replace(resultSql, "@analysisId", analysisId.toString());
return resultSql;
}
public String buildAnalysisQuery(IncidenceRateAnalysis analyisis, BuildExpressionQueryOptions options) {
try {
IncidenceRateAnalysisExpression analysisExpression = objectMapper.readValue(analyisis.getDetails().getExpression(), IncidenceRateAnalysisExpression.class);
return buildAnalysisQuery(analysisExpression, analyisis.getId(), options);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/TimeAtRisk.java | src/main/java/org/ohdsi/webapi/ircalc/TimeAtRisk.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class TimeAtRisk {
public FieldOffset start = new FieldOffset();
public FieldOffset end = new FieldOffset();
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/DateRange.java | src/main/java/org/ohdsi/webapi/ircalc/DateRange.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import java.util.Date;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class DateRange {
public String startDate;
public String endDate;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/FieldOffset.java | src/main/java/org/ohdsi/webapi/ircalc/FieldOffset.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import org.ohdsi.webapi.cohortdefinition.*;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class FieldOffset {
public enum DateField {
StartDate, EndDate
}
@JsonProperty("DateField")
public DateField dateField = DateField.StartDate;
@JsonProperty("Offset")
public int offset = 0;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IRAnalysisInfoListener.java | src/main/java/org/ohdsi/webapi/ircalc/IRAnalysisInfoListener.java | package org.ohdsi.webapi.ircalc;
import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph;
import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraphUtils;
import org.ohdsi.webapi.Constants;
import org.ohdsi.webapi.GenerationStatus;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.batch.core.JobParameters;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.transaction.support.TransactionTemplate;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.Objects;
import java.util.Optional;
public class IRAnalysisInfoListener implements JobExecutionListener {
private static final int MAX_MESSAGE_LENGTH = 2000;
private static final EntityGraph IR_WITH_EXECUTION_INFOS_ENTITY_GRAPH = EntityGraphUtils.fromName("IncidenceRateAnalysis.withExecutionInfoList");
private final TransactionTemplate transactionTemplate;
private final IncidenceRateAnalysisRepository incidenceRateAnalysisRepository;
private Date startTime;
public IRAnalysisInfoListener(TransactionTemplate transactionTemplate, IncidenceRateAnalysisRepository incidenceRateAnalysisRepository) {
this.transactionTemplate = transactionTemplate;
this.incidenceRateAnalysisRepository = incidenceRateAnalysisRepository;
}
@Override
public void beforeJob(JobExecution je) {
startTime = Calendar.getInstance().getTime();
JobParameters jobParams = je.getJobParameters();
Integer analysisId = Integer.valueOf(jobParams.getString("analysis_id"));
Integer sourceId = Integer.valueOf(jobParams.getString("source_id"));
DefaultTransactionDefinition requresNewTx = new DefaultTransactionDefinition();
requresNewTx.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
TransactionStatus initStatus = this.transactionTemplate.getTransactionManager().getTransaction(requresNewTx);
IncidenceRateAnalysis analysis = this.incidenceRateAnalysisRepository.findOneWithExecutionsOnExistingSources(analysisId,
IR_WITH_EXECUTION_INFOS_ENTITY_GRAPH);
findExecutionInfoBySourceId(analysis.getExecutionInfoList(), sourceId).ifPresent(analysisInfo -> {
analysisInfo.setIsValid(false);
analysisInfo.setStartTime(startTime);
analysisInfo.setStatus(GenerationStatus.RUNNING);
});
this.incidenceRateAnalysisRepository.save(analysis);
this.transactionTemplate.getTransactionManager().commit(initStatus);
}
@Override
public void afterJob(JobExecution je) {
boolean isValid = !(je.getStatus() == BatchStatus.FAILED || je.getStatus() == BatchStatus.STOPPED);
String statusMessage = je.getExitStatus().getExitDescription();
JobParameters jobParams = je.getJobParameters();
Integer analysisId = Integer.valueOf(jobParams.getString("analysis_id"));
Integer sourceId = Integer.valueOf(jobParams.getString("source_id"));
DefaultTransactionDefinition requresNewTx = new DefaultTransactionDefinition();
requresNewTx.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
TransactionStatus completeStatus = this.transactionTemplate.getTransactionManager().getTransaction(requresNewTx);
Date endTime = Calendar.getInstance().getTime();
IncidenceRateAnalysis analysis = this.incidenceRateAnalysisRepository.findOneWithExecutionsOnExistingSources(analysisId,
IR_WITH_EXECUTION_INFOS_ENTITY_GRAPH);
findExecutionInfoBySourceId(analysis.getExecutionInfoList(), sourceId).ifPresent(analysisInfo -> {
analysisInfo.setIsValid(isValid);
analysisInfo.setCanceled(je.getStatus() == BatchStatus.STOPPED || je.getStepExecutions().stream().anyMatch(se -> Objects.equals(Constants.CANCELED, se.getExitStatus().getExitCode())));
analysisInfo.setExecutionDuration((int) (endTime.getTime() - startTime.getTime()));
analysisInfo.setStatus(GenerationStatus.COMPLETE);
analysisInfo.setMessage(statusMessage.substring(0, Math.min(MAX_MESSAGE_LENGTH, statusMessage.length())));
});
this.incidenceRateAnalysisRepository.save(analysis);
this.transactionTemplate.getTransactionManager().commit(completeStatus);
}
private Optional<ExecutionInfo> findExecutionInfoBySourceId(Collection<ExecutionInfo> infoList, Integer sourceId) {
return infoList.stream()
.filter(info -> Objects.equals(info.getId().getSourceId(), sourceId))
.findFirst();
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfo.java | src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfo.java | /*
* Copyright 2016 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.ohdsi.webapi.GenerationStatus;
import org.ohdsi.webapi.IExecutionInfo;
import org.ohdsi.webapi.source.Source;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
@Entity(name = "IRAnalysisGenerationInfo")
@Table(name="ir_execution")
public class ExecutionInfo implements Serializable, IExecutionInfo {
private static final long serialVersionUID = 1L;
@EmbeddedId
private ExecutionInfoId id;
@JsonIgnore
@ManyToOne
@MapsId("analysisId")
@JoinColumn(name="analysis_id", referencedColumnName="id")
private IncidenceRateAnalysis analysis;
@JsonIgnore
@ManyToOne
@MapsId("sourceId")
@JoinColumn(name="source_id", referencedColumnName="source_id")
@NotFound(action = NotFoundAction.IGNORE)
private Source source;
@Column(name="start_time")
private Date startTime;
@Column(name="execution_duration")
private Integer executionDuration;
@Column(name="status")
@Enumerated(EnumType.STRING)
private GenerationStatus status;
@Column(name="is_valid")
private boolean isValid;
@Column(name = "is_canceled")
private boolean isCanceled;
@Column(name="message")
private String message;
public ExecutionInfo()
{
}
public ExecutionInfo(IncidenceRateAnalysis analysis, Source source)
{
this.id = new ExecutionInfoId(analysis.getId(), source.getSourceId());
this.source = source;
this.analysis = analysis;
}
public ExecutionInfoId getId() {
return id;
}
public void setId(ExecutionInfoId id) {
this.id = id;
}
public Date getStartTime() {
return startTime;
}
public ExecutionInfo setStartTime(Date startTime) {
this.startTime = startTime;
return this;
}
public Integer getExecutionDuration() {
return executionDuration;
}
public ExecutionInfo setExecutionDuration(Integer executionDuration) {
this.executionDuration = executionDuration;
return this;
}
public GenerationStatus getStatus() {
return status;
}
public ExecutionInfo setStatus(GenerationStatus status) {
this.status = status;
return this;
}
public boolean getIsValid() {
return isValid;
}
public ExecutionInfo setIsValid(boolean isValid) {
this.isValid = isValid;
return this;
}
@Override
public boolean getIsCanceled() {
return isCanceled();
}
public boolean isCanceled() {
return isCanceled;
}
public void setCanceled(boolean canceled) {
isCanceled = canceled;
}
public String getMessage() {
return message;
}
public ExecutionInfo setMessage(String message) {
this.message = message;
return this;
}
public IncidenceRateAnalysis getAnalysis() {
return analysis;
}
public Source getSource() {
return source;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/StratifyRule.java | src/main/java/org/ohdsi/webapi/ircalc/StratifyRule.java | /*
* Copyright 2015 Observational Health Data Sciences and Informatics [OHDSI.org].
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.ircalc;
import org.ohdsi.circe.cohortdefinition.CriteriaGroup;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
public class StratifyRule {
public String name;
public String description;
public CriteriaGroup expression;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisExportExpression.java | src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysisExportExpression.java | package org.ohdsi.webapi.ircalc;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.ohdsi.webapi.cohortdefinition.dto.CohortDTO;
import java.util.ArrayList;
import java.util.List;
public class IncidenceRateAnalysisExportExpression extends IncidenceRateAnalysisExpression {
@JsonProperty("targetCohorts")
public List<CohortDTO> targetCohorts = new ArrayList<>();
@JsonProperty("outcomeCohorts")
public List<CohortDTO> outcomeCohorts = new ArrayList<>();
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/dto/IRVersionFullDTO.java | src/main/java/org/ohdsi/webapi/ircalc/dto/IRVersionFullDTO.java | package org.ohdsi.webapi.ircalc.dto;
import org.ohdsi.webapi.service.dto.IRAnalysisDTO;
import org.ohdsi.webapi.versioning.dto.VersionFullDTO;
public class IRVersionFullDTO extends VersionFullDTO<IRAnalysisDTO> {
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/converter/IRAnalysisToIRVersionConverter.java | src/main/java/org/ohdsi/webapi/ircalc/converter/IRAnalysisToIRVersionConverter.java | package org.ohdsi.webapi.ircalc.converter;
import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter;
import org.ohdsi.webapi.ircalc.IncidenceRateAnalysis;
import org.ohdsi.webapi.versioning.domain.CohortVersion;
import org.ohdsi.webapi.versioning.domain.IRVersion;
import org.springframework.stereotype.Component;
@Component
public class IRAnalysisToIRVersionConverter
extends BaseConversionServiceAwareConverter<IncidenceRateAnalysis, IRVersion> {
@Override
public IRVersion convert(IncidenceRateAnalysis source) {
IRVersion target = new IRVersion();
target.setAssetId(source.getId());
target.setDescription(source.getDescription());
target.setAssetJson(source.getDetails().getExpression());
return target;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/ircalc/converter/IRVersionToIRAnalysisVersionFullDTOConverter.java | src/main/java/org/ohdsi/webapi/ircalc/converter/IRVersionToIRAnalysisVersionFullDTOConverter.java | package org.ohdsi.webapi.ircalc.converter;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter;
import org.ohdsi.webapi.exception.ConversionAtlasException;
import org.ohdsi.webapi.ircalc.IncidenceRateAnalysis;
import org.ohdsi.webapi.ircalc.IncidenceRateAnalysisDetails;
import org.ohdsi.webapi.ircalc.IncidenceRateAnalysisExportExpression;
import org.ohdsi.webapi.ircalc.IncidenceRateAnalysisRepository;
import org.ohdsi.webapi.ircalc.dto.IRVersionFullDTO;
import org.ohdsi.webapi.service.CohortDefinitionService;
import org.ohdsi.webapi.service.dto.IRAnalysisDTO;
import org.ohdsi.webapi.util.ExceptionUtils;
import org.ohdsi.webapi.versioning.domain.IRVersion;
import org.ohdsi.webapi.versioning.dto.VersionDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.ws.rs.InternalServerErrorException;
@Component
public class IRVersionToIRAnalysisVersionFullDTOConverter
extends BaseConversionServiceAwareConverter<IRVersion, IRVersionFullDTO> {
private static final Logger log = LoggerFactory.getLogger(IRVersionToIRAnalysisVersionFullDTOConverter.class);
@Autowired
private IncidenceRateAnalysisRepository analysisRepository;
@Autowired
private ObjectMapper objectMapper;
@Autowired
private CohortDefinitionService cohortService;
@Override
public IRVersionFullDTO convert(IRVersion source) {
IncidenceRateAnalysis def = this.analysisRepository.findOne(source.getAssetId().intValue());
ExceptionUtils.throwNotFoundExceptionIfNull(def,
String.format("There is no incidence rate analysis with id = %d.", source.getAssetId()));
IncidenceRateAnalysis entity = new IncidenceRateAnalysis();
entity.setId(def.getId());
entity.setTags(def.getTags());
entity.setName(def.getName());
entity.setDescription(source.getDescription());
entity.setCreatedBy(def.getCreatedBy());
entity.setCreatedDate(def.getCreatedDate());
entity.setModifiedBy(def.getModifiedBy());
entity.setModifiedDate(def.getModifiedDate());
entity.setExecutionInfoList(def.getExecutionInfoList());
IncidenceRateAnalysisDetails details = new IncidenceRateAnalysisDetails(entity);
try {
IncidenceRateAnalysisExportExpression expression = objectMapper.readValue(
source.getAssetJson(), IncidenceRateAnalysisExportExpression.class);
expression.outcomeCohorts = cohortService.getCohortDTOs(expression.outcomeIds);
expression.targetCohorts = cohortService.getCohortDTOs(expression.targetIds);
if (expression.outcomeCohorts.size() != expression.outcomeIds.size() ||
expression.targetCohorts.size() != expression.targetIds.size()) {
throw new ConversionAtlasException("Could not load version because it contains deleted cohorts");
}
} catch (JsonProcessingException e) {
log.error("Error converting expression to object", e);
throw new InternalServerErrorException();
}
details.setExpression(source.getAssetJson());
entity.setDetails(details);
IRVersionFullDTO target = new IRVersionFullDTO();
target.setVersionDTO(conversionService.convert(source, VersionDTO.class));
target.setEntityDTO(conversionService.convert(entity, IRAnalysisDTO.class));
return target;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/sqlrender/SourceStatement.java | src/main/java/org/ohdsi/webapi/sqlrender/SourceStatement.java | package org.ohdsi.webapi.sqlrender;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
*
* @author Lee Evans
*/
public class SourceStatement {
@JsonProperty("targetdialect")
private String targetDialect;
@JsonProperty("oracleTempSchema")
private String oracleTempSchema;
@JsonProperty("SQL")
private String sql;
@JsonProperty("parameters")
private Map<String,String> parameters = new HashMap<>();
public String getTargetDialect() {
return targetDialect;
}
public void setTargetDialect(String targetDialect) {
this.targetDialect = targetDialect;
}
public String getOracleTempSchema() {
return oracleTempSchema;
}
public void setOracleTempSchema(String oracleTempSchema) {
this.oracleTempSchema = oracleTempSchema;
}
public String getSql() {
return sql;
}
public void setSql(String sql) {
this.sql = sql;
}
public Map<String, String> getParameters() {
return parameters;
}
public void setParameters(Map<String, String> parameters) {
this.parameters = parameters;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SourceStatement that = (SourceStatement) o;
return Objects.equals(targetDialect, that.targetDialect) &&
Objects.equals(oracleTempSchema, that.oracleTempSchema) &&
Objects.equals(sql, that.sql) &&
Objects.equals(parameters, that.parameters);
}
@Override
public int hashCode() {
return Objects.hash(targetDialect, oracleTempSchema, sql, parameters);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/sqlrender/SourceAwareSqlRender.java | src/main/java/org/ohdsi/webapi/sqlrender/SourceAwareSqlRender.java | package org.ohdsi.webapi.sqlrender;
import org.apache.commons.lang3.ArrayUtils;
import org.ohdsi.sql.SqlRender;
import org.ohdsi.webapi.source.SourceService;
import org.ohdsi.webapi.source.Source;
import org.ohdsi.webapi.util.SourceUtils;
import org.springframework.stereotype.Component;
import static org.ohdsi.webapi.Constants.Params.*;
@Component
public class SourceAwareSqlRender {
private static final String[] DAIMONS = {RESULTS_DATABASE_SCHEMA, CDM_DATABASE_SCHEMA, TEMP_DATABASE_SCHEMA, VOCABULARY_DATABASE_SCHEMA};
private final SourceService sourceService;
public SourceAwareSqlRender(SourceService sourceService) {
this.sourceService = sourceService;
}
public String renderSql(int sourceId, String sql, String paramater, String value) {
return renderSql(sourceId, sql, new String[]{paramater}, new String[]{value});
}
public String renderSql(int sourceId, String sql, String[] parameters, String[] values) {
final Source source = sourceService.findBySourceId(sourceId);
if(source == null) {
throw new IllegalArgumentException("wrong source: " + sourceId);
}
final String resultsQualifier = SourceUtils.getResultsQualifier(source);
final String cdmQualifier = SourceUtils.getCdmQualifier(source);
final String tempQualifier = SourceUtils.getTempQualifier(source, resultsQualifier);
final String vocabularyQualifier = SourceUtils.getVocabularyQualifier(source);
return SqlRender.renderSql(sql, ArrayUtils.addAll(parameters, DAIMONS), ArrayUtils.addAll(values, resultsQualifier, cdmQualifier, tempQualifier, vocabularyQualifier));
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/sqlrender/TranslatedStatement.java | src/main/java/org/ohdsi/webapi/sqlrender/TranslatedStatement.java | package org.ohdsi.webapi.sqlrender;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
*
* @author Lee Evans
*/
public class TranslatedStatement {
@JsonProperty("targetSQL")
private String targetSQL;
public String getTargetSQL() {
return targetSQL;
}
public void setTargetSQL(String targetSQL) {
this.targetSQL = targetSQL;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TranslatedStatement that = (TranslatedStatement) o;
return Objects.equals(targetSQL, that.targetSQL);
}
@Override
public int hashCode() {
return Objects.hash(targetSQL);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ConceptQuartileRecord.java | src/main/java/org/ohdsi/webapi/report/ConceptQuartileRecord.java | package org.ohdsi.webapi.report;
/**
*
* i.e. box plot
*
*/
public class ConceptQuartileRecord {
private String category;
private long conceptId;
private int p10Value;
private int p25Value;
private int p75Value;
private int p90Value;
private int minValue;
private int medianValue;
private int maxValue;
/**
* @return the category
*/
public String getCategory() {
return category;
}
/**
* @param category the category to set
*/
public void setCategory(String category) {
this.category = category;
}
/**
* @return the conceptId
*/
public long getConceptId() {
return conceptId;
}
/**
* @param conceptId the conceptId to set
*/
public void setConceptId(long conceptId) {
this.conceptId = conceptId;
}
/**
* @return the p10Value
*/
public int getP10Value() {
return p10Value;
}
/**
* @param p10Value the p10Value to set
*/
public void setP10Value(int p10Value) {
this.p10Value = p10Value;
}
/**
* @return the p25Value
*/
public int getP25Value() {
return p25Value;
}
/**
* @param p25Value the p25Value to set
*/
public void setP25Value(int p25Value) {
this.p25Value = p25Value;
}
/**
* @return the p75Value
*/
public int getP75Value() {
return p75Value;
}
/**
* @param p75Value the p75Value to set
*/
public void setP75Value(int p75Value) {
this.p75Value = p75Value;
}
/**
* @return the p90Value
*/
public int getP90Value() {
return p90Value;
}
/**
* @param p90Value the p90Value to set
*/
public void setP90Value(int p90Value) {
this.p90Value = p90Value;
}
/**
* @return the minValue
*/
public int getMinValue() {
return minValue;
}
/**
* @param minValue the minValue to set
*/
public void setMinValue(int minValue) {
this.minValue = minValue;
}
/**
* @return the medianValue
*/
public int getMedianValue() {
return medianValue;
}
/**
* @param medianValue the medianValue to set
*/
public void setMedianValue(int medianValue) {
this.medianValue = medianValue;
}
/**
* @return the maxValue
*/
public int getMaxValue() {
return maxValue;
}
/**
* @param maxValue the maxValue to set
*/
public void setMaxValue(int maxValue) {
this.maxValue = maxValue;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMDashboard.java | src/main/java/org/ohdsi/webapi/report/CDMDashboard.java | package org.ohdsi.webapi.report;
import java.util.List;
import java.util.Objects;
public class CDMDashboard {
private List<CDMAttribute> summary;
private List<ConceptCountRecord> gender;
private List<ConceptDistributionRecord> ageAtFirstObservation;
private List<CumulativeObservationRecord> cumulativeObservation;
private List<MonthObservationRecord> observedByMonth;
public List<CDMAttribute> getSummary() {
return summary;
}
public void setSummary(List<CDMAttribute> summary) {
this.summary = summary;
}
/**
* @return the gender
*/
public List<ConceptCountRecord> getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(List<ConceptCountRecord> gender) {
this.gender = gender;
}
/**
* @return the ageAtFirstObservation
*/
public List<ConceptDistributionRecord> getAgeAtFirstObservation() {
return ageAtFirstObservation;
}
/**
* @param ageAtFirstObservation the ageAtFirstObservation to set
*/
public void setAgeAtFirstObservation(
List<ConceptDistributionRecord> ageAtFirstObservation) {
this.ageAtFirstObservation = ageAtFirstObservation;
}
/**
* @return the cumulativeObservation
*/
public List<CumulativeObservationRecord> getCumulativeObservation() {
return cumulativeObservation;
}
/**
* @param cumulativeObservation the cumulativeObservation to set
*/
public void setCumulativeObservation(
List<CumulativeObservationRecord> cumulativeObservation) {
this.cumulativeObservation = cumulativeObservation;
}
/**
* @return the observedByMonth
*/
public List<MonthObservationRecord> getObservedByMonth() {
return observedByMonth;
}
/**
* @param observedByMonth the observedByMonth to set
*/
public void setObservedByMonth(List<MonthObservationRecord> observedByMonth) {
this.observedByMonth = observedByMonth;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CDMDashboard that = (CDMDashboard) o;
return Objects.equals(summary, that.summary) &&
Objects.equals(gender, that.gender) &&
Objects.equals(ageAtFirstObservation, that.ageAtFirstObservation) &&
Objects.equals(cumulativeObservation, that.cumulativeObservation) &&
Objects.equals(observedByMonth, that.observedByMonth);
}
@Override
public int hashCode() {
return Objects.hash(summary, gender, ageAtFirstObservation, cumulativeObservation, observedByMonth);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/SeriesPerPerson.java | src/main/java/org/ohdsi/webapi/report/SeriesPerPerson.java | package org.ohdsi.webapi.report;
public class SeriesPerPerson {
private String seriesName;
private int xCalendarMonth;
private float yRecordCount;
/**
* @return the seriesName
*/
public String getSeriesName() {
return seriesName;
}
/**
* @param seriesName the seriesName to set
*/
public void setSeriesName(String seriesName) {
this.seriesName = seriesName;
}
/**
* @return the xCalendarMonth
*/
public int getxCalendarMonth() {
return xCalendarMonth;
}
/**
* @param xCalendarMonth the xCalendarMonth to set
*/
public void setxCalendarMonth(int xCalendarMonth) {
this.xCalendarMonth = xCalendarMonth;
}
/**
* @return the yRecordCount
*/
public float getyRecordCount() {
return yRecordCount;
}
/**
* @param yRecordCount the yRecordCount to set
*/
public void setyRecordCount(float yRecordCount) {
this.yRecordCount = yRecordCount;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortPersonSummary.java | src/main/java/org/ohdsi/webapi/report/CohortPersonSummary.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortPersonSummary {
private List<ConceptDistributionRecord> yearOfBirth;
private List<CohortStatsRecord> yearOfBirthStats;
private List<ConceptCountRecord> gender;
private List<ConceptCountRecord> race;
private List<ConceptCountRecord> ethnicity;
/**
* @return the YearOfBirth
*/
public List<ConceptDistributionRecord> getYearOfBirth() {
return yearOfBirth;
}
/**
* @param YearOfBirth the YearOfBirth to set
*/
public void setYearOfBirth(
List<ConceptDistributionRecord> yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
/**
* @return the yearOfBirthStats
*/
public List<CohortStatsRecord> getYearOfBirthStats() {
return yearOfBirthStats;
}
/**
* @param yearOfBirthStats the yearOfBirthStats to set
*/
public void setYearOfBirthStats(List<CohortStatsRecord> yearOfBirthStats) {
this.yearOfBirthStats = yearOfBirthStats;
}
/**
* @return the gender
*/
public List<ConceptCountRecord> getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(List<ConceptCountRecord> gender) {
this.gender = gender;
}
/**
* @return the race
*/
public List<ConceptCountRecord> getRace() {
return race;
}
/**
* @param race the race to set
*/
public void setRace(List<ConceptCountRecord> race) {
this.race = race;
}
/**
* @return the ethnicity
*/
public List<ConceptCountRecord> getEthnicity() {
return ethnicity;
}
/**
* @param ethnicity the ethnicity to set
*/
public void setEthnicity(List<ConceptCountRecord> ethnicity) {
this.ethnicity = ethnicity;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortDrugEraDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortDrugEraDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortDrugEraDrilldown {
private List<ConceptQuartileRecord> ageAtFirstExposure;
private List<ConceptQuartileRecord> lengthOfEra;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstExposure
*/
public List<ConceptQuartileRecord> getAgeAtFirstExposure() {
return ageAtFirstExposure;
}
/**
* @param ageAtFirstExposure the ageAtFirstExposure to set
*/
public void setAgeAtFirstExposure(List<ConceptQuartileRecord> ageAtFirstExposure) {
this.ageAtFirstExposure = ageAtFirstExposure;
}
/**
* @return the lengthOfEra
*/
public List<ConceptQuartileRecord> getLengthOfEra() {
return lengthOfEra;
}
/**
* @param lengthOfEra the lengthOfEra to set
*/
public void setLengthOfEra(List<ConceptQuartileRecord> lengthOfEra) {
this.lengthOfEra = lengthOfEra;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortBreakdown.java | src/main/java/org/ohdsi/webapi/report/CohortBreakdown.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
/**
*
* @author sgold1
*/
public class CohortBreakdown {
public Long people; // count
public String gender;
public String age; // e.g. "30-39"
public Long conditions; // count
public Long drugs; // count
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMPersonSummary.java | src/main/java/org/ohdsi/webapi/report/CDMPersonSummary.java | package org.ohdsi.webapi.report;
import java.util.List;
import java.util.Objects;
/**
* Created by taa7016 on 8/12/2016.
*/
public class CDMPersonSummary {
private List<CDMAttribute> summary;
private List<ConceptCountRecord> gender;
private List<ConceptCountRecord> race;
private List<ConceptCountRecord> ethnicity;
private List<ConceptDistributionRecord> yearOfBirth;
private List<CohortStatsRecord> yearOfBirthStats;
/**
* @return the summary
*/
public List<CDMAttribute> getSummary() {
return summary;
}
/**
* @param summary the summary to set
*/
public void setSummary(List<CDMAttribute> summary) {
this.summary = summary;
}
public List<ConceptDistributionRecord> getYearOfBirth() {
return yearOfBirth;
}
public void setYearOfBirth(List<ConceptDistributionRecord> yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
/**
* @return the yearOfBirthStats
*/
public List<CohortStatsRecord> getYearOfBirthStats() {
return yearOfBirthStats;
}
/**
* @param yearOfBirthStats the yearOfBirthStats to set
*/
public void setYearOfBirthStats(List<CohortStatsRecord> yearOfBirthStats) {
this.yearOfBirthStats = yearOfBirthStats;
}
/**
* @return the gender
*/
public List<ConceptCountRecord> getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(List<ConceptCountRecord> gender) {
this.gender = gender;
}
/**
* @return the race
*/
public List<ConceptCountRecord> getRace() {
return race;
}
/**
* @param race the race to set
*/
public void setRace(List<ConceptCountRecord> race) {
this.race = race;
}
/**
* @return the ethnicity
*/
public List<ConceptCountRecord> getEthnicity() {
return ethnicity;
}
/**
* @param ethnicity the ethnicity to set
*/
public void setEthnicity(List<ConceptCountRecord> ethnicity) {
this.ethnicity = ethnicity;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CDMPersonSummary that = (CDMPersonSummary) o;
return Objects.equals(summary, that.summary) &&
Objects.equals(gender, that.gender) &&
Objects.equals(race, that.race) &&
Objects.equals(ethnicity, that.ethnicity) &&
Objects.equals(yearOfBirth, that.yearOfBirth) &&
Objects.equals(yearOfBirthStats, that.yearOfBirthStats);
}
@Override
public int hashCode() {
return Objects.hash(summary, gender, race, ethnicity, yearOfBirth, yearOfBirthStats);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ConceptDistributionRecord.java | src/main/java/org/ohdsi/webapi/report/ConceptDistributionRecord.java | package org.ohdsi.webapi.report;
import java.util.Objects;
/**
*
* i.e. histogram record
*
*/
public class ConceptDistributionRecord {
private int intervalIndex;
private double percentValue;
private long countValue;
/**
* @return the intervalIndex
*/
public int getIntervalIndex() {
return intervalIndex;
}
/**
* @param intervalIndex the intervalIndex to set
*/
public void setIntervalIndex(int intervalIndex) {
this.intervalIndex = intervalIndex;
}
/**
* @return the percentValue
*/
public double getPercentValue() {
return percentValue;
}
/**
* @param percentValue the percentValue to set
*/
public void setPercentValue(double percentValue) {
this.percentValue = percentValue;
}
/**
* @return the countValue
*/
public long getCountValue() {
return countValue;
}
/**
* @param countValue the countValue to set
*/
public void setCountValue(long countValue) {
this.countValue = countValue;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConceptDistributionRecord that = (ConceptDistributionRecord) o;
return intervalIndex == that.intervalIndex &&
Double.compare(that.percentValue, percentValue) == 0 &&
countValue == that.countValue;
}
@Override
public int hashCode() {
return Objects.hash(intervalIndex, percentValue, countValue);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortDrugDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortDrugDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortDrugDrilldown {
private List<ConceptQuartileRecord> ageAtFirstExposure;
private List<ConceptQuartileRecord> daysSupplyDistribution;
private List<ConceptCountRecord> drugsByType;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
private List<ConceptQuartileRecord> quantityDistribution;
private List<ConceptQuartileRecord> refillsDistribution;
/**
* @return the ageAtFirstExposure
*/
public List<ConceptQuartileRecord> getAgeAtFirstExposure() {
return ageAtFirstExposure;
}
/**
* @param ageAtFirstExposure the ageAtFirstExposure to set
*/
public void setAgeAtFirstExposure(List<ConceptQuartileRecord> ageAtFirstExposure) {
this.ageAtFirstExposure = ageAtFirstExposure;
}
/**
* @return the daysSupplyDistribution
*/
public List<ConceptQuartileRecord> getDaysSupplyDistribution() {
return daysSupplyDistribution;
}
/**
* @param daysSupplyDistribution the daysSupplyDistribution to set
*/
public void setDaysSupplyDistribution(
List<ConceptQuartileRecord> daysSupplyDistribution) {
this.daysSupplyDistribution = daysSupplyDistribution;
}
/**
* @return the drugsByType
*/
public List<ConceptCountRecord> getDrugsByType() {
return drugsByType;
}
/**
* @param drugsByType the drugsByType to set
*/
public void setDrugsByType(List<ConceptCountRecord> drugsByType) {
this.drugsByType = drugsByType;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
/**
* @return the quantityDistribution
*/
public List<ConceptQuartileRecord> getQuantityDistribution() {
return quantityDistribution;
}
/**
* @param quantityDistribution the quantityDistribution to set
*/
public void setQuantityDistribution(
List<ConceptQuartileRecord> quantityDistribution) {
this.quantityDistribution = quantityDistribution;
}
/**
* @return the refillsDistribution
*/
public List<ConceptQuartileRecord> getRefillsDistribution() {
return refillsDistribution;
}
/**
* @param refillsDistribution the refillsDistribution to set
*/
public void setRefillsDistribution(
List<ConceptQuartileRecord> refillsDistribution) {
this.refillsDistribution = refillsDistribution;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ScatterplotRecord.java | src/main/java/org/ohdsi/webapi/report/ScatterplotRecord.java | package org.ohdsi.webapi.report;
public class ScatterplotRecord {
private String recordType;
private long conceptId;
private String conceptName;
private int duration;
private int countValue;
private double pctPersons;
/**
* @return the recordType
*/
public String getRecordType() {
return recordType;
}
/**
* @param recordType the recordType to set
*/
public void setRecordType(String recordType) {
this.recordType = recordType;
}
/**
* @return the conceptId
*/
public long getConceptId() {
return conceptId;
}
/**
* @param conceptId the conceptId to set
*/
public void setConceptId(long conceptId) {
this.conceptId = conceptId;
}
/**
* @return the conceptName
*/
public String getConceptName() {
return conceptName;
}
/**
* @param conceptName the conceptName to set
*/
public void setConceptName(String conceptName) {
this.conceptName = conceptName;
}
/**
* @return the duration
*/
public int getDuration() {
return duration;
}
/**
* @param duration the duration to set
*/
public void setDuration(int duration) {
this.duration = duration;
}
/**
* @return the countValue
*/
public int getCountValue() {
return countValue;
}
/**
* @param countValue the countValue to set
*/
public void setCountValue(int countValue) {
this.countValue = countValue;
}
/**
* @return the pctPersons
*/
public double getPctPersons() {
return pctPersons;
}
/**
* @param pctPersons the pctPersons to set
*/
public void setPctPersons(double pctPersons) {
this.pctPersons = pctPersons;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/PredictorResult.java | src/main/java/org/ohdsi/webapi/report/PredictorResult.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author asena5
*/
public class PredictorResult {
@JsonProperty("exposure_cohort_definition_id")
public String exposureCohortDefinitionId;
@JsonProperty("outcome_cohort_definition_id")
public String outcomeCohortDefinitionId;
@JsonProperty("concept_id")
public String conceptId;
@JsonProperty("concept_name")
public String conceptName;
@JsonProperty("domain_id")
public String domainId;
@JsonProperty("concept_w_outcome")
public String conceptWithOutcome;
@JsonProperty("pct_outcome_w_concept")
public String pctOutcomeWithConcept;
@JsonProperty("pct_nooutcome_w_concept")
public String pctNoOutcomeWithConcept;
@JsonProperty("abs_std_diff")
public String absStdDiff;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/package-info.java | src/main/java/org/ohdsi/webapi/report/package-info.java | /**
* Model specific classes used by for viewing Achilles results (cohort results)
*/
package org.ohdsi.webapi.report; | java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/DrugEraPrevalence.java | src/main/java/org/ohdsi/webapi/report/DrugEraPrevalence.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
/**
*
* @author anthonygsena
*/
public class DrugEraPrevalence {
public DrugEraPrevalence() {
}
public long conceptId;
public String trellisName;
public String seriesName;
public long xCalendarYear;
public Float yPrevalence1000Pp;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMDeath.java | src/main/java/org/ohdsi/webapi/report/CDMDeath.java | package org.ohdsi.webapi.report;
import java.util.List;
/**
* Created by taa7016 on 11/29/2016.
*/
public class CDMDeath {
private List<ConceptQuartileRecord> ageAtDeath;
private List<ConceptCountRecord> deathByType;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
public void setDeathByType(List<ConceptCountRecord> deathByType) {
this.deathByType = deathByType;
}
public List<ConceptCountRecord> getDeathByType() {
return deathByType;
}
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
public void setPrevalenceByGenderAgeYear(List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
public void setAgeAtDeath(List<ConceptQuartileRecord> ageAtDeath) {
this.ageAtDeath = ageAtDeath;
}
public List<ConceptQuartileRecord> getAgeAtDeath() {
return ageAtDeath;
}
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortStatsRecord.java | src/main/java/org/ohdsi/webapi/report/CohortStatsRecord.java | package org.ohdsi.webapi.report;
import java.util.Objects;
public class CohortStatsRecord {
private int minValue;
private int maxValue;
private int intervalSize;
/**
* @return the minValue
*/
public int getMinValue() {
return minValue;
}
/**
* @param minValue the minValue to set
*/
public void setMinValue(int minValue) {
this.minValue = minValue;
}
/**
* @return the maxValue
*/
public int getMaxValue() {
return maxValue;
}
/**
* @param maxValue the maxValue to set
*/
public void setMaxValue(int maxValue) {
this.maxValue = maxValue;
}
/**
* @return the intervalSize
*/
public int getIntervalSize() {
return intervalSize;
}
/**
* @param intervalSize the intervalSize to set
*/
public void setIntervalSize(int intervalSize) {
this.intervalSize = intervalSize;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CohortStatsRecord that = (CohortStatsRecord) o;
return minValue == that.minValue &&
maxValue == that.maxValue &&
intervalSize == that.intervalSize;
}
@Override
public int hashCode() {
return Objects.hash(minValue, maxValue, intervalSize);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/HierarchicalConceptRecord.java | src/main/java/org/ohdsi/webapi/report/HierarchicalConceptRecord.java | package org.ohdsi.webapi.report;
/**
*
* i.e. treemap
*
*/
public class HierarchicalConceptRecord {
private long conceptId;
private String conceptPath;
private double recordsPerPerson;
private double percentPersons;
private long numPersons;
private double lengthOfEra;
private double percentPersonsBefore;
private double percentPersonsAfter;
private double riskDiffAfterBefore;
private double logRRAfterBefore;
private long countValue;
public HierarchicalConceptRecord() {
// default constructor
}
/**
* @return the conceptId
*/
public long getConceptId() {
return conceptId;
}
/**
* @param conceptId the conceptId to set
*/
public void setConceptId(long conceptId) {
this.conceptId = conceptId;
}
/**
* @return the conceptPath
*/
public String getConceptPath() {
return conceptPath;
}
/**
* @param conceptPath the conceptPath to set
*/
public void setConceptPath(String conceptPath) {
this.conceptPath = conceptPath;
}
/**
* @return the recordsPerPerson
*/
public double getRecordsPerPerson() {
return recordsPerPerson;
}
/**
* @param recordsPerPerson the recordsPerPerson to set
*/
public void setRecordsPerPerson(double recordsPerPerson) {
this.recordsPerPerson = recordsPerPerson;
}
/**
* @return the percentPersons
*/
public double getPercentPersons() {
return percentPersons;
}
/**
* @param percentPersons the percentPersons to set
*/
public void setPercentPersons(double percentPersons) {
this.percentPersons = percentPersons;
}
/**
* @return the numPersons
*/
public long getNumPersons() {
return numPersons;
}
/**
* @param numPersons the numPersons to set
*/
public void setNumPersons(long numPersons) {
this.numPersons = numPersons;
}
/**
* @return the lengthOfEra
*/
public double getLengthOfEra() {
return lengthOfEra;
}
/**
* @param lengthOfEra the lengthOfEra to set
*/
public void setLengthOfEra(double lengthOfEra) {
this.lengthOfEra = lengthOfEra;
}
/**
* @return the percentPersonsBefore
*/
public double getPercentPersonsBefore() {
return percentPersonsBefore;
}
/**
* @param percentPersonsBefore the percentPersonsBefore to set
*/
public void setPercentPersonsBefore(double percentPersonsBefore) {
this.percentPersonsBefore = percentPersonsBefore;
}
/**
* @return the percentPersonsAfter
*/
public double getPercentPersonsAfter() {
return percentPersonsAfter;
}
/**
* @param percentPersonsAfter the percentPersonsAfter to set
*/
public void setPercentPersonsAfter(double percentPersonsAfter) {
this.percentPersonsAfter = percentPersonsAfter;
}
/**
* @return the riskDiffAfterBefore
*/
public double getRiskDiffAfterBefore() {
return riskDiffAfterBefore;
}
/**
* @param riskDiffAfterBefore the riskDiffAfterBefore to set
*/
public void setRiskDiffAfterBefore(double riskDiffAfterBefore) {
this.riskDiffAfterBefore = riskDiffAfterBefore;
}
/**
* @return the logRRAfterBefore
*/
public double getLogRRAfterBefore() {
return logRRAfterBefore;
}
/**
* @param logRRAfterBefore the logRRAfterBefore to set
*/
public void setLogRRAfterBefore(double logRRAfterBefore) {
this.logRRAfterBefore = logRRAfterBefore;
}
/**
* @return the countValue
*/
public long getCountValue() {
return countValue;
}
/**
* @param countValue the countValue to set
*/
public void setCountValue(long countValue) {
this.countValue = countValue;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/MonthObservationRecord.java | src/main/java/org/ohdsi/webapi/report/MonthObservationRecord.java | package org.ohdsi.webapi.report;
import java.util.Objects;
public class MonthObservationRecord {
private int monthYear;
private double percentValue;
private long countValue;
/**
* @return the monthYear
*/
public int getMonthYear() {
return monthYear;
}
/**
* @param monthYear the monthYear to set
*/
public void setMonthYear(int monthYear) {
this.monthYear = monthYear;
}
/**
* @return the percentValue
*/
public double getPercentValue() {
return percentValue;
}
/**
* @param percentValue the percentValue to set
*/
public void setPercentValue(double percentValue) {
this.percentValue = percentValue;
}
/**
* @return the countValue
*/
public long getCountValue() {
return countValue;
}
/**
* @param countValue the countValue to set
*/
public void setCountValue(long countValue) {
this.countValue = countValue;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MonthObservationRecord that = (MonthObservationRecord) o;
return monthYear == that.monthYear &&
Double.compare(that.percentValue, percentValue) == 0 &&
countValue == that.countValue;
}
@Override
public int hashCode() {
return Objects.hash(monthYear, percentValue, countValue);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMAttribute.java | src/main/java/org/ohdsi/webapi/report/CDMAttribute.java | package org.ohdsi.webapi.report;
import java.util.Objects;
public class CDMAttribute {
private String attributeName;
private String attributeValue;
/**
* @return the attributeName
*/
public String getAttributeName() {
return attributeName;
}
/**
* @param attributeName the attributeName to set
*/
public void setAttributeName(String attributeName) {
this.attributeName = attributeName;
}
/**
* @return the attributeValue
*/
public String getAttributeValue() {
return attributeValue;
}
/**
* @param attributeValue the attributeValue to set
*/
public void setAttributeValue(String attributeValue) {
this.attributeValue = attributeValue;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CDMAttribute that = (CDMAttribute) o;
return Objects.equals(attributeName, that.attributeName) &&
Objects.equals(attributeValue, that.attributeValue);
}
@Override
public int hashCode() {
return Objects.hash(attributeName, attributeValue);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunner.java | src/main/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunner.java | package org.ohdsi.webapi.report;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.ohdsi.webapi.report.mapper.*;
import org.ohdsi.webapi.source.Source;
import org.ohdsi.webapi.source.SourceDaimon;
import org.ohdsi.webapi.util.PreparedStatementRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
import java.util.Objects;
import org.springframework.stereotype.Component;
@Component
public class CDMResultsAnalysisRunner {
private static final String BASE_SQL_PATH = "/resources/cdmresults/sql";
private static final Logger log = LoggerFactory.getLogger(CDMResultsAnalysisRunner.class);
private static final String[] STANDARD_TABLE = new String[]{"results_database_schema", "vocab_database_schema", "cdm_database_schema"};
private static final String[] DRILLDOWN_COLUMNS = new String[]{"conceptId"};
private static final String[] DRILLDOWN_TABLE = new String[]{"results_database_schema", "vocab_database_schema"};
private String sourceDialect;
private ObjectMapper objectMapper;
public void init(String sourceDialect, ObjectMapper objectMapper) {
this.sourceDialect = sourceDialect;
this.objectMapper = objectMapper;
}
public CDMDashboard getDashboard(JdbcTemplate jdbcTemplate,
Source source) {
CDMDashboard dashboard = new CDMDashboard();
PreparedStatementRenderer summarySql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/population.sql", source);
if (summarySql != null) {
dashboard.setSummary(jdbcTemplate.query(summarySql.getSql(), summarySql.getSetter(), new CDMAttributeMapper()));
}
PreparedStatementRenderer ageAtFirstObsSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/observationperiod/ageatfirst.sql", source);
if (ageAtFirstObsSql != null) {
dashboard.setAgeAtFirstObservation(jdbcTemplate.query(ageAtFirstObsSql.getSql(), ageAtFirstObsSql.getSetter(), new ConceptDistributionMapper()));
}
PreparedStatementRenderer genderSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/gender.sql", source);
if (genderSql != null) {
dashboard.setGender(jdbcTemplate.query(genderSql.getSql(), genderSql.getSetter(), new ConceptCountMapper()));
}
PreparedStatementRenderer cumulObsSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/observationperiod/cumulativeduration.sql", source);
if (cumulObsSql != null) {
dashboard.setCumulativeObservation(jdbcTemplate.query(cumulObsSql.getSql(), cumulObsSql.getSetter(), new CumulativeObservationMapper()));
}
PreparedStatementRenderer obsByMonthSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/observationperiod/observedbymonth.sql", source);
if (obsByMonthSql != null) {
dashboard.setObservedByMonth(jdbcTemplate.query(obsByMonthSql.getSql(), obsByMonthSql.getSetter(), new MonthObservationMapper()));
}
return dashboard;
}
/**
* Queries for CDM person results for the given source
*
* @param jdbcTemplate JDBCTemplate
* @return CDMPersonSummary
*/
public CDMPersonSummary getPersonResults(JdbcTemplate jdbcTemplate,
final Source source) {
CDMPersonSummary person = new CDMPersonSummary();
PreparedStatementRenderer summarySql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/population.sql", source);
if (summarySql != null) {
person.setSummary(jdbcTemplate.query(summarySql.getSql(), summarySql.getSetter(), new CDMAttributeMapper()));
}
PreparedStatementRenderer genderSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/gender.sql", source);
if (genderSql != null) {
person.setGender(jdbcTemplate.query(genderSql.getSql(), genderSql.getSetter(), new ConceptCountMapper()));
}
PreparedStatementRenderer raceSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/race.sql", source);
if (raceSql != null) {
person.setRace(jdbcTemplate.query(raceSql.getSql(), raceSql.getSetter(), new ConceptCountMapper()));
}
PreparedStatementRenderer ethnicitySql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/ethnicity.sql", source);
if (ethnicitySql != null) {
person.setEthnicity(jdbcTemplate.query(ethnicitySql.getSql(), ethnicitySql.getSetter(), new ConceptCountMapper()));
}
PreparedStatementRenderer yearOfBirthSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/yearofbirth_data.sql", source);
if (yearOfBirthSql != null) {
person.setYearOfBirth(jdbcTemplate.query(yearOfBirthSql.getSql(), yearOfBirthSql.getSetter(), new ConceptDistributionMapper()));
}
PreparedStatementRenderer yearOfBirthStatsSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/person/yearofbirth_stats.sql", source);
if (yearOfBirthStatsSql != null) {
person.setYearOfBirthStats(jdbcTemplate.query(yearOfBirthStatsSql.getSql(), yearOfBirthStatsSql.getSetter(), new CohortStatsMapper()));
}
return person;
}
public CDMDataDensity getDataDensityResults(JdbcTemplate jdbcTemplate, Source source) {
CDMDataDensity cdmDataDensity = new CDMDataDensity();
PreparedStatementRenderer conceptsPerPersonSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/datadensity/conceptsperperson.sql", source);
if (conceptsPerPersonSql != null) {
cdmDataDensity.setConceptsPerPerson(jdbcTemplate.query(conceptsPerPersonSql.getSql(), conceptsPerPersonSql.getSetter(), new ConceptQuartileMapper()));
}
PreparedStatementRenderer recordsPerPersonSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/datadensity/recordsperperson.sql", source);
if (recordsPerPersonSql != null) {
cdmDataDensity.setRecordsPerPerson(jdbcTemplate.query(recordsPerPersonSql.getSql(), recordsPerPersonSql.getSetter(), new SeriesPerPersonMapper()));
}
PreparedStatementRenderer totalRecordsSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/datadensity/totalrecords.sql", source);
if (totalRecordsSql != null) {
cdmDataDensity.setTotalRecords(jdbcTemplate.query(totalRecordsSql.getSql(), totalRecordsSql.getSetter(), new SeriesPerPersonMapper()));
}
return cdmDataDensity;
}
public CDMDeath getDeathResults(JdbcTemplate jdbcTemplate, Source source) {
CDMDeath cdmDeath = new CDMDeath();
PreparedStatementRenderer prevalenceByGenderAgeYearSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/death/sqlPrevalenceByGenderAgeYear.sql", source);
if (prevalenceByGenderAgeYearSql != null) {
cdmDeath.setPrevalenceByGenderAgeYear(jdbcTemplate.query(prevalenceByGenderAgeYearSql.getSql(), prevalenceByGenderAgeYearSql.getSetter(), new ConceptDecileMapper()));
}
PreparedStatementRenderer prevalenceByMonthSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/death/sqlPrevalenceByMonth.sql", source);
if (prevalenceByMonthSql != null) {
cdmDeath.setPrevalenceByMonth(jdbcTemplate.query(prevalenceByMonthSql.getSql(), prevalenceByMonthSql.getSetter(), new PrevalanceMapper()));
}
PreparedStatementRenderer deathByTypeSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/death/sqlDeathByType.sql", source);
if (deathByTypeSql != null) {
cdmDeath.setDeathByType(jdbcTemplate.query(deathByTypeSql.getSql(), deathByTypeSql.getSetter(), new ConceptCountMapper()));
}
PreparedStatementRenderer ageAtDeathSql = this.renderTranslateSql(BASE_SQL_PATH + "/report/death/sqlAgeAtDeath.sql", source);
if (ageAtDeathSql != null) {
cdmDeath.setAgeAtDeath(jdbcTemplate.query(ageAtDeathSql.getSql(), ageAtDeathSql.getSetter(), new ConceptQuartileMapper()));
}
return cdmDeath;
}
public CDMObservationPeriod getObservationPeriodResults(JdbcTemplate jdbcTemplate, Source source) {
CDMObservationPeriod obsPeriod = new CDMObservationPeriod();
PreparedStatementRenderer ageAtFirstSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/ageatfirst.sql", source);
if (ageAtFirstSql != null) {
obsPeriod.setAgeAtFirst(jdbcTemplate.query(ageAtFirstSql.getSql(), ageAtFirstSql.getSetter(),
new ConceptDistributionMapper()));
}
PreparedStatementRenderer obsLengthSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observationlength_data.sql", source);
if (obsLengthSql != null) {
obsPeriod.setObservationLength(jdbcTemplate.query(obsLengthSql.getSql(), obsLengthSql.getSetter(),
new ConceptDistributionMapper()));
}
PreparedStatementRenderer obsLengthStatsSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observationlength_stats.sql", source);
if (obsLengthStatsSql != null) {
obsPeriod.setObservationLengthStats(jdbcTemplate.query(obsLengthStatsSql.getSql(),
obsLengthStatsSql.getSetter(), new CohortStatsMapper()));
}
PreparedStatementRenderer obsYearStatsSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observedbyyear_stats.sql",
source);
if (obsYearStatsSql != null) {
obsPeriod.setPersonsWithContinuousObservationsByYearStats(jdbcTemplate.query(obsYearStatsSql.getSql(),
obsYearStatsSql.getSetter(), new CohortStatsMapper()));
}
PreparedStatementRenderer personsWithContObsSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observedbyyear_data.sql", source);
if (personsWithContObsSql != null) {
obsPeriod.setPersonsWithContinuousObservationsByYear(jdbcTemplate.query(personsWithContObsSql.getSql(),
personsWithContObsSql.getSetter(), new ConceptDistributionMapper()));
}
PreparedStatementRenderer ageByGenderSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/agebygender.sql", source);
if (ageByGenderSql != null) {
obsPeriod.setAgeByGender(jdbcTemplate.query(ageByGenderSql.getSql(), ageByGenderSql.getSetter(),
new ConceptQuartileMapper()));
}
PreparedStatementRenderer durationByGenderSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observationlengthbygender.sql", source);
if (durationByGenderSql != null) {
obsPeriod.setDurationByGender(jdbcTemplate.query(durationByGenderSql.getSql(), durationByGenderSql.getSetter(),
new ConceptQuartileMapper()));
}
PreparedStatementRenderer durationByAgeSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observationlengthbyage.sql", source);
if (durationByAgeSql != null) {
obsPeriod.setDurationByAgeDecile(jdbcTemplate.query(durationByAgeSql.getSql(), durationByAgeSql.getSetter(),
new ConceptQuartileMapper()));
}
PreparedStatementRenderer cumulObsSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/cumulativeduration.sql", source);
if (cumulObsSql != null) {
obsPeriod.setCumulativeObservation(jdbcTemplate.query(cumulObsSql.getSql(), cumulObsSql.getSetter(),
new CumulativeObservationMapper()));
}
PreparedStatementRenderer obsByMonthSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/observedbymonth.sql", source);
if (obsByMonthSql != null) {
obsPeriod.setObservedByMonth(jdbcTemplate.query(obsByMonthSql.getSql(), obsByMonthSql.getSetter(),
new MonthObservationMapper()));
}
PreparedStatementRenderer obsPeriodsPerPersonSql = renderTranslateSql(
BASE_SQL_PATH + "/report/observationperiod/periodsperperson.sql", source);
if (obsPeriodsPerPersonSql != null) {
obsPeriod.setObservationPeriodsPerPerson(jdbcTemplate.query(obsPeriodsPerPersonSql.getSql(),
obsPeriodsPerPersonSql.getSetter(), new ConceptCountMapper()));
}
return obsPeriod;
}
private PreparedStatementRenderer renderTranslateSql(String sqlPath, Source source) {
return renderTranslateSql(sqlPath, null, source);
}
public ArrayNode getTreemap(JdbcTemplate jdbcTemplate,
String domain,
Source source) {
ArrayNode arrayNode = objectMapper.createArrayNode();
String sqlPath = BASE_SQL_PATH + "/report/" + domain.toLowerCase() + "/treemap.sql";
PreparedStatementRenderer sql = this.renderTranslateSql(sqlPath, source);
if (sql != null) {
List<JsonNode> list = jdbcTemplate.query(sql.getSql(), sql.getSetter(), new GenericRowMapper(objectMapper));
arrayNode.addAll(list);
}
return arrayNode;
}
public JsonNode getDrilldown(JdbcTemplate jdbcTemplate,
String domain,
Integer conceptId,
Source source) {
ObjectNode objectNode = objectMapper.createObjectNode();
ClassLoader cl = this.getClass().getClassLoader();
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(cl);
String folder = Objects.nonNull(conceptId) ? "/drilldown/" : "/drilldownsummary/";
String pattern = BASE_SQL_PATH + "/report/" + domain.toLowerCase() + folder + "*.sql";
try {
Resource[] resources = resolver.getResources(pattern);
for (Resource resource : resources) {
String fullSqlPath = resource.getURL().getPath();
int startIndex = fullSqlPath.indexOf(BASE_SQL_PATH);
String sqlPath = fullSqlPath.substring(startIndex);
PreparedStatementRenderer sql = this.renderTranslateSql(sqlPath, conceptId, source);
if (sql != null) {
List<JsonNode> l = jdbcTemplate.query(sql.getSql(), sql.getSetter(), new GenericRowMapper(objectMapper));
String analysisName = resource.getFilename().replace(".sql", "");
objectNode.putArray(analysisName).addAll(l);
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return objectNode;
}
private PreparedStatementRenderer renderTranslateSql(String sqlPath, Integer conceptId, Source source) {
String resultsTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.Results);
String vocabularyTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.Vocabulary);
String cdmTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.CDM);
PreparedStatementRenderer psr;
String[] tableQualifierValues;
if (conceptId != null) {
tableQualifierValues = new String[]{resultsTableQualifier, vocabularyTableQualifier};
psr = new PreparedStatementRenderer(source, sqlPath, DRILLDOWN_TABLE, tableQualifierValues, DRILLDOWN_COLUMNS, new Integer[]{conceptId});
} else {
tableQualifierValues = new String[]{resultsTableQualifier, vocabularyTableQualifier, cdmTableQualifier};
psr = new PreparedStatementRenderer(source, sqlPath, STANDARD_TABLE, tableQualifierValues, (String) null, null);
}
return psr;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortSpecificSummary.java | src/main/java/org/ohdsi/webapi/report/CohortSpecificSummary.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortSpecificSummary {
private List<ObservationPeriodRecord> personsByDurationFromStartToEnd;
private List<PrevalenceRecord> prevalenceByMonth;
private List<ConceptDecileRecord> numPersonsByCohortStartByGenderByAge;
private List<ConceptQuartileRecord> ageAtIndexDistribution;
private List<MonthObservationRecord> personsInCohortFromCohortStartToEnd;
private List<ConceptQuartileRecord> distributionAgeCohortStartByCohortStartYear;
private List<ConceptQuartileRecord> distributionAgeCohortStartByGender;
/**
* @return the numPersonsByCohortStartByGenderByAge
*/
public List<ConceptDecileRecord> getNumPersonsByCohortStartByGenderByAge() {
return numPersonsByCohortStartByGenderByAge;
}
/**
* @param numPersonsByCohortStartByGenderByAge the numPersonsByCohortStartByGenderByAge to set
*/
public void setNumPersonsByCohortStartByGenderByAge(
List<ConceptDecileRecord> numPersonsByCohortStartByGenderByAge) {
this.numPersonsByCohortStartByGenderByAge = numPersonsByCohortStartByGenderByAge;
}
/**
* @return the personsByDurationFromStartToEnd
*/
public List<ObservationPeriodRecord> getPersonsByDurationFromStartToEnd() {
return personsByDurationFromStartToEnd;
}
/**
* @param personsByDurationFromStartToEnd the personsByDurationFromStartToEnd to set
*/
public void setPersonsByDurationFromStartToEnd(
List<ObservationPeriodRecord> personsByDurationFromStartToEnd) {
this.personsByDurationFromStartToEnd = personsByDurationFromStartToEnd;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
/**
* @return the ageAtIndexDistribution
*/
public List<ConceptQuartileRecord> getAgeAtIndexDistribution() {
return ageAtIndexDistribution;
}
/**
* @param ageAtIndexDistribution the ageAtIndexDistribution to set
*/
public void setAgeAtIndexDistribution(
List<ConceptQuartileRecord> ageAtIndexDistribution) {
this.ageAtIndexDistribution = ageAtIndexDistribution;
}
/**
* @return the personsInCohortFromCohortStartToEnd
*/
public List<MonthObservationRecord> getPersonsInCohortFromCohortStartToEnd() {
return personsInCohortFromCohortStartToEnd;
}
/**
* @param personsInCohortFromCohortStartToEnd the personsInCohortFromCohortStartToEnd to set
*/
public void setPersonsInCohortFromCohortStartToEnd(
List<MonthObservationRecord> personsInCohortFromCohortStartToEnd) {
this.personsInCohortFromCohortStartToEnd = personsInCohortFromCohortStartToEnd;
}
/**
* @return the distributionAgeCohortStartByCohortStartYear
*/
public List<ConceptQuartileRecord> getDistributionAgeCohortStartByCohortStartYear() {
return distributionAgeCohortStartByCohortStartYear;
}
/**
* @param distributionAgeCohortStartByCohortStartYear the distributionAgeCohortStartByCohortStartYear to set
*/
public void setDistributionAgeCohortStartByCohortStartYear(
List<ConceptQuartileRecord> distributionAgeCohortStartByCohortStartYear) {
this.distributionAgeCohortStartByCohortStartYear = distributionAgeCohortStartByCohortStartYear;
}
/**
* @return the distributionAgeCohortStartByGender
*/
public List<ConceptQuartileRecord> getDistributionAgeCohortStartByGender() {
return distributionAgeCohortStartByGender;
}
/**
* @param distributionAgeCohortStartByGender the distributionAgeCohortStartByGender to set
*/
public void setDistributionAgeCohortStartByGender(
List<ConceptQuartileRecord> distributionAgeCohortStartByGender) {
this.distributionAgeCohortStartByGender = distributionAgeCohortStartByGender;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortDeathData.java | src/main/java/org/ohdsi/webapi/report/CohortDeathData.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortDeathData {
private List<ConceptQuartileRecord> agetAtDeath;
private List<ConceptCountRecord> deathByType;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the agetAtDeath
*/
public List<ConceptQuartileRecord> getAgetAtDeath() {
return agetAtDeath;
}
/**
* @param agetAtDeath the agetAtDeath to set
*/
public void setAgetAtDeath(List<ConceptQuartileRecord> agetAtDeath) {
this.agetAtDeath = agetAtDeath;
}
/**
* @return the deathByType
*/
public List<ConceptCountRecord> getDeathByType() {
return deathByType;
}
/**
* @param deathByType the deathByType to set
*/
public void setDeathByType(List<ConceptCountRecord> deathByType) {
this.deathByType = deathByType;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMObservation.java | src/main/java/org/ohdsi/webapi/report/CDMObservation.java | package org.ohdsi.webapi.report;
/**
* Created by taa7016 on 10/4/2016.
*/
public class CDMObservation {
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ConditionOccurrenceTreemapNode.java | src/main/java/org/ohdsi/webapi/report/ConditionOccurrenceTreemapNode.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
/**
*
* @author asena5
*/
public class ConditionOccurrenceTreemapNode {
public ConditionOccurrenceTreemapNode() {
}
public long conceptId;
public String conceptPath;
public long numPersons;
public Float percentPersons;
public Float recordsPerPerson;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ExposureCohortResult.java | src/main/java/org/ohdsi/webapi/report/ExposureCohortResult.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author asena5
*/
public class ExposureCohortResult {
@JsonProperty("exposure_cohort_definition_id")
public String exposureCohortDefinitionId;
@JsonProperty("outcome_cohort_definition_id")
public String outcomeCohortDefinitionId;
@JsonProperty("num_persons_exposed")
public long numPersonsExposed;
@JsonProperty("num_persons_w_outcome_pre_exposure")
public long numPersonsWithOutcomePreExposure;
@JsonProperty("num_persons_w_outcome_post_exposure")
public long numPersonsWithOutcomePostExposure;
@JsonProperty("time_at_risk")
public Float timeAtRisk;
@JsonProperty("incidence_rate_1000py")
public Float incidenceRate1000py;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMDrugSummary.java | src/main/java/org/ohdsi/webapi/report/CDMDrugSummary.java | package org.ohdsi.webapi.report;
/**
* Created by taa7016 on 8/29/2016.
*/
public class CDMDrugSummary {
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/TimeToEventResult.java | src/main/java/org/ohdsi/webapi/report/TimeToEventResult.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author asena5
*/
public class TimeToEventResult {
@JsonProperty("exposure_cohort_definition_id")
public String exposureCohortDefinitionId;
@JsonProperty("outcome_cohort_definition_id")
public String outcomeCohortDefinitionId;
@JsonProperty("recordType")
public String recordType;
@JsonProperty("duration")
public long duration;
@JsonProperty("count_value")
public long countValue;
@JsonProperty("pctPersons")
public double pctPersons;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortConditionDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortConditionDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortConditionDrilldown {
private List<ConceptQuartileRecord> ageAtFirstDiagnosis;
private List<ConceptCountRecord> conditionsByType;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstDiagnosis
*/
public List<ConceptQuartileRecord> getAgeAtFirstDiagnosis() {
return ageAtFirstDiagnosis;
}
/**
* @param ageAtFirstDiagnosis the ageAtFirstDiagnosis to set
*/
public void setAgeAtFirstDiagnosis(List<ConceptQuartileRecord> ageAtFirstDiagnosis) {
this.ageAtFirstDiagnosis = ageAtFirstDiagnosis;
}
/**
* @return the conditionsByType
*/
public List<ConceptCountRecord> getConditionsByType() {
return conditionsByType;
}
/**
* @param conditionsByType the conditionsByType to set
*/
public void setConditionsByType(List<ConceptCountRecord> conditionsByType) {
this.conditionsByType = conditionsByType;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortMeasurementDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortMeasurementDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortMeasurementDrilldown {
private List<ConceptQuartileRecord> ageAtFirstOccurrence;
private List<ConceptQuartileRecord> lowerLimitDistribution;
private List<ConceptQuartileRecord> measurementValueDistribution;
private List<ConceptQuartileRecord> upperLimitDistribution;
private List<ConceptCountRecord> observationsByType;
private List<ConceptCountRecord> recordsByUnit;
private List<ConceptCountRecord> valuesRelativeToNorm;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstOccurrence
*/
public List<ConceptQuartileRecord> getAgeAtFirstOccurrence() {
return ageAtFirstOccurrence;
}
/**
* @param ageAtFirstOccurrence the ageAtFirstOccurrence to set
*/
public void setAgeAtFirstOccurrence(
List<ConceptQuartileRecord> ageAtFirstOccurrence) {
this.ageAtFirstOccurrence = ageAtFirstOccurrence;
}
/**
* @return the lowerLimitDistribution
*/
public List<ConceptQuartileRecord> getLowerLimitDistribution() {
return lowerLimitDistribution;
}
/**
* @param lowerLimitDistribution the lowerLimitDistribution to set
*/
public void setLowerLimitDistribution(
List<ConceptQuartileRecord> lowerLimitDistribution) {
this.lowerLimitDistribution = lowerLimitDistribution;
}
/**
* @return the observationsByType
*/
public List<ConceptCountRecord> getMeasurementsByType() {
return observationsByType;
}
/**
* @param observationsByType the observationsByType to set
*/
public void setMeasurementsByType(List<ConceptCountRecord> observationsByType) {
this.observationsByType = observationsByType;
}
/**
* @return the observationValueDistribution
*/
public List<ConceptQuartileRecord> getMeasurementValueDistribution() {
return measurementValueDistribution;
}
/**
* @param observationValueDistribution the observationValueDistribution to set
*/
public void setMeasurementValueDistribution(
List<ConceptQuartileRecord> observationValueDistribution) {
this.measurementValueDistribution = observationValueDistribution;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
/**
* @return the recordsByUnit
*/
public List<ConceptCountRecord> getRecordsByUnit() {
return recordsByUnit;
}
/**
* @param recordsByUnit the recordsByUnit to set
*/
public void setRecordsByUnit(List<ConceptCountRecord> recordsByUnit) {
this.recordsByUnit = recordsByUnit;
}
/**
* @return the upperLimitDistribution
*/
public List<ConceptQuartileRecord> getUpperLimitDistribution() {
return upperLimitDistribution;
}
/**
* @param upperLimitDistribution the upperLimitDistribution to set
*/
public void setUpperLimitDistribution(
List<ConceptQuartileRecord> upperLimitDistribution) {
this.upperLimitDistribution = upperLimitDistribution;
}
/**
* @return the valuesRelativeToNorm
*/
public List<ConceptCountRecord> getValuesRelativeToNorm() {
return valuesRelativeToNorm;
}
/**
* @param valuesRelativeToNorm the valuesRelativeToNorm to set
*/
public void setValuesRelativeToNorm(
List<ConceptCountRecord> valuesRelativeToNorm) {
this.valuesRelativeToNorm = valuesRelativeToNorm;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMDataDensity.java | src/main/java/org/ohdsi/webapi/report/CDMDataDensity.java | package org.ohdsi.webapi.report;
import java.util.List;
/**
* Created by taa7016 on 10/4/2016.
*/
public class CDMDataDensity {
private List<ConceptQuartileRecord> conceptsPerPerson;
private List<SeriesPerPerson> recordsPerPerson;
private List<SeriesPerPerson> totalRecords;
public List<SeriesPerPerson> getTotalRecords() {
return totalRecords;
}
public void setTotalRecords(List<SeriesPerPerson> totalRecords) {
this.totalRecords = totalRecords;
}
public List<SeriesPerPerson> getRecordsPerPerson() {
return recordsPerPerson;
}
public void setRecordsPerPerson(List<SeriesPerPerson> recordsPerPerson) {
this.recordsPerPerson = recordsPerPerson;
}
public List<ConceptQuartileRecord> getConceptsPerPerson() {
return conceptsPerPerson;
}
public void setConceptsPerPerson(List<ConceptQuartileRecord> conceptsPerPerson) {
this.conceptsPerPerson = conceptsPerPerson;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ConceptDecileRecord.java | src/main/java/org/ohdsi/webapi/report/ConceptDecileRecord.java | package org.ohdsi.webapi.report;
/**
*
* i.e. Trellis plot record
*
*/
public class ConceptDecileRecord {
private String trellisName;
private long conceptId;
private String seriesName;
private double yPrevalence1000Pp;
private int xCalendarYear;
private int numPersons;
/**
* @return the numPersons
*/
public int getNumPersons() {
return numPersons;
}
/**
* @param numPersons the numPersons to set
*/
public void setNumPersons(int numPersons) {
this.numPersons = numPersons;
}
/**
* @return the trellisName
*/
public String getTrellisName() {
return trellisName;
}
/**
* @param trellisName the trellisName to set
*/
public void setTrellisName(String trellisName) {
this.trellisName = trellisName;
}
/**
* @return the conceptId
*/
public long getConceptId() {
return conceptId;
}
/**
* @param conceptId the conceptId to set
*/
public void setConceptId(long conceptId) {
this.conceptId = conceptId;
}
/**
* @return the seriesName
*/
public String getSeriesName() {
return seriesName;
}
/**
* @param seriesName the seriesName to set
*/
public void setSeriesName(String seriesName) {
this.seriesName = seriesName;
}
/**
* @return the yPrevalence1000Pp
*/
public double getyPrevalence1000Pp() {
return yPrevalence1000Pp;
}
/**
* @param yPrevalence1000Pp the yPrevalence1000Pp to set
*/
public void setyPrevalence1000Pp(double yPrevalence1000Pp) {
this.yPrevalence1000Pp = yPrevalence1000Pp;
}
/**
* @return the xCalendarYear
*/
public int getxCalendarYear() {
return xCalendarYear;
}
/**
* @param xCalendarYear the xCalendarYear to set
*/
public void setxCalendarYear(int xCalendarYear) {
this.xCalendarYear = xCalendarYear;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMObservationPeriod.java | src/main/java/org/ohdsi/webapi/report/CDMObservationPeriod.java | package org.ohdsi.webapi.report;
import java.util.List;
/**
* Created by taa7016 on 10/4/2016.
*/
public class CDMObservationPeriod {
private List<ConceptDistributionRecord> ageAtFirst;
private List<ConceptDistributionRecord> observationLength;
private List<ConceptDistributionRecord> personsWithContinuousObservationsByYear;
private List<CohortStatsRecord> personsWithContinuousObservationsByYearStats;
private List<CohortStatsRecord> observationLengthStats;
private List<ConceptQuartileRecord> ageByGender;
private List<ConceptQuartileRecord> durationByGender;
private List<ConceptQuartileRecord> durationByAgeDecile;
private List<CumulativeObservationRecord> cumulativeObservation;
private List<ConceptCountRecord> observationPeriodsPerPerson;
private List<MonthObservationRecord> observedByMonth;
/**
* @return the ageAtFirst
*/
public List<ConceptDistributionRecord> getAgeAtFirst() {
return ageAtFirst;
}
/**
* @param ageAtFirst the ageAtFirst to set
*/
public void setAgeAtFirst(List<ConceptDistributionRecord> ageAtFirst) {
this.ageAtFirst = ageAtFirst;
}
/**
* @return the ageByGender
*/
public List<ConceptQuartileRecord> getAgeByGender() {
return ageByGender;
}
/**
* @param ageByGender the ageByGender to set
*/
public void setAgeByGender(List<ConceptQuartileRecord> ageByGender) {
this.ageByGender = ageByGender;
}
/**
* @return the observationLength
*/
public List<ConceptDistributionRecord> getObservationLength() {
return observationLength;
}
/**
* @param observationLength the observationLength to set
*/
public void setObservationLength(
List<ConceptDistributionRecord> observationLength) {
this.observationLength = observationLength;
}
/**
* @return the durationByGender
*/
public List<ConceptQuartileRecord> getDurationByGender() {
return durationByGender;
}
/**
* @param durationByGender the durationByGender to set
*/
public void setDurationByGender(List<ConceptQuartileRecord> durationByGender) {
this.durationByGender = durationByGender;
}
/**
* @return the cumulativeObservation
*/
public List<CumulativeObservationRecord> getCumulativeObservation() {
return cumulativeObservation;
}
/**
* @param cumulativeObservation the cumulativeObservation to set
*/
public void setCumulativeObservation(
List<CumulativeObservationRecord> cumulativeObservation) {
this.cumulativeObservation = cumulativeObservation;
}
/**
* @return the durationByAgeDecile
*/
public List<ConceptQuartileRecord> getDurationByAgeDecile() {
return durationByAgeDecile;
}
/**
* @param durationByAgeDecile the durationByAgeDecile to set
*/
public void setDurationByAgeDecile(
List<ConceptQuartileRecord> durationByAgeDecile) {
this.durationByAgeDecile = durationByAgeDecile;
}
/**
* @return the personsWithContinuousObservationsByYear
*/
public List<ConceptDistributionRecord> getPersonsWithContinuousObservationsByYear() {
return personsWithContinuousObservationsByYear;
}
/**
* @param personsWithContinuousObservationsByYear the personsWithContinuousObservationsByYear to set
*/
public void setPersonsWithContinuousObservationsByYear(
List<ConceptDistributionRecord> personsWithContinuousObservationsByYear) {
this.personsWithContinuousObservationsByYear = personsWithContinuousObservationsByYear;
}
/**
* @return the observationPeriodsPerPerson
*/
public List<ConceptCountRecord> getObservationPeriodsPerPerson() {
return observationPeriodsPerPerson;
}
/**
* @param observationPeriodsPerPerson the observationPeriodsPerPerson to set
*/
public void setObservationPeriodsPerPerson(
List<ConceptCountRecord> observationPeriodsPerPerson) {
this.observationPeriodsPerPerson = observationPeriodsPerPerson;
}
/**
* @return the observedByMonth
*/
public List<MonthObservationRecord> getObservedByMonth() {
return observedByMonth;
}
/**
* @param observedByMonth the observedByMonth to set
*/
public void setObservedByMonth(List<MonthObservationRecord> observedByMonth) {
this.observedByMonth = observedByMonth;
}
/**
* @return the personsWithContinuousObservationsByYearStats
*/
public List<CohortStatsRecord> getPersonsWithContinuousObservationsByYearStats() {
return personsWithContinuousObservationsByYearStats;
}
/**
* @param personsWithContinuousObservationsByYearStats the personsWithContinuousObservationsByYearStats to set
*/
public void setPersonsWithContinuousObservationsByYearStats(
List<CohortStatsRecord> personsWithContinuousObservationsByYearStats) {
this.personsWithContinuousObservationsByYearStats = personsWithContinuousObservationsByYearStats;
}
/**
* @return the observationLengthStats
*/
public List<CohortStatsRecord> getObservationLengthStats() {
return observationLengthStats;
}
/**
* @param observationLengthStats the observationLengthStats to set
*/
public void setObservationLengthStats(
List<CohortStatsRecord> observationLengthStats) {
this.observationLengthStats = observationLengthStats;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortConditionEraDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortConditionEraDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortConditionEraDrilldown {
private List<ConceptQuartileRecord> ageAtFirstDiagnosis;
private List<ConceptQuartileRecord> lengthOfEra;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstDiagnosis
*/
public List<ConceptQuartileRecord> getAgeAtFirstDiagnosis() {
return ageAtFirstDiagnosis;
}
/**
* @param ageAtFirstDiagnosis the ageAtFirstDiagnosis to set
*/
public void setAgeAtFirstDiagnosis(List<ConceptQuartileRecord> ageAtFirstDiagnosis) {
this.ageAtFirstDiagnosis = ageAtFirstDiagnosis;
}
/**
* @return the lengthOfEra
*/
public List<ConceptQuartileRecord> getLengthOfEra() {
return lengthOfEra;
}
/**
* @param lengthOfEra the lengthOfEra to set
*/
public void setLengthOfEra(List<ConceptQuartileRecord> lengthOfEra) {
this.lengthOfEra = lengthOfEra;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/MonthlyPrevalence.java | src/main/java/org/ohdsi/webapi/report/MonthlyPrevalence.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
import java.util.ArrayList;
/**
*
* @author fdefalco
*/
public class MonthlyPrevalence {
public ArrayList<Float> prevalence;
public ArrayList<String> monthKey;
public MonthlyPrevalence() {
prevalence = new ArrayList<>();
monthKey = new ArrayList<>();
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMConditionEra.java | src/main/java/org/ohdsi/webapi/report/CDMConditionEra.java | package org.ohdsi.webapi.report;
/**
* Created by taa7016 on 10/4/2016.
*/
public class CDMConditionEra {
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMProcedureSummary.java | src/main/java/org/ohdsi/webapi/report/CDMProcedureSummary.java | package org.ohdsi.webapi.report;
/**
* Created by taa7016 on 8/29/2016.
*/
public class CDMProcedureSummary {
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/PrevalenceRecord.java | src/main/java/org/ohdsi/webapi/report/PrevalenceRecord.java | package org.ohdsi.webapi.report;
public class PrevalenceRecord {
private int xCalendarMonth;
private long conceptId;
private String conceptName;
private double yPrevalence1000Pp;
private int numPersons;
/**
* @return the xCalendarMonth
*/
public int getxCalendarMonth() {
return xCalendarMonth;
}
/**
* @param xCalendarMonth the xCalendarMonth to set
*/
public void setxCalendarMonth(int xCalendarMonth) {
this.xCalendarMonth = xCalendarMonth;
}
/**
* @return the conceptId
*/
public long getConceptId() {
return conceptId;
}
/**
* @param conceptId the conceptId to set
*/
public void setConceptId(long conceptId) {
this.conceptId = conceptId;
}
/**
* @return the conceptName
*/
public String getConceptName() {
return conceptName;
}
/**
* @param conceptName the conceptName to set
*/
public void setConceptName(String conceptName) {
this.conceptName = conceptName;
}
/**
* @return the yPrevalence1000Pp
*/
public double getyPrevalence1000Pp() {
return yPrevalence1000Pp;
}
/**
* @param yPrevalence1000Pp the yPrevalence1000Pp to set
*/
public void setyPrevalence1000Pp(double yPrevalence1000Pp) {
this.yPrevalence1000Pp = yPrevalence1000Pp;
}
/**
* @return the numPersons
*/
public int getNumPersons() {
return numPersons;
}
/**
* @param numPersons the numPersons to set
*/
public void setNumPersons(int numPersons) {
this.numPersons = numPersons;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortObservationDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortObservationDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortObservationDrilldown {
private List<ConceptQuartileRecord> ageAtFirstOccurrence;
private List<ConceptQuartileRecord> lowerLimitDistribution;
private List<ConceptQuartileRecord> observationValueDistribution;
private List<ConceptQuartileRecord> upperLimitDistribution;
private List<ConceptCountRecord> observationsByType;
private List<ConceptCountRecord> recordsByUnit;
private List<ConceptCountRecord> valuesRelativeToNorm;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstOccurrence
*/
public List<ConceptQuartileRecord> getAgeAtFirstOccurrence() {
return ageAtFirstOccurrence;
}
/**
* @param ageAtFirstOccurrence the ageAtFirstOccurrence to set
*/
public void setAgeAtFirstOccurrence(
List<ConceptQuartileRecord> ageAtFirstOccurrence) {
this.ageAtFirstOccurrence = ageAtFirstOccurrence;
}
/**
* @return the lowerLimitDistribution
*/
public List<ConceptQuartileRecord> getLowerLimitDistribution() {
return lowerLimitDistribution;
}
/**
* @param lowerLimitDistribution the lowerLimitDistribution to set
*/
public void setLowerLimitDistribution(
List<ConceptQuartileRecord> lowerLimitDistribution) {
this.lowerLimitDistribution = lowerLimitDistribution;
}
/**
* @return the observationsByType
*/
public List<ConceptCountRecord> getObservationsByType() {
return observationsByType;
}
/**
* @param observationsByType the observationsByType to set
*/
public void setObservationsByType(List<ConceptCountRecord> observationsByType) {
this.observationsByType = observationsByType;
}
/**
* @return the observationValueDistribution
*/
public List<ConceptQuartileRecord> getObservationValueDistribution() {
return observationValueDistribution;
}
/**
* @param observationValueDistribution the observationValueDistribution to set
*/
public void setObservationValueDistribution(
List<ConceptQuartileRecord> observationValueDistribution) {
this.observationValueDistribution = observationValueDistribution;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
/**
* @return the recordsByUnit
*/
public List<ConceptCountRecord> getRecordsByUnit() {
return recordsByUnit;
}
/**
* @param recordsByUnit the recordsByUnit to set
*/
public void setRecordsByUnit(List<ConceptCountRecord> recordsByUnit) {
this.recordsByUnit = recordsByUnit;
}
/**
* @return the upperLimitDistribution
*/
public List<ConceptQuartileRecord> getUpperLimitDistribution() {
return upperLimitDistribution;
}
/**
* @param upperLimitDistribution the upperLimitDistribution to set
*/
public void setUpperLimitDistribution(
List<ConceptQuartileRecord> upperLimitDistribution) {
this.upperLimitDistribution = upperLimitDistribution;
}
/**
* @return the valuesRelativeToNorm
*/
public List<ConceptCountRecord> getValuesRelativeToNorm() {
return valuesRelativeToNorm;
}
/**
* @param valuesRelativeToNorm the valuesRelativeToNorm to set
*/
public void setValuesRelativeToNorm(
List<ConceptCountRecord> valuesRelativeToNorm) {
this.valuesRelativeToNorm = valuesRelativeToNorm;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/DrugPrevalence.java | src/main/java/org/ohdsi/webapi/report/DrugPrevalence.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
/**
*
* @author anthonygsena
*/
public class DrugPrevalence {
public DrugPrevalence() {
}
public String conceptPath;
public long conceptId;
public long numPersons;
public Float percentPersons;
public Float lengthOfEra;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CumulativeObservationRecord.java | src/main/java/org/ohdsi/webapi/report/CumulativeObservationRecord.java | package org.ohdsi.webapi.report;
import java.util.Objects;
public class CumulativeObservationRecord {
private String seriesName;
private int xLengthOfObservation;
private double yPercentPersons;
/**
* @return the seriesName
*/
public String getSeriesName() {
return seriesName;
}
/**
* @param seriesName the seriesName to set
*/
public void setSeriesName(String seriesName) {
this.seriesName = seriesName;
}
/**
* @return the xLengthOfObservation
*/
public int getxLengthOfObservation() {
return xLengthOfObservation;
}
/**
* @param xLengthOfObservation the xLengthOfObservation to set
*/
public void setxLengthOfObservation(int xLengthOfObservation) {
this.xLengthOfObservation = xLengthOfObservation;
}
/**
* @return the yPercentPersons
*/
public double getyPercentPersons() {
return yPercentPersons;
}
/**
* @param yPercentPersons the yPercentPersons to set
*/
public void setyPercentPersons(double yPercentPersons) {
this.yPercentPersons = yPercentPersons;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CumulativeObservationRecord that = (CumulativeObservationRecord) o;
return xLengthOfObservation == that.xLengthOfObservation &&
Double.compare(that.yPercentPersons, yPercentPersons) == 0 &&
Objects.equals(seriesName, that.seriesName);
}
@Override
public int hashCode() {
return Objects.hash(seriesName, xLengthOfObservation, yPercentPersons);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ExposureCohortSearch.java | src/main/java/org/ohdsi/webapi/report/ExposureCohortSearch.java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohdsi.webapi.report;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author asena5
*/
public class ExposureCohortSearch {
public ExposureCohortSearch(){}
@JsonProperty("EXPOSURE_COHORT_LIST")
public String[] exposureCohortList;
@JsonProperty("OUTCOME_COHORT_LIST")
public String[] outcomeCohortList;
@JsonProperty("MIN_CELL_COUNT")
public int minCellCount = 0;
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ObservationPeriodRecord.java | src/main/java/org/ohdsi/webapi/report/ObservationPeriodRecord.java | package org.ohdsi.webapi.report;
public class ObservationPeriodRecord {
private int cohortDefinitionId;
private double pctPersons;
private int countValue;
private int duration;
/**
* @return the cohortDefinitionId
*/
public int getCohortDefinitionId() {
return cohortDefinitionId;
}
/**
* @param cohortDefinitionId the cohortDefinitionId to set
*/
public void setCohortDefinitionId(int cohortDefinitionId) {
this.cohortDefinitionId = cohortDefinitionId;
}
/**
* @return the pctPersons
*/
public double getPctPersons() {
return pctPersons;
}
/**
* @param pctPersons the pctPersons to set
*/
public void setPctPersons(double pctPersons) {
this.pctPersons = pctPersons;
}
/**
* @return the countValue
*/
public int getCountValue() {
return countValue;
}
/**
* @param countValue the countValue to set
*/
public void setCountValue(int countValue) {
this.countValue = countValue;
}
/**
* @return the duration
*/
public int getDuration() {
return duration;
}
/**
* @param duration the duration to set
*/
public void setDuration(int duration) {
this.duration = duration;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CDMCondition.java | src/main/java/org/ohdsi/webapi/report/CDMCondition.java | package org.ohdsi.webapi.report;
/**
* Created by taa7016 on 10/4/2016.
*/
public class CDMCondition {
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortObservationPeriod.java | src/main/java/org/ohdsi/webapi/report/CohortObservationPeriod.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortObservationPeriod {
private List<ConceptDistributionRecord> ageAtFirst;
private List<ConceptDistributionRecord> observationLength;
private List<ConceptDistributionRecord> personsWithContinuousObservationsByYear;
private List<CohortStatsRecord> personsWithContinuousObservationsByYearStats;
private List<CohortStatsRecord> observationLengthStats;
private List<ConceptQuartileRecord> ageByGender;
private List<ConceptQuartileRecord> durationByGender;
private List<ConceptQuartileRecord> durationByAgeDecile;
private List<CumulativeObservationRecord> cumulativeObservation;
private List<ConceptCountRecord> observationPeriodsPerPerson;
private List<MonthObservationRecord> observedByMonth;
/**
* @return the ageAtFirst
*/
public List<ConceptDistributionRecord> getAgeAtFirst() {
return ageAtFirst;
}
/**
* @param ageAtFirst the ageAtFirst to set
*/
public void setAgeAtFirst(List<ConceptDistributionRecord> ageAtFirst) {
this.ageAtFirst = ageAtFirst;
}
/**
* @return the ageByGender
*/
public List<ConceptQuartileRecord> getAgeByGender() {
return ageByGender;
}
/**
* @param ageByGender the ageByGender to set
*/
public void setAgeByGender(List<ConceptQuartileRecord> ageByGender) {
this.ageByGender = ageByGender;
}
/**
* @return the observationLength
*/
public List<ConceptDistributionRecord> getObservationLength() {
return observationLength;
}
/**
* @param observationLength the observationLength to set
*/
public void setObservationLength(
List<ConceptDistributionRecord> observationLength) {
this.observationLength = observationLength;
}
/**
* @return the durationByGender
*/
public List<ConceptQuartileRecord> getDurationByGender() {
return durationByGender;
}
/**
* @param durationByGender the durationByGender to set
*/
public void setDurationByGender(List<ConceptQuartileRecord> durationByGender) {
this.durationByGender = durationByGender;
}
/**
* @return the cumulativeObservation
*/
public List<CumulativeObservationRecord> getCumulativeObservation() {
return cumulativeObservation;
}
/**
* @param cumulativeObservation the cumulativeObservation to set
*/
public void setCumulativeObservation(
List<CumulativeObservationRecord> cumulativeObservation) {
this.cumulativeObservation = cumulativeObservation;
}
/**
* @return the durationByAgeDecile
*/
public List<ConceptQuartileRecord> getDurationByAgeDecile() {
return durationByAgeDecile;
}
/**
* @param durationByAgeDecile the durationByAgeDecile to set
*/
public void setDurationByAgeDecile(
List<ConceptQuartileRecord> durationByAgeDecile) {
this.durationByAgeDecile = durationByAgeDecile;
}
/**
* @return the personsWithContinuousObservationsByYear
*/
public List<ConceptDistributionRecord> getPersonsWithContinuousObservationsByYear() {
return personsWithContinuousObservationsByYear;
}
/**
* @param personsWithContinuousObservationsByYear the personsWithContinuousObservationsByYear to set
*/
public void setPersonsWithContinuousObservationsByYear(
List<ConceptDistributionRecord> personsWithContinuousObservationsByYear) {
this.personsWithContinuousObservationsByYear = personsWithContinuousObservationsByYear;
}
/**
* @return the observationPeriodsPerPerson
*/
public List<ConceptCountRecord> getObservationPeriodsPerPerson() {
return observationPeriodsPerPerson;
}
/**
* @param observationPeriodsPerPerson the observationPeriodsPerPerson to set
*/
public void setObservationPeriodsPerPerson(
List<ConceptCountRecord> observationPeriodsPerPerson) {
this.observationPeriodsPerPerson = observationPeriodsPerPerson;
}
/**
* @return the observedByMonth
*/
public List<MonthObservationRecord> getObservedByMonth() {
return observedByMonth;
}
/**
* @param observedByMonth the observedByMonth to set
*/
public void setObservedByMonth(List<MonthObservationRecord> observedByMonth) {
this.observedByMonth = observedByMonth;
}
/**
* @return the personsWithContinuousObservationsByYearStats
*/
public List<CohortStatsRecord> getPersonsWithContinuousObservationsByYearStats() {
return personsWithContinuousObservationsByYearStats;
}
/**
* @param personsWithContinuousObservationsByYearStats the personsWithContinuousObservationsByYearStats to set
*/
public void setPersonsWithContinuousObservationsByYearStats(
List<CohortStatsRecord> personsWithContinuousObservationsByYearStats) {
this.personsWithContinuousObservationsByYearStats = personsWithContinuousObservationsByYearStats;
}
/**
* @return the observationLengthStats
*/
public List<CohortStatsRecord> getObservationLengthStats() {
return observationLengthStats;
}
/**
* @param observationLengthStats the observationLengthStats to set
*/
public void setObservationLengthStats(
List<CohortStatsRecord> observationLengthStats) {
this.observationLengthStats = observationLengthStats;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/PackedConceptNode.java | src/main/java/org/ohdsi/webapi/report/PackedConceptNode.java | /*
* Copyright 2015 fdefalco.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ohdsi.webapi.report;
import java.util.List;
/**
*
* @author fdefalco
*/
public class PackedConceptNode {
public PackedConceptNode() {
}
public String conceptName;
public long conceptId;
public long size;
public List<PackedConceptNode> children;
public boolean hasChildren() {
return children.size() > 0;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortVisitsDrilldown.java | src/main/java/org/ohdsi/webapi/report/CohortVisitsDrilldown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortVisitsDrilldown {
private List<ConceptQuartileRecord> ageAtFirstOccurrence;
private List<ConceptQuartileRecord> visitDurationByType;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstOccurrence
*/
public List<ConceptQuartileRecord> getAgeAtFirstOccurrence() {
return ageAtFirstOccurrence;
}
/**
* @param ageAtFirstOccurrence the ageAtFirstOccurrence to set
*/
public void setAgeAtFirstOccurrence(
List<ConceptQuartileRecord> ageAtFirstOccurrence) {
this.ageAtFirstOccurrence = ageAtFirstOccurrence;
}
/**
* @return the visitDurationByType
*/
public List<ConceptQuartileRecord> getVisitDurationByType() {
return visitDurationByType;
}
/**
* @param visitDurationByType the visitDurationByType to set
*/
public void setVisitDurationByType(List<ConceptQuartileRecord> visitDurationByType) {
this.visitDurationByType = visitDurationByType;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortProceduresDrillDown.java | src/main/java/org/ohdsi/webapi/report/CohortProceduresDrillDown.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortProceduresDrillDown {
private List<ConceptQuartileRecord> ageAtFirstOccurrence;
private List<ConceptCountRecord> proceduresByType;
private List<ConceptDecileRecord> prevalenceByGenderAgeYear;
private List<PrevalenceRecord> prevalenceByMonth;
/**
* @return the ageAtFirstOccurrence
*/
public List<ConceptQuartileRecord> getAgeAtFirstOccurrence() {
return ageAtFirstOccurrence;
}
/**
* @param ageAtFirstOccurrence the ageAtFirstOccurrence to set
*/
public void setAgeAtFirstOccurrence(
List<ConceptQuartileRecord> ageAtFirstOccurrence) {
this.ageAtFirstOccurrence = ageAtFirstOccurrence;
}
/**
* @return the proceduresByType
*/
public List<ConceptCountRecord> getProceduresByType() {
return proceduresByType;
}
/**
* @param proceduresByType the proceduresByType to set
*/
public void setProceduresByType(List<ConceptCountRecord> proceduresByType) {
this.proceduresByType = proceduresByType;
}
/**
* @return the prevalenceByGenderAgeYear
*/
public List<ConceptDecileRecord> getPrevalenceByGenderAgeYear() {
return prevalenceByGenderAgeYear;
}
/**
* @param prevalenceByGenderAgeYear the prevalenceByGenderAgeYear to set
*/
public void setPrevalenceByGenderAgeYear(
List<ConceptDecileRecord> prevalenceByGenderAgeYear) {
this.prevalenceByGenderAgeYear = prevalenceByGenderAgeYear;
}
/**
* @return the prevalenceByMonth
*/
public List<PrevalenceRecord> getPrevalenceByMonth() {
return prevalenceByMonth;
}
/**
* @param prevalenceByMonth the prevalenceByMonth to set
*/
public void setPrevalenceByMonth(List<PrevalenceRecord> prevalenceByMonth) {
this.prevalenceByMonth = prevalenceByMonth;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/ConceptCountRecord.java | src/main/java/org/ohdsi/webapi/report/ConceptCountRecord.java | package org.ohdsi.webapi.report;
import java.util.Objects;
/**
*
* i.e. donut
*
*/
public class ConceptCountRecord {
private String conditionConceptName;
private long conditionConceptId;
private String observationConceptName;
private long observationConceptId;
private String conceptName;
private long conceptId;
private long countValue;
/**
* @return the conditionConceptName
*/
public String getConditionConceptName() {
return conditionConceptName;
}
/**
* @param conditionConceptName the conditionConceptName to set
*/
public void setConditionConceptName(String conditionConceptName) {
this.conditionConceptName = conditionConceptName;
}
/**
* @return the conditionConceptId
*/
public long getConditionConceptId() {
return conditionConceptId;
}
/**
* @param conditionConceptId the conditionConceptId to set
*/
public void setConditionConceptId(long conditionConceptId) {
this.conditionConceptId = conditionConceptId;
}
/**
* @return the observationConceptName
*/
public String getObservationConceptName() {
return observationConceptName;
}
/**
* @param observationConceptName the observationConceptName to set
*/
public void setObservationConceptName(String observationConceptName) {
this.observationConceptName = observationConceptName;
}
/**
* @return the observationConceptId
*/
public long getObservationConceptId() {
return observationConceptId;
}
/**
* @param observationConceptId the observationConceptId to set
*/
public void setObservationConceptId(long observationConceptId) {
this.observationConceptId = observationConceptId;
}
/**
* @return the conceptName
*/
public String getConceptName() {
return conceptName;
}
/**
* @param conceptName the conceptName to set
*/
public void setConceptName(String conceptName) {
this.conceptName = conceptName;
}
/**
* @return the conceptId
*/
public long getConceptId() {
return conceptId;
}
/**
* @param conceptId the conceptId to set
*/
public void setConceptId(long conceptId) {
this.conceptId = conceptId;
}
/**
* @return the countValue
*/
public long getCountValue() {
return countValue;
}
/**
* @param countValue the countValue to set
*/
public void setCountValue(long countValue) {
this.countValue = countValue;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConceptCountRecord that = (ConceptCountRecord) o;
return conditionConceptId == that.conditionConceptId &&
observationConceptId == that.observationConceptId &&
conceptId == that.conceptId &&
countValue == that.countValue &&
Objects.equals(conditionConceptName, that.conditionConceptName) &&
Objects.equals(observationConceptName, that.observationConceptName) &&
Objects.equals(conceptName, that.conceptName);
}
@Override
public int hashCode() {
return Objects.hash(conditionConceptName, conditionConceptId, observationConceptName, observationConceptId, conceptName, conceptId, countValue);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortSpecificTreemap.java | src/main/java/org/ohdsi/webapi/report/CohortSpecificTreemap.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortSpecificTreemap {
private List<HierarchicalConceptRecord> conditionOccurrencePrevalence;
private List<HierarchicalConceptRecord> procedureOccurrencePrevalence;
private List<HierarchicalConceptRecord> drugEraPrevalence;
/**
* @return the conditionOccurrencePrevalence
*/
public List<HierarchicalConceptRecord> getConditionOccurrencePrevalence() {
return conditionOccurrencePrevalence;
}
/**
* @param conditionOccurrencePrevalence the conditionOccurrencePrevalence to set
*/
public void setConditionOccurrencePrevalence(
List<HierarchicalConceptRecord> conditionOccurrencePrevalence) {
this.conditionOccurrencePrevalence = conditionOccurrencePrevalence;
}
/**
* @return the procedureOccurrencePrevalence
*/
public List<HierarchicalConceptRecord> getProcedureOccurrencePrevalence() {
return procedureOccurrencePrevalence;
}
/**
* @param procedureOccurrencePrevalence the procedureOccurrencePrevalence to set
*/
public void setProcedureOccurrencePrevalence(
List<HierarchicalConceptRecord> procedureOccurrencePrevalence) {
this.procedureOccurrencePrevalence = procedureOccurrencePrevalence;
}
/**
* @return the drugEraPrevalence
*/
public List<HierarchicalConceptRecord> getDrugEraPrevalence() {
return drugEraPrevalence;
}
/**
* @param drugEraPrevalence the drugEraPrevalence to set
*/
public void setDrugEraPrevalence(
List<HierarchicalConceptRecord> drugEraPrevalence) {
this.drugEraPrevalence = drugEraPrevalence;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/CohortDataDensity.java | src/main/java/org/ohdsi/webapi/report/CohortDataDensity.java | package org.ohdsi.webapi.report;
import java.util.List;
public class CohortDataDensity {
private List<SeriesPerPerson> recordsPerPerson;
private List<SeriesPerPerson> totalRecords;
private List<ConceptQuartileRecord> conceptsPerPerson;
/**
* @return the recordsPerPerson
*/
public List<SeriesPerPerson> getRecordsPerPerson() {
return recordsPerPerson;
}
/**
* @param recordsPerPerson the recordsPerPerson to set
*/
public void setRecordsPerPerson(List<SeriesPerPerson> recordsPerPerson) {
this.recordsPerPerson = recordsPerPerson;
}
/**
* @return the totalRecords
*/
public List<SeriesPerPerson> getTotalRecords() {
return totalRecords;
}
/**
* @param totalRecords the totalRecords to set
*/
public void setTotalRecords(List<SeriesPerPerson> totalRecords) {
this.totalRecords = totalRecords;
}
/**
* @return the conceptsPerPerson
*/
public List<ConceptQuartileRecord> getConceptsPerPerson() {
return conceptsPerPerson;
}
/**
* @param conceptsPerPerson the conceptsPerPerson to set
*/
public void setConceptsPerPerson(List<ConceptQuartileRecord> conceptsPerPerson) {
this.conceptsPerPerson = conceptsPerPerson;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptConditionCountMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptConditionCountMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.ConceptCountRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptConditionCountMapper implements RowMapper<ConceptCountRecord> {
@Override
public ConceptCountRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
ConceptCountRecord record = new ConceptCountRecord();
record.setConditionConceptId(rs.getLong("CONDITION_CONCEPT_ID"));
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setConditionConceptName(rs.getString("CONDITION_CONCEPT_NAME"));
record.setConceptName(rs.getString("CONCEPT_NAME"));
record.setCountValue(rs.getLong("COUNT_VALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/CumulativeObservationMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/CumulativeObservationMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.CumulativeObservationRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class CumulativeObservationMapper implements RowMapper<CumulativeObservationRecord> {
@Override
public CumulativeObservationRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
CumulativeObservationRecord record = new CumulativeObservationRecord();
record.setSeriesName(rs.getString("SERIESNAME"));
record.setxLengthOfObservation(rs.getInt("XLENGTHOFOBSERVATION"));
record.setyPercentPersons(rs.getDouble("YPERCENTPERSONS"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ScatterplotMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ScatterplotMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.ScatterplotRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ScatterplotMapper implements RowMapper<ScatterplotRecord> {
@Override
public ScatterplotRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
ScatterplotRecord record = new ScatterplotRecord();
record.setRecordType(rs.getString("RECORD_TYPE"));
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setConceptName(rs.getString("CONCEPT_NAME"));
record.setCountValue(rs.getInt("COUNT_VALUE"));
record.setDuration(rs.getInt("DURATION"));
record.setPctPersons(rs.getDouble("PCT_PERSONS"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/HierarchicalConceptPrevalenceMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/HierarchicalConceptPrevalenceMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.HierarchicalConceptRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class HierarchicalConceptPrevalenceMapper implements RowMapper<HierarchicalConceptRecord> {
@Override
public HierarchicalConceptRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
HierarchicalConceptRecord record = new HierarchicalConceptRecord();
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setConceptPath(rs.getString("CONCEPT_PATH"));
record.setNumPersons(rs.getLong("NUM_PERSONS"));
record.setPercentPersons(rs.getDouble("PERCENT_PERSONS"));
record.setPercentPersonsBefore(rs.getDouble("PERCENT_PERSONS_BEFORE"));
record.setPercentPersonsAfter(rs.getDouble("PERCENT_PERSONS_AFTER"));
record.setRiskDiffAfterBefore(rs.getDouble("RISK_DIFF_AFTER_BEFORE"));
record.setLogRRAfterBefore(rs.getDouble("LOGRR_AFTER_BEFORE"));
record.setCountValue(rs.getLong("COUNT_VALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/PrevalanceConceptNameMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/PrevalanceConceptNameMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.PrevalenceRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class PrevalanceConceptNameMapper implements RowMapper<PrevalenceRecord> {
@Override
public PrevalenceRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
PrevalenceRecord record = new PrevalenceRecord();
record.setyPrevalence1000Pp(rs.getDouble("Y_PREVALENCE_1000PP"));
record.setxCalendarMonth(rs.getInt("X_CALENDAR_MONTH"));
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setConceptName(rs.getString("CONCEPT_NAME"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/CDMAttributeMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/CDMAttributeMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.CDMAttribute;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class CDMAttributeMapper implements RowMapper<CDMAttribute> {
@Override
public CDMAttribute mapRow(ResultSet rs, int rowNum) throws SQLException {
CDMAttribute attribute = new CDMAttribute();
attribute.setAttributeName(rs.getString("ATTRIBUTE_NAME"));
attribute.setAttributeValue(rs.getString("ATTRIBUTE_VALUE"));
return attribute;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/HierarchicalConceptMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/HierarchicalConceptMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.HierarchicalConceptRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class HierarchicalConceptMapper implements RowMapper<HierarchicalConceptRecord> {
@Override
public HierarchicalConceptRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
HierarchicalConceptRecord record = new HierarchicalConceptRecord();
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setConceptPath(rs.getString("CONCEPT_PATH"));
record.setRecordsPerPerson(rs.getDouble("RECORDS_PER_PERSON"));
record.setNumPersons(rs.getLong("NUM_PERSONS"));
record.setPercentPersons(rs.getDouble("PERCENT_PERSONS"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptDistributionMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptDistributionMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.ConceptDistributionRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptDistributionMapper implements RowMapper<ConceptDistributionRecord>{
@Override
public ConceptDistributionRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
ConceptDistributionRecord record = new ConceptDistributionRecord();
record.setCountValue(rs.getLong("COUNTVALUE"));
record.setIntervalIndex(rs.getInt("INTERVALINDEX"));
record.setPercentValue(rs.getDouble("PERCENTVALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/HierarchicalConceptEraMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/HierarchicalConceptEraMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.HierarchicalConceptRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class HierarchicalConceptEraMapper implements RowMapper<HierarchicalConceptRecord> {
@Override
public HierarchicalConceptRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
HierarchicalConceptRecord record = new HierarchicalConceptRecord();
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setLengthOfEra(rs.getDouble("LENGTH_OF_ERA"));
record.setConceptPath(rs.getString("CONCEPT_PATH"));
record.setNumPersons(rs.getLong("NUM_PERSONS"));
record.setPercentPersons(rs.getDouble("PERCENT_PERSONS"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptCountMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptCountMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.ConceptCountRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptCountMapper implements RowMapper<ConceptCountRecord> {
@Override
public ConceptCountRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
ConceptCountRecord record = new ConceptCountRecord();
record.setConceptId(rs.getLong("CONCEPTID"));
record.setConceptName(rs.getString("CONCEPTNAME"));
record.setCountValue(rs.getLong("COUNTVALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptObservationCountMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptObservationCountMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.ConceptCountRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptObservationCountMapper implements RowMapper<ConceptCountRecord> {
@Override
public ConceptCountRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
ConceptCountRecord record = new ConceptCountRecord();
record.setObservationConceptId(rs.getLong("OBSERVATION_CONCEPT_ID"));
record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setObservationConceptName(rs.getString("OBSERVATION_CONCEPT_ID"));
record.setConceptName(rs.getString("CONCEPT_NAME"));
record.setCountValue(rs.getLong("COUNT_VALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/PrevalanceConceptMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/PrevalanceConceptMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.PrevalenceRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class PrevalanceConceptMapper implements RowMapper<PrevalenceRecord> {
@Override
public PrevalenceRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
PrevalenceRecord record = new PrevalenceRecord();
record.setyPrevalence1000Pp(rs.getDouble("Y_PREVALENCE_1000PP"));
record.setxCalendarMonth(rs.getInt("X_CALENDAR_MONTH"));
record.setConceptId(rs.getLong("CONCEPT_ID"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/GenericRowMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/GenericRowMapper.java | package org.ohdsi.webapi.report.mapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.text.WordUtils;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.JdbcUtils;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.Date;
/**
* Created by mark on 10/29/16.
*/
public class GenericRowMapper implements RowMapper<JsonNode> {
private final ObjectMapper mapper;
public GenericRowMapper(ObjectMapper mapper) {
this.mapper = mapper;
}
@Override
public JsonNode mapRow(ResultSet rs, int rowNum) throws SQLException {
ObjectNode objectNode = mapper.createObjectNode();
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
for (int index = 1; index <= columnCount; index++) {
String column = JdbcUtils.lookupColumnName(rsmd, index);
Object value = rs.getObject(column);
column = this.snakeCaseToCamelCase(column);
if (value == null) {
objectNode.putNull(column);
} else if (value instanceof Integer) {
objectNode.put(column, (Integer) value);
} else if (value instanceof String) {
objectNode.put(column, (String) value);
} else if (value instanceof Boolean) {
objectNode.put(column, (Boolean) value);
} else if (value instanceof Date) {
objectNode.put(column, ((Date) value).getTime());
} else if (value instanceof Long) {
objectNode.put(column, (Long) value);
} else if (value instanceof Double) {
objectNode.put(column, (Double) value);
} else if (value instanceof Float) {
objectNode.put(column, (Float) value);
} else if (value instanceof BigDecimal) {
objectNode.put(column, (BigDecimal) value);
} else if (value instanceof Byte) {
objectNode.put(column, (Byte) value);
} else if (value instanceof byte[]) {
objectNode.put(column, (byte[]) value);
} else {
throw new IllegalArgumentException("Unmappable object type: " + value.getClass());
}
}
return objectNode;
}
protected String snakeCaseToCamelCase(String str) {
char[] delimeters = new char[] { '_' };
str = WordUtils.capitalizeFully(str.toLowerCase(), delimeters)
.replace("_", "");
return Character.toLowerCase(str.charAt(0)) + str.substring(1);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/MonthObservationMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/MonthObservationMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.MonthObservationRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class MonthObservationMapper implements RowMapper<MonthObservationRecord> {
@Override
public MonthObservationRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
MonthObservationRecord record = new MonthObservationRecord();
record.setMonthYear(rs.getInt("MONTHYEAR"));
record.setPercentValue(rs.getDouble("PERCENTVALUE"));
record.setCountValue(rs.getLong("COUNTVALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/PrevalanceMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/PrevalanceMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.PrevalenceRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class PrevalanceMapper implements RowMapper<PrevalenceRecord> {
@Override
public PrevalenceRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
PrevalenceRecord record = new PrevalenceRecord();
record.setyPrevalence1000Pp(rs.getDouble("Y_PREVALENCE_1000PP"));
record.setxCalendarMonth(rs.getInt("X_CALENDAR_MONTH"));
// record.setNumPersons(rs.getInt("NUM_PERSONS"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ObservationPeriodMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ObservationPeriodMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.cohortresults.ObservationPeriodRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ObservationPeriodMapper implements RowMapper<ObservationPeriodRecord> {
@Override
public ObservationPeriodRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
ObservationPeriodRecord obsRecord = new ObservationPeriodRecord();
obsRecord.setCohortDefinitionId(rs.getInt("COHORT_DEFINITION_ID"));
obsRecord.setPctPersons(rs.getDouble("PCT_PERSONS"));
obsRecord.setCountValue(rs.getInt("COUNT_VALUE"));
obsRecord.setDuration(rs.getInt("DURATION"));
return obsRecord;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptQuartileMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptQuartileMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.ConceptQuartileRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptQuartileMapper implements RowMapper<ConceptQuartileRecord> {
@Override
public ConceptQuartileRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
ConceptQuartileRecord record = new ConceptQuartileRecord();
record.setCategory(rs.getString("CATEGORY"));
record.setMaxValue(rs.getInt("MAX_VALUE"));
record.setP75Value(rs.getInt("P75_VALUE"));
record.setP10Value(rs.getInt("P10_VALUE"));
record.setMedianValue(rs.getInt("MEDIAN_VALUE"));
record.setP25Value(rs.getInt("P25_VALUE"));
record.setMinValue(rs.getInt("MIN_VALUE"));
record.setP90Value(rs.getInt("P90_VALUE"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/CohortStatsMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/CohortStatsMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.CohortStatsRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class CohortStatsMapper implements RowMapper<CohortStatsRecord> {
@Override
public CohortStatsRecord mapRow(ResultSet rs, int rowNum)
throws SQLException {
CohortStatsRecord stats = new CohortStatsRecord();
stats.setIntervalSize(rs.getInt("INTERVALSIZE"));
stats.setMaxValue(rs.getInt("MAXVALUE"));
stats.setMinValue(rs.getInt("MINVALUE"));
return stats;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptDecileMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptDecileMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.ConceptDecileRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptDecileMapper implements RowMapper<ConceptDecileRecord> {
@Override
public ConceptDecileRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
ConceptDecileRecord record = new ConceptDecileRecord();
record.setTrellisName(rs.getString("TRELLIS_NAME"));
// record.setConceptId(rs.getLong("CONCEPT_ID"));
record.setSeriesName(rs.getString("SERIES_NAME"));
record.setyPrevalence1000Pp(rs.getDouble("Y_PREVALENCE_1000PP"));
record.setxCalendarYear(rs.getInt("X_CALENDAR_YEAR"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/SeriesPerPersonMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/SeriesPerPersonMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.SeriesPerPerson;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SeriesPerPersonMapper implements RowMapper<SeriesPerPerson> {
@Override
public SeriesPerPerson mapRow(ResultSet rs, int rowNum)
throws SQLException {
SeriesPerPerson record = new SeriesPerPerson();
record.setSeriesName(rs.getString("SERIES_NAME"));
record.setxCalendarMonth(rs.getInt("X_CALENDAR_MONTH"));
record.setyRecordCount(rs.getFloat("Y_RECORD_COUNT"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/report/mapper/ConceptDecileCountsMapper.java | src/main/java/org/ohdsi/webapi/report/mapper/ConceptDecileCountsMapper.java | package org.ohdsi.webapi.report.mapper;
import org.ohdsi.webapi.report.ConceptDecileRecord;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ConceptDecileCountsMapper implements RowMapper<ConceptDecileRecord> {
@Override
public ConceptDecileRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
ConceptDecileRecord record = new ConceptDecileRecord();
record.setTrellisName(rs.getString("TRELLIS_NAME"));
record.setSeriesName(rs.getString("SERIES_NAME"));
record.setyPrevalence1000Pp(rs.getDouble("Y_PREVALENCE_1000PP"));
record.setxCalendarYear(rs.getInt("X_CALENDAR_YEAR"));
record.setNumPersons(rs.getInt("NUM_PERSONS"));
return record;
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/cohortsample/CohortSampleRepository.java | src/main/java/org/ohdsi/webapi/cohortsample/CohortSampleRepository.java | package org.ohdsi.webapi.cohortsample;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Repository of samples. This does not fetch any sample elements.
*/
@Component
public interface CohortSampleRepository extends CrudRepository<CohortSample, Integer> {
@Query("SELECT c FROM CohortSample c LEFT JOIN FETCH c.createdBy WHERE c.id = :id")
CohortSample findById(@Param("id") int cohortSampleId);
@Query("SELECT c FROM CohortSample c LEFT JOIN FETCH c.createdBy WHERE c.cohortDefinitionId = :cohortDefinitionId AND c.sourceId = :sourceId")
List<CohortSample> findByCohortDefinitionIdAndSourceId(@Param("cohortDefinitionId") int cohortDefinitionId, @Param("sourceId") int sourceId);
@Query("SELECT count(c.id) FROM CohortSample c WHERE c.cohortDefinitionId = :cohortDefinitionId")
int countSamples(@Param("cohortDefinitionId") int cohortDefinitionId);
@Query("SELECT count(c.id) FROM CohortSample c WHERE c.cohortDefinitionId = :cohortDefinitionId AND c.sourceId = :sourceId")
int countSamples(@Param("cohortDefinitionId") int cohortDefinitionId, @Param("sourceId") int sourceId);
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
OHDSI/WebAPI | https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/cohortsample/CleanupCohortSamplesTasklet.java | src/main/java/org/ohdsi/webapi/cohortsample/CleanupCohortSamplesTasklet.java | package org.ohdsi.webapi.cohortsample;
import org.ohdsi.webapi.cohortdefinition.CleanupCohortTasklet;
import org.ohdsi.webapi.job.JobExecutionResource;
import org.ohdsi.webapi.job.JobTemplate;
import org.ohdsi.webapi.source.Source;
import org.ohdsi.webapi.source.SourceDaimon;
import org.ohdsi.webapi.source.SourceRepository;
import org.ohdsi.webapi.util.PreparedStatementRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.job.builder.SimpleJobBuilder;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.transaction.support.TransactionTemplate;
import java.util.List;
import java.util.Map;
import static org.ohdsi.webapi.Constants.Params.COHORT_DEFINITION_ID;
import static org.ohdsi.webapi.Constants.Params.JOB_NAME;
import static org.ohdsi.webapi.Constants.Params.SOURCE_ID;
public class CleanupCohortSamplesTasklet implements Tasklet {
private static final Logger log = LoggerFactory.getLogger(CleanupCohortTasklet.class);
private final TransactionTemplate transactionTemplate;
private final SourceRepository sourceRepository;
private final CohortSamplingService samplingService;
private final CohortSampleRepository sampleRepository;
public CleanupCohortSamplesTasklet(
final TransactionTemplate transactionTemplate,
final SourceRepository sourceRepository,
CohortSamplingService samplingService,
CohortSampleRepository sampleRepository
) {
this.transactionTemplate = transactionTemplate;
this.sourceRepository = sourceRepository;
this.samplingService = samplingService;
this.sampleRepository = sampleRepository;
}
private Integer doTask(ChunkContext chunkContext) {
Map<String, Object> jobParams = chunkContext.getStepContext().getJobParameters();
int cohortDefinitionId = Integer.parseInt(jobParams.get(COHORT_DEFINITION_ID).toString());
if (jobParams.containsKey(SOURCE_ID)) {
int sourceId = Integer.parseInt(jobParams.get(SOURCE_ID).toString());
Source source = this.sourceRepository.findOne(sourceId);
if (source != null) {
return mapSource(source, cohortDefinitionId);
} else {
return 0;
}
} else {
return this.sourceRepository.findAll().stream()
.filter(source-> source.getDaimons()
.stream()
.anyMatch(daimon -> daimon.getDaimonType() == SourceDaimon.DaimonType.Results))
.mapToInt(source -> mapSource(source, cohortDefinitionId))
.sum();
}
}
private int mapSource(Source source, int cohortDefinitionId) {
try {
String resultSchema = source.getTableQualifier(SourceDaimon.DaimonType.Results);
return transactionTemplate.execute(transactionStatus -> {
List<CohortSample> samples = sampleRepository.findByCohortDefinitionIdAndSourceId(cohortDefinitionId, source.getId());
if (samples.isEmpty()) {
return 0;
}
sampleRepository.delete(samples);
int[] cohortSampleIds = samples.stream()
.mapToInt(CohortSample::getId)
.toArray();
PreparedStatementRenderer renderer = new PreparedStatementRenderer(
source,
"/resources/cohortsample/sql/deleteSampleElementsById.sql",
"results_schema",
resultSchema,
"cohortSampleId",
cohortSampleIds);
samplingService.getSourceJdbcTemplate(source)
.update(renderer.getSql(), renderer.getOrderedParams());
return cohortSampleIds.length;
});
} catch (Exception e) {
log.error("Error deleting samples for cohort: {}, cause: {}", cohortDefinitionId, e.getMessage());
return 0;
}
}
@Override
public RepeatStatus execute(final StepContribution contribution, final ChunkContext chunkContext) throws Exception {
this.transactionTemplate.execute(status -> doTask(chunkContext));
return RepeatStatus.FINISHED;
}
public JobExecutionResource launch(JobBuilderFactory jobBuilders, StepBuilderFactory stepBuilders, JobTemplate jobTemplate, int cohortDefinitionId) {
JobParametersBuilder builder = new JobParametersBuilder();
builder.addString(JOB_NAME, String.format("Cleanup cohort samples of cohort definition %d.", cohortDefinitionId));
builder.addString(COHORT_DEFINITION_ID, String.valueOf(cohortDefinitionId));
log.info("Beginning cohort cleanup for cohort definition id: {}", cohortDefinitionId);
return launch(jobBuilders, stepBuilders, jobTemplate, builder.toJobParameters());
}
public JobExecutionResource launch(JobBuilderFactory jobBuilders, StepBuilderFactory stepBuilders, JobTemplate jobTemplate, int cohortDefinitionId, int sourceId) {
JobParametersBuilder builder = new JobParametersBuilder();
builder.addString(JOB_NAME, String.format("Cleanup cohort samples of cohort definition %d.", cohortDefinitionId));
builder.addString(COHORT_DEFINITION_ID, String.valueOf(cohortDefinitionId));
builder.addString(SOURCE_ID, String.valueOf(sourceId));
log.info("Beginning cohort cleanup for cohort definition id {} and source ID {}", cohortDefinitionId, sourceId);
return launch(jobBuilders, stepBuilders, jobTemplate, builder.toJobParameters());
}
private JobExecutionResource launch(JobBuilderFactory jobBuilders, StepBuilderFactory stepBuilders, JobTemplate jobTemplate, JobParameters jobParameters) {
Step cleanupStep = stepBuilders.get("cohortSample.cleanupSamples")
.tasklet(this)
.build();
SimpleJobBuilder cleanupJobBuilder = jobBuilders.get("cleanupSamples")
.start(cleanupStep);
Job cleanupCohortJob = cleanupJobBuilder.build();
return jobTemplate.launch(cleanupCohortJob, jobParameters);
}
}
| java | Apache-2.0 | b22d7bf02d98c0cf78c46801877368d6ecad2245 | 2026-01-05T02:37:20.475642Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.