Skip to content

Commit

Permalink
make methods accessible for extension (#549)
Browse files Browse the repository at this point in the history
Co-authored-by: JP <jonathan.percival@smilecdr.com>
  • Loading branch information
Capt-Mac and JPercival authored Oct 8, 2024
1 parent ff5af8a commit f296380
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.hl7.fhir.r4.model.Measure.MeasureGroupComponent;
import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.PrimitiveType;
import org.hl7.fhir.r4.model.Resource;
import org.opencds.cqf.fhir.api.Repository;
import org.opencds.cqf.fhir.cr.measure.CareGapsProperties;
Expand Down Expand Up @@ -99,7 +98,7 @@ public Parameters getCareGapsReport(
return result.setParameter(components);
}

private R4CareGapsParameters setCareGapParameters(
protected R4CareGapsParameters setCareGapParameters(
@Nullable ZonedDateTime periodStart,
@Nullable ZonedDateTime periodEnd,
String subject,
Expand All @@ -116,7 +115,7 @@ private R4CareGapsParameters setCareGapParameters(
return r4CareGapsParams;
}

private List<Measure> resolveMeasure(List<Either3<IdType, String, CanonicalType>> measure) {
protected List<Measure> resolveMeasure(List<Either3<IdType, String, CanonicalType>> measure) {
return measure.stream()
.map(x -> x.fold(
id -> repository.read(Measure.class, id),
Expand All @@ -136,7 +135,7 @@ protected List<String> getSubjects(String subject) {
return subjects;
}

private void addConfiguredResource(String id, String key) {
protected void addConfiguredResource(String id, String key) {
// read resource from repository
Resource resource = repository.read(Organization.class, new IdType(RESOURCE_TYPE_ORGANIZATION, id));

Expand All @@ -151,7 +150,7 @@ private void addConfiguredResource(String id, String key) {
configuredResources.put(key, resource);
}

private void checkMeasureImprovementNotation(Measure measure) {
protected void checkMeasureImprovementNotation(Measure measure) {
if (!measure.hasImprovementNotation()) {
ourLog.warn(
"Measure '{}' does not specify an improvement notation, defaulting to: '{}'.",
Expand All @@ -160,19 +159,11 @@ private void checkMeasureImprovementNotation(Measure measure) {
}
}

private Parameters initializeResult() {
protected Parameters initializeResult() {
return newResource(Parameters.class, "care-gaps-report-" + UUID.randomUUID());
}

private List<String> canonicalToString(List<CanonicalType> measureUrls) {
return measureUrls.stream()
.map(PrimitiveType::toString)
.map(x -> x.replace("CanonicalType[", ""))
.map(x -> x.replace("]", ""))
.collect(Collectors.toList());
}

private void checkValidStatusCode(List<String> statuses) {
protected void checkValidStatusCode(List<String> statuses) {
r4MeasureServiceUtils.listThrowIllegalArgumentIfEmpty(statuses, "status");

for (String status : statuses) {
Expand All @@ -186,7 +177,7 @@ private void checkValidStatusCode(List<String> statuses) {
}
}

private void measureCompatibilityCheck(List<Measure> measures) {
protected void measureCompatibilityCheck(List<Measure> measures) {
for (Measure measure : measures) {
checkMeasureScoringType(measure);
checkMeasureImprovementNotation(measure);
Expand All @@ -195,7 +186,7 @@ private void measureCompatibilityCheck(List<Measure> measures) {
}
}

private void checkMeasureBasis(Measure measure) {
protected void checkMeasureBasis(Measure measure) {
R4MeasureBasisDef measureDef = new R4MeasureBasisDef();
if (!measureDef.isBooleanBasis(measure)) {
throw new IllegalArgumentException(
Expand All @@ -208,7 +199,7 @@ private void checkMeasureBasis(Measure measure) {
* This is helpful when creating DetectedIssues per GroupComponent so endUsers can attribute evidence of a Care-Gap to the specific MeasureReport result
* @param measure Measure resource
*/
private void checkMeasureGroupComponents(Measure measure) {
protected void checkMeasureGroupComponents(Measure measure) {
// if a Multi-rate Measure, enforce groupId to be populated
if (measure.getGroup().size() > 1) {
for (MeasureGroupComponent group : measure.getGroup()) {
Expand All @@ -221,7 +212,7 @@ private void checkMeasureGroupComponents(Measure measure) {
}
}

private void checkMeasureScoringType(Measure measure) {
protected void checkMeasureScoringType(Measure measure) {
List<MeasureScoring> scoringTypes = r4MeasureServiceUtils.getMeasureScoringDef(measure);
for (MeasureScoring measureScoringType : scoringTypes) {
if (!MeasureScoring.PROPORTION.equals(measureScoringType)
Expand All @@ -233,7 +224,7 @@ private void checkMeasureScoringType(Measure measure) {
}
}

private void checkConfigurationReferences() {
protected void checkConfigurationReferences() {
careGapsProperties.validateRequiredProperties();

addConfiguredResource(careGapsProperties.getCareGapsReporter(), CareGapsConstants.CARE_GAPS_REPORTER_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Parameters getCareGapsReport(
notDocument);
}

private List<Either3<IdType, String, CanonicalType>> liftMeasureParameters(
protected List<Either3<IdType, String, CanonicalType>> liftMeasureParameters(
List<IdType> measureId, List<String> measureIdentifier, List<CanonicalType> measureUrl) {

List<Either3<IdType, String, CanonicalType>> eitherList = new ArrayList<>();
Expand Down

0 comments on commit f296380

Please sign in to comment.