Skip to content

Commit

Permalink
New unit tests for building StratifierDef in R4MeasureDefBuilder (#609)
Browse files Browse the repository at this point in the history
* First commit.

* More detailed tests.

* Throw InvalidRequestOption for non-existent MeasureEvalType.
  • Loading branch information
lukedegruchy authored Dec 9, 2024
1 parent a0f6d96 commit 4ee0710
Show file tree
Hide file tree
Showing 2 changed files with 281 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.opencds.cqf.fhir.cr.measure.common;

import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -56,7 +57,7 @@ public enum MeasureEvalType {
public static Optional<MeasureEvalType> fromCode(String code) {
MeasureEvalType evalType = lookup.get(code);
if (code != null && evalType == null) {
throw new UnsupportedOperationException(
throw new InvalidRequestException(
String.format("ReportType: %s, is not an accepted EvalType value.", code));
}
return Optional.ofNullable(evalType);
Expand Down
Loading

0 comments on commit 4ee0710

Please sign in to comment.