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/cohortcharacterization/dto/CcDistributionStat.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/dto/CcDistributionStat.java
package org.ohdsi.webapi.cohortcharacterization.dto; import org.ohdsi.analysis.cohortcharacterization.result.DistributionStat; public class CcDistributionStat extends CcPrevalenceStat implements DistributionStat { private Double avg; private Double stdDev; private Double min; private Double p10; private Double p25; private Double median; private Double p75; private Double p90; private Double max; private Integer aggregateId; private String aggregateName; private Boolean missingMeansZero; @Override public Double getAvg() { return avg; } @Override public Double getStdDev() { return stdDev; } @Override public Double getMin() { return min; } @Override public Double getP10() { return p10; } @Override public Double getP25() { return p25; } @Override public Double getMedian() { return median; } @Override public Double getP75() { return p75; } @Override public Double getP90() { return p90; } @Override public Double getMax() { return max; } public void setAvg(final Double avg) { this.avg = avg; } public void setStdDev(final Double stdDev) { this.stdDev = stdDev; } public void setMin(final Double min) { this.min = min; } public void setP10(final Double p10) { this.p10 = p10; } public void setP25(final Double p25) { this.p25 = p25; } public void setMedian(final Double median) { this.median = median; } public void setP75(final Double p75) { this.p75 = p75; } public void setP90(final Double p90) { this.p90 = p90; } public void setMax(final Double max) { this.max = max; } public Integer getAggregateId() { return aggregateId; } public void setAggregateId(Integer aggregateId) { this.aggregateId = aggregateId; } public String getAggregateName() { return aggregateName; } public void setAggregateName(String aggregateName) { this.aggregateName = aggregateName; } @Override public Boolean isMissingMeansZero() { return missingMeansZero; } public void setMissingMeansZero(Boolean missingMeansZero) { this.missingMeansZero = missingMeansZero; } }
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/cohortcharacterization/dto/CcPrevalenceStat.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/dto/CcPrevalenceStat.java
package org.ohdsi.webapi.cohortcharacterization.dto; import org.ohdsi.analysis.cohortcharacterization.result.PrevalenceStat; public class CcPrevalenceStat extends CcResult implements PrevalenceStat { private String timeWindow; private Long value; private Double proportion; private Double avg; private Long covariateId; private String covariateName; private Long conceptId; private String conceptName; private Long count; private long distance = 0; @Override public Double getProportion() { return this.proportion; } @Override public Long getCovariateId() { return covariateId; } @Override public String getCovariateName() { return covariateName; } @Override public Long getConceptId() { return conceptId; } @Override public Long getCount() { return count; } public void setCovariateId(final Long covariateId) { this.covariateId = covariateId; } public void setCovariateName(final String covariateName) { this.covariateName = covariateName; } public void setConceptId(final Long conceptId) { this.conceptId = conceptId; } public void setCount(final Long count) { this.count = count; } public String getTimeWindow() { return timeWindow; } public void setTimeWindow(final String timeWindow) { this.timeWindow = timeWindow; } public void setProportion(Double proportion) { this.proportion = proportion; } public Double getAvg() { return avg; } public void setAvg(Double avg) { this.avg = avg; } public long getDistance() { return distance; } public void setDistance(long distance) { this.distance = distance; } public String getConceptName() { return conceptName; } public void setConceptName(String conceptName) { this.conceptName = conceptName; } }
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/cohortcharacterization/dto/CcResult.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/dto/CcResult.java
package org.ohdsi.webapi.cohortcharacterization.dto; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.ohdsi.analysis.cohortcharacterization.design.CcResultType; @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) @JsonSubTypes({ @JsonSubTypes.Type(value = CcPrevalenceStat.class), @JsonSubTypes.Type(value = CcDistributionStat.class) }) public abstract class CcResult { private Long id; private String faType; private String sourceKey; private Integer cohortId; private Integer analysisId; private String analysisName; private CcResultType resultType; private Long strataId; private String strataName; public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public String getFaType() { return faType; } public void setFaType(String faType) { this.faType = faType; } public String getSourceKey() { return sourceKey; } public void setSourceKey(String sourceKey) { this.sourceKey = sourceKey; } public CcResultType getResultType() { return resultType; } public void setResultType(final CcResultType resultType) { this.resultType = resultType; } public Integer getCohortId() { return cohortId; } public void setCohortId(Integer cohortId) { this.cohortId = cohortId; } public Integer getAnalysisId() { return analysisId; } public void setAnalysisId(Integer analysisId) { this.analysisId = analysisId; } public String getAnalysisName() { return analysisName; } public void setAnalysisName(final String analysisName) { this.analysisName = analysisName; } public Long getStrataId() { return strataId; } public void setStrataId(Long strataId) { this.strataId = strataId; } public String getStrataName() { return strataName; } public void setStrataName(String strataName) { this.strataName = strataName; } }
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/cohortcharacterization/domain/CcGenerationEntity.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CcGenerationEntity.java
package org.ohdsi.webapi.cohortcharacterization.domain; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.ohdsi.webapi.common.generation.CommonGeneration; @Entity @Table(name = "cc_generation") public class CcGenerationEntity extends CommonGeneration { @ManyToOne(targetEntity = CohortCharacterizationEntity.class, fetch = FetchType.LAZY) @JoinColumn(name = "cc_id") private CohortCharacterizationEntity cohortCharacterization; public CohortCharacterizationEntity getCohortCharacterization() { return cohortCharacterization; } }
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/cohortcharacterization/domain/CcStrataConceptSetEntity.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CcStrataConceptSetEntity.java
package org.ohdsi.webapi.cohortcharacterization.domain; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.ohdsi.webapi.common.CommonConceptSetEntity; @Entity @Table(name = "cc_strata_conceptset") public class CcStrataConceptSetEntity extends CommonConceptSetEntity { @Id @GenericGenerator( name = "cc_strata_conceptset_generator", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "cc_strata_conceptset_seq"), @Parameter(name = "increment_size", value = "1") } ) @GeneratedValue(generator = "cc_strata_conceptset_generator") private Long id; @OneToOne(optional = false, targetEntity = CohortCharacterizationEntity.class, fetch = FetchType.LAZY) @JoinColumn(name = "cohort_characterization_id") private CohortCharacterizationEntity cohortCharacterization; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public CohortCharacterizationEntity getCohortCharacterization() { return cohortCharacterization; } public void setCohortCharacterization(CohortCharacterizationEntity cohortCharacterization) { this.cohortCharacterization = cohortCharacterization; } }
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/cohortcharacterization/domain/CohortCharacterizationEntity.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CohortCharacterizationEntity.java
package org.ohdsi.webapi.cohortcharacterization.domain; import java.util.*; import java.util.stream.Collectors; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.ohdsi.analysis.cohortcharacterization.design.CohortCharacterization; import org.ohdsi.circe.cohortdefinition.ConceptSet; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import org.ohdsi.webapi.feanalysis.domain.FeAnalysisEntity; import org.ohdsi.webapi.model.CommonEntity; import org.ohdsi.webapi.model.CommonEntityExt; import org.ohdsi.webapi.tag.domain.Tag; @Entity @Table(name = "cohort_characterization") public class CohortCharacterizationEntity extends CommonEntityExt<Long> implements CohortCharacterization { @Id @GenericGenerator( name = "cohort_characterization_generator", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "cohort_characterization_seq"), @Parameter(name = "increment_size", value = "1") } ) @GeneratedValue(generator = "cohort_characterization_generator") private Long id; @Column private String name; @Column private String description; @ManyToMany(targetEntity = CohortDefinition.class, fetch = FetchType.LAZY) @JoinTable(name = "cc_cohort", joinColumns = @JoinColumn(name = "cohort_characterization_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "cohort_id", referencedColumnName = "id")) private Set<CohortDefinition> cohortDefinitions = new HashSet<>(); @OneToMany(orphanRemoval = true) @JoinColumn(name = "cohort_characterization_id", insertable = false, updatable = false, nullable = false) private Set<CcFeAnalysisEntity> featureAnalyses = new HashSet<>(); @OneToMany(mappedBy = "cohortCharacterization", fetch = FetchType.LAZY, targetEntity = CcParamEntity.class) private Set<CcParamEntity> parameters = new HashSet<>(); @OneToMany(mappedBy = "cohortCharacterization", fetch = FetchType.LAZY, targetEntity = CcStrataEntity.class) private Set<CcStrataEntity> stratas = new HashSet<>(); @Column(name = "stratified_by") private String stratifiedBy; @Column(name = "strata_only") private Boolean strataOnly; @OneToOne(mappedBy = "cohortCharacterization", cascade = CascadeType.ALL) private CcStrataConceptSetEntity conceptSetEntity; @Column(name = "hash_code") private Integer hashCode; @ManyToMany(targetEntity = Tag.class, fetch = FetchType.LAZY) @JoinTable(name = "cohort_characterization_tag", joinColumns = @JoinColumn(name = "asset_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "tag_id", referencedColumnName = "id")) private Set<Tag> tags; @Override public Set<CohortDefinition> getCohorts() { return cohortDefinitions; } @Override public Set<FeAnalysisEntity> getFeatureAnalyses() { return featureAnalyses != null ? featureAnalyses.stream().map(CcFeAnalysisEntity::getFeatureAnalysis).collect(Collectors.toSet()) : Collections.emptySet(); } public Set<CcFeAnalysisEntity> getCcFeatureAnalyses() { return featureAnalyses; } @Override public Set<CcParamEntity> getParameters() { return parameters; } public void setFeatureAnalyses(Set<CcFeAnalysisEntity> featureAnalyses) { this.featureAnalyses = featureAnalyses; } @Override public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public String getName() { return name; } public void setName(final String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public void setParameters(final Set<CcParamEntity> parameters) { this.parameters = parameters; } public Set<CohortDefinition> getCohortDefinitions() { return cohortDefinitions; } public void setCohortDefinitions(final Set<CohortDefinition> cohortDefinitions) { this.cohortDefinitions = cohortDefinitions; } @Override public Set<CcStrataEntity> getStratas() { return stratas; } public void setStratas(Set<CcStrataEntity> stratas) { this.stratas = stratas; } public String getStratifiedBy() { return stratifiedBy; } public void setStratifiedBy(String stratifiedBy) { this.stratifiedBy = stratifiedBy; } public Boolean getStrataOnly() { return Objects.nonNull(strataOnly) ? strataOnly : false; } public void setStrataOnly(Boolean strataOnly) { this.strataOnly = strataOnly; } public CcStrataConceptSetEntity getConceptSetEntity() { return conceptSetEntity; } public void setConceptSetEntity(CcStrataConceptSetEntity conceptSetEntity) { this.conceptSetEntity = conceptSetEntity; } @Override public Collection<ConceptSet> getStrataConceptSets() { return Objects.nonNull(this.conceptSetEntity) ? this.conceptSetEntity.getConceptSets() : Collections.emptyList(); } public Integer getHashCode() { return hashCode; } public void setHashCode(final Integer hashCode) { this.hashCode = hashCode; } public Set<Tag> getTags() { return tags; } 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/cohortcharacterization/domain/CcParamEntity.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CcParamEntity.java
package org.ohdsi.webapi.cohortcharacterization.domain; import java.util.Objects; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.ohdsi.analysis.WithId; import org.ohdsi.analysis.cohortcharacterization.design.CohortCharacterization; import org.ohdsi.analysis.cohortcharacterization.design.CohortCharacterizationParam; @Entity @Table(name = "cc_param") public class CcParamEntity implements CohortCharacterizationParam, WithId<Long> { @Id @GenericGenerator( name = "cc_param_generator", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "cc_param_sequence"), @Parameter(name = "increment_size", value = "1") } ) @GeneratedValue(generator = "cc_param_generator") private Long id; @ManyToOne(optional = false, targetEntity = CohortCharacterizationEntity.class, fetch = FetchType.LAZY) @JoinColumn(name = "cohort_characterization_id") private CohortCharacterization cohortCharacterization; @Column private String name; @Column private String value; @Override public String getName() { return name; } @Override public String getValue() { return value; } public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public CohortCharacterization getCohortCharacterization() { return cohortCharacterization; } public void setCohortCharacterization(final CohortCharacterization cohortCharacterization) { this.cohortCharacterization = cohortCharacterization; } public void setName(final String name) { this.name = name; } public void setValue(final String value) { this.value = value; } @Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof CcParamEntity)) return false; final CcParamEntity that = (CcParamEntity) o; return Objects.equals(getId(), that.getId()); } @Override public int hashCode() { return Objects.hash(getId(), super.hashCode()); } }
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/cohortcharacterization/domain/CcStrataEntity.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CcStrataEntity.java
package org.ohdsi.webapi.cohortcharacterization.domain; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.ohdsi.analysis.Utils; import org.ohdsi.analysis.WithId; import org.ohdsi.analysis.cohortcharacterization.design.CohortCharacterizationStrata; import org.ohdsi.circe.cohortdefinition.CriteriaGroup; @Entity @Table(name = "cc_strata") public class CcStrataEntity implements CohortCharacterizationStrata, WithId<Long> { @Id @GenericGenerator( name = "cc_strata_generator", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "cc_strata_seq"), @Parameter(name = "increment_size", value = "1") } ) @GeneratedValue(generator = "cc_strata_generator") private Long id; @Column(name = "name") private String name; @Column(name = "expression") private String expressionString; @ManyToOne(optional = false, targetEntity = CohortCharacterizationEntity.class, fetch = FetchType.LAZY) @JoinColumn(name = "cohort_characterization_id") private CohortCharacterizationEntity cohortCharacterization; public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Override public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public CriteriaGroup getCriteria() { return Utils.deserialize(expressionString, CriteriaGroup.class); } public String getExpressionString() { return expressionString; } public void setExpressionString(String expressionString) { this.expressionString = expressionString; } public CohortCharacterizationEntity getCohortCharacterization() { return cohortCharacterization; } public void setCohortCharacterization(CohortCharacterizationEntity cohortCharacterization) { this.cohortCharacterization = cohortCharacterization; } }
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/cohortcharacterization/domain/CcFeAnalysisEntity.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CcFeAnalysisEntity.java
package org.ohdsi.webapi.cohortcharacterization.domain; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import org.ohdsi.analysis.cohortcharacterization.design.FeatureAnalysis; import org.ohdsi.analysis.cohortcharacterization.design.FeatureAnalysisDomain; import org.ohdsi.analysis.cohortcharacterization.design.FeatureAnalysisType; import org.ohdsi.webapi.feanalysis.domain.FeAnalysisEntity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import java.util.Optional; import java.util.function.Function; import java.util.function.Supplier; @Entity @Table(name = "cc_analysis") public class CcFeAnalysisEntity implements FeatureAnalysis { @Id @GenericGenerator( name = "cc_analysis_generator", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "cc_analysis_seq"), @Parameter(name = "increment_size", value = "1") } ) @GeneratedValue(generator = "cc_analysis_generator") private Long id; @ManyToOne(optional = false) @JoinColumn(name = "cohort_characterization_id") private CohortCharacterizationEntity cohortCharacterization; @ManyToOne(optional = false) @JoinColumn(name = "fe_analysis_id") private FeAnalysisEntity featureAnalysis; @Column(name = "include_annual") private Boolean includeAnnual; @Column(name = "include_temporal") private Boolean includeTemporal; public CohortCharacterizationEntity getCohortCharacterization() { return cohortCharacterization; } public void setCohortCharacterization(CohortCharacterizationEntity cohortCharacterization) { this.cohortCharacterization = cohortCharacterization; } public FeAnalysisEntity getFeatureAnalysis() { return featureAnalysis; } public void setFeatureAnalysis(FeAnalysisEntity featureAnalysis) { this.featureAnalysis = featureAnalysis; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Boolean getIncludeAnnual() { return includeAnnual; } public void setIncludeAnnual(Boolean includeAnnual) { this.includeAnnual = includeAnnual; } public Boolean getIncludeTemporal() { return includeTemporal; } public void setIncludeTemporal(Boolean includeTemporal) { this.includeTemporal = includeTemporal; } private <T> T mapFeatureAnalysis(Function<FeAnalysisEntity, T> getter) { return Optional.ofNullable(featureAnalysis).map(getter).orElse(null); } @Override public FeatureAnalysisType getType() { return mapFeatureAnalysis(FeatureAnalysis::getType); } @Override public String getName() { return mapFeatureAnalysis(FeatureAnalysis::getName); } @Override public FeatureAnalysisDomain getDomain() { return mapFeatureAnalysis(FeatureAnalysis::getDomain); } @Override public String getDescr() { return mapFeatureAnalysis(FeatureAnalysis::getDescr); } @Override public Object getDesign() { return mapFeatureAnalysis(FeatureAnalysis::getDesign); } }
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/cohortcharacterization/repository/CcFeAnalysisRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/CcFeAnalysisRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import org.ohdsi.webapi.cohortcharacterization.domain.CcFeAnalysisEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface CcFeAnalysisRepository extends JpaRepository<CcFeAnalysisEntity, Long> { }
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/cohortcharacterization/repository/AnalysisGenerationInfoEntityRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/AnalysisGenerationInfoEntityRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaRepository; import org.ohdsi.webapi.common.generation.AnalysisGenerationInfoEntity; import java.util.Optional; public interface AnalysisGenerationInfoEntityRepository extends EntityGraphJpaRepository<AnalysisGenerationInfoEntity, Long> { Optional<AnalysisGenerationInfoEntity> findById(Long generationId); }
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/cohortcharacterization/repository/CcConceptSetRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/CcConceptSetRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import org.ohdsi.webapi.cohortcharacterization.domain.CcStrataConceptSetEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface CcConceptSetRepository extends JpaRepository<CcStrataConceptSetEntity, Long> { }
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/cohortcharacterization/repository/CcParamRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/CcParamRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import java.util.Set; import org.ohdsi.webapi.cohortcharacterization.domain.CcParamEntity; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface CcParamRepository extends JpaRepository<CcParamEntity, Long> { Set<CcParamEntity> findAllByCohortCharacterization(CohortCharacterizationEntity mainEntity); }
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/cohortcharacterization/repository/CcRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/CcRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import java.util.List; import java.util.Optional; import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaRepository; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import org.ohdsi.webapi.feanalysis.domain.FeAnalysisEntity; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; public interface CcRepository extends EntityGraphJpaRepository<CohortCharacterizationEntity, Long> { Optional<CohortCharacterizationEntity> findById(final Long id); @Query("SELECT cc FROM CohortCharacterizationEntity cc WHERE cc.name LIKE ?1 ESCAPE '\\'") List<CohortCharacterizationEntity> findAllByNameStartsWith(String pattern); Optional<CohortCharacterizationEntity> findByName(String name); @Query("SELECT COUNT(cc) FROM CohortCharacterizationEntity cc WHERE cc.name = :ccName and cc.id <> :ccId") int getCountCcWithSameName(@Param("ccId") Long ccId, @Param("ccName") String ccName); @Query("SELECT cc FROM CohortCharacterizationEntity cc JOIN cc.cohortDefinitions cd WHERE cd = ?1") List<CohortCharacterizationEntity> findByCohortDefinition(CohortDefinition cd); @Query("SELECT cc FROM CohortCharacterizationEntity cc JOIN cc.featureAnalyses fa WHERE fa.featureAnalysis = :fa") List<CohortCharacterizationEntity> findByFeatureAnalysis(@Param("fa") FeAnalysisEntity feAnalysis); @Query("SELECT DISTINCT cc FROM CohortCharacterizationEntity cc JOIN FETCH cc.tags t WHERE lower(t.name) in :tagNames") List<CohortCharacterizationEntity> 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/cohortcharacterization/repository/CcStrataRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/CcStrataRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import org.ohdsi.webapi.cohortcharacterization.domain.CcStrataEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface CcStrataRepository extends JpaRepository<CcStrataEntity, Long> { }
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/cohortcharacterization/repository/CcGenerationEntityRepository.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/repository/CcGenerationEntityRepository.java
package org.ohdsi.webapi.cohortcharacterization.repository; import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaRepository; import java.util.List; import java.util.Optional; import org.ohdsi.webapi.cohortcharacterization.domain.CcGenerationEntity; public interface CcGenerationEntityRepository extends EntityGraphJpaRepository<CcGenerationEntity, Long> { List<CcGenerationEntity> findByCohortCharacterizationIdOrderByIdDesc(Long id, EntityGraph entityGraph); List<CcGenerationEntity> findByCohortCharacterizationIdAndSourceSourceKeyOrderByIdDesc(Long id, String sourceKey, EntityGraph source); List<CcGenerationEntity> findByStatusIn(List<String> statuses); Optional<CcGenerationEntity> findById(Long generationId); CcGenerationEntity findById(Long generationId, EntityGraph 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/cohortcharacterization/converter/CcStrataEntityToCcStrataDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcStrataEntityToCcStrataDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import com.odysseusinc.arachne.commons.converter.BaseConvertionServiceAwareConverter; import org.ohdsi.webapi.cohortcharacterization.domain.CcStrataEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcStrataDTO; import org.springframework.stereotype.Component; @Component public class CcStrataEntityToCcStrataDTOConverter extends BaseConvertionServiceAwareConverter<CcStrataEntity, CcStrataDTO> { @Override protected CcStrataDTO createResultObject(CcStrataEntity ccStrataEntity) { return new CcStrataDTO(); } @Override protected void convert(CcStrataEntity source, CcStrataDTO dto) { dto.setId(source.getId()); dto.setName(source.getName()); dto.setCriteria(source.getCriteria()); } }
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/cohortcharacterization/converter/CcToCcExportDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcToCcExportDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.dto.CcExportDTO; import org.springframework.stereotype.Component; @Component public class CcToCcExportDTOConverter extends BaseCcToCcExportDTOConverter<CcExportDTO> { @Override protected CcExportDTO createResultObject() { return new CcExportDTO(); } }
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/cohortcharacterization/converter/SerializedCcToCcConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/SerializedCcToCcConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import com.fasterxml.jackson.core.type.TypeReference; import org.ohdsi.analysis.Utils; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcExportDTO; import org.springframework.core.convert.ConversionService; import javax.persistence.AttributeConverter; public class SerializedCcToCcConverter implements AttributeConverter<CohortCharacterizationEntity, String> { private static ConversionService conversionService; public static void setConversionService(ConversionService conversionService) { SerializedCcToCcConverter.conversionService = conversionService; } @Override public String convertToDatabaseColumn(CohortCharacterizationEntity data) { CcExportDTO cohortCharacterizationDTO = conversionService.convert(data, CcExportDTO.class); cohortCharacterizationDTO.setModifiedDate(null); return Utils.serialize(cohortCharacterizationDTO); } @Override public CohortCharacterizationEntity convertToEntityAttribute(String data) { TypeReference<CcExportDTO> typeRef = new TypeReference<CcExportDTO>() {}; CcExportDTO dto = Utils.deserialize(data, typeRef); return conversionService.convert(dto, CohortCharacterizationEntity.class); } }
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/cohortcharacterization/converter/CharacterizationVersionToCharacterizationVersionFullDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CharacterizationVersionToCharacterizationVersionFullDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.analysis.Utils; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcVersionFullDTO; import org.ohdsi.webapi.cohortcharacterization.dto.CohortCharacterizationDTO; import org.ohdsi.webapi.cohortcharacterization.repository.CcRepository; import org.ohdsi.webapi.cohortcharacterization.specification.CohortCharacterizationImpl; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import org.ohdsi.webapi.cohortdefinition.dto.CohortMetadataDTO; import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter; import org.ohdsi.webapi.exception.ConversionAtlasException; import org.ohdsi.webapi.service.CohortDefinitionService; import org.ohdsi.webapi.versioning.domain.CharacterizationVersion; import org.ohdsi.webapi.versioning.dto.VersionDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.HashSet; import java.util.List; import java.util.stream.Collectors; @Component public class CharacterizationVersionToCharacterizationVersionFullDTOConverter extends BaseConversionServiceAwareConverter<CharacterizationVersion, CcVersionFullDTO> { @Autowired private CohortDefinitionService cohortService; @Autowired private CcRepository ccRepository; @Override public CcVersionFullDTO convert(CharacterizationVersion source) { CohortCharacterizationEntity def = ccRepository.findOne(source.getAssetId()); CohortCharacterizationImpl characterizationImpl = Utils.deserialize(source.getAssetJson(), CohortCharacterizationImpl.class); CohortCharacterizationEntity entity = conversionService.convert(characterizationImpl, CohortCharacterizationEntity.class); entity.setId(def.getId()); entity.setTags(def.getTags()); entity.setName(def.getName()); entity.setCreatedBy(def.getCreatedBy()); entity.setCreatedDate(def.getCreatedDate()); entity.setModifiedBy(def.getModifiedBy()); entity.setModifiedDate(def.getModifiedDate()); List<Integer> ids = characterizationImpl.getCohorts().stream() .map(CohortMetadataDTO::getId) .collect(Collectors.toList()); List<CohortDefinition> cohorts = cohortService.getCohorts(ids); if (cohorts.size() != ids.size()) { throw new ConversionAtlasException("Could not load version because it contains deleted cohorts"); } entity.setCohortDefinitions(new HashSet<>(cohorts)); CcVersionFullDTO target = new CcVersionFullDTO(); target.setVersionDTO(conversionService.convert(source, VersionDTO.class)); target.setEntityDTO(conversionService.convert(entity, CohortCharacterizationDTO.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/cohortcharacterization/converter/BaseCcDTOToCcEntityConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/BaseCcDTOToCcEntityConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import com.odysseusinc.arachne.commons.utils.ConverterUtils; import org.apache.commons.lang3.StringUtils; import org.ohdsi.analysis.Utils; import org.ohdsi.analysis.cohortcharacterization.design.CcResultType; import org.ohdsi.webapi.cohortcharacterization.domain.CcFeAnalysisEntity; import org.ohdsi.webapi.cohortcharacterization.domain.CcStrataConceptSetEntity; import org.ohdsi.webapi.cohortcharacterization.domain.CcParamEntity; import org.ohdsi.webapi.cohortcharacterization.domain.CcStrataEntity; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.dto.BaseCcDTO; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import org.ohdsi.webapi.cohortdefinition.CohortMetadataExt; import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter; import org.ohdsi.webapi.feanalysis.domain.FeAnalysisEntity; import org.ohdsi.webapi.feanalysis.dto.FeAnalysisShortDTO; import org.ohdsi.webapi.tag.domain.Tag; import org.springframework.beans.factory.annotation.Autowired; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import static org.ohdsi.analysis.cohortcharacterization.design.StandardFeatureAnalysisType.CRITERIA_SET; public abstract class BaseCcDTOToCcEntityConverter<T extends BaseCcDTO<? extends CohortMetadataExt, ? extends FeAnalysisShortDTO>> extends BaseConversionServiceAwareConverter<T, CohortCharacterizationEntity> { @Autowired private ConverterUtils converterUtils; @Override public CohortCharacterizationEntity convert(T source) { final CohortCharacterizationEntity cohortCharacterization = new CohortCharacterizationEntity(); cohortCharacterization.setName(StringUtils.trim(source.getName())); cohortCharacterization.setDescription(source.getDescription()); cohortCharacterization.setStratifiedBy(source.getStratifiedBy()); cohortCharacterization.setStrataOnly(source.getStrataOnly()); cohortCharacterization.setId(source.getId()); cohortCharacterization.setCohortDefinitions(converterUtils.convertSet(source.getCohorts(), CohortDefinition.class)); source.getFeatureAnalyses().forEach(fa -> { // Legacy Criteria Analyses didn't have statType, they were always PREVALENCE if (Objects.equals(fa.getType(), CRITERIA_SET) && fa.getStatType() == null) { fa.setStatType(CcResultType.PREVALENCE); } }); cohortCharacterization.setFeatureAnalyses( source.getFeatureAnalyses().stream().map(fa -> { CcFeAnalysisEntity feAnalysisEntity = new CcFeAnalysisEntity(); feAnalysisEntity.setFeatureAnalysis(conversionService.convert(fa, FeAnalysisEntity.class)); feAnalysisEntity.setCohortCharacterization(cohortCharacterization); feAnalysisEntity.setIncludeAnnual(fa.getIncludeAnnual()); feAnalysisEntity.setIncludeTemporal(fa.getIncludeTemporal()); return feAnalysisEntity; }).collect(Collectors.toSet()) ); cohortCharacterization.setParameters(converterUtils.convertSet(source.getParameters(), CcParamEntity.class)); cohortCharacterization.setStratas(converterUtils.convertSet(source.getStratas(), CcStrataEntity.class)); CcStrataConceptSetEntity conceptSetEntity = new CcStrataConceptSetEntity(); conceptSetEntity.setCohortCharacterization(cohortCharacterization); conceptSetEntity.setRawExpression(Utils.serialize(source.getStrataConceptSets())); cohortCharacterization.setConceptSetEntity(conceptSetEntity); if (Objects.nonNull(source.getTags())) { Set<Tag> tags = source.getTags().stream() .map(tag -> conversionService.convert(tag, Tag.class)).collect(Collectors.toSet()); cohortCharacterization.setTags(tags); } return cohortCharacterization; } }
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/cohortcharacterization/converter/BaseCcToCcDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/BaseCcToCcDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import com.odysseusinc.arachne.commons.utils.ConverterUtils; import org.apache.commons.lang3.ObjectUtils; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.dto.BaseCcDTO; import org.ohdsi.webapi.cohortcharacterization.dto.CcParameterDTO; import org.ohdsi.webapi.cohortcharacterization.dto.CcStrataDTO; import org.ohdsi.webapi.tag.dto.TagDTO; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; public abstract class BaseCcToCcDTOConverter<T extends BaseCcDTO> extends BaseCcToCcShortDTOConverter<T> { @Autowired protected ConverterUtils converterUtils; @Override public T convert(CohortCharacterizationEntity source) { final T cohortCharacterizationDTO = super.convert(source); Set<CcParameterDTO> convertedParameters = new TreeSet<>((o1, o2) -> ObjectUtils.compare(o1.getId(), o2.getId())); convertedParameters.addAll(converterUtils.convertSet(source.getParameters(), CcParameterDTO.class)); cohortCharacterizationDTO.setParameters(convertedParameters); Set<CcStrataDTO> convertedStratas = new TreeSet<>((o1, o2) -> ObjectUtils.compare(o1.getId(), o2.getId())); convertedStratas.addAll(converterUtils.convertSet(source.getStratas(), CcStrataDTO.class)); cohortCharacterizationDTO.setStratas(convertedStratas); cohortCharacterizationDTO.setStratifiedBy(source.getStratifiedBy()); cohortCharacterizationDTO.setStrataOnly(source.getStrataOnly()); cohortCharacterizationDTO.setStrataConceptSets(source.getStrataConceptSets()); if (Objects.nonNull(source.getTags())) { Set<TagDTO> tags = source.getTags().stream() .map(tag -> conversionService.convert(tag, TagDTO.class)).collect(Collectors.toSet()); cohortCharacterizationDTO.setTags(tags); } return cohortCharacterizationDTO; } }
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/cohortcharacterization/converter/CcDTOToCcEntityConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcDTOToCcEntityConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.dto.CohortCharacterizationDTO; import org.springframework.stereotype.Component; @Component public class CcDTOToCcEntityConverter extends BaseCcDTOToCcEntityConverter<CohortCharacterizationDTO> { }
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/cohortcharacterization/converter/CcExportDTOToCcEntityConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcExportDTOToCcEntityConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.dto.CcExportDTO; import org.springframework.stereotype.Component; @Component public class CcExportDTOToCcEntityConverter extends BaseCcDTOToCcEntityConverter<CcExportDTO> { }
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/cohortcharacterization/converter/CcToCohortCharacterizationImplConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcToCohortCharacterizationImplConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.specification.CohortCharacterizationImpl; import org.springframework.stereotype.Component; @Component public class CcToCohortCharacterizationImplConverter extends BaseCcToCcExportDTOConverter<CohortCharacterizationImpl> { @Override protected CohortCharacterizationImpl createResultObject() { return new CohortCharacterizationImpl(); } }
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/cohortcharacterization/converter/CcParameterDTOToCcParamEntityConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcParameterDTOToCcParamEntityConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.domain.CcParamEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcParameterDTO; import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter; import org.springframework.stereotype.Component; @Component public class CcParameterDTOToCcParamEntityConverter extends BaseConversionServiceAwareConverter<CcParameterDTO, CcParamEntity> { @Override public CcParamEntity convert(final CcParameterDTO source) { final CcParamEntity result = new CcParamEntity(); result.setName(source.getName()); result.setId(source.getId()); result.setValue(source.getValue()); 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/cohortcharacterization/converter/CcParamEntityToCcParameterDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcParamEntityToCcParameterDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.domain.CcParamEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcParameterDTO; import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter; import org.springframework.stereotype.Component; @Component public class CcParamEntityToCcParameterDTOConverter extends BaseConversionServiceAwareConverter<CcParamEntity, CcParameterDTO> { @Override public CcParameterDTO convert(final CcParamEntity source) { final CcParameterDTO dto = new CcParameterDTO(); dto.setValue(source.getValue()); dto.setName(source.getName()); dto.setId(source.getId()); return dto; } }
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/cohortcharacterization/converter/CcToCcDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcToCcDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CohortCharacterizationDTO; import org.ohdsi.webapi.cohortdefinition.dto.CohortMetadataDTO; import org.ohdsi.webapi.cohortdefinition.dto.CohortMetadataImplDTO; import org.ohdsi.webapi.feanalysis.dto.FeAnalysisShortDTO; import org.springframework.stereotype.Component; @Component public class CcToCcDTOConverter extends BaseCcToCcDTOConverter<CohortCharacterizationDTO> { @Override public CohortCharacterizationDTO convert(final CohortCharacterizationEntity source) { final CohortCharacterizationDTO cohortCharacterizationDTO = super.convert(source); cohortCharacterizationDTO.setCohorts(converterUtils.convertSet(source.getCohortDefinitions(), CohortMetadataImplDTO.class)); cohortCharacterizationDTO.setFeatureAnalyses(converterUtils.convertSet(source.getCcFeatureAnalyses(), FeAnalysisShortDTO.class)); return cohortCharacterizationDTO; } @Override protected CohortCharacterizationDTO createResultObject() { return new CohortCharacterizationDTO(); } }
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/cohortcharacterization/converter/BaseCcToCcShortDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/BaseCcToCcShortDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.apache.commons.lang3.StringUtils; import org.ohdsi.webapi.cohortcharacterization.dto.CcShortDTO; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.service.converters.BaseCommonEntityExtToDTOExtConverter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.convert.ConversionService; public abstract class BaseCcToCcShortDTOConverter<T extends CcShortDTO> extends BaseCommonEntityExtToDTOExtConverter<CohortCharacterizationEntity, T> { @Autowired protected ConversionService conversionService; @Override public void doConvert(final CohortCharacterizationEntity source, T target) { target.setName(StringUtils.trim(source.getName())); target.setDescription(source.getDescription()); target.setId(source.getId()); target.setHashCode(source.getHashCode()); } }
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/cohortcharacterization/converter/CharacterizationToCharacterizationVersionConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CharacterizationToCharacterizationVersionConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.analysis.Utils; import org.ohdsi.webapi.cohortcharacterization.CcService; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.specification.CohortCharacterizationImpl; import org.ohdsi.webapi.converter.BaseConversionServiceAwareConverter; import org.ohdsi.webapi.util.ExportUtil; import org.ohdsi.webapi.versioning.domain.CharacterizationVersion; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @Component public class CharacterizationToCharacterizationVersionConverter extends BaseConversionServiceAwareConverter<CohortCharacterizationEntity, CharacterizationVersion> { @Autowired private CcService ccService; @Autowired private Environment env; @Override public CharacterizationVersion convert(CohortCharacterizationEntity source) { CohortCharacterizationImpl characterizationImpl = conversionService.convert(source, CohortCharacterizationImpl.class); ExportUtil.clearCreateAndUpdateInfo(characterizationImpl); characterizationImpl.getFeatureAnalyses().forEach(ExportUtil::clearCreateAndUpdateInfo); characterizationImpl.getCohorts().forEach(ExportUtil::clearCreateAndUpdateInfo); characterizationImpl.setOrganizationName(env.getRequiredProperty("organization.name")); String expression = Utils.serialize(characterizationImpl, true); CharacterizationVersion target = new CharacterizationVersion(); target.setAssetId(source.getId()); target.setAssetJson(expression); 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/cohortcharacterization/converter/CcToCcShortDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcToCcShortDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.ohdsi.webapi.cohortcharacterization.dto.CcShortDTO; import org.springframework.stereotype.Component; @Component public class CcToCcShortDTOConverter extends BaseCcToCcShortDTOConverter<CcShortDTO> { @Override protected CcShortDTO createResultObject() { return new CcShortDTO(); } }
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/cohortcharacterization/converter/CcStrataDTOToCcStrataEntityConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/CcStrataDTOToCcStrataEntityConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import com.odysseusinc.arachne.commons.converter.BaseConvertionServiceAwareConverter; import org.ohdsi.analysis.Utils; import org.ohdsi.webapi.cohortcharacterization.domain.CcStrataEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcStrataDTO; import org.springframework.stereotype.Component; @Component public class CcStrataDTOToCcStrataEntityConverter extends BaseConvertionServiceAwareConverter<CcStrataDTO, CcStrataEntity> { @Override protected CcStrataEntity createResultObject(CcStrataDTO source) { return new CcStrataEntity(); } @Override protected void convert(CcStrataDTO source, CcStrataEntity entity) { entity.setId(source.getId()); entity.setName(source.getName()); entity.setExpressionString(Utils.serialize(source.getCriteria())); } }
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/cohortcharacterization/converter/BaseCcToCcExportDTOConverter.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/converter/BaseCcToCcExportDTOConverter.java
package org.ohdsi.webapi.cohortcharacterization.converter; import org.apache.commons.lang3.ObjectUtils; import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; import org.ohdsi.webapi.cohortcharacterization.dto.CcExportDTO; import org.ohdsi.webapi.cohortdefinition.dto.CohortDTO; import org.ohdsi.webapi.feanalysis.dto.FeAnalysisDTO; import java.util.Set; import java.util.TreeSet; public abstract class BaseCcToCcExportDTOConverter<T extends CcExportDTO> extends BaseCcToCcDTOConverter<T> { @Override public T convert(CohortCharacterizationEntity source) { final T exportDTO = super.convert(source); Set<CohortDTO> convertedCohortDTOs = new TreeSet<>((o1, o2) -> ObjectUtils.compare(o1.getId(), o2.getId())); convertedCohortDTOs.addAll(converterUtils.convertSet(source.getCohortDefinitions(), CohortDTO.class)); exportDTO.setCohorts(convertedCohortDTOs); Set<FeAnalysisDTO> convertedFeAnalysisDTOs = new TreeSet<>((o1, o2) -> ObjectUtils.compare(o1.getId(), o2.getId())); convertedFeAnalysisDTOs.addAll(converterUtils.convertSet(source.getFeatureAnalyses(), FeAnalysisDTO.class)); exportDTO.setFeatureAnalyses(convertedFeAnalysisDTOs); return exportDTO; } }
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/cohortcharacterization/report/AnalysisItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/AnalysisItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.ohdsi.analysis.cohortcharacterization.design.CcResultType; import org.ohdsi.webapi.cohortcharacterization.dto.CcResult; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import java.util.*; public class AnalysisItem { // Key is covariate id and strata id private Map<Pair<Long, Long>, List<CcResult>> map = new HashMap<>(); private CcResultType type; private String name; private String faType; public List<CcResult> getOrCreateCovariateItem(Long covariateId, Long strataId) { Pair<Long, Long> key = new ImmutablePair<>(covariateId, strataId); map.putIfAbsent(key, new ArrayList<>()); return map.get(key); } public void setType(CcResultType resultType) { this.type = resultType; } public CcResultType getType() { return this.type; } public String getName() { return name; } public void setName(String name) { this.name = name; } public void setFaType(String faType) { this.faType = faType; } public String getFaType() { return faType; } public AnalysisResultItem getSimpleItems(Map<Integer, CohortDefinition> definitionMap, Map<String, String> feAnalysisMap) { Set<ExportItem> values = new HashSet<>(); Set<String> domainIds = new HashSet<>(); Set<Cohort> cohorts = new HashSet<>(); ItemFactory factory = new ItemFactory(); for (List<CcResult> results : map.values()) { for (CcResult ccResult : results) { CohortDefinition cohortDef = definitionMap.get(ccResult.getCohortId()); ExportItem item = factory.createItem(ccResult, cohortDef.getName()); String domainId = feAnalysisMap.get(ccResult.getAnalysisName()); item.setDomainId(domainId); domainIds.add(domainId); cohorts.add(new Cohort(cohortDef.getId(), cohortDef.getName())); values.add(item); } } return new AnalysisResultItem(domainIds, cohorts, values); } public AnalysisResultItem getComparativeItems(CohortDefinition firstCohortDef, CohortDefinition secondCohortDef, Map<String, String> feAnalysisMap) { Set<ExportItem> values = new HashSet<>(); Set<String> domainIds = new HashSet<>(); Set<Cohort> cohorts = new HashSet<>(); cohorts.add(new Cohort(firstCohortDef.getId(), firstCohortDef.getName())); cohorts.add(new Cohort(secondCohortDef.getId(), secondCohortDef.getName())); ItemFactory factory = new ItemFactory(); for (List<CcResult> results : map.values()) { // create default items, because we can have result for only one cohort ExportItem first = null; ExportItem second = null; for (CcResult ccResult : results) { if (Objects.equals(ccResult.getCohortId(), firstCohortDef.getId())) { first = factory.createItem(ccResult, firstCohortDef.getName()); } else { second = factory.createItem(ccResult, secondCohortDef.getName()); } } ExportItem comparativeItem; if(first instanceof DistributionItem || second instanceof DistributionItem) { comparativeItem = new ComparativeDistributionItem((DistributionItem) first, (DistributionItem) second, firstCohortDef, secondCohortDef); } else { comparativeItem = new ComparativeItem((PrevalenceItem) first, (PrevalenceItem) second, firstCohortDef, secondCohortDef); } String domainId = feAnalysisMap.get(comparativeItem.getAnalysisName()); comparativeItem.setDomainId(domainId); domainIds.add(domainId); values.add(comparativeItem); } return new AnalysisResultItem(domainIds, cohorts, values); } }
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/cohortcharacterization/report/DistributionItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/DistributionItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import org.ohdsi.webapi.cohortcharacterization.dto.CcDistributionStat; import java.util.ArrayList; import java.util.List; public class DistributionItem extends PrevalenceItem<DistributionItem> { private final Double stdDev; private final Double min; private final Double p10; private final Double p25; private final Double median; private final Double p75; private final Double p90; private final Double max; private final Integer aggregateId; private final String aggregateName; private final Boolean missingMeansZero; public DistributionItem(CcDistributionStat distributionStat, String cohortName) { super(distributionStat, cohortName); this.stdDev = distributionStat.getStdDev(); this.min = distributionStat.getMin(); this.p10 = distributionStat.getP10(); this.p25 = distributionStat.getP25(); this.median = distributionStat.getMedian(); this.p75 = distributionStat.getP75(); this.p90 = distributionStat.getP90(); this.max = distributionStat.getMax(); this.aggregateId = distributionStat.getAggregateId(); this.aggregateName = distributionStat.getAggregateName(); this.missingMeansZero = distributionStat.isMissingMeansZero(); } @Override protected List<String> getValueList() { // Do not use parent function as this report has its own order of columns List<String> values = new ArrayList<>(); values.add(String.valueOf(this.getAnalysisId())); values.add(this.getAnalysisName()); values.add(String.valueOf(this.getStrataId())); values.add(this.getStrataName()); values.add(String.valueOf(this.cohortId)); values.add(this.cohortName); values.add(String.valueOf(this.getCovariateId())); values.add(this.getCovariateName()); values.add(this.getCovariateShortName()); values.add(this.aggregateName); values.add(String.valueOf(this.missingMeansZero)); values.add(String.valueOf(this.count)); values.add(String.valueOf(this.avg)); values.add(String.valueOf(this.stdDev)); values.add(String.valueOf(this.min)); values.add(String.valueOf(this.p10)); values.add(String.valueOf(this.p25)); values.add(String.valueOf(this.median)); values.add(String.valueOf(this.p75)); values.add(String.valueOf(this.p90)); values.add(String.valueOf(this.max)); return values; } @Override protected double calcDiff(DistributionItem another) { if (stdDev == null || another.stdDev == null || avg == null || another.avg == null) { return 0d; } double sd1 = stdDev; double sd2 = another.stdDev; double sd = Math.sqrt((sd1 * sd1 + sd2 * sd2)/2.0); // prevent division by zero return sd != 0D ? (avg - another.avg) / sd : 0; } public Double getStdDev() { return stdDev; } public Double getMin() { return min; } public Double getP10() { return p10; } public Double getP25() { return p25; } public Double getMedian() { return median; } public Double getP75() { return p75; } public Double getP90() { return p90; } public Double getMax() { return max; } public Integer getAggregateId() { return aggregateId; } public String getAggregateName() { return aggregateName; } public Boolean isMissingMeansZero() { return missingMeansZero; } }
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/cohortcharacterization/report/PrevalenceItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/PrevalenceItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import org.ohdsi.webapi.cohortcharacterization.dto.CcPrevalenceStat; import java.util.ArrayList; import java.util.List; public class PrevalenceItem<T extends PrevalenceItem> extends ExportItem<T> { protected final double MAX_DIFF = 1000.0d; // we need to ensure a JSON-parsable value protected final Integer cohortId; protected final String cohortName; protected final Long count; protected final Double pct; protected final Double avg; private List<TemporalItem> temporal; private List<TemporalAnnualItem> temporalAnnual; public PrevalenceItem(CcPrevalenceStat prevalenceStat, String cohortName) { super(prevalenceStat); this.cohortId = prevalenceStat.getCohortId(); this.cohortName = cohortName; this.count = prevalenceStat.getCount(); this.avg = prevalenceStat.getAvg(); this.pct = prevalenceStat.getAvg() * 100; } @Override protected List<String> getValueList() { List<String> values = new ArrayList<>(); values.add(String.valueOf(this.getAnalysisId())); values.add(this.getAnalysisName()); values.add(String.valueOf(this.getStrataId())); values.add(this.getStrataName()); values.add(String.valueOf(this.cohortId)); values.add(this.cohortName); values.add(String.valueOf(this.getCovariateId())); values.add(this.getCovariateName()); values.add(this.getCovariateShortName()); values.add(String.valueOf(this.count)); values.add(String.valueOf(this.pct)); return values; } /** * Calculate Standardized Mean Difference of dichotomous (binary) variable * From https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3472075/pdf/sim0028-3083.pdf * **/ @Override protected double calcDiff(PrevalenceItem another) { double pTarget = avg == null ? 0 : avg; double pCompare = another.avg == null ? 0 : another.avg; double pooledError = Math.sqrt(((pTarget * (1.0 - pTarget)) + (pCompare * (1.0 - pCompare)))/2); if (pooledError == 0) { // undefined case where denom = 0 if (pTarget != pCompare) { // return +/- INF based on if T is bigger. return pTarget > pCompare ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY; } else { // pTreatment and pCompare are same, so return 0 return 0.0d; } } else { // calculate the standard mean differnce return (pTarget - pCompare) / pooledError; } } @Override public int compareTo(PrevalenceItem that) { int res = getAnalysisId().compareTo(that.getAnalysisId()); if (res == 0) { getCovariateName().compareToIgnoreCase(that.getCovariateName()); } if (res == 0) { res = cohortName.compareToIgnoreCase(that.cohortName); } return res; } public Long getCount() { return count; } public Double getPct() { return pct; } public Double getAvg() { return avg; } public Integer getCohortId() { return cohortId; } public String getCohortName() { return cohortName; } public List<TemporalItem> getTemporal() { return temporal; } public void setTemporal(List<TemporalItem> temporal) { this.temporal = temporal; } public List<TemporalAnnualItem> getTemporalAnnual() { return temporalAnnual; } public void setTemporalAnnual(List<TemporalAnnualItem> temporalAnnual) { this.temporalAnnual = temporalAnnual; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; PrevalenceItem<?> that = (PrevalenceItem<?>) o; return cohortId != null ? cohortId.equals(that.cohortId) : that.cohortId == null; } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (cohortId != null ? cohortId.hashCode() : 0); 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/cohortcharacterization/report/ComparativeItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/ComparativeItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import java.util.ArrayList; import java.util.List; import org.ohdsi.webapi.cohortcharacterization.dto.CcPrevalenceStat; public class ComparativeItem extends ExportItem<ComparativeItem> { private final boolean hasFirstItem; private final boolean hasSecondItem; private final Integer targetCohortId; private final String targetCohortName; private final Long targetCount; private final Double targetPct; private final Integer comparatorCohortId; private final String comparatorCohortName; private final Long comparatorCount; private final Double comparatorPct; private final double diff; private static final CcPrevalenceStat EMPTY_ITEM; static { EMPTY_ITEM = new CcPrevalenceStat(); EMPTY_ITEM.setAvg(0.0d); EMPTY_ITEM.setProportion(0.0d); } public ComparativeItem(PrevalenceItem firstItem, PrevalenceItem secondItem, CohortDefinition firstCohortDef, CohortDefinition secondCohortDef) { super(firstItem != null ? firstItem : secondItem); this.hasFirstItem = firstItem != null; this.hasSecondItem = secondItem != null; this.targetCohortId = firstCohortDef.getId(); this.targetCohortName = firstCohortDef.getName(); this.targetCount = firstItem != null ? firstItem.count : null; this.targetPct = firstItem != null ? firstItem.pct : null; this.comparatorCohortId = secondCohortDef.getId(); this.comparatorCohortName = secondCohortDef.getName(); this.comparatorCount = secondItem != null ? secondItem.count : null; this.comparatorPct = secondItem != null ? secondItem.pct : null; this.diff = calcDiff(firstItem, secondItem); } protected double calcDiff(ExportItem first, ExportItem second) { if (first == null) { first = new PrevalenceItem(EMPTY_ITEM, this.targetCohortName); } if (second == null) { second = new PrevalenceItem(EMPTY_ITEM, this.comparatorCohortName); } return first.calcDiff(second); } @Override protected List<String> getValueList() { // Do not use parent function as this report has its own order of columns List<String> values = new ArrayList<>(); values.add(String.valueOf(this.getAnalysisId())); values.add(this.getAnalysisName()); values.add(String.valueOf(this.getStrataId())); values.add(this.getStrataName()); values.add(String.valueOf(targetCohortId)); values.add(targetCohortName); values.add(String.valueOf(comparatorCohortId)); values.add(comparatorCohortName); values.add(String.valueOf(this.getCovariateId())); values.add(this.getCovariateName()); values.add(this.getCovariateShortName()); values.add(this.targetCount != null ? String.valueOf(this.targetCount) : "0"); values.add(this.targetPct != null ? String.valueOf(this.targetPct) : "0"); values.add(this.comparatorCount != null ? String.valueOf(this.comparatorCount) : "0"); values.add(this.comparatorPct != null ? String.valueOf(this.comparatorPct) : "0"); values.add(String.format("%.4f", this.diff)); return values; } @Override public int compareTo(ComparativeItem that) { int res = getAnalysisId().compareTo(that.getAnalysisId()); if (res == 0) { getCovariateName().compareToIgnoreCase(that.getCovariateName()); } return res; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } ComparativeItem that = (ComparativeItem) o; if (targetCohortId != null ? !targetCohortId.equals(that.targetCohortId) : that.targetCohortId != null) { return false; } return comparatorCohortId != null ? comparatorCohortId.equals(that.comparatorCohortId) : that.comparatorCohortId == null; } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (targetCohortId != null ? targetCohortId.hashCode() : 0); result = 31 * result + (comparatorCohortId != null ? comparatorCohortId.hashCode() : 0); return result; } public boolean isHasFirstItem() { return hasFirstItem; } public boolean isHasSecondItem() { return hasSecondItem; } public Integer getTargetCohortId() { return targetCohortId; } public String getTargetCohortName() { return targetCohortName; } public Long getTargetCount() { return targetCount; } public Double getTargetPct() { return targetPct; } public Integer getComparatorCohortId() { return comparatorCohortId; } public String getComparatorCohortName() { return comparatorCohortName; } public Long getComparatorCount() { return comparatorCount; } public Double getComparatorPct() { return comparatorPct; } public double getDiff() { return diff; } }
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/cohortcharacterization/report/Cohort.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/Cohort.java
package org.ohdsi.webapi.cohortcharacterization.report; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; public class Cohort { private Integer cohortId; private String cohortName; @JsonCreator public Cohort(@JsonProperty("cohortId") Integer cohortId, @JsonProperty("cohortName") String cohortName) { this.cohortId = cohortId; this.cohortName = cohortName; } public Integer getCohortId() { return cohortId; } public String getCohortName() { return cohortName; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Cohort)) return false; Cohort cohort = (Cohort) o; return Objects.equals(cohortId, cohort.cohortId) && Objects.equals(cohortName, cohort.cohortName); } @Override public int hashCode() { return Objects.hash(cohortId, cohortName); } }
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/cohortcharacterization/report/ItemFactory.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/ItemFactory.java
package org.ohdsi.webapi.cohortcharacterization.report; import com.google.common.collect.ImmutableMap; import org.ohdsi.analysis.cohortcharacterization.design.CcResultType; import org.ohdsi.webapi.cohortcharacterization.dto.CcDistributionStat; import org.ohdsi.webapi.cohortcharacterization.dto.CcPrevalenceStat; import org.ohdsi.webapi.cohortcharacterization.dto.CcResult; import java.util.Map; import java.util.Optional; import java.util.function.BiFunction; import static org.ohdsi.analysis.cohortcharacterization.design.CcResultType.DISTRIBUTION; import static org.ohdsi.analysis.cohortcharacterization.design.CcResultType.PREVALENCE; public class ItemFactory { private static Map<CcResultType, BiFunction<CcResult, String, ExportItem>> itemMap = ImmutableMap.of( PREVALENCE, (ccResult, cohortName) -> new PrevalenceItem((CcPrevalenceStat) ccResult, cohortName), DISTRIBUTION, (ccResult, cohortName) -> new DistributionItem((CcDistributionStat) ccResult, cohortName) ); public ExportItem createItem(CcResult ccResult, String cohortName) { return Optional.ofNullable(itemMap.get(ccResult.getResultType())) .orElseThrow(() -> new RuntimeException("ExportItem for result type: " + ccResult.getResultType() + " is not defined")) .apply(ccResult, cohortName); } }
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/cohortcharacterization/report/ExportItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/ExportItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.apache.commons.lang3.StringUtils; import org.ohdsi.webapi.cohortcharacterization.dto.CcPrevalenceStat; import java.util.ArrayList; import java.util.List; @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) @JsonSubTypes({ @JsonSubTypes.Type(value = ComparativeDistributionItem.class), @JsonSubTypes.Type(value = ComparativeItem.class), @JsonSubTypes.Type(value = DistributionItem.class), @JsonSubTypes.Type(value = PrevalenceItem.class) }) public abstract class ExportItem<T extends ExportItem> implements Comparable<T> { private final Integer analysisId; private final String analysisName; private final Long strataId; private final String strataName; private final Long covariateId; private final String covariateName; private final String covariateShortName; private final String faType; private String domainId; private final Long conceptId; private final String conceptName; public ExportItem(CcPrevalenceStat ccResult) { this.analysisId = ccResult.getAnalysisId(); this.analysisName = ccResult.getAnalysisName(); this.strataId = ccResult.getStrataId(); this.strataName = getStrataNameOrDefault(ccResult.getStrataName()); this.covariateId = ccResult.getCovariateId(); this.covariateName = ccResult.getCovariateName(); this.covariateShortName = extractMeaningfulCovariateName(ccResult.getCovariateName()); this.faType = ccResult.getFaType(); this.conceptId = ccResult.getConceptId(); this.conceptName = ccResult.getConceptName(); } public ExportItem(PrevalenceItem item) { this.analysisId = item.getAnalysisId(); this.analysisName = item.getAnalysisName(); this.strataId = item.getStrataId(); this.strataName = getStrataNameOrDefault(item.getStrataName()); this.covariateId = item.getCovariateId(); this.covariateName = item.getCovariateName(); this.covariateShortName = extractMeaningfulCovariateName(item.getCovariateName()); this.faType = item.getFaType(); this.conceptId = item.getConceptId(); this.conceptName = item.getConceptName(); } protected List<String> getValueList() { List<String> values = new ArrayList<>(); values.add(String.valueOf(this.analysisId)); values.add(this.analysisName); values.add(String.valueOf(this.strataId)); values.add(this.strataName); values.add(String.valueOf(this.covariateId)); values.add(this.covariateName); values.add(this.covariateShortName); return values; } @Override public int compareTo(ExportItem that) { int res = analysisId.compareTo(analysisId); if (res == 0) { covariateName.compareToIgnoreCase(that.covariateName); } return res; } @JsonIgnore public String[] getValueArray() { List<String> values = getValueList(); return values.toArray(new String[values.size()]); } protected String extractMeaningfulCovariateName(String fullName) { if (fullName == null) { return StringUtils.EMPTY; } String[] nameParts = fullName.split(":"); if (nameParts.length < 2) { nameParts = fullName.split("="); } if (nameParts.length != 2) { return fullName; } else { return nameParts[1]; } } protected String getStrataNameOrDefault(String value) { return StringUtils.isNotEmpty(value) ? value : "All stratas"; } protected double calcDiff(T another) { return 0; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ExportItem<?> that = (ExportItem<?>) o; if (analysisId != null ? !analysisId.equals(that.analysisId) : that.analysisId != null) return false; if (strataId != null ? !strataId.equals(that.strataId) : that.strataId != null) return false; if (covariateId != null ? !covariateId.equals(that.covariateId) : that.covariateId != null) return false; if (conceptId != null ? !conceptId.equals(that.conceptId) : that.conceptId != null) return false; return conceptName != null ? conceptName.equals(that.conceptName) : that.conceptName == null; } @Override public int hashCode() { int result = analysisId != null ? analysisId.hashCode() : 0; result = 31 * result + (strataId != null ? strataId.hashCode() : 0); result = 31 * result + (covariateId != null ? covariateId.hashCode() : 0); result = 31 * result + (conceptId != null ? conceptId.hashCode() : 0); return result; } public Integer getAnalysisId() { return analysisId; } public String getAnalysisName() { return analysisName; } public Long getStrataId() { return strataId; } public String getStrataName() { return strataName; } public Long getCovariateId() { return covariateId; } public String getCovariateName() { return covariateName; } public String getCovariateShortName() { return covariateShortName; } public String getFaType() { return faType; } public String getDomainId() { return domainId; } public void setDomainId(String domainId) { this.domainId = domainId; } public Long getConceptId() { return conceptId; } public String getConceptName() { return conceptName; } }
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/cohortcharacterization/report/TemporalItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/TemporalItem.java
package org.ohdsi.webapi.cohortcharacterization.report; public class TemporalItem { private Long count; private Double avg; private Integer startDay; private Integer endDay; public Long getCount() { return count; } public void setCount(Long count) { this.count = count; } public Double getAvg() { return avg; } public void setAvg(Double avg) { this.avg = avg; } public Integer getStartDay() { return startDay; } public void setStartDay(Integer startDay) { this.startDay = startDay; } public Integer getEndDay() { return endDay; } public void setEndDay(Integer endDay) { this.endDay = endDay; } }
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/cohortcharacterization/report/AnalysisResultItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/AnalysisResultItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import org.apache.commons.lang3.tuple.Pair; import java.util.Set; public class AnalysisResultItem { private Set<String> domainIds; private Set<Cohort> cohorts; private Set<ExportItem> exportItems; public AnalysisResultItem(Set<String> domainIds, Set<Cohort> cohorts, Set<ExportItem> exportItems) { this.domainIds = domainIds; this.cohorts = cohorts; this.exportItems = exportItems; } public Set<String> getDomainIds() { return domainIds; } public Set<Cohort> getCohorts() { return cohorts; } public Set<ExportItem> getExportItems() { return exportItems; } }
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/cohortcharacterization/report/TemporalAnnualItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/TemporalAnnualItem.java
package org.ohdsi.webapi.cohortcharacterization.report; public class TemporalAnnualItem { private Long count; private Double avg; private Integer year; public Long getCount() { return count; } public void setCount(Long count) { this.count = count; } public Double getAvg() { return avg; } public void setAvg(Double avg) { this.avg = avg; } public Integer getYear() { return year; } public void setYear(Integer year) { this.year = year; } }
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/cohortcharacterization/report/Report.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/Report.java
package org.ohdsi.webapi.cohortcharacterization.report; import com.fasterxml.jackson.annotation.JsonIgnore; import org.apache.commons.lang3.tuple.Pair; import org.ohdsi.analysis.cohortcharacterization.design.CcResultType; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; public class Report { public String analysisName; public Integer analysisId; public CcResultType resultType; @JsonIgnore public List<String[]> header; public Set<String> domainIds; public Set<Cohort> cohorts; public Set<ExportItem> items; public boolean isComparative; public boolean isSummary; public String faType; public String domainId; public Report(String analysisName, Integer analysisId, AnalysisResultItem resultItem) { this.analysisName = analysisName; this.analysisId = analysisId; this.items = resultItem.getExportItems(); cohorts = resultItem.getCohorts(); domainIds = resultItem.getDomainIds(); } public Report(String analysisName, List<AnalysisResultItem> simpleResultSummary) { this.analysisName = analysisName; domainIds = new HashSet<>(); cohorts = new HashSet<>(); items = new HashSet<>(); simpleResultSummary .forEach(item -> { domainIds.addAll(item.getDomainIds()); cohorts.addAll(item.getCohorts()); items.addAll(item.getExportItems()); }); } @JsonIgnore public List<String[]> getResultArray() { return items .stream() .sorted() .map(ExportItem::getValueArray) .collect(Collectors.toList()); } }
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/cohortcharacterization/report/ComparativeDistributionItem.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/report/ComparativeDistributionItem.java
package org.ohdsi.webapi.cohortcharacterization.report; import org.ohdsi.webapi.cohortdefinition.CohortDefinition; import java.util.Objects; import org.ohdsi.webapi.cohortcharacterization.dto.CcDistributionStat; public class ComparativeDistributionItem extends ComparativeItem { private final Double targetStdDev; private final Double targetMin; private final Double targetP10; private final Double targetP25; private final Double targetMedian; private final Double targetP75; private final Double targetP90; private final Double targetMax; private final Double targetAvg; private final Double comparatorStdDev; private final Double comparatorMin; private final Double comparatorP10; private final Double comparatorP25; private final Double comparatorMedian; private final Double comparatorP75; private final Double comparatorP90; private final Double comparatorMax; private final Double comparatorAvg; private final Integer aggregateId; private final String aggregateName; private final Boolean missingMeansZero; private static final CcDistributionStat EMPTY_ITEM; public ComparativeDistributionItem(DistributionItem firstItem, DistributionItem secondItem, CohortDefinition firstCohortDef, CohortDefinition secondCohortDef) { super(firstItem, secondItem, firstCohortDef, secondCohortDef); DistributionItem item = Objects.nonNull(firstItem) ? firstItem : secondItem; this.aggregateId = item.getAggregateId(); this.aggregateName = item.getAggregateName(); this.missingMeansZero = item.isMissingMeansZero(); this.targetStdDev = firstItem != null ? firstItem.getStdDev() : null; this.targetMin = firstItem != null ? firstItem.getMin() : null; this.targetP10 = firstItem != null ? firstItem.getP10() : null; this.targetP25 = firstItem != null ? firstItem.getP25() : null; this.targetMedian = firstItem != null ? firstItem.getMedian() : null; this.targetP75 = firstItem != null ? firstItem.getP75() : null; this.targetP90 = firstItem != null ? firstItem.getP90() : null; this.targetMax = firstItem != null ? firstItem.getMax() : null; this.targetAvg = firstItem != null ? firstItem.avg : null; this.comparatorStdDev = secondItem != null ? secondItem.getStdDev() : null; this.comparatorMin = secondItem != null ? secondItem.getMin() : null; this.comparatorP10 = secondItem != null ? secondItem.getP10() : null; this.comparatorP25 = secondItem != null ? secondItem.getP25() : null; this.comparatorMedian = secondItem != null ? secondItem.getMedian() : null; this.comparatorP75 = secondItem != null ? secondItem.getP75() : null; this.comparatorP90 = secondItem != null ? secondItem.getP90() : null; this.comparatorMax = secondItem != null ? secondItem.getMax() : null; this.comparatorAvg = secondItem != null ? secondItem.avg : null; } static { EMPTY_ITEM = new CcDistributionStat(); EMPTY_ITEM.setAvg(0.0d); EMPTY_ITEM.setStdDev(0.0d); } @Override protected double calcDiff(ExportItem first, ExportItem second) { if (first == null) { first = new DistributionItem(EMPTY_ITEM, this.getTargetCohortName()); } if (second == null) { second = new DistributionItem(EMPTY_ITEM, this.getComparatorCohortName()); } return first.calcDiff(second); } public Double getTargetStdDev() { return targetStdDev; } public Double getTargetMin() { return targetMin; } public Double getTargetP10() { return targetP10; } public Double getTargetP25() { return targetP25; } public Double getTargetMedian() { return targetMedian; } public Double getTargetP75() { return targetP75; } public Double getTargetP90() { return targetP90; } public Double getTargetMax() { return targetMax; } public Double getTargetAvg() { return targetAvg; } public Double getComparatorStdDev() { return comparatorStdDev; } public Double getComparatorMin() { return comparatorMin; } public Double getComparatorP10() { return comparatorP10; } public Double getComparatorP25() { return comparatorP25; } public Double getComparatorMedian() { return comparatorMedian; } public Double getComparatorP75() { return comparatorP75; } public Double getComparatorP90() { return comparatorP90; } public Double getComparatorMax() { return comparatorMax; } public Double getComparatorAvg() { return comparatorAvg; } public Integer getAggregateId() { return aggregateId; } public String getAggregateName() { return aggregateName; } public Boolean isMissingMeansZero() { return missingMeansZero; } }
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/cohortcharacterization/specification/CohortCharacterizationImpl.java
src/main/java/org/ohdsi/webapi/cohortcharacterization/specification/CohortCharacterizationImpl.java
package org.ohdsi.webapi.cohortcharacterization.specification; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import org.ohdsi.analysis.cohortcharacterization.design.CohortCharacterization; import org.ohdsi.analysis.hydra.design.SkeletonTypeEnum; import org.ohdsi.webapi.cohortcharacterization.dto.CcExportDTO; @JsonIgnoreProperties(ignoreUnknown = true) public class CohortCharacterizationImpl extends CcExportDTO implements CohortCharacterization { @JsonProperty private SkeletonTypeEnum skeletonType = SkeletonTypeEnum.COHORT_CHARACTERIZATION; @JsonProperty private String skeletonVersion = "v0.0.1"; @JsonProperty private String packageName = null; @JsonProperty private String organizationName = null; public SkeletonTypeEnum getSkeletonType() { return skeletonType; } public void setSkeletonType(SkeletonTypeEnum skeletonType) { this.skeletonType = skeletonType; } public String getSkeletonVersion() { return skeletonVersion; } public void setSkeletonVersion(String skeletonVersion) { this.skeletonVersion = skeletonVersion; } public String getPackageName() { return packageName; } public void setPackageName(String packageName) { this.packageName = packageName; } public String getOrganizationName() { return organizationName; } public void setOrganizationName(String organizationName) { this.organizationName = organizationName; } }
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/cohortresults/ConceptQuartileRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ConceptQuartileRecord.java
package org.ohdsi.webapi.cohortresults; /** * * 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/cohortresults/SeriesPerPerson.java
src/main/java/org/ohdsi/webapi/cohortresults/SeriesPerPerson.java
package org.ohdsi.webapi.cohortresults; public class SeriesPerPerson { private String seriesName; private int xCalendarMonth; private long 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 long getyRecordCount() { return yRecordCount; } /** * @param yRecordCount the yRecordCount to set */ public void setyRecordCount(long 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/cohortresults/HealthcareDrugUtilizationSummary.java
src/main/java/org/ohdsi/webapi/cohortresults/HealthcareDrugUtilizationSummary.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import java.util.List; /** * * @author cknoll1 */ public class HealthcareDrugUtilizationSummary { public List<Record> data; public static class Record extends HealthcareDrugUtlizationStatistic { public String drugName; public String drugId; public String drugClass; public String drugCode; public String drugVocabularyId; public 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/cohortresults/CohortPersonSummary.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortPersonSummary.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortDrugEraDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortDrugEraDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortBreakdown.java
src/main/java/org/ohdsi/webapi/cohortresults/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.cohortresults; /** * * @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/cohortresults/ConceptDistributionRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ConceptDistributionRecord.java
package org.ohdsi.webapi.cohortresults; /** * * 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; } }
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/cohortresults/CohortDrugDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortDrugDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/ScatterplotRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ScatterplotRecord.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/PredictorResult.java
src/main/java/org/ohdsi/webapi/cohortresults/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.cohortresults; 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/cohortresults/package-info.java
src/main/java/org/ohdsi/webapi/cohortresults/package-info.java
/** * Model specific classes used by for viewing Heracles results (cohort results) */ package org.ohdsi.webapi.cohortresults;
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/cohortresults/CohortAttribute.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortAttribute.java
package org.ohdsi.webapi.cohortresults; public class CohortAttribute { 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; } }
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/cohortresults/Concept.java
src/main/java/org/ohdsi/webapi/cohortresults/Concept.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; /** * * @author cknoll1 */ public class Concept { public long conceptId; public String conceptName; }
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/cohortresults/CohortStatsRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortStatsRecord.java
package org.ohdsi.webapi.cohortresults; 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; } }
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/cohortresults/HierarchicalConceptRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/HierarchicalConceptRecord.java
package org.ohdsi.webapi.cohortresults; /** * * 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/cohortresults/MonthObservationRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/MonthObservationRecord.java
package org.ohdsi.webapi.cohortresults; 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; } }
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/cohortresults/HealthcareDrugUtilizationDetail.java
src/main/java/org/ohdsi/webapi/cohortresults/HealthcareDrugUtilizationDetail.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; import java.util.List; /** * * @author cknoll1 */ public class HealthcareDrugUtilizationDetail { public List<Record> data; public static class Record extends HealthcareDrugUtlizationStatistic { public String periodType; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") public Date periodStart; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") public Date periodEnd; public 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/cohortresults/CohortSpecificSummary.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortSpecificSummary.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortDeathData.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortDeathData.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/VisitStatType.java
src/main/java/org/ohdsi/webapi/cohortresults/VisitStatType.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import java.util.Arrays; /** * * @author cknoll1 */ public enum VisitStatType { OCCURRENCE("occurrence"), VISIT_DATE("visitdate"), CARESITE_DATE("caresitedate"); private String value; private VisitStatType(String value) { this.value = value; } public static VisitStatType fromString(String value) { for (VisitStatType category : values()) { if (category.value.equalsIgnoreCase(value)) { return category; } } throw new IllegalArgumentException( "Unknown enum type " + value + ", Allowed values are " + Arrays.toString(values())); } }
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/cohortresults/ExposureCohortResult.java
src/main/java/org/ohdsi/webapi/cohortresults/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.cohortresults; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** * * @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/cohortresults/TimeToEventResult.java
src/main/java/org/ohdsi/webapi/cohortresults/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.cohortresults; 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/cohortresults/CohortConditionDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortConditionDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortMeasurementDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortMeasurementDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/ConceptDecileRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ConceptDecileRecord.java
package org.ohdsi.webapi.cohortresults; /** * * 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/cohortresults/WindowType.java
src/main/java/org/ohdsi/webapi/cohortresults/WindowType.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import java.util.Arrays; /** * * @author cknoll1 */ public enum WindowType { BASELINE("baseline"), AT_RISK("atrisk"); private String value; private WindowType(String value) { this.value = value; } public static WindowType fromString(String value) { for (WindowType category : values()) { if (category.value.equalsIgnoreCase(value)) { return category; } } throw new IllegalArgumentException( "Unknown enum type " + value + ", Allowed values are " + Arrays.toString(values())); } }
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/cohortresults/ProfileSampleRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ProfileSampleRecord.java
package org.ohdsi.webapi.cohortresults; public class ProfileSampleRecord { private long genderConceptId; private long personId; private int ageGroup; public long getGenderConceptId() { return genderConceptId; } public void setGenderConceptId(long genderConceptId) { this.genderConceptId = genderConceptId; } public long getPersonId() { return personId; } public void setPersonId(long personId) { this.personId = personId; } public int getAgeGroup() { return ageGroup; } public void setAgeGroup(int ageGroup) { this.ageGroup = ageGroup; } }
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/cohortresults/CohortResultsAnalysisRunner.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortResultsAnalysisRunner.java
package org.ohdsi.webapi.cohortresults; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.ohdsi.circe.helper.ResourceHelper; import org.ohdsi.sql.SqlRender; import org.ohdsi.webapi.cohortanalysis.CohortAnalysisTask; import org.ohdsi.webapi.cohortresults.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.jdbc.core.JdbcTemplate; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; import static org.ohdsi.webapi.util.SecurityUtils.whitelist; public class CohortResultsAnalysisRunner { public static final String COHORT_SPECIFIC = "cohort_specific"; public static final String COHORT_SPECIFIC_CONDITION_DRILLDOWN = "cohort_specific_condition_drilldown"; public static final String COHORT_SPECIFIC_DRUG_DRILLDOWN = "cohort_specific_drug_drilldown"; public static final String COHORT_SPECIFIC_PROCEDURE_DRILLDOWN = "cohort_specific_procedure_drilldown"; public static final String COHORT_SPECIFIC_TREEMAP = "cohort_specific_treemap"; public static final String CONDITION = "condition"; public static final String CONDITION_DRILLDOWN = "condition_drilldown"; public static final String CONDITION_ERA = "condition_era"; public static final String CONDITION_ERA_DRILLDOWN = "condition_era_drilldown"; public static final String DASHBOARD = "dashboard"; public static final String DATA_DENSITY = "data_density"; public static final String DEATH = "death"; public static final String DEFAULT = "default"; public static final String DRUG = "drug"; public static final String DRUG_DRILLDOWN = "drug_drilldown"; public static final String DRUG_ERA = "drug_era"; public static final String DRUG_ERA_DRILLDOWN = "drug_era_drilldown"; public static final String DRUG_EXPOSURE = "drug_exposure"; public static final String HERACLES_HEEL = "heracles_heel"; public static final String MEASUREMENT = "measurement"; public static final String MEASUREMENT_DRILLDOWN = "measurement_drilldown"; public static final String OBSERVATION = "observation"; public static final String OBSERVATION_DRILLDOWN = "observation_drilldown"; public static final String OBSERVATION_PERIOD = "observation_period"; public static final String OBSERVATION_PERIODS = "observation_periods"; public static final String PERSON = "person"; public static final String PROCEDURE = "procedure"; public static final String PROCEDURE_DRILLDOWN = "procedure_drilldown"; public static final String VISIT = "visit"; public static final String VISIT_DRILLDOWN = "visit_drilldown"; private static final Logger log = LoggerFactory.getLogger(CohortResultsAnalysisRunner.class); public static final String BASE_SQL_PATH = "/resources/cohortresults/sql"; private static final String[] STANDARD_COLUMNS = new String[]{"cdm_database_schema", "ohdsi_database_schema", "cohortDefinitionId", "minCovariatePersonCount", "minIntervalPersonCount"}; private static final String[] DRILLDOWN_COLUMNS = new String[]{"cdm_database_schema", "ohdsi_database_schema", "cohortDefinitionId", "minCovariatePersonCount", "minIntervalPersonCount", "conceptId"}; public static final Integer MIN_COVARIATE_PERSON_COUNT = 10; public static final Integer MIN_INTERVAL_PERSON_COUNT = 10; private ObjectMapper mapper; private String sourceDialect; private VisualizationDataRepository visualizationDataRepository; public CohortResultsAnalysisRunner(String sourceDialect, VisualizationDataRepository visualizationDataRepository, ObjectMapper objectMapper) { this.sourceDialect = sourceDialect; this.visualizationDataRepository = visualizationDataRepository; mapper = objectMapper; } public List<TornadoRecord> getTornadoRecords(JdbcTemplate jdbcTemplate, final int id, Source source) { final String sqlPath = BASE_SQL_PATH + "/tornado/getTornadoData.sql"; String resultsTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.Results); String[] search = new String[]{"tableQualifier"}; String[] replace = new String[]{resultsTableQualifier}; String[] cols = new String[]{"cohortDefinitionId"}; Object[] colValues = new Object[]{id}; final PreparedStatementRenderer psr = new PreparedStatementRenderer(source, sqlPath, search, replace, cols, colValues); return jdbcTemplate.query(psr.getSql(), psr.getSetter(), new TornadoMapper()); } public List<ProfileSampleRecord> getProfileSampleRecords(JdbcTemplate jdbcTemplate, final int id, Source source) { final String sqlPath = BASE_SQL_PATH + "/tornado/getProfileSamples.sql"; String resultsTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.Results); String[] search = new String[]{"tableQualifier"}; String[] replace = new String[]{resultsTableQualifier}; String[] cols = new String[]{"cohortDefinitionId"}; Object[] colValues = new Object[]{id}; final PreparedStatementRenderer psr = new PreparedStatementRenderer(source, sqlPath, search, replace, cols, colValues); return jdbcTemplate.query(psr.getSql(), psr.getSetter(), new ProfileSampleMapper()); } public List<ScatterplotRecord> getCohortConditionDrilldown(JdbcTemplate jdbcTemplate, final int id, final int conceptId, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { final String key = COHORT_SPECIFIC_CONDITION_DRILLDOWN; List<ScatterplotRecord> records = new ArrayList<>(); final PreparedStatementRenderer psr = prepareDrillDownCohortSql("firstConditionRelativeToIndex", "cohortSpecific", id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (psr != null) { records = jdbcTemplate.query(psr.getSql(), psr.getSetter(), new ScatterplotMapper()); if (save) { this.saveEntityDrilldown(id, source.getSourceId(), key, conceptId, records); } } return records; } public CohortDataDensity getCohortDataDensity(JdbcTemplate jdbcTemplate, final int id, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { CohortDataDensity data = new CohortDataDensity(); final String key = DATA_DENSITY; boolean empty = true; PreparedStatementRenderer recordsPerPersonSql = this.renderTranslateCohortSql(BASE_SQL_PATH + "/datadensity/recordsperperson.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (recordsPerPersonSql != null) { data.setRecordsPerPerson(jdbcTemplate.query(recordsPerPersonSql.getSql(), recordsPerPersonSql.getSetter(), new SeriesPerPersonMapper())); } PreparedStatementRenderer totalRecordsSql = renderTranslateCohortSql(BASE_SQL_PATH + "/datadensity/totalrecords.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (totalRecordsSql != null) { data.setTotalRecords(jdbcTemplate.query(totalRecordsSql.getSql(), totalRecordsSql.getSetter(), new SeriesPerPersonMapper())); } PreparedStatementRenderer conceptsPerPersonSql = renderTranslateCohortSql(BASE_SQL_PATH + "/datadensity/conceptsperperson.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (conceptsPerPersonSql != null) { data.setConceptsPerPerson(jdbcTemplate.query(conceptsPerPersonSql.getSql(), conceptsPerPersonSql.getSetter(), new ConceptQuartileMapper())); } if (CollectionUtils.isNotEmpty(data.getRecordsPerPerson()) || CollectionUtils.isNotEmpty(data.getTotalRecords()) || CollectionUtils.isNotEmpty(data.getConceptsPerPerson())) { empty = false; } if (!empty && save) { saveEntity(id, source.getSourceId(), key, data); } return data; } public CohortDeathData getCohortDeathData(JdbcTemplate jdbcTemplate, final int id, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { CohortDeathData data = new CohortDeathData(); final String key = DEATH; boolean empty = true; List<ConceptQuartileRecord> age = null; PreparedStatementRenderer ageSql = renderTranslateCohortSql(BASE_SQL_PATH + "/death/sqlAgeAtDeath.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageSql != null) { age = jdbcTemplate.query(ageSql.getSql(), ageSql.getSetter(), new ConceptQuartileMapper()); } data.setAgetAtDeath(age); List<ConceptCountRecord> byType = null; PreparedStatementRenderer byTypeSql = renderTranslateCohortSql(BASE_SQL_PATH + "/death/sqlDeathByType.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (byTypeSql != null) { byType = jdbcTemplate.query(byTypeSql.getSql(), byTypeSql.getSetter(), new ConceptCountMapper()); } data.setDeathByType(byType); List<ConceptDecileRecord> prevalenceByGenderAgeYear = null; PreparedStatementRenderer prevalenceGenderAgeSql = renderTranslateCohortSql(BASE_SQL_PATH + "/death/sqlPrevalenceByGenderAgeYear.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalenceGenderAgeSql != null) { prevalenceByGenderAgeYear = jdbcTemplate.query(prevalenceGenderAgeSql.getSql(), prevalenceGenderAgeSql.getSetter(), new ConceptDecileCountsMapper()); } data.setPrevalenceByGenderAgeYear(prevalenceByGenderAgeYear); List<PrevalenceRecord> prevalenceByMonth = null; PreparedStatementRenderer prevalanceMonthSql = renderTranslateCohortSql(BASE_SQL_PATH + "/death/sqlPrevalenceByMonth.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalanceMonthSql != null) { prevalenceByMonth = jdbcTemplate.query(prevalanceMonthSql.getSql(), prevalanceMonthSql.getSetter(), new PrevalanceConceptMapper()); } data.setPrevalenceByMonth(prevalenceByMonth); if (CollectionUtils.isNotEmpty(data.getAgetAtDeath()) || CollectionUtils.isNotEmpty(data.getDeathByType()) || CollectionUtils.isNotEmpty(data.getPrevalenceByGenderAgeYear()) || CollectionUtils.isNotEmpty(data.getPrevalenceByMonth())) { empty = false; } if (!empty && save) { this.saveEntity(id, source.getSourceId(), key, data); } return data; } public List<ScatterplotRecord> getCohortDrugDrilldown(JdbcTemplate jdbcTemplate, final int id, final int conceptId, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { List<ScatterplotRecord> records = new ArrayList<>(); final String key = COHORT_SPECIFIC_DRUG_DRILLDOWN; final PreparedStatementRenderer sql = prepareDrillDownCohortSql("drugOccursRelativeToIndex", "cohortSpecific", id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sql != null) { records = jdbcTemplate.query(sql.getSql(), sql.getSetter(), new ScatterplotMapper()); if (save) { saveEntityDrilldown(id, source.getSourceId(), key, conceptId, records); } } return records; } public List<HierarchicalConceptRecord> getCohortMeasurementResults(JdbcTemplate jdbcTemplate, final int id, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { List<HierarchicalConceptRecord> res = null; final String key = MEASUREMENT; PreparedStatementRenderer sql = renderTranslateCohortSql(BASE_SQL_PATH + "/measurement/sqlMeasurementTreemap.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sql != null) { res = jdbcTemplate.query(sql.getSql(), sql.getSetter(), new HierarchicalConceptMapper()); if (save) { saveEntity(id, source.getSourceId(), key, res); } } return res; } public CohortMeasurementDrilldown getCohortMeasurementResultsDrilldown(JdbcTemplate jdbcTemplate, final int id, final int conceptId, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { CohortMeasurementDrilldown drilldown = new CohortMeasurementDrilldown(); final String key = MEASUREMENT_DRILLDOWN; boolean empty = true; PreparedStatementRenderer ageAtFirstOccurrenceSql = prepareDrillDownCohortSql("sqlAgeAtFirstOccurrence", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageAtFirstOccurrenceSql != null) { drilldown.setAgeAtFirstOccurrence(jdbcTemplate.query(ageAtFirstOccurrenceSql.getSql(), ageAtFirstOccurrenceSql.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer sqlLowerLimitDistribution = prepareDrillDownCohortSql("sqlLowerLimitDistribution", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlLowerLimitDistribution != null) { drilldown.setLowerLimitDistribution(jdbcTemplate.query(sqlLowerLimitDistribution.getSql(), sqlLowerLimitDistribution.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer sqlMeasurementValueDistribution = prepareDrillDownCohortSql("sqlMeasurementValueDistribution", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlMeasurementValueDistribution != null) { drilldown.setMeasurementValueDistribution(jdbcTemplate.query(sqlMeasurementValueDistribution.getSql(), sqlMeasurementValueDistribution.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer sqlUpperLimitDistribution = prepareDrillDownCohortSql("sqlUpperLimitDistribution", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlUpperLimitDistribution != null) { drilldown.setUpperLimitDistribution(jdbcTemplate.query(sqlUpperLimitDistribution.getSql(), sqlUpperLimitDistribution.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer sqlMeasurementsByType = prepareDrillDownCohortSql("sqlMeasurementsByType", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlMeasurementsByType != null) { drilldown.setMeasurementsByType(jdbcTemplate.query(sqlMeasurementsByType.getSql(), sqlMeasurementsByType.getSetter(), new ConceptObservationCountMapper())); } PreparedStatementRenderer sqlRecordsByUnit = prepareDrillDownCohortSql("sqlRecordsByUnit", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlRecordsByUnit != null) { drilldown.setRecordsByUnit(jdbcTemplate.query(sqlRecordsByUnit.getSql(), sqlRecordsByUnit.getSetter(), new ConceptObservationCountMapper())); } PreparedStatementRenderer sqlValuesRelativeToNorm = prepareDrillDownCohortSql("sqlValuesRelativeToNorm", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlValuesRelativeToNorm != null) { drilldown.setValuesRelativeToNorm(jdbcTemplate.query(sqlValuesRelativeToNorm.getSql(), sqlValuesRelativeToNorm.getSetter(), new ConceptObservationCountMapper())); } PreparedStatementRenderer sqlPrevalenceByGenderAgeYear = prepareDrillDownCohortSql("sqlPrevalenceByGenderAgeYear", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlPrevalenceByGenderAgeYear != null) { drilldown.setPrevalenceByGenderAgeYear(jdbcTemplate.query(sqlPrevalenceByGenderAgeYear.getSql(), sqlPrevalenceByGenderAgeYear.getSetter(), new ConceptDecileMapper())); } List<PrevalenceRecord> prevalenceByMonth = null; PreparedStatementRenderer prevalanceMonthSql = prepareDrillDownCohortSql("sqlPrevalenceByMonth", MEASUREMENT, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalanceMonthSql != null) { prevalenceByMonth = jdbcTemplate.query(prevalanceMonthSql.getSql(), prevalanceMonthSql.getSetter(), new PrevalanceConceptNameMapper()); } drilldown.setPrevalenceByMonth(prevalenceByMonth); if (CollectionUtils.isNotEmpty(drilldown.getAgeAtFirstOccurrence()) || CollectionUtils.isNotEmpty(drilldown.getLowerLimitDistribution()) || CollectionUtils.isNotEmpty(drilldown.getMeasurementsByType()) || CollectionUtils.isNotEmpty(drilldown.getMeasurementValueDistribution()) || CollectionUtils.isNotEmpty(drilldown.getPrevalenceByGenderAgeYear()) || CollectionUtils.isNotEmpty(drilldown.getPrevalenceByMonth()) || CollectionUtils.isNotEmpty(drilldown.getRecordsByUnit()) || CollectionUtils.isNotEmpty(drilldown.getUpperLimitDistribution()) || CollectionUtils.isNotEmpty(drilldown.getValuesRelativeToNorm())) { empty = false; } if (!empty && save) { this.saveEntityDrilldown(id, source.getSourceId(), key, conceptId, drilldown); } return drilldown; } public CohortObservationPeriod getCohortObservationPeriod(final JdbcTemplate jdbcTemplate, final int id, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { CohortObservationPeriod obsPeriod = new CohortObservationPeriod(); final String key = OBSERVATION_PERIOD; boolean empty = true; PreparedStatementRenderer ageAtFirstSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/ageatfirst.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageAtFirstSql != null) { obsPeriod.setAgeAtFirst(jdbcTemplate.query(ageAtFirstSql.getSql(), ageAtFirstSql.getSetter(), new ConceptDistributionMapper())); } PreparedStatementRenderer obsLengthSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observationlength_data.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (obsLengthSql != null) { obsPeriod.setObservationLength(jdbcTemplate.query(obsLengthSql.getSql(), obsLengthSql.getSetter(), new ConceptDistributionMapper())); } PreparedStatementRenderer obsLengthStatsSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observationlength_stats.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (obsLengthStatsSql != null) { obsPeriod.setObservationLengthStats(jdbcTemplate.query(obsLengthStatsSql.getSql(), obsLengthStatsSql.getSetter(), new CohortStatsMapper())); } PreparedStatementRenderer obsYearStatsSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observedbyyear_stats.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (obsYearStatsSql != null) { obsPeriod.setPersonsWithContinuousObservationsByYearStats(jdbcTemplate.query(obsYearStatsSql.getSql(), obsYearStatsSql.getSetter(), new CohortStatsMapper())); } PreparedStatementRenderer personsWithContObsSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observedbyyear_data.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (personsWithContObsSql != null) { obsPeriod.setPersonsWithContinuousObservationsByYear(jdbcTemplate.query(personsWithContObsSql.getSql(), personsWithContObsSql.getSetter(), new ConceptDistributionMapper())); } PreparedStatementRenderer ageByGenderSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/agebygender.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageByGenderSql != null) { obsPeriod.setAgeByGender(jdbcTemplate.query(ageByGenderSql.getSql(), ageByGenderSql.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer durationByGenderSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observationlengthbygender.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (durationByGenderSql != null) { obsPeriod.setDurationByGender(jdbcTemplate.query(durationByGenderSql.getSql(), durationByGenderSql.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer durationByAgeSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observationlengthbyage.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (durationByAgeSql != null) { obsPeriod.setDurationByAgeDecile(jdbcTemplate.query(durationByAgeSql.getSql(), durationByAgeSql.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer cumulObsSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/cumulativeduration.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (cumulObsSql != null) { obsPeriod.setCumulativeObservation(jdbcTemplate.query(cumulObsSql.getSql(), cumulObsSql.getSetter(), new CumulativeObservationMapper())); } PreparedStatementRenderer obsByMonthSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/observedbymonth.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (obsByMonthSql != null) { obsPeriod.setObservedByMonth(jdbcTemplate.query(obsByMonthSql.getSql(), obsByMonthSql.getSetter(), new MonthObservationMapper())); } PreparedStatementRenderer obsPeriodsPerPersonSql = renderTranslateCohortSql(BASE_SQL_PATH + "/observationperiod/periodsperperson.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (obsPeriodsPerPersonSql != null) { obsPeriod.setObservationPeriodsPerPerson(jdbcTemplate.query(obsPeriodsPerPersonSql.getSql(), obsPeriodsPerPersonSql.getSetter(), new ConceptCountMapper())); } if (CollectionUtils.isNotEmpty(obsPeriod.getAgeAtFirst()) || CollectionUtils.isNotEmpty(obsPeriod.getAgeByGender()) || CollectionUtils.isNotEmpty(obsPeriod.getCumulativeObservation()) || CollectionUtils.isNotEmpty(obsPeriod.getDurationByAgeDecile()) || CollectionUtils.isNotEmpty(obsPeriod.getDurationByGender()) || CollectionUtils.isNotEmpty(obsPeriod.getObservationLength()) || CollectionUtils.isNotEmpty(obsPeriod.getObservationLengthStats()) || CollectionUtils.isNotEmpty(obsPeriod.getObservationPeriodsPerPerson()) || CollectionUtils.isNotEmpty(obsPeriod.getObservedByMonth()) || CollectionUtils.isNotEmpty(obsPeriod.getPersonsWithContinuousObservationsByYear()) || CollectionUtils.isNotEmpty(obsPeriod.getPersonsWithContinuousObservationsByYearStats())) { empty = false; } if (!empty && save) { this.saveEntity(id, source.getSourceId(), key, obsPeriod); } return obsPeriod; } public List<HierarchicalConceptRecord> getCohortObservationResults(JdbcTemplate jdbcTemplate, final int id, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { List<HierarchicalConceptRecord> res = null; final String key = OBSERVATION; PreparedStatementRenderer sql = renderTranslateCohortSql(BASE_SQL_PATH + "/observation/sqlObservationTreemap.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sql != null) { res = jdbcTemplate.query(sql.getSql(), sql.getSetter(), new HierarchicalConceptMapper()); if (save) { saveEntity(id, source.getSourceId(), key, res); } } return res; } public CohortObservationDrilldown getCohortObservationResultsDrilldown(JdbcTemplate jdbcTemplate, final int id, final int conceptId, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { CohortObservationDrilldown drilldown = new CohortObservationDrilldown(); final String key = OBSERVATION_DRILLDOWN; boolean empty = true; PreparedStatementRenderer ageAtFirstOccurrenceSql = prepareDrillDownCohortSql("sqlAgeAtFirstOccurrence", OBSERVATION, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageAtFirstOccurrenceSql != null) { drilldown.setAgeAtFirstOccurrence(jdbcTemplate.query(ageAtFirstOccurrenceSql.getSql(), ageAtFirstOccurrenceSql.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer sqlObservationValueDistribution = prepareDrillDownCohortSql("sqlObservationValueDistribution", OBSERVATION, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlObservationValueDistribution != null) { drilldown.setObservationValueDistribution(jdbcTemplate.query(sqlObservationValueDistribution.getSql(), sqlObservationValueDistribution.getSetter(), new ConceptQuartileMapper())); } PreparedStatementRenderer sqlObservationsByType = prepareDrillDownCohortSql("sqlObservationsByType", OBSERVATION, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlObservationsByType != null) { drilldown.setObservationsByType(jdbcTemplate.query(sqlObservationsByType.getSql(), sqlObservationsByType.getSetter(), new ConceptObservationCountMapper())); } PreparedStatementRenderer sqlRecordsByUnit = prepareDrillDownCohortSql("sqlRecordsByUnit", OBSERVATION, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlRecordsByUnit != null) { drilldown.setRecordsByUnit(jdbcTemplate.query(sqlRecordsByUnit.getSql(), sqlRecordsByUnit.getSetter(), new ConceptObservationCountMapper())); } PreparedStatementRenderer sqlPrevalenceByGenderAgeYear = prepareDrillDownCohortSql("sqlPrevalenceByGenderAgeYear", OBSERVATION, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sqlPrevalenceByGenderAgeYear != null) { drilldown.setPrevalenceByGenderAgeYear(jdbcTemplate.query(sqlPrevalenceByGenderAgeYear.getSql(), sqlPrevalenceByGenderAgeYear.getSetter(), new ConceptDecileMapper())); } List<PrevalenceRecord> prevalenceByMonth = null; PreparedStatementRenderer prevalanceMonthSql = prepareDrillDownCohortSql("sqlPrevalenceByMonth", OBSERVATION, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalanceMonthSql != null) { prevalenceByMonth = jdbcTemplate.query(prevalanceMonthSql.getSql(), prevalanceMonthSql.getSetter(), new PrevalanceConceptNameMapper()); } drilldown.setPrevalenceByMonth(prevalenceByMonth); if (CollectionUtils.isNotEmpty(drilldown.getAgeAtFirstOccurrence()) || CollectionUtils.isNotEmpty(drilldown.getLowerLimitDistribution()) || CollectionUtils.isNotEmpty(drilldown.getObservationsByType()) || CollectionUtils.isNotEmpty(drilldown.getObservationValueDistribution()) || CollectionUtils.isNotEmpty(drilldown.getPrevalenceByGenderAgeYear()) || CollectionUtils.isNotEmpty(drilldown.getPrevalenceByMonth()) || CollectionUtils.isNotEmpty(drilldown.getRecordsByUnit()) || CollectionUtils.isNotEmpty(drilldown.getUpperLimitDistribution()) || CollectionUtils.isNotEmpty(drilldown.getValuesRelativeToNorm())) { empty = false; } if (!empty && save) { this.saveEntityDrilldown(id, source.getSourceId(), key, conceptId, drilldown); } return drilldown; } public List<ScatterplotRecord> getCohortProcedureDrilldown(JdbcTemplate jdbcTemplate, final int id, final int conceptId, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { List<ScatterplotRecord> records = new ArrayList<>(); final String key = COHORT_SPECIFIC_PROCEDURE_DRILLDOWN; final PreparedStatementRenderer sql = prepareDrillDownCohortSql("procedureOccursRelativeToIndex", "cohortSpecific", id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (sql != null) { records = jdbcTemplate.query(sql.getSql(), sql.getSetter(), new ScatterplotMapper()); if (save) { saveEntityDrilldown(id, source.getSourceId(), key, conceptId, records); } } return records; } public CohortProceduresDrillDown getCohortProceduresDrilldown(JdbcTemplate jdbcTemplate, final int id, final int conceptId, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { CohortProceduresDrillDown drilldown = new CohortProceduresDrillDown(); final String key = PROCEDURE_DRILLDOWN; boolean empty = true; List<ConceptQuartileRecord> ageAtFirst = null; PreparedStatementRenderer ageAtFirstSql = prepareDrillDownCohortSql("sqlAgeAtFirstOccurrence", PROCEDURE, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageAtFirstSql != null) { ageAtFirst = jdbcTemplate.query(ageAtFirstSql.getSql(), ageAtFirstSql.getSetter(), new ConceptQuartileMapper()); } drilldown.setAgeAtFirstOccurrence(ageAtFirst); List<ConceptCountRecord> byType = null; PreparedStatementRenderer byTypeSql = prepareDrillDownCohortSql("sqlProceduresByType", PROCEDURE, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (byTypeSql != null) { byType = jdbcTemplate.query(byTypeSql.getSql(), byTypeSql.getSetter(), new ConceptCountMapper()); } drilldown.setProceduresByType(byType); List<ConceptDecileRecord> prevalenceByGenderAgeYear = null; PreparedStatementRenderer prevalenceGenderAgeSql = prepareDrillDownCohortSql("sqlPrevalenceByGenderAgeYear", PROCEDURE, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalenceGenderAgeSql != null) { prevalenceByGenderAgeYear = jdbcTemplate.query(prevalenceGenderAgeSql.getSql(), prevalenceGenderAgeSql.getSetter(), new ConceptDecileMapper()); } drilldown.setPrevalenceByGenderAgeYear(prevalenceByGenderAgeYear); List<PrevalenceRecord> prevalenceByMonth = null; PreparedStatementRenderer prevalanceMonthSql = prepareDrillDownCohortSql("sqlPrevalenceByMonth", PROCEDURE, id, conceptId, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalanceMonthSql != null) { prevalenceByMonth = jdbcTemplate.query(prevalanceMonthSql.getSql(), prevalanceMonthSql.getSetter(), new PrevalanceConceptMapper()); } drilldown.setPrevalenceByMonth(prevalenceByMonth); if (CollectionUtils.isNotEmpty(drilldown.getAgeAtFirstOccurrence()) || CollectionUtils.isNotEmpty(drilldown.getPrevalenceByGenderAgeYear()) || CollectionUtils.isNotEmpty(drilldown.getPrevalenceByMonth()) || CollectionUtils.isNotEmpty(drilldown.getProceduresByType())) { empty = false; } if (!empty && save) { saveEntityDrilldown(id, source.getSourceId(), key, conceptId, drilldown); } return drilldown; } public CohortSpecificSummary getCohortSpecificSummary(JdbcTemplate jdbcTemplate, final int id, final Integer minCovariatePersonCountParam, final Integer minIntervalPersonCountParam, Source source, boolean save) { final String key = COHORT_SPECIFIC; CohortSpecificSummary summary = new CohortSpecificSummary(); boolean empty = true; // 1805, 1806 PreparedStatementRenderer personsByDurationSql = renderTranslateCohortSql(BASE_SQL_PATH + "/cohortSpecific/observationPeriodTimeRelativeToIndex.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (personsByDurationSql != null) { summary.setPersonsByDurationFromStartToEnd(jdbcTemplate.query(personsByDurationSql.getSql(), personsByDurationSql.getSetter(), new ObservationPeriodMapper())); } // 1815 PreparedStatementRenderer monthPrevalenceSql = renderTranslateCohortSql(BASE_SQL_PATH + "/cohortSpecific/prevalenceByMonth.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (monthPrevalenceSql != null) { summary.setPrevalenceByMonth(jdbcTemplate.query(monthPrevalenceSql.getSql(), monthPrevalenceSql.getSetter(), new PrevalanceMapper())); } // 1814 List<ConceptDecileRecord> prevalenceByGenderAgeYear = null; PreparedStatementRenderer prevalenceGenderAgeSql = renderTranslateCohortSql(BASE_SQL_PATH + "/cohortSpecific/prevalenceByYearGenderSex.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (prevalenceGenderAgeSql != null) { prevalenceByGenderAgeYear = jdbcTemplate.query(prevalenceGenderAgeSql.getSql(), prevalenceGenderAgeSql.getSetter(), new ConceptDecileCountsMapper()); } summary.setNumPersonsByCohortStartByGenderByAge(prevalenceByGenderAgeYear); // 1801 List<ConceptQuartileRecord> ageAtIndex = null; PreparedStatementRenderer ageAtIndexSql = renderTranslateCohortSql(BASE_SQL_PATH + "/cohortSpecific/ageAtIndexDistribution.sql", id, minCovariatePersonCountParam, minIntervalPersonCountParam, source); if (ageAtIndexSql != null) {
java
Apache-2.0
b22d7bf02d98c0cf78c46801877368d6ecad2245
2026-01-05T02:37:20.475642Z
true
OHDSI/WebAPI
https://github.com/OHDSI/WebAPI/blob/b22d7bf02d98c0cf78c46801877368d6ecad2245/src/main/java/org/ohdsi/webapi/cohortresults/HealthcareDrugUtlizationStatistic.java
src/main/java/org/ohdsi/webapi/cohortresults/HealthcareDrugUtlizationStatistic.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import java.math.BigDecimal; /** * * @author cknoll1 */ public class HealthcareDrugUtlizationStatistic { public long personsCount; public BigDecimal personsPct; public long exposureCount; public BigDecimal exposuresPer1000; public BigDecimal exposurePer1000WithExposures; public BigDecimal exposurePer1000PerYear; public long daysSupplyTotal; public BigDecimal daysSupplyAvg; public BigDecimal daysSupplyPer1000PerYear; public long quantityTotal; public BigDecimal quantityAvg; public BigDecimal quantityPer1000PerYear; public BigDecimal allowed; public BigDecimal allowedPmPm; public BigDecimal charged; public BigDecimal chargedPmPm; public BigDecimal paid; public BigDecimal paidPmPm; public BigDecimal allowedChargedRatio; public BigDecimal paidAllowedRatio; }
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/cohortresults/CohortConditionEraDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortConditionEraDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortDashboard.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortDashboard.java
package org.ohdsi.webapi.cohortresults; import java.util.List; public class CohortDashboard { private List<ConceptCountRecord> gender; private List<ConceptDistributionRecord> ageAtFirstObservation; private List<CumulativeObservationRecord> cumulativeObservation; private List<MonthObservationRecord> observedByMonth; /** * @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; } }
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/cohortresults/VisualizationData.java
src/main/java/org/ohdsi/webapi/cohortresults/VisualizationData.java
package org.ohdsi.webapi.cohortresults; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; @Entity(name = "VisualizationData") @Table(name = "heracles_visualization_data") public class VisualizationData implements Serializable { private static final long serialVersionUID = -567692689983359944L; @Id @GenericGenerator( name = "visualization_generator", strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", parameters = { @Parameter(name = "sequence_name", value = "heracles_vis_data_sequence"), @Parameter(name = "increment_size", value = "1") } ) @GeneratedValue(generator = "visualization_generator") @Column(name = "ID") private int id; @Column(name = "COHORT_DEFINITION_ID") private int cohortDefinitionId; @Column(name = "SOURCE_ID") private int sourceId; @Column(name = "VISUALIZATION_KEY") private String visualizationKey; @Column(name = "DATA") private String data; @Column(name = "END_TIME") private Date endTime; @Column(name = "DRILLDOWN_ID") private int drilldownId; /** * @return the id */ public int getId() { return id; } /** * @param id the id to set */ public void setId(int id) { this.id = id; } /** * @return the cohortDefinitionId */ public int getCohortDefinitionId() { return cohortDefinitionId; } /** * @param cohortDefinitionId the cohortDefinitionId to set */ public void setCohortDefinitionId(int cohortDefinitionId) { this.cohortDefinitionId = cohortDefinitionId; } /** * @return the source_id */ public int getSourceId() { return sourceId; } /** * @param source_id the source_id to set */ public void setSourceId(int sourceId) { this.sourceId = sourceId; } /** * @return the visualizationKey */ public String getVisualizationKey() { return visualizationKey; } /** * @param visualizationKey the visualizationKey to set */ public void setVisualizationKey(String visualizationKey) { this.visualizationKey = visualizationKey; } /** * @return the data */ public String getData() { return data; } /** * @param data the data to set */ public void setData(String data) { this.data = data; } /** * @return the endTime */ public Date getEndTime() { return endTime; } /** * @param endTime the endTime to set */ public void setEndTime(Date endTime) { this.endTime = endTime; } /** * @return the drilldownId */ public int getDrilldownId() { return drilldownId; } /** * @param drilldownId the drilldownId to set */ public void setDrilldownId(int drilldownId) { this.drilldownId = drilldownId; } }
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/cohortresults/PrevalenceRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/PrevalenceRecord.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortObservationDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortObservationDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CumulativeObservationRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/CumulativeObservationRecord.java
package org.ohdsi.webapi.cohortresults; 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; } }
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/cohortresults/HealthcareExposureReport.java
src/main/java/org/ohdsi/webapi/cohortresults/HealthcareExposureReport.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import com.fasterxml.jackson.annotation.JsonFormat; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * * @author cknoll1 */ public class HealthcareExposureReport { public Summary summary; public List<ReportItem> data; public static class Summary { public long personsCount; public BigDecimal exposureTotal; public BigDecimal exposureAvg; public Summary() { } } public static class ReportItem extends Summary { public String periodType; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") public Date periodStart; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") public Date periodEnd; public BigDecimal personsPct; public BigDecimal exposurePct; public ReportItem() { } } }
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/cohortresults/ExposureCohortSearch.java
src/main/java/org/ohdsi/webapi/cohortresults/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.cohortresults; 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/cohortresults/ObservationPeriodRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ObservationPeriodRecord.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortObservationPeriod.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortObservationPeriod.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/CohortVisitsDrilldown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortVisitsDrilldown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/VisualizationDataRepository.java
src/main/java/org/ohdsi/webapi/cohortresults/VisualizationDataRepository.java
package org.ohdsi.webapi.cohortresults; import java.util.List; import org.springframework.data.repository.CrudRepository; import org.springframework.transaction.annotation.Transactional; public interface VisualizationDataRepository extends CrudRepository<VisualizationData, Long> { public List<VisualizationData> findByCohortDefinitionIdAndSourceId( int cohortDefinitionId, int sourceId ); public VisualizationData findByCohortDefinitionIdAndSourceIdAndVisualizationKey( int cohortDefinitionId, int sourceId, String visualizationKey ); public List<VisualizationData> findDistinctVisualizationDataByCohortDefinitionIdAndSourceIdAndVisualizationKey( int cohortDefinitionId, int sourceId, String visualizationKey ); public VisualizationData findByCohortDefinitionIdAndSourceIdAndVisualizationKeyAndDrilldownId( int cohortDefinitionId, int sourceId, String visualizationKey, int drilldownId ); @Transactional public Long deleteByCohortDefinitionIdAndSourceIdAndVisualizationKey(int cohortDefinitionId, int sourceId, String visualizationKey); @Transactional public Long deleteByCohortDefinitionIdAndSourceIdAndVisualizationKeyAndDrilldownId( int cohortDefinitionId, int sourceId, String visualizationKey, int drilldownId ); }
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/cohortresults/CohortProceduresDrillDown.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortProceduresDrillDown.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/DataCompletenessAttr.java
src/main/java/org/ohdsi/webapi/cohortresults/DataCompletenessAttr.java
package org.ohdsi.webapi.cohortresults; /** * */ public class DataCompletenessAttr { private String covariance; private float genderP; private float raceP; private float ethP; /** * @return the covariance */ public String getCovariance() { return covariance; } /** * @param covariance the covariance to set */ public void setCovariance(String covariance) { this.covariance = covariance; } /** * @return the genderP */ public float getGenderP() { return genderP; } /** * @param genderP the genderP to set */ public void setGenderP(float genderP) { this.genderP = genderP; } /** * @return the raceP */ public float getRaceP() { return raceP; } /** * @param raceP the raceP to set */ public void setRaceP(float raceP) { this.raceP = raceP; } /** * @return the ethP */ public float getEthP() { return ethP; } /** * @param ethP the ethP to set */ public void setEthP(float ethP) { this.ethP = ethP; } }
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/cohortresults/TornadoReport.java
src/main/java/org/ohdsi/webapi/cohortresults/TornadoReport.java
package org.ohdsi.webapi.cohortresults; import java.util.Collection; public class TornadoReport { public Collection<TornadoRecord> tornadoRecords; public Collection<ProfileSampleRecord> profileSamples; }
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/cohortresults/HealthcareVisitUtilizationReport.java
src/main/java/org/ohdsi/webapi/cohortresults/HealthcareVisitUtilizationReport.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import com.fasterxml.jackson.annotation.JsonFormat; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * * @author cknoll1 */ public class HealthcareVisitUtilizationReport { public Summary summary; public List<ReportItem> data; public List<Concept> visitConcepts; public List<Concept> visitTypeConcepts; public static class Summary { public long personsCount; public BigDecimal personsPct; public long visitsCount; public BigDecimal visitsPer1000; public BigDecimal visitsPer1000WithVisits; public BigDecimal visitsPer1000PerYear; public long lengthOfStayTotal; public BigDecimal lengthOfStayAvg; public BigDecimal allowed; public BigDecimal allowedPmPm; public BigDecimal charged; public BigDecimal chargedPmPm; public BigDecimal paid; public BigDecimal paidPmPm; public BigDecimal allowedChargedRatio; public BigDecimal paidAllowedRatio; public Summary() { } } public static class ReportItem extends Summary { public String periodType; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") public Date periodStart; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") public Date periodEnd; public ReportItem() { } } }
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/cohortresults/EntropyAttr.java
src/main/java/org/ohdsi/webapi/cohortresults/EntropyAttr.java
package org.ohdsi.webapi.cohortresults; /** * */ public class EntropyAttr { private String date; private float entropy; private String insitution; /** * @return the date */ public String getDate() { return date; } /** * @param date the date to set */ public void setDate(String date) { this.date = date; } /** * @return the entropy */ public float getEntropy() { return entropy; } /** * @param entropy the entropy to set */ public void setEntropy(float entropy) { this.entropy = entropy; } /** * @return the insitution */ public String getInsitution() { return insitution; } /** * @param insitution the insitution to set */ public void setInsitution(String insitution) { this.insitution = insitution; } }
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/cohortresults/ConceptCountRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/ConceptCountRecord.java
package org.ohdsi.webapi.cohortresults; /** * * 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; } }
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/cohortresults/CohortSpecificTreemap.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortSpecificTreemap.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/TornadoRecord.java
src/main/java/org/ohdsi/webapi/cohortresults/TornadoRecord.java
package org.ohdsi.webapi.cohortresults; public class TornadoRecord { private long genderConceptId; private int ageGroup; private long personCount; public long getGenderConceptId() { return genderConceptId; } public void setGenderConceptId(long genderConceptId) { this.genderConceptId = genderConceptId; } public int getAgeGroup() { return ageGroup; } public void setAgeGroup(int ageGroup) { this.ageGroup = ageGroup; } public long getPersonCount() { return personCount; } public void setPersonCount(long personCount) { this.personCount = personCount; } }
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/cohortresults/PeriodType.java
src/main/java/org/ohdsi/webapi/cohortresults/PeriodType.java
/* * Copyright 2018 cknoll1. * * 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.cohortresults; import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Arrays; /** * * @author cknoll1 */ public enum PeriodType { WW("ww"), MM("mm"), QQ("qq"), YY("yy"); private String value; private PeriodType(String value) { this.value = value; } public String getValue() { return this.value; } @JsonCreator public static PeriodType fromString(String value) { for (PeriodType category : values()) { if (category.value.equalsIgnoreCase(value)) { return category; } } throw new IllegalArgumentException( "Unknown enum type " + value + ", Allowed values are " + Arrays.toString(values())); } }
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/cohortresults/CohortDataDensity.java
src/main/java/org/ohdsi/webapi/cohortresults/CohortDataDensity.java
package org.ohdsi.webapi.cohortresults; 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/cohortresults/mapper/ConceptConditionCountMapper.java
src/main/java/org/ohdsi/webapi/cohortresults/mapper/ConceptConditionCountMapper.java
package org.ohdsi.webapi.cohortresults.mapper; import java.sql.ResultSet; import java.sql.SQLException; import org.ohdsi.webapi.cohortresults.ConceptCountRecord; import org.springframework.jdbc.core.RowMapper; 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/cohortresults/mapper/CumulativeObservationMapper.java
src/main/java/org/ohdsi/webapi/cohortresults/mapper/CumulativeObservationMapper.java
package org.ohdsi.webapi.cohortresults.mapper; import java.sql.ResultSet; import java.sql.SQLException; import org.ohdsi.webapi.cohortresults.CumulativeObservationRecord; import org.springframework.jdbc.core.RowMapper; public class CumulativeObservationMapper implements RowMapper<CumulativeObservationRecord> { @Override public CumulativeObservationRecord mapRow(ResultSet rs, int rowNum) throws SQLException { CumulativeObservationRecord record = new CumulativeObservationRecord(); record.setSeriesName(rs.getString("SERIES_NAME")); record.setxLengthOfObservation(rs.getInt("X_LENGTH_OF_OBSERVATION")); record.setyPercentPersons(rs.getDouble("Y_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/cohortresults/mapper/ScatterplotMapper.java
src/main/java/org/ohdsi/webapi/cohortresults/mapper/ScatterplotMapper.java
package org.ohdsi.webapi.cohortresults.mapper; import java.sql.ResultSet; import java.sql.SQLException; import org.ohdsi.webapi.cohortresults.ScatterplotRecord; import org.springframework.jdbc.core.RowMapper; 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