Update Clinical Reasoning to 3.13.0 (#6358)
* Update Clinical Reasoning to 3.12.0 * Update to 3.13.0 * add stub for new not document parameter * Add new client Timezone header and enhance JsonUtil to handle ZonedDateTime. * Add StringTimePeriodHandler and test. Add new code to DateUtils and new test class. Inject StringTimePeriodHandler into MeasureOperationsProvider and CareGapsOperationProvider. Change CareGapsOperationProvider to take String params instead of IPrimitiveType<Date>. * Remove old LibraryEvaluationOperationProvider * Fix test * Fix tests * Add $data-requirement parameters to docs * Update docs for new measures timezone header. * Add prefetchData parameter to $apply doc * Add changelog * Fix test * Update snapshot version * Add new $extract parameters to docs * Remove old test * fix test and properties for care-gaps * Fix dstu3 config * remove property for fhirserverurl * update upgrade.md doc * fix formatting of upgrade doc * comment on measureidentifier param * nonDocument parameter inclusion * java doc on care-gaps * No longer dead code. * Spotless. * Change CareGapsOperationProvider to R4 BooleanType. * Update to release * change log update * change log edit * cleanup * Use existing bean * spotless * Ensure CollectDataOperationProvider uses StringTimePeriodHandler to convert periods. * Spotless. * Add tests for id * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/upgrade.md Co-authored-by: Tadgh <garygrantgraham@gmail.com> * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/upgrade.md Co-authored-by: Tadgh <garygrantgraham@gmail.com> * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/upgrade.md Co-authored-by: Tadgh <garygrantgraham@gmail.com> * cleanup and comments * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/clinical_reasoning/measures.md Implement code reviewer suggestion on timezone docs Co-authored-by: Tadgh <garygrantgraham@gmail.com> * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/clinical_reasoning/measures.md Implement code reviewer suggestion on timezone docs Co-authored-by: Tadgh <garygrantgraham@gmail.com> * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/clinical_reasoning/measures.md Implement code reviewer suggestion on timezone docs Co-authored-by: Tadgh <garygrantgraham@gmail.com> * Update hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/clinical_reasoning/measures.md Implement code reviewer suggestion on timezone docs Co-authored-by: Tadgh <garygrantgraham@gmail.com> * Code review feedback: Add logging for StringTimePeriodHandler. * Spotless. * cleanup * Code review feedback: measures.md style changes. Change code 2560 to 2561. * Change error code. --------- Co-authored-by: Luke deGruchy <luke.degruchy@smiledigitalhealth.com> Co-authored-by: Justin McKelvy <60718638+Capt-Mac@users.noreply.github.com> Co-authored-by: Tadgh <garygrantgraham@gmail.com> Co-authored-by: Luke deGruchy <luke.degruchy@smilecdr.com>
This commit is contained in:
parent
8f52f1c769
commit
161a077f2a
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -115,6 +115,7 @@ public class Constants {
|
|||
public static final String HEADER_AUTHORIZATION_VALPREFIX_BASIC = "Basic ";
|
||||
public static final String HEADER_AUTHORIZATION_VALPREFIX_BEARER = "Bearer ";
|
||||
public static final String HEADER_CACHE_CONTROL = "Cache-Control";
|
||||
public static final String HEADER_CLIENT_TIMEZONE = "Timezone";
|
||||
public static final String HEADER_CONTENT_DISPOSITION = "Content-Disposition";
|
||||
public static final String HEADER_CONTENT_ENCODING = "Content-Encoding";
|
||||
public static final String HEADER_CONTENT_LOCATION = "Content-Location";
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package ca.uhn.fhir.util;
|
||||
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
@ -28,11 +29,20 @@ import java.lang.ref.SoftReference;
|
|||
import java.text.ParseException;
|
||||
import java.text.ParsePosition;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoField;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.time.temporal.TemporalField;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
|
@ -93,6 +103,89 @@ public final class DateUtils {
|
|||
*/
|
||||
private DateUtils() {}
|
||||
|
||||
/**
|
||||
* Calculate a LocalDateTime with any missing date/time data points defaulting to the earliest values (ex 0 for hour)
|
||||
* from a TemporalAccessor or empty if it doesn't contain a year.
|
||||
*
|
||||
* @param theTemporalAccessor The TemporalAccessor containing date/time information
|
||||
* @return A LocalDateTime or empty
|
||||
*/
|
||||
public static Optional<LocalDateTime> extractLocalDateTimeForRangeStartOrEmpty(
|
||||
TemporalAccessor theTemporalAccessor) {
|
||||
if (theTemporalAccessor.isSupported(ChronoField.YEAR)) {
|
||||
final int year = theTemporalAccessor.get(ChronoField.YEAR);
|
||||
final Month month = Month.of(getTimeUnitIfSupported(theTemporalAccessor, ChronoField.MONTH_OF_YEAR, 1));
|
||||
final int day = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.DAY_OF_MONTH, 1);
|
||||
final int hour = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.HOUR_OF_DAY, 0);
|
||||
final int minute = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.MINUTE_OF_HOUR, 0);
|
||||
final int seconds = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.SECOND_OF_MINUTE, 0);
|
||||
|
||||
return Optional.of(LocalDateTime.of(year, month, day, hour, minute, seconds));
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate a LocalDateTime with any missing date/time data points defaulting to the latest values (ex 23 for hour)
|
||||
* from a TemporalAccessor or empty if it doesn't contain a year.
|
||||
*
|
||||
* @param theTemporalAccessor The TemporalAccessor containing date/time information
|
||||
* @return A LocalDateTime or empty
|
||||
*/
|
||||
public static Optional<LocalDateTime> extractLocalDateTimeForRangeEndOrEmpty(TemporalAccessor theTemporalAccessor) {
|
||||
if (theTemporalAccessor.isSupported(ChronoField.YEAR)) {
|
||||
final int year = theTemporalAccessor.get(ChronoField.YEAR);
|
||||
final Month month = Month.of(getTimeUnitIfSupported(theTemporalAccessor, ChronoField.MONTH_OF_YEAR, 12));
|
||||
final int day = getTimeUnitIfSupported(
|
||||
theTemporalAccessor,
|
||||
ChronoField.DAY_OF_MONTH,
|
||||
YearMonth.of(year, month).atEndOfMonth().getDayOfMonth());
|
||||
final int hour = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.HOUR_OF_DAY, 23);
|
||||
final int minute = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.MINUTE_OF_HOUR, 59);
|
||||
final int seconds = getTimeUnitIfSupported(theTemporalAccessor, ChronoField.SECOND_OF_MINUTE, 59);
|
||||
|
||||
return Optional.of(LocalDateTime.of(year, month, day, hour, minute, seconds));
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* With the provided DateTimeFormatter, parse a date time String or return empty if the String doesn't correspond
|
||||
* to the formatter.
|
||||
*
|
||||
* @param theDateTimeString A date/time String in some date format
|
||||
* @param theSupportedDateTimeFormatter The DateTimeFormatter we expect corresponds to the String
|
||||
* @return The parsed TemporalAccessor or empty
|
||||
*/
|
||||
public static Optional<TemporalAccessor> parseDateTimeStringIfValid(
|
||||
String theDateTimeString, DateTimeFormatter theSupportedDateTimeFormatter) {
|
||||
Objects.requireNonNull(theSupportedDateTimeFormatter);
|
||||
Preconditions.checkArgument(StringUtils.isNotBlank(theDateTimeString));
|
||||
|
||||
try {
|
||||
return Optional.of(theSupportedDateTimeFormatter.parse(theDateTimeString));
|
||||
} catch (Exception exception) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
private static int getTimeUnitIfSupported(
|
||||
TemporalAccessor theTemporalAccessor, TemporalField theTemporalField, int theDefaultValue) {
|
||||
return getTimeUnitIfSupportedOrEmpty(theTemporalAccessor, theTemporalField)
|
||||
.orElse(theDefaultValue);
|
||||
}
|
||||
|
||||
private static Optional<Integer> getTimeUnitIfSupportedOrEmpty(
|
||||
TemporalAccessor theTemporalAccessor, TemporalField theTemporalField) {
|
||||
if (theTemporalAccessor.isSupported(theTemporalField)) {
|
||||
return Optional.of(theTemporalAccessor.get(theTemporalField));
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* A factory for {@link SimpleDateFormat}s. The instances are stored in a
|
||||
* threadlocal way because SimpleDateFormat is not thread safe as noted in
|
||||
|
|
|
@ -34,6 +34,7 @@ import com.fasterxml.jackson.databind.ser.FilterProvider;
|
|||
import com.fasterxml.jackson.databind.ser.PropertyWriter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import jakarta.annotation.Nonnull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -60,16 +61,22 @@ public class JsonUtil {
|
|||
ourMapperPrettyPrint.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
ourMapperPrettyPrint.setFilterProvider(SENSITIVE_DATA_FILTER_PROVIDER);
|
||||
ourMapperPrettyPrint.enable(SerializationFeature.INDENT_OUTPUT);
|
||||
// Needed to handle ZonedDateTime
|
||||
ourMapperPrettyPrint.registerModule(new JavaTimeModule());
|
||||
|
||||
ourMapperNonPrettyPrint = new ObjectMapper();
|
||||
ourMapperNonPrettyPrint.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
ourMapperNonPrettyPrint.setFilterProvider(SENSITIVE_DATA_FILTER_PROVIDER);
|
||||
ourMapperNonPrettyPrint.disable(SerializationFeature.INDENT_OUTPUT);
|
||||
// Needed to handle ZonedDateTime
|
||||
ourMapperNonPrettyPrint.registerModule(new JavaTimeModule());
|
||||
|
||||
ourMapperIncludeSensitive = new ObjectMapper();
|
||||
ourMapperIncludeSensitive.setFilterProvider(SHOW_ALL_DATA_FILTER_PROVIDER);
|
||||
ourMapperIncludeSensitive.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
ourMapperIncludeSensitive.disable(SerializationFeature.INDENT_OUTPUT);
|
||||
// Needed to handle ZonedDateTime
|
||||
ourMapperIncludeSensitive.registerModule(new JavaTimeModule());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,179 @@
|
|||
package ca.uhn.fhir.util;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class DateUtilsTest {
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY = DateTimeFormatter.ofPattern("yyyy");
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_DD = DateTimeFormatter.ISO_DATE;
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_DD_HH = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH");
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_DD_HH_MM = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm");
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_DD_HH_MM_SS = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
||||
|
||||
private static Stream<Arguments> extractLocalDateTimeStartIfValidParams() {
|
||||
return Stream.of(
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024"),
|
||||
LocalDateTime.of(2024, Month.JANUARY, 1, 0, 0, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-02"),
|
||||
LocalDateTime.of(2023, Month.FEBRUARY, 1, 0, 0, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2022-09"),
|
||||
LocalDateTime.of(2022, Month.SEPTEMBER, 1, 0, 0, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2021-03-24"),
|
||||
LocalDateTime.of(2021, Month.MARCH, 24, 0, 0, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-10-23"),
|
||||
LocalDateTime.of(2024, Month.OCTOBER, 23, 0, 0, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-08-24T12"),
|
||||
LocalDateTime.of(2024, Month.AUGUST, 24, 12, 0, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-11-24T12:35"),
|
||||
LocalDateTime.of(2024, Month.NOVEMBER, 24, 12, 35, 0)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-09-24T12:35:47"),
|
||||
LocalDateTime.of(2024, Month.SEPTEMBER, 24, 12, 35, 47)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private static Stream<Arguments> extractLocalDateTimeEndIfValidParams() {
|
||||
return Stream.of(
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024"),
|
||||
LocalDateTime.of(2024, Month.DECEMBER, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-01"),
|
||||
LocalDateTime.of(2023, Month.JANUARY, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-02"),
|
||||
LocalDateTime.of(2023, Month.FEBRUARY, 28, 23, 59, 59)
|
||||
),
|
||||
// Leap year
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-02"),
|
||||
LocalDateTime.of(2024, Month.FEBRUARY, 29, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-03"),
|
||||
LocalDateTime.of(2023, Month.MARCH, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-04"),
|
||||
LocalDateTime.of(2023, Month.APRIL, 30, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-05"),
|
||||
LocalDateTime.of(2023, Month.MAY, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-06"),
|
||||
LocalDateTime.of(2023, Month.JUNE, 30, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-07"),
|
||||
LocalDateTime.of(2023, Month.JULY, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-08"),
|
||||
LocalDateTime.of(2023, Month.AUGUST, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2023-09"),
|
||||
LocalDateTime.of(2023, Month.SEPTEMBER, 30, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2022-10"),
|
||||
LocalDateTime.of(2022, Month.OCTOBER, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2022-11"),
|
||||
LocalDateTime.of(2022, Month.NOVEMBER, 30, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2022-12"),
|
||||
LocalDateTime.of(2022, Month.DECEMBER, 31, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2021-03-24"),
|
||||
LocalDateTime.of(2021, Month.MARCH, 24, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-10-23"),
|
||||
LocalDateTime.of(2024, Month.OCTOBER, 23, 23, 59, 59)
|
||||
),
|
||||
Arguments.of(
|
||||
getTemporalAccessor("2024-09-24T12:35:47"),
|
||||
LocalDateTime.of(2024, Month.SEPTEMBER, 24, 12, 35, 47)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("extractLocalDateTimeStartIfValidParams")
|
||||
void extractLocalDateTimeStartIfValid (
|
||||
TemporalAccessor theTemporalAccessor,
|
||||
@Nullable LocalDateTime theExpectedResult) {
|
||||
assertThat(DateUtils.extractLocalDateTimeForRangeStartOrEmpty(theTemporalAccessor))
|
||||
.isEqualTo(Optional.ofNullable(theExpectedResult));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("extractLocalDateTimeEndIfValidParams")
|
||||
void extractLocalDateTimeEndIfValid (
|
||||
TemporalAccessor theTemporalAccessor,
|
||||
@Nullable LocalDateTime theExpectedResult) {
|
||||
assertThat(DateUtils.extractLocalDateTimeForRangeEndOrEmpty(theTemporalAccessor))
|
||||
.isEqualTo(Optional.ofNullable(theExpectedResult));
|
||||
}
|
||||
|
||||
private static TemporalAccessor getTemporalAccessor(String theDateTimeString) {
|
||||
final DateTimeFormatter dateTimeFormatter = getDateTimeFormatter(theDateTimeString);
|
||||
|
||||
assertThat(dateTimeFormatter)
|
||||
.withFailMessage("Cannot find DateTimeFormatter for: " + theDateTimeString)
|
||||
.isNotNull();
|
||||
|
||||
return DateUtils.parseDateTimeStringIfValid(
|
||||
theDateTimeString,
|
||||
dateTimeFormatter
|
||||
).orElseThrow(() -> new IllegalArgumentException("Unable to parse: " + theDateTimeString));
|
||||
}
|
||||
|
||||
private static DateTimeFormatter getDateTimeFormatter(String theDateTimeString) {
|
||||
return switch (theDateTimeString.length()) {
|
||||
case 4 -> DATE_TIME_FORMATTER_YYYY;
|
||||
case 7 -> DATE_TIME_FORMATTER_YYYY_MM;
|
||||
case 10 -> DATE_TIME_FORMATTER_YYYY_MM_DD;
|
||||
case 13 -> DATE_TIME_FORMATTER_YYYY_MM_DD_HH;
|
||||
case 16 -> DATE_TIME_FORMATTER_YYYY_MM_DD_HH_MM;
|
||||
case 19 -> DATE_TIME_FORMATTER_YYYY_MM_DD_HH_MM_SS;
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-bom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<name>HAPI FHIR BOM</name>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-cli</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
type: add
|
||||
issue: 6357
|
||||
title: Upgrade the Clinical Reasoning module to the latest release of 3.13.0. This update comes with several changes
|
||||
and feature enhancements to CPG and dQM clinical-reasoning operations. Please review associated ticket and upgrade.md
|
||||
for detailed list of changes.
|
|
@ -0,0 +1,25 @@
|
|||
# Measures and Care Gaps
|
||||
|
||||
## TimeZone Header
|
||||
DQM `$care-gaps` and `$evaluate-measure` will convert parameters `periodStart` and `periodEnd`
|
||||
according to a timezone supplied by the client, not the server timezone as it was previously. Clients can leverage this
|
||||
functionality by passing in a new `Timezone` header (ex: `America/Denver`). If nothing is supplied, it will default to
|
||||
UTC.
|
||||
|
||||
## CareGaps Operation Parameters
|
||||
### Parameters removed
|
||||
Certain `$care-gaps` operation parameters have been dropped, because they are not used or likely to be implemented
|
||||
* `topic`
|
||||
* `practitioner` is now callable via `subject` parameter
|
||||
* `organization`
|
||||
* `program`
|
||||
|
||||
### Parameters added:
|
||||
* `measureIdentifier` now is available to resolve measure resources for evaluation
|
||||
* `nonDocument` is a new optional parameter that defaults to `false` which returns standard `document` bundle for `$care-gaps`.
|
||||
If `true`, this will return summarized subject bundle with only detectedIssue.
|
||||
|
||||
# SDC $populate operation
|
||||
|
||||
The `subject` parameter of the `Questionnaire/$populate` operation has been changed to expect a `Reference` as specified
|
||||
in the SDC IG.
|
|
@ -111,8 +111,50 @@ A request using `periodStart` and `periodEnd` looks like:
|
|||
```bash
|
||||
GET fhir/Measure/<MeasureId>/$evaluate-measure?periodStart=2019-01-01&periodEnd=2019-12-31
|
||||
```
|
||||
`periodStart` and `periodEnd` support Dates (YYYY, YYYY-MM, or YYYY-MM-DD) and DateTimes (YYYY-MM-DDThh:mm:ss). DateTime formats of YYYY-MM-DDThh:mm:ss+zz no longer accepted. To pass in timezones to period queries, please see the [Headers](#headers) section below:
|
||||
|
||||
`periodStart` and `periodEnd` support Dates (YYYY, YYYY-MM, or YYYY-MM-DD) and DateTimes (YYYY-MM-DDThh:mm:ss+zz:zz)
|
||||
#### Headers
|
||||
|
||||
The behaviour of the `periodStart` and `periodEnd` parameters depends on the value of the `Timezone` header. The measure report will be queried according to the period range, as denoted by that timezone, **not the server timezone**.
|
||||
|
||||
Accepted values for this header are documented on the [Wikipedia timezones page](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
|
||||
|
||||
ex: `Timezone`:`America/Denver` will set the timezone to Mountain Time.
|
||||
|
||||
If the client omits this header, the timezone will default to UTC.
|
||||
|
||||
Please consult the below table for examples of various combinations of start, end, and timezone, as well as the resulting queried periods:
|
||||
|
||||
| Request timezone | Start | End | Converted Start | Converted End |
|
||||
|--------------------| ---------------------| --------------------|---------------------------|---------------------------|
|
||||
| (unset) | (unset) | (unset) | N/A | N/A |
|
||||
| (unset) | 2020 | 2021 | 2020-01-01T00:00:00Z | 2021-12-31T23:59:59Z |
|
||||
| Z | 2020 | 2021 | 2020-01-01T00:00:00Z | 2021-12-31T23:59:59Z |
|
||||
| UTC | 2020 | 2021 | 2020-01-01T00:00:00Z | 2021-12-31T23:59:59Z |
|
||||
| America/St_Johns | 2020 | 2021 | 2020-01-01T00:00:00-03:30 | 2021-12-31T23:59:59-03:30 |
|
||||
| America/Toronto | 2020 | 2021 | 2020-01-01T00:00:00-05:00 | 2021-12-31T23:59:59-05:00 |
|
||||
| America/Denver | 2020 | 2021 | 2020-01-01T00:00:00-07:00 | 2021-12-31T23:59:59-07:00 |
|
||||
| (unset) | 2022-02 | 2022-08 | 2022-02-01T00:00:00Z | 2022-08-31T23:59:59Z |
|
||||
| UTC | 2022-02 | 2022-08 | 2022-02-01T00:00:00Z | 2022-08-31T23:59:59Z |
|
||||
| America/St_Johns | 2022-02 | 2022-08 | 2022-02-01T00:00:00-03:30 | 2022-08-31T23:59:59-02:30 |
|
||||
| America/Toronto | 2022-02 | 2022-08 | 2022-02-01T00:00:00-05:00 | 2022-08-31T23:59:59-04:00 |
|
||||
| America/Denver | 2022-02 | 2022-08 | 2022-02-01T00:00:00-07:00 | 2022-08-31T23:59:59-06:00 |
|
||||
| (unset) | 2024-02-25 | 2024-02-26 | 2024-02-25T00:00:00Z | 2024-02-26T23:59:59Z |
|
||||
| UTC | 2024-02-25 | 2024-02-26 | 2024-02-25T00:00:00Z | 2024-02-26T23:59:59Z |
|
||||
| America/St_Johns | 2024-02-25 | 2024-02-26 | 2024-02-25T00:00:00-03:30 | 2024-02-26T23:59:59-03:30 |
|
||||
| America/Toronto | 2024-02-25 | 2024-02-26 | 2024-02-25T00:00:00-05:00 | 2024-02-26T23:59:59-05:00 |
|
||||
| America/Denver | 2024-02-25 | 2024-02-26 | 2024-02-25T00:00:00-07:00 | 2024-02-26T23:59:59-07:00 |
|
||||
| (unset) | 2024-09-25 | 2024-09-26 | 2024-09-25T00:00:00Z | 2024-09-26T23:59:59Z |
|
||||
| UTC | 2024-09-25 | 2024-09-26 | 2024-09-25T00:00:00Z | 2024-09-26T23:59:59Z |
|
||||
| America/St_Johns | 2024-09-25 | 2024-09-26 | 2024-09-25T00:00:00-02:30 | 2024-09-26T23:59:59-02:30 |
|
||||
| America/Toronto | 2024-09-25 | 2024-09-26 | 2024-09-25T00:00:00-04:00 | 2024-09-26T23:59:59-04:00 |
|
||||
| America/Denver | 2024-09-25 | 2024-09-26 | 2024-09-25T00:00:00-06:00 | 2024-09-26T23:59:59-06:00 |
|
||||
| (unset) | 2024-09-25T12:00:00 | 2024-09-26T12:00:00 | 2024-09-25T12:00:00-06:00 | 2024-09-26T11:59:59-06:00 |
|
||||
| Z | 2024-09-25T12:00:00 | 2024-09-26T12:00:00 | 2024-09-25T12:00:00-06:00 | 2024-09-26T11:59:59-06:00 |
|
||||
| UTC | 2024-09-25T12:00:00 | 2024-09-26T12:00:00 | 2024-09-25T12:00:00-06:00 | 2024-09-26T11:59:59-06:00 |
|
||||
| America/St_Johns | 2024-09-25T12:00:00 | 2024-09-26T12:00:00 | 2024-09-25T12:00:00-02:30 | 2024-09-26T11:59:59-02:30 |
|
||||
| America/Toronto | 2024-09-25T12:00:00 | 2024-09-26T12:00:00 | 2024-09-25T12:00:00-04:00 | 2024-09-26T11:59:59-04:00 |
|
||||
| America/Denver | 2024-09-25T12:00:00 | 2024-09-26T12:00:00 | 2024-09-25T12:00:00-06:00 | 2024-09-26T11:59:59-06:00 |
|
||||
|
||||
#### Report Types
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ HAPI implements the following operations for PlanDefinitions:
|
|||
|
||||
* [$apply](/docs/clinical_reasoning/plan_definitions.html#apply)
|
||||
* [$package](/docs/clinical_reasoning/plan_definitions.html#package)
|
||||
* [$data-requirements](/docs/clinical_reasoning/plan_definitions.html#datarequirements)
|
||||
|
||||
## Apply
|
||||
|
||||
|
@ -40,32 +41,36 @@ GET http://your-server-base/fhir/PlanDefinition/opioidcds-10-patient-view/$apply
|
|||
|
||||
The following parameters are supported for the `PlanDefinition/$apply` and `PlanDefinition/$r5.apply` operation:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|---------------------|---------------------------|-------------|
|
||||
| planDefinition | PlanDefinition | The plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required, or a url (and optionally version) must be supplied. |
|
||||
| canonical | canonical(PlanDefinition) | The canonical url of the plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the planDefinition parameter must be supplied. |
|
||||
| url | uri | Canonical URL of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters. |
|
||||
| version | string | Version of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters. |
|
||||
| subject | string(reference) | The subject(s) that is/are the target of the plan definition to be applied. |
|
||||
| encounter | string(reference) | The encounter in context, if any. |
|
||||
| practitioner | string(reference) | The practitioner applying the plan definition. |
|
||||
| organization | string(reference) | The organization applying the plan definition. |
|
||||
| userType | CodeableConcept | The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.) |
|
||||
| userLanguage | CodeableConcept | Preferred language of the person using the system |
|
||||
| userTaskContext | CodeableConcept | The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources. |
|
||||
| setting | CodeableConcept | The current setting of the request (inpatient, outpatient, etc.). |
|
||||
| settingContext | CodeableConcept | Additional detail about the setting of the request, if any |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the PlanDefinition. |
|
||||
| useServerData | boolean | Whether to use data from the server performing the evaluation. If this parameter is true (the default), then the operation will use data first from any bundles provided as parameters (through the data and prefetch parameters), second data from the server performing the operation, and third, data from the dataEndpoint parameter (if provided). If this parameter is false, the operation will use data first from the bundles provided in the data or prefetch parameters, and second from the dataEndpoint parameter (if provided). |
|
||||
| data | Bundle | Data to be made available to the PlanDefinition evaluation. |
|
||||
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the PlanDefinition. |
|
||||
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the PlanDefinition. |
|
||||
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the PlanDefinition. |
|
||||
| Parameter | Type | Description |
|
||||
|-------------------------|---------------------------|-------------|
|
||||
| planDefinition | PlanDefinition | The plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required, or a url (and optionally version) must be supplied. |
|
||||
| canonical | canonical(PlanDefinition) | The canonical url of the plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the planDefinition parameter must be supplied. |
|
||||
| url | uri | Canonical URL of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters. |
|
||||
| version | string | Version of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters. |
|
||||
| subject | string(reference) | The subject(s) that is/are the target of the plan definition to be applied. |
|
||||
| encounter | string(reference) | The encounter in context, if any. |
|
||||
| practitioner | string(reference) | The practitioner applying the plan definition. |
|
||||
| organization | string(reference) | The organization applying the plan definition. |
|
||||
| userType | CodeableConcept | The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.) |
|
||||
| userLanguage | CodeableConcept | Preferred language of the person using the system |
|
||||
| userTaskContext | CodeableConcept | The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources. |
|
||||
| setting | CodeableConcept | The current setting of the request (inpatient, outpatient, etc.). |
|
||||
| settingContext | CodeableConcept | Additional detail about the setting of the request, if any |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the PlanDefinition. |
|
||||
| useServerData | boolean | Whether to use data from the server performing the evaluation. If this parameter is true (the default), then the operation will use data first from any bundles provided as parameters (through the data and prefetch parameters), second data from the server performing the operation, and third, data from the dataEndpoint parameter (if provided). If this parameter is false, the operation will use data first from the bundles provided in the data or prefetch parameters, and second from the dataEndpoint parameter (if provided). |
|
||||
| data | Bundle | Data to be made available to the PlanDefinition evaluation. |
|
||||
| prefetchData | | Data to be made available to the PlanDefinition evaluation, organized as prefetch response bundles. Each prefetchData parameter specifies either the name of the prefetchKey it is satisfying, a DataRequirement describing the prefetch, or both. |
|
||||
| prefetchData.key | string | The key of the prefetch item. This typically corresponds to the name of a parameter in a library, or the name of a prefetch item in a CDS Hooks discovery response. |
|
||||
| prefetchData.descriptor | DataRequirement | A DataRequirement describing the content of the prefetch item. |
|
||||
| prefetchData.data | Bundle | The prefetch data as a Bundle. If the prefetchData has no data part, it indicates there is no data associated with this prefetch item. |
|
||||
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the PlanDefinition. |
|
||||
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the PlanDefinition. |
|
||||
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the PlanDefinition. |
|
||||
|
||||
|
||||
## Package
|
||||
|
||||
The `PlanDefinition/$package` [operation](https://build.fhir.org/ig/HL7/crmi-ig/OperationDefinition-crmi-package.html) for PlanDefinition will generate a Bundle of resources that includes the PlanDefinition as well as any related resources which can then be shared. This implementation follows the [CRMI IG](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/index.html) guidance for [packaging artifacts](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html).
|
||||
The `PlanDefinition/$package` [operation](https://hl7.org/fhir/uv/crmi/OperationDefinition-crmi-package.html) for PlanDefinition will generate a Bundle of resources that includes the PlanDefinition as well as any related resources which can then be shared. This implementation follows the [CRMI IG](https://hl7.org/fhir/uv/crmi/index.html) guidance for [packaging artifacts](https://hl7.org/fhir/uv/crmi/packaging.html).
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -80,6 +85,22 @@ The following parameters are supported for the `PlanDefinition/$package` operati
|
|||
| usePut | boolean | Determines the type of method returned in the Bundle Entries: POST if False (the default), PUT if True. |
|
||||
|
||||
|
||||
## DataRequirements
|
||||
|
||||
The `PlanDefinition/$data-requirements` [operation](https://hl7.org/fhir/uv/crmi/OperationDefinition-crmi-data-requirements.html) for PlanDefinition will generate a Library of type `module-definition` that returns the computed effective requirements of the artifact.
|
||||
|
||||
### Parameters
|
||||
|
||||
The following parameters are supported for the `PlanDefinition/$data-requirements` operation:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|-----------|----------------------------------------------------------------------------------------------------------------|
|
||||
| id | string | The logical id of the canonical or artifact resource to analyze. |
|
||||
| canonical | canonical | A canonical url (optionally version specific) to a canonical resource. |
|
||||
| url | uri | A canonical or artifact reference to a canonical resource. This is exclusive with the canonical parameter. |
|
||||
| version | string | The version of the canonical or artifact resource to analyze. This is exclusive with the canonical parameter. |
|
||||
|
||||
|
||||
## Example PlanDefinition
|
||||
|
||||
```json
|
||||
|
|
|
@ -16,7 +16,7 @@ HAPI implements the following operations for Questionnaires and QuestionnaireRes
|
|||
* [$populate](/docs/clinical_reasoning/questionnaires.html#populate)
|
||||
* [$extract](/docs/clinical_reasoning/questionnaires.html#extract)
|
||||
* [$package](/docs/clinical_reasoning/questionnaires.html#package)
|
||||
|
||||
* [$data-requirements](/docs/clinical_reasoning/questionnaires.html#datarequirements)
|
||||
|
||||
## Questionnaire
|
||||
|
||||
|
@ -26,65 +26,69 @@ The `StructureDefinition/$questionnaire` [operation]() generates a [Questionnair
|
|||
|
||||
The following parameters are supported for the `StructureDefinition/$questionnaire` operation:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| profile | StructureDefinition | The StructureDefinition to base the Questionnaire on. Used when the operation is invoked at the 'type' level. |
|
||||
| canonical | canonical | The canonical identifier for the StructureDefinition (optionally version-specific). |
|
||||
| url | uri | Canonical URL of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters. |
|
||||
| version | string | Version of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters. |
|
||||
| supportedOnly | boolean | If true (default: false), the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition. |
|
||||
| requiredOnly | boolean | If true (default: false), the questionnaire will only include those elements marked as "min>0" in the StructureDefinition. |
|
||||
| subject | string | The subject(s) that is/are the target of the Questionnaire. |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the StructureDefinition. |
|
||||
| useServerData | boolean Whether to use data from the server performing the evaluation. |
|
||||
| data | Bundle | Data to be made available during CQL evaluation. |
|
||||
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the StructureDefinition. |
|
||||
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the StructureDefinition. |
|
||||
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the StructureDefinition. |
|
||||
| Parameter | Type | Description |
|
||||
|---------------------|----------------------|-------------|
|
||||
| profile | StructureDefinition | The StructureDefinition to base the Questionnaire on. Used when the operation is invoked at the 'type' level. |
|
||||
| canonical | canonical | The canonical identifier for the StructureDefinition (optionally version-specific). |
|
||||
| url | uri | Canonical URL of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters. |
|
||||
| version | string | Version of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters. |
|
||||
| supportedOnly | boolean | If true (default: false), the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition. |
|
||||
| requiredOnly | boolean | If true (default: false), the questionnaire will only include those elements marked as "min>0" in the StructureDefinition. |
|
||||
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the StructureDefinition. |
|
||||
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the StructureDefinition. |
|
||||
|
||||
## Populate
|
||||
|
||||
The `Questionnaire/$populate` [operation](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html) generates a [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) based on a specific [Questionnaire](https://www.hl7.org/fhir/questionnaire.html), filling in answers to questions where possible based on information provided as part of the operation or already known by the server about the subject of the Questionnaire.
|
||||
The `Questionnaire/$populate` [operation](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html) generates a [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) based on a specific [Questionnaire](https://www.hl7.org/fhir/questionnaire.html), filling in answers to questions where possible based on information provided as part of the operation or already known by the server about the subject of the Questionnaire.
|
||||
|
||||
This implementation only allows for [Expression-based](https://hl7.org/fhir/uv/sdc/populate.html#expression-based-population) population.
|
||||
Additional parameters have been added to support CQL evaluation.
|
||||
|
||||
### Parameters
|
||||
|
||||
The following parameters are supported for the `Questionnaire/$populate` operation:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| questionnaire | Questionnaire | The Questionnaire to populate. Used when the operation is invoked at the 'type' level. |
|
||||
| canonical | canonical | The canonical identifier for the Questionnaire (optionally version-specific). |
|
||||
| url | uri | Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters. |
|
||||
| version | string | Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters. |
|
||||
| subject | string | The subject(s) that is/are the target of the Questionnaire. |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the Questionnaire. |
|
||||
| useServerData | boolean | Whether to use data from the server performing the evaluation. |
|
||||
| data | Bundle | Data to be made available during CQL evaluation. |
|
||||
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the Questionnaire. |
|
||||
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire. |
|
||||
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the Questionnaire. |
|
||||
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|---------------------|---------------|-------------|
|
||||
| questionnaire | Questionnaire | The Questionnaire to populate. Used when the operation is invoked at the 'type' level. |
|
||||
| canonical | canonical | The canonical identifier for the Questionnaire (optionally version-specific). |
|
||||
| url | uri | Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters. |
|
||||
| version | string | Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters. |
|
||||
| subject | Reference | The resource that is to be the QuestionnaireResponse.subject. The QuestionnaireResponse instance will reference the provided subject. |
|
||||
| context | | Resources containing information to be used to help populate the QuestionnaireResponse. |
|
||||
| context.name | string | The name of the launchContext or root Questionnaire variable the passed content should be used as for population purposes. The name SHALL correspond to a launchContext or variable delared at the root of the Questionnaire. |
|
||||
| context.reference | Reference | The actual resource (or resources) to use as the value of the launchContext or variable. |
|
||||
| local | boolean | Whether the server should use what resources and other knowledge it has about the referenced subject when pre-populating answers to questions. |
|
||||
| launchContext | Extension | The [Questionnaire Launch Context](https://hl7.org/fhir/uv/sdc/StructureDefinition-sdc-questionnaire-launchContext.html) extension containing Resources that provide context for form processing logic (pre-population) when creating/displaying/editing a QuestionnaireResponse. |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the Questionnaire. |
|
||||
| useServerData | boolean | Whether to use data from the server performing the evaluation. |
|
||||
| data | Bundle | Data to be made available during CQL evaluation. |
|
||||
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the Questionnaire. |
|
||||
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire. |
|
||||
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the Questionnaire. |
|
||||
|
||||
## Extract
|
||||
|
||||
The `QuestionnaireResponse/$extract` [operation](http://hl7.org/fhir/uv/sdc/OperationDefinition-QuestionnaireResponse-extract.html) takes a completed [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) and converts it to a Bundle of resources by using metadata embedded in the [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) the QuestionnaireResponse is based on. The extracted resources might include Observations, MedicationStatements and other standard FHIR resources which can then be shared and manipulated. When invoking the $extract operation, care should be taken that the submitted QuestionnaireResponse is itself valid. If not, the extract operation could fail (with appropriate OperationOutcomes) or, more problematic, might succeed but provide incorrect output.
|
||||
|
||||
This implementation allows for both [Observation based](https://hl7.org/fhir/uv/sdc/extraction.html#observation-based-extraction) and [Definition based](https://hl7.org/fhir/uv/sdc/extraction.html#definition-based-extraction) extraction.
|
||||
This implementation allows for both [Observation-based](https://hl7.org/fhir/uv/sdc/extraction.html#observation-based-extraction) and [Definition-based](https://hl7.org/fhir/uv/sdc/extraction.html#definition-based-extraction) extraction.
|
||||
|
||||
### Parameters
|
||||
|
||||
The following parameters are supported for the `QuestionnaireResponse/$extract` operation:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| Parameter | Type | Description |
|
||||
|------------------------|-----------------------|-------------|
|
||||
| questionnaire-response | QuestionnaireResponse | The QuestionnaireResponse to extract data from. Used when the operation is invoked at the 'type' level. |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the Questionnaire. |
|
||||
| data | Bundle | Data to be made available during CQL evaluation. |
|
||||
| questionnaire | Questionnaire | The Questionnaire the QuestionnaireResponse is answering. Used when the server does not have access to the Questionnaire. |
|
||||
| parameters | Parameters | Any input parameters defined in libraries referenced by the Questionnaire. |
|
||||
| useServerData | boolean | Whether to use data from the server performing the evaluation. |
|
||||
| data | Bundle | Data to be made available during CQL evaluation. |
|
||||
|
||||
|
||||
## Package
|
||||
|
||||
The `Questionnaire/$package` [operation](https://build.fhir.org/ig/HL7/crmi-ig/OperationDefinition-crmi-package.html) for [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) will generate a Bundle of resources that includes the Questionnaire as well as any related Library or ValueSet resources which can then be shared. This implementation follows the [CRMI IG](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/index.html) guidance for [packaging artifacts](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html).
|
||||
The `Questionnaire/$package` [operation](https://hl7.org/fhir/uv/crmi/OperationDefinition-crmi-package.html) for [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) will generate a Bundle of resources that includes the Questionnaire as well as any related Library or ValueSet resources which can then be shared. This implementation follows the [CRMI IG](https://hl7.org/fhir/uv/crmi/index.html) guidance for [packaging artifacts](https://hl7.org/fhir/uv/crmi/packaging.html).
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -99,6 +103,22 @@ The following parameters are supported for the `Questionnaire/$package` operatio
|
|||
| usePut | boolean | Determines the type of method returned in the Bundle Entries: POST if False (the default), PUT if True. |
|
||||
|
||||
|
||||
## DataRequirements
|
||||
|
||||
The `Questionnaire/$data-requirements` [operation](https://hl7.org/fhir/uv/crmi/OperationDefinition-crmi-data-requirements.html) for Questionnaire will generate a Library of type `module-definition` that returns the computed effective requirements of the artifact.
|
||||
|
||||
### Parameters
|
||||
|
||||
The following parameters are supported for the `Questionnaire/$data-requirements` operation:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|-----------|----------------------------------------------------------------------------------------------------------------|
|
||||
| id | string | The logical id of the canonical or artifact resource to analyze. |
|
||||
| canonical | canonical | A canonical url (optionally version specific) to a canonical resource. |
|
||||
| url | uri | A canonical or artifact reference to a canonical resource. This is exclusive with the canonical parameter. |
|
||||
| version | string | The version of the canonical or artifact resource to analyze. This is exclusive with the canonical parameter. |
|
||||
|
||||
|
||||
## Example Questionnaire
|
||||
|
||||
```json
|
||||
|
|
|
@ -94,6 +94,7 @@ page.clinical_reasoning.overview=Clinical Reasoning Overview
|
|||
page.clinical_reasoning.cql=CQL
|
||||
page.clinical_reasoning.caregaps=Care Gaps
|
||||
page.clinical_reasoning.measures=Measures
|
||||
page.clinical_reasoning.activity_definitions=ActivityDefinitions
|
||||
page.clinical_reasoning.plan_definitions=PlanDefinitions
|
||||
page.clinical_reasoning.questionnaires=Questionnaires
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-caching-api</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-spring-boot</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>7.5.1-SNAPSHOT</version>
|
||||
<version>7.5.2-SNAPSHOT</version>
|
||||
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
|
|
@ -22,6 +22,9 @@ package ca.uhn.fhir.cr.common;
|
|||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import org.opencds.cqf.fhir.cr.activitydefinition.ActivityDefinitionProcessor;
|
||||
|
||||
/**
|
||||
* This interface takes a RequestDetails object and uses it to create a Repository which is passed to the constructor of the processor class being instantiated.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IActivityDefinitionProcessorFactory {
|
||||
ActivityDefinitionProcessor create(RequestDetails theRequestDetails);
|
||||
|
|
|
@ -17,12 +17,15 @@
|
|||
* limitations under the License.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.r4;
|
||||
package ca.uhn.fhir.cr.common;
|
||||
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import org.opencds.cqf.fhir.cr.cpg.r4.R4LibraryEvaluationService;
|
||||
import org.opencds.cqf.fhir.cr.library.LibraryProcessor;
|
||||
|
||||
/**
|
||||
* This interface takes a RequestDetails object and uses it to create a Repository which is passed to the constructor of the processor class being instantiated.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ILibraryEvaluationServiceFactory {
|
||||
R4LibraryEvaluationService create(RequestDetails theRequestDetails);
|
||||
public interface ILibraryProcessorFactory {
|
||||
LibraryProcessor create(RequestDetails theRequestDetails);
|
||||
}
|
|
@ -22,6 +22,9 @@ package ca.uhn.fhir.cr.common;
|
|||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import org.opencds.cqf.fhir.cr.plandefinition.PlanDefinitionProcessor;
|
||||
|
||||
/**
|
||||
* This interface takes a RequestDetails object and uses it to create a Repository which is passed to the constructor of the processor class being instantiated.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IPlanDefinitionProcessorFactory {
|
||||
PlanDefinitionProcessor create(RequestDetails theRequestDetails);
|
||||
|
|
|
@ -22,6 +22,9 @@ package ca.uhn.fhir.cr.common;
|
|||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import org.opencds.cqf.fhir.cr.questionnaire.QuestionnaireProcessor;
|
||||
|
||||
/**
|
||||
* This interface takes a RequestDetails object and uses it to create a Repository which is passed to the constructor of the processor class being instantiated.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IQuestionnaireProcessorFactory {
|
||||
QuestionnaireProcessor create(RequestDetails theRequestDetails);
|
||||
|
|
|
@ -22,6 +22,9 @@ package ca.uhn.fhir.cr.common;
|
|||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import org.opencds.cqf.fhir.cr.questionnaireresponse.QuestionnaireResponseProcessor;
|
||||
|
||||
/**
|
||||
* This interface takes a RequestDetails object and uses it to create a Repository which is passed to the constructor of the processor class being instantiated.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IQuestionnaireResponseProcessorFactory {
|
||||
QuestionnaireResponseProcessor create(RequestDetails theRequestDetails);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.common;
|
||||
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import org.opencds.cqf.fhir.cr.valueset.ValueSetProcessor;
|
||||
|
||||
/**
|
||||
* This interface takes a RequestDetails object and uses it to create a Repository which is passed to the constructor of the processor class being instantiated.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IValueSetProcessorFactory {
|
||||
ValueSetProcessor create(RequestDetails theRequestDetails);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.common;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.Ids;
|
||||
|
||||
public class IdHelper {
|
||||
public static IIdType getIdType(FhirVersionEnum fhirVersion, String resourceType, String theId) {
|
||||
if (StringUtils.isBlank(theId)) {
|
||||
return null;
|
||||
}
|
||||
return Ids.newId(fhirVersion, resourceType, theId.replace(resourceType + "/", ""));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,230 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.common;
|
||||
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.util.DateUtils;
|
||||
import jakarta.annotation.Nullable;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Used immediately after receiving a REST call by $evaluate-measure and any potential variants to validate and convert
|
||||
* period start and end inputs to timezones with offsets. The offset is determined from the request header a value for "Timezone".
|
||||
* <p/>
|
||||
* This class takes a fallback timezone that's used in case the request header does not contain a value for "Timezone".
|
||||
* <p/>
|
||||
* Currently, these are the date/time formats supported:
|
||||
* <ol>
|
||||
* <li>yyyy</li>
|
||||
* <li>yyyy-MM</li>
|
||||
* <li>yyyy-MM-dd</li>
|
||||
* <li>yyyy-MM-ddTHH:mm:ss</li>
|
||||
* </ol>
|
||||
* <p/>
|
||||
* Also used for various operations to serialize/deserialize dates to/from JSON classes.
|
||||
*/
|
||||
public class StringTimePeriodHandler {
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(StringTimePeriodHandler.class);
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_INPUT = DateTimeFormatter.ofPattern("yyyy");
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_INPUT = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_DD_INPUT = DateTimeFormatter.ISO_DATE;
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_YYYY_MM_DD_HH_MM_SS_INPUT =
|
||||
DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER_JSON_SERIALIZE = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
|
||||
private static final Map<Integer, DateTimeFormatter> VALID_DATE_TIME_FORMATTERS_BY_FORMAT_LENGTH = Map.of(
|
||||
4, DATE_TIME_FORMATTER_YYYY_INPUT,
|
||||
7, DATE_TIME_FORMATTER_YYYY_MM_INPUT,
|
||||
10, DATE_TIME_FORMATTER_YYYY_MM_DD_INPUT,
|
||||
19, DATE_TIME_FORMATTER_YYYY_MM_DD_HH_MM_SS_INPUT);
|
||||
|
||||
// The default, in order to signal to clinical-reasoning that none is set
|
||||
private final ZoneId myFallbackTimezone;
|
||||
|
||||
public StringTimePeriodHandler(ZoneId theFallbackTimezone) {
|
||||
myFallbackTimezone = theFallbackTimezone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meant to serialize a ZonedDateTime into a String to pass to a JSON object.
|
||||
*/
|
||||
public String serialize(ZonedDateTime theZoneDateTime) {
|
||||
return DATE_TIME_FORMATTER_JSON_SERIALIZE.format(theZoneDateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Meant to deserialize a String from a JSON object back into a ZonedDateTime.
|
||||
*/
|
||||
public ZonedDateTime deSerialize(String theInputDateString) {
|
||||
return ZonedDateTime.parse(theInputDateString, DATE_TIME_FORMATTER_JSON_SERIALIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the start period as a parsed ZoneDateTime (ex 2024 to 2024-01-01T00:00:00-07:00).
|
||||
*
|
||||
* @param theInputDateTimeString A String representation of the period start date in yyyy, yyyy-MM, YYYY-MM-dd, or yyyy-MM-ddTHH:mm:ss
|
||||
* @param theRequestDetails RequestDetails that may or may not contain a Timezone header
|
||||
* @return the parsed start date/time with zone info
|
||||
*/
|
||||
@Nullable
|
||||
public ZonedDateTime getStartZonedDateTime(
|
||||
@Nullable String theInputDateTimeString, RequestDetails theRequestDetails) {
|
||||
ourLog.debug("transforming String start date: {} to ZonedDateTime", theInputDateTimeString);
|
||||
return getStartZonedDateTime(theInputDateTimeString, getClientTimezoneOrInvalidRequest(theRequestDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the start period as a parsed ZoneDateTime (ex 2024 to 2024-01-01T00:00:00-07:00).
|
||||
*
|
||||
* @param theInputDateTimeString A String representation of the period start date in yyyy, yyyy-MM, YYYY-MM-dd, or yyyy-MM-ddTHH:mm:ss
|
||||
* @param theTimezone A ZoneId with which to convert the timestamp
|
||||
* @return the parsed start date/time with zone info
|
||||
*/
|
||||
@Nullable
|
||||
public ZonedDateTime getStartZonedDateTime(@Nullable String theInputDateTimeString, ZoneId theTimezone) {
|
||||
return getZonedDateTime(
|
||||
theInputDateTimeString,
|
||||
theTimezone,
|
||||
true,
|
||||
// start date/time
|
||||
DateUtils::extractLocalDateTimeForRangeStartOrEmpty);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the end period as a parsed ZoneDateTime (ex 2024 to 2024-12-31T23:59:59-07:00).
|
||||
*
|
||||
* @param theInputDateTimeString A String representation of the period start date in yyyy, yyyy-MM, YYYY-MM-dd, or yyyy-MM-ddTHH:mm:ss
|
||||
* @param theRequestDetails RequestDetails that may or may not contain a Timezone header
|
||||
* @return the parsed end date/time with zone info
|
||||
*/
|
||||
@Nullable
|
||||
public ZonedDateTime getEndZonedDateTime(
|
||||
@Nullable String theInputDateTimeString, RequestDetails theRequestDetails) {
|
||||
ourLog.debug("transforming String end date: {} to ZonedDateTime", theInputDateTimeString);
|
||||
return getEndZonedDateTime(theInputDateTimeString, getClientTimezoneOrInvalidRequest(theRequestDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the end period as a parsed ZoneDateTime (ex 2024 to 2024-12-31T23:59:59-07:00).
|
||||
*
|
||||
* @param theInputDateTimeString A String representation of the period start date in yyyy, yyyy-MM, YYYY-MM-dd, or yyyy-MM-ddTHH:mm:ss
|
||||
* @param theTimezone A ZoneId with which to convert the timestamp
|
||||
* @return the parsed end date/time with zone info
|
||||
*/
|
||||
@Nullable
|
||||
public ZonedDateTime getEndZonedDateTime(@Nullable String theInputDateTimeString, ZoneId theTimezone) {
|
||||
return getZonedDateTime(
|
||||
theInputDateTimeString,
|
||||
theTimezone,
|
||||
false,
|
||||
// end date/time
|
||||
DateUtils::extractLocalDateTimeForRangeEndOrEmpty);
|
||||
}
|
||||
|
||||
private ZonedDateTime getZonedDateTime(
|
||||
String theInputDateTimeString,
|
||||
ZoneId theTimezone,
|
||||
boolean theIsStart,
|
||||
Function<TemporalAccessor, Optional<LocalDateTime>> theStartOrEndExtractFunction) {
|
||||
|
||||
// We may pass null periods to clinical-reasoning
|
||||
if (theInputDateTimeString == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final DateTimeFormatter dateTimeFormat = validateAndGetDateTimeFormat(theInputDateTimeString);
|
||||
|
||||
final LocalDateTime localDateTime = validateAndGetLocalDateTime(
|
||||
theInputDateTimeString, dateTimeFormat, theStartOrEndExtractFunction, theIsStart);
|
||||
|
||||
final ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, theTimezone);
|
||||
|
||||
ourLog.debug(
|
||||
"successfully transformed String date: {} to ZonedDateTime: {}", theInputDateTimeString, zonedDateTime);
|
||||
|
||||
return zonedDateTime;
|
||||
}
|
||||
|
||||
private LocalDateTime validateAndGetLocalDateTime(
|
||||
String thePeriod,
|
||||
DateTimeFormatter theDateTimeFormatter,
|
||||
Function<TemporalAccessor, Optional<LocalDateTime>> theTemporalAccessorToLocalDateTimeConverter,
|
||||
boolean isStart) {
|
||||
return DateUtils.parseDateTimeStringIfValid(thePeriod, theDateTimeFormatter)
|
||||
.flatMap(theTemporalAccessorToLocalDateTimeConverter)
|
||||
.orElseThrow(() -> {
|
||||
ourLog.warn(
|
||||
"{}Period {}: {} has an unsupported format",
|
||||
Msg.code(2558),
|
||||
isStart ? "start" : "end",
|
||||
thePeriod);
|
||||
|
||||
return new InvalidRequestException(String.format(
|
||||
"%sPeriod %s: %s has an unsupported format",
|
||||
Msg.code(2558), isStart ? "start" : "end", thePeriod));
|
||||
});
|
||||
}
|
||||
|
||||
private DateTimeFormatter validateAndGetDateTimeFormat(String theInputDateTimeString) {
|
||||
final DateTimeFormatter dateTimeFormatter =
|
||||
VALID_DATE_TIME_FORMATTERS_BY_FORMAT_LENGTH.get(theInputDateTimeString.length());
|
||||
|
||||
if (dateTimeFormatter == null) {
|
||||
ourLog.warn("{}Unsupported Date/Time format for input: {}", Msg.code(2559), theInputDateTimeString);
|
||||
|
||||
throw new InvalidRequestException(String.format(
|
||||
"%sUnsupported Date/Time format for input: %s", Msg.code(2559), theInputDateTimeString));
|
||||
}
|
||||
|
||||
return dateTimeFormatter;
|
||||
}
|
||||
|
||||
private ZoneId getClientTimezoneOrInvalidRequest(RequestDetails theRequestDetails) {
|
||||
final String clientTimezoneString = theRequestDetails.getHeader(Constants.HEADER_CLIENT_TIMEZONE);
|
||||
|
||||
if (Strings.isNotBlank(clientTimezoneString)) {
|
||||
try {
|
||||
return ZoneId.of(clientTimezoneString);
|
||||
} catch (Exception exception) {
|
||||
ourLog.warn("{}Invalid value for Timezone header: {}", Msg.code(2561), clientTimezoneString);
|
||||
throw new InvalidRequestException(
|
||||
String.format("%sInvalid value for Timezone header: %s", Msg.code(2561), clientTimezoneString));
|
||||
}
|
||||
}
|
||||
|
||||
return myFallbackTimezone;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.config;
|
||||
|
||||
import ca.uhn.fhir.cr.common.StringTimePeriodHandler;
|
||||
import org.opencds.cqf.fhir.cr.measure.common.MeasurePeriodValidator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.time.ZoneOffset;
|
||||
|
||||
@Configuration
|
||||
public class CrBaseConfig {
|
||||
|
||||
@Bean
|
||||
StringTimePeriodHandler stringTimePeriodHandler() {
|
||||
return new StringTimePeriodHandler(ZoneOffset.UTC);
|
||||
}
|
||||
|
||||
@Bean
|
||||
MeasurePeriodValidator measurePeriodValidator() {
|
||||
return new MeasurePeriodValidator();
|
||||
}
|
||||
}
|
|
@ -21,6 +21,12 @@ package ca.uhn.fhir.cr.config;
|
|||
|
||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
||||
import org.opencds.cqf.fhir.cql.EvaluationSettings;
|
||||
import org.opencds.cqf.fhir.cr.activitydefinition.ActivityDefinitionProcessor;
|
||||
import org.opencds.cqf.fhir.cr.library.LibraryProcessor;
|
||||
import org.opencds.cqf.fhir.cr.plandefinition.PlanDefinitionProcessor;
|
||||
import org.opencds.cqf.fhir.cr.questionnaire.QuestionnaireProcessor;
|
||||
import org.opencds.cqf.fhir.cr.questionnaireresponse.QuestionnaireResponseProcessor;
|
||||
import org.opencds.cqf.fhir.cr.valueset.ValueSetProcessor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -29,28 +35,36 @@ public class CrProcessorConfig {
|
|||
@Bean
|
||||
ca.uhn.fhir.cr.common.IActivityDefinitionProcessorFactory activityDefinitionProcessorFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new org.opencds.cqf.fhir.cr.activitydefinition.ActivityDefinitionProcessor(
|
||||
theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
return rd -> new ActivityDefinitionProcessor(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory planDefinitionProcessorFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new org.opencds.cqf.fhir.cr.plandefinition.PlanDefinitionProcessor(
|
||||
theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
return rd -> new PlanDefinitionProcessor(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory questionnaireProcessorFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new org.opencds.cqf.fhir.cr.questionnaire.QuestionnaireProcessor(
|
||||
theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
return rd -> new QuestionnaireProcessor(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.common.IQuestionnaireResponseProcessorFactory questionnaireResponseProcessorFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new org.opencds.cqf.fhir.cr.questionnaireresponse.QuestionnaireResponseProcessor(
|
||||
theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
return rd -> new QuestionnaireResponseProcessor(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.common.ILibraryProcessorFactory libraryProcessorFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new LibraryProcessor(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.common.IValueSetProcessorFactory valueSetProcessorFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new ValueSetProcessor(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package ca.uhn.fhir.cr.config.dstu3;
|
|||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
||||
import ca.uhn.fhir.cr.config.CrBaseConfig;
|
||||
import ca.uhn.fhir.cr.config.ProviderLoader;
|
||||
import ca.uhn.fhir.cr.config.ProviderSelector;
|
||||
import ca.uhn.fhir.cr.config.RepositoryConfig;
|
||||
|
@ -39,7 +40,7 @@ import java.util.Arrays;
|
|||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
@Import({RepositoryConfig.class})
|
||||
@Import({RepositoryConfig.class, CrBaseConfig.class})
|
||||
public class CrDstu3Config {
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -35,23 +35,41 @@ import java.util.Map;
|
|||
|
||||
@Configuration
|
||||
@Import(CrProcessorConfig.class)
|
||||
public class ExtractOperationConfig {
|
||||
public class DataRequirementsOperationConfig {
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.questionnaireresponse.QuestionnaireResponseExtractProvider
|
||||
dstu3QuestionnaireResponseExtractProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.questionnaireresponse.QuestionnaireResponseExtractProvider();
|
||||
ca.uhn.fhir.cr.dstu3.library.LibraryDataRequirementsProvider dstu3LibraryDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.library.LibraryDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "extractOperationLoader")
|
||||
public ProviderLoader extractOperationLoader(
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionDataRequirementsProvider
|
||||
dstu3PlanDefinitionDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnaireDataRequirementsProvider
|
||||
dstu3QuestionnaireDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnaireDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.valueset.ValueSetDataRequirementsProvider dstu3ValueSetDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.valueset.ValueSetDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "dataRequirementsOperationLoader")
|
||||
public ProviderLoader dataRequirementsOperationLoader(
|
||||
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
|
||||
var selector = new ProviderSelector(
|
||||
theFhirContext,
|
||||
Map.of(
|
||||
FhirVersionEnum.DSTU3,
|
||||
Arrays.asList(
|
||||
ca.uhn.fhir.cr.dstu3.questionnaireresponse.QuestionnaireResponseExtractProvider
|
||||
.class)));
|
||||
ca.uhn.fhir.cr.dstu3.library.LibraryDataRequirementsProvider.class,
|
||||
ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionDataRequirementsProvider.class,
|
||||
ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnaireDataRequirementsProvider.class,
|
||||
ca.uhn.fhir.cr.dstu3.valueset.ValueSetDataRequirementsProvider.class)));
|
||||
|
||||
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
|
||||
}
|
|
@ -30,23 +30,20 @@ import org.springframework.context.annotation.Bean;
|
|||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
public class QuestionnaireOperationConfig {
|
||||
public class EvaluateOperationConfig {
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.structuredefinition.StructureDefinitionQuestionnaireProvider
|
||||
dstu3StructureDefinitionQuestionnaireProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.structuredefinition.StructureDefinitionQuestionnaireProvider();
|
||||
ca.uhn.fhir.cr.dstu3.library.LibraryEvaluateProvider dstu3LibraryEvaluateProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.library.LibraryEvaluateProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "questionnaireOperationLoader")
|
||||
public ProviderLoader questionnaireOperationLoader(
|
||||
@Bean(name = "evaluateOperationLoader")
|
||||
public ProviderLoader evaluateOperationLoader(
|
||||
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
|
||||
var selector = new ProviderSelector(
|
||||
theFhirContext,
|
||||
Map.of(
|
||||
FhirVersionEnum.DSTU3,
|
||||
Arrays.asList(
|
||||
ca.uhn.fhir.cr.dstu3.structuredefinition.StructureDefinitionQuestionnaireProvider
|
||||
.class)));
|
||||
Arrays.asList(ca.uhn.fhir.cr.dstu3.library.LibraryEvaluateProvider.class)));
|
||||
|
||||
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
|
||||
}
|
|
@ -46,6 +46,16 @@ public class PackageOperationConfig {
|
|||
return new ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnairePackageProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.library.LibraryPackageProvider dstu3LibraryPackageProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.library.LibraryPackageProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.valueset.ValueSetPackageProvider dstu3ValueSetPackageProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.valueset.ValueSetPackageProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "packageOperationLoader")
|
||||
public ProviderLoader packageOperationLoader(
|
||||
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
|
||||
|
@ -54,8 +64,10 @@ public class PackageOperationConfig {
|
|||
Map.of(
|
||||
FhirVersionEnum.DSTU3,
|
||||
Arrays.asList(
|
||||
ca.uhn.fhir.cr.dstu3.library.LibraryPackageProvider.class,
|
||||
ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnairePackageProvider.class,
|
||||
ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionPackageProvider.class)));
|
||||
ca.uhn.fhir.cr.dstu3.plandefinition.PlanDefinitionPackageProvider.class,
|
||||
ca.uhn.fhir.cr.dstu3.valueset.ValueSetPackageProvider.class)));
|
||||
|
||||
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import ca.uhn.fhir.context.FhirContext;
|
|||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
||||
import ca.uhn.fhir.cr.common.RepositoryFactoryForRepositoryInterface;
|
||||
import ca.uhn.fhir.cr.common.StringTimePeriodHandler;
|
||||
import ca.uhn.fhir.cr.config.CrBaseConfig;
|
||||
import ca.uhn.fhir.cr.config.ProviderLoader;
|
||||
import ca.uhn.fhir.cr.config.ProviderSelector;
|
||||
import ca.uhn.fhir.cr.config.RepositoryConfig;
|
||||
|
@ -30,11 +32,9 @@ import ca.uhn.fhir.cr.r4.ICareGapsServiceFactory;
|
|||
import ca.uhn.fhir.cr.r4.ICollectDataServiceFactory;
|
||||
import ca.uhn.fhir.cr.r4.ICqlExecutionServiceFactory;
|
||||
import ca.uhn.fhir.cr.r4.IDataRequirementsServiceFactory;
|
||||
import ca.uhn.fhir.cr.r4.ILibraryEvaluationServiceFactory;
|
||||
import ca.uhn.fhir.cr.r4.IMeasureServiceFactory;
|
||||
import ca.uhn.fhir.cr.r4.ISubmitDataProcessorFactory;
|
||||
import ca.uhn.fhir.cr.r4.cpg.CqlExecutionOperationProvider;
|
||||
import ca.uhn.fhir.cr.r4.cpg.LibraryEvaluationOperationProvider;
|
||||
import ca.uhn.fhir.cr.r4.measure.CareGapsOperationProvider;
|
||||
import ca.uhn.fhir.cr.r4.measure.CollectDataOperationProvider;
|
||||
import ca.uhn.fhir.cr.r4.measure.DataRequirementsOperationProvider;
|
||||
|
@ -43,15 +43,14 @@ import ca.uhn.fhir.cr.r4.measure.SubmitDataProvider;
|
|||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import org.opencds.cqf.fhir.cql.EvaluationSettings;
|
||||
import org.opencds.cqf.fhir.cr.cpg.r4.R4CqlExecutionService;
|
||||
import org.opencds.cqf.fhir.cr.cpg.r4.R4LibraryEvaluationService;
|
||||
import org.opencds.cqf.fhir.cr.measure.CareGapsProperties;
|
||||
import org.opencds.cqf.fhir.cr.measure.MeasureEvaluationOptions;
|
||||
import org.opencds.cqf.fhir.cr.measure.common.MeasurePeriodValidator;
|
||||
import org.opencds.cqf.fhir.cr.measure.r4.R4CareGapsService;
|
||||
import org.opencds.cqf.fhir.cr.measure.r4.R4CollectDataService;
|
||||
import org.opencds.cqf.fhir.cr.measure.r4.R4DataRequirementsService;
|
||||
import org.opencds.cqf.fhir.cr.measure.r4.R4MeasureService;
|
||||
import org.opencds.cqf.fhir.cr.measure.r4.R4SubmitDataService;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -59,17 +58,18 @@ import org.springframework.context.annotation.Import;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Configuration
|
||||
@Import({RepositoryConfig.class})
|
||||
@Import({RepositoryConfig.class, CrBaseConfig.class})
|
||||
public class CrR4Config {
|
||||
|
||||
@Bean
|
||||
IMeasureServiceFactory r4MeasureServiceFactory(
|
||||
RepositoryFactoryForRepositoryInterface theRepositoryFactory,
|
||||
MeasureEvaluationOptions theEvaluationOptions) {
|
||||
return rd -> new R4MeasureService(theRepositoryFactory.create(rd), theEvaluationOptions);
|
||||
MeasureEvaluationOptions theEvaluationOptions,
|
||||
MeasurePeriodValidator theMeasurePeriodValidator) {
|
||||
return rd ->
|
||||
new R4MeasureService(theRepositoryFactory.create(rd), theEvaluationOptions, theMeasurePeriodValidator);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@ -83,20 +83,16 @@ public class CrR4Config {
|
|||
return rd -> new R4CqlExecutionService(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ILibraryEvaluationServiceFactory r4LibraryEvaluationServiceFactory(
|
||||
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
|
||||
return rd -> new R4LibraryEvaluationService(theRepositoryFactory.create(rd), theEvaluationSettings);
|
||||
}
|
||||
|
||||
@Bean
|
||||
CqlExecutionOperationProvider r4CqlExecutionOperationProvider() {
|
||||
return new CqlExecutionOperationProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
CollectDataOperationProvider r4CollectDataOperationProvider() {
|
||||
return new CollectDataOperationProvider();
|
||||
CollectDataOperationProvider r4CollectDataOperationProvider(
|
||||
ICollectDataServiceFactory theR4CollectDataServiceFactory,
|
||||
StringTimePeriodHandler theStringTimePeriodHandler) {
|
||||
return new CollectDataOperationProvider(theR4CollectDataServiceFactory, theStringTimePeriodHandler);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@ -116,27 +112,24 @@ public class CrR4Config {
|
|||
return rd -> new R4DataRequirementsService(theRepositoryFactory.create(rd), theMeasureEvaluationOptions);
|
||||
}
|
||||
|
||||
@Bean
|
||||
LibraryEvaluationOperationProvider r4LibraryEvaluationOperationProvider() {
|
||||
return new LibraryEvaluationOperationProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ICareGapsServiceFactory careGapsServiceFactory(
|
||||
IRepositoryFactory theRepositoryFactory,
|
||||
CareGapsProperties theCareGapsProperties,
|
||||
MeasureEvaluationOptions theMeasureEvaluationOptions,
|
||||
@Qualifier("cqlExecutor") Executor theExecutor) {
|
||||
MeasurePeriodValidator theMeasurePeriodValidator) {
|
||||
return rd -> new R4CareGapsService(
|
||||
theCareGapsProperties,
|
||||
theRepositoryFactory.create(rd),
|
||||
theMeasureEvaluationOptions,
|
||||
rd.getFhirServerBase());
|
||||
rd.getFhirServerBase(),
|
||||
theMeasurePeriodValidator);
|
||||
}
|
||||
|
||||
@Bean
|
||||
CareGapsOperationProvider r4CareGapsOperationProvider() {
|
||||
return new CareGapsOperationProvider();
|
||||
CareGapsOperationProvider r4CareGapsOperationProvider(
|
||||
ICareGapsServiceFactory theR4CareGapsProcessorFactory, StringTimePeriodHandler theStringTimePeriodHandler) {
|
||||
return new CareGapsOperationProvider(theR4CareGapsProcessorFactory, theStringTimePeriodHandler);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@ -145,8 +138,9 @@ public class CrR4Config {
|
|||
}
|
||||
|
||||
@Bean
|
||||
MeasureOperationsProvider r4MeasureOperationsProvider() {
|
||||
return new MeasureOperationsProvider();
|
||||
MeasureOperationsProvider r4MeasureOperationsProvider(
|
||||
IMeasureServiceFactory theR4MeasureServiceFactory, StringTimePeriodHandler theStringTimePeriodHandler) {
|
||||
return new MeasureOperationsProvider(theR4MeasureServiceFactory, theStringTimePeriodHandler);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@ -162,7 +156,6 @@ public class CrR4Config {
|
|||
SubmitDataProvider.class,
|
||||
CareGapsOperationProvider.class,
|
||||
CqlExecutionOperationProvider.class,
|
||||
LibraryEvaluationOperationProvider.class,
|
||||
CollectDataOperationProvider.class,
|
||||
DataRequirementsOperationProvider.class)));
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.config.r4;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.config.CrProcessorConfig;
|
||||
import ca.uhn.fhir.cr.config.ProviderLoader;
|
||||
import ca.uhn.fhir.cr.config.ProviderSelector;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
@Import(CrProcessorConfig.class)
|
||||
public class DataRequirementsOperationConfig {
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.r4.library.LibraryDataRequirementsProvider r4LibraryDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.library.LibraryDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionDataRequirementsProvider r4PlanDefinitionDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireDataRequirementsProvider r4QuestionnaireDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.r4.valueset.ValueSetDataRequirementsProvider r4ValueSetDataRequirementsProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.valueset.ValueSetDataRequirementsProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "dataRequirementsOperationLoader")
|
||||
public ProviderLoader dataRequirementsOperationLoader(
|
||||
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
|
||||
var selector = new ProviderSelector(
|
||||
theFhirContext,
|
||||
Map.of(
|
||||
FhirVersionEnum.R4,
|
||||
Arrays.asList(
|
||||
ca.uhn.fhir.cr.r4.library.LibraryDataRequirementsProvider.class,
|
||||
ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionDataRequirementsProvider.class,
|
||||
ca.uhn.fhir.cr.r4.questionnaire.QuestionnaireDataRequirementsProvider.class,
|
||||
ca.uhn.fhir.cr.r4.valueset.ValueSetDataRequirementsProvider.class)));
|
||||
|
||||
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
|
||||
}
|
||||
}
|
|
@ -17,38 +17,31 @@
|
|||
* limitations under the License.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.config.dstu3;
|
||||
package ca.uhn.fhir.cr.config.r4;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.config.CrProcessorConfig;
|
||||
import ca.uhn.fhir.cr.config.ProviderLoader;
|
||||
import ca.uhn.fhir.cr.config.ProviderSelector;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
@Import(CrProcessorConfig.class)
|
||||
public class PopulateOperationConfig {
|
||||
public class EvaluateOperationConfig {
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnairePopulateProvider dstu3QuestionnairePopulateProvider() {
|
||||
return new ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnairePopulateProvider();
|
||||
ca.uhn.fhir.cr.r4.library.LibraryEvaluateProvider r4LibraryEvaluateProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.library.LibraryEvaluateProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "populateOperationLoader")
|
||||
public ProviderLoader populateOperationLoader(
|
||||
@Bean(name = "evaluateOperationLoader")
|
||||
public ProviderLoader evaluateOperationLoader(
|
||||
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
|
||||
var selector = new ProviderSelector(
|
||||
theFhirContext,
|
||||
Map.of(
|
||||
FhirVersionEnum.DSTU3,
|
||||
Arrays.asList(ca.uhn.fhir.cr.dstu3.questionnaire.QuestionnairePopulateProvider.class)));
|
||||
Map.of(FhirVersionEnum.R4, Arrays.asList(ca.uhn.fhir.cr.r4.library.LibraryEvaluateProvider.class)));
|
||||
|
||||
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
|
||||
}
|
|
@ -46,6 +46,16 @@ public class PackageOperationConfig {
|
|||
return new ca.uhn.fhir.cr.r4.questionnaire.QuestionnairePackageProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.r4.library.LibraryPackageProvider r4LibraryPackageProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.library.LibraryPackageProvider();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ca.uhn.fhir.cr.r4.valueset.ValueSetPackageProvider r4ValueSetPackageProvider() {
|
||||
return new ca.uhn.fhir.cr.r4.valueset.ValueSetPackageProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "packageOperationLoader")
|
||||
public ProviderLoader packageOperationLoader(
|
||||
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
|
||||
|
@ -54,8 +64,10 @@ public class PackageOperationConfig {
|
|||
Map.of(
|
||||
FhirVersionEnum.R4,
|
||||
Arrays.asList(
|
||||
ca.uhn.fhir.cr.r4.library.LibraryPackageProvider.class,
|
||||
ca.uhn.fhir.cr.r4.questionnaire.QuestionnairePackageProvider.class,
|
||||
ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionPackageProvider.class)));
|
||||
ca.uhn.fhir.cr.r4.plandefinition.PlanDefinitionPackageProvider.class,
|
||||
ca.uhn.fhir.cr.r4.valueset.ValueSetPackageProvider.class)));
|
||||
|
||||
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class TestCqlProperties {
|
|||
private Boolean cql_runtime_enable_expression_caching = true;
|
||||
private Boolean cql_compiler_validate_units = true;
|
||||
private Boolean cql_compiler_verify_only = false;
|
||||
private String cql_compiler_compatibility_level = "1.3";
|
||||
private String cql_compiler_compatibility_level = "1.5";
|
||||
private CqlCompilerException.ErrorSeverity cql_compiler_error_level = CqlCompilerException.ErrorSeverity.Info;
|
||||
private LibraryBuilder.SignatureLevel cql_compiler_signature_level = LibraryBuilder.SignatureLevel.All;
|
||||
private Boolean cql_compiler_analyze_data_requirements = false;
|
||||
|
|
|
@ -69,8 +69,8 @@ public class TestCrR4Config {
|
|||
@Bean
|
||||
CareGapsProperties careGapsProperties() {
|
||||
var careGapsProperties = new CareGapsProperties();
|
||||
careGapsProperties.setCareGapsReporter("Organization/alphora");
|
||||
careGapsProperties.setCareGapsCompositionSectionAuthor("Organization/alphora-author");
|
||||
careGapsProperties.setCareGapsReporter("alphora");
|
||||
careGapsProperties.setCareGapsCompositionSectionAuthor("alphora-author");
|
||||
return careGapsProperties;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.library;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.ILibraryProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Library;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class LibraryDataRequirementsProvider {
|
||||
@Autowired
|
||||
ILibraryProcessorFactory myLibraryProcessorFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = Library.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, theId, null), null);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = Library.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IIdType id = getIdType(FhirVersionEnum.DSTU3, "Library", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, id, null), null);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,175 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.library;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.ILibraryProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Endpoint;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Library;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
public class LibraryEvaluateProvider {
|
||||
@Autowired
|
||||
ILibraryProcessorFactory myLibraryProcessorFactory;
|
||||
|
||||
/**
|
||||
* Evaluates a CQL library and returns the results as a Parameters resource.
|
||||
*
|
||||
* @param theId the library resource's Id
|
||||
* @param theSubject Subject for which the library will be evaluated.
|
||||
* This corresponds to the context in which the
|
||||
* library
|
||||
* will be evaluated and is represented as a relative
|
||||
* FHIR id (e.g. Patient/123), which establishes both
|
||||
* the context and context value for the evaluation
|
||||
* @param theExpression Expression(s) to be evaluated. If no expression
|
||||
* names
|
||||
* are provided, the operation evaluates all public
|
||||
* expression definitions in the library
|
||||
* @param theParameters Any input parameters for the expression.
|
||||
* {@link Parameters} Parameters defined in this
|
||||
* input will be made available by name to the CQL
|
||||
* expression. Parameter types are mapped to CQL as
|
||||
* specified in the Using CQL section of the CPG
|
||||
* Implementation guide. If a parameter appears more
|
||||
* than once in the input Parameters resource, it is
|
||||
* represented with a List in the input CQL. If a
|
||||
* parameter has parts, it is represented as a Tuple
|
||||
* in the input CQL
|
||||
* @param theUseServerData Whether to use data from the server performing the
|
||||
* evaluation. If this parameter is true (the default),
|
||||
* then the operation will use data first from any
|
||||
* bundles provided as parameters (through the data
|
||||
* and prefetch parameters), second data from the
|
||||
* server performing the operation, and third, data
|
||||
* from the dataEndpoint parameter (if provided).
|
||||
* If this parameter is false, the operation will use
|
||||
* data first from the bundles provided in the data or
|
||||
* prefetch parameters, and second from the dataEndpoint
|
||||
* parameter (if provided).
|
||||
* @param theData Data to be made available to the library
|
||||
* evaluation. This parameter is exclusive with the
|
||||
* prefetchData parameter (i.e. either provide all
|
||||
* data as a single bundle, or provide data using
|
||||
* multiple bundles with prefetch descriptions)
|
||||
* @param thePrefetchData ***Not Yet Implemented***
|
||||
* @param theDataEndpoint An {@link Endpoint} endpoint to use to access data
|
||||
* referenced by retrieve operations in the library.
|
||||
* If provided, this endpoint is used after the data
|
||||
* or prefetchData bundles, and the server, if the
|
||||
* useServerData parameter is true.
|
||||
* @param theContentEndpoint An {@link Endpoint} endpoint to use to access
|
||||
* content (i.e. libraries) referenced by the
|
||||
* library. If no content endpoint is supplied, the
|
||||
* evaluation will attempt to retrieve content from
|
||||
* the server on which the operation is being
|
||||
* performed
|
||||
* @param theTerminologyEndpoint An {@link Endpoint} endpoint to use to access
|
||||
* terminology (i.e. valuesets, codesystems, and
|
||||
* membership testing) referenced by the library. If
|
||||
* no terminology endpoint is supplied, the
|
||||
* evaluation will attempt to use the server on which
|
||||
* the operation is being performed as the
|
||||
* terminology server
|
||||
* @param theRequestDetails the {@link RequestDetails RequestDetails}
|
||||
* @return The results of the library evaluation, returned as a
|
||||
* {@link Parameters} resource
|
||||
* with a parameter for each named expression defined in the library.
|
||||
* The value of
|
||||
* each expression is returned as a FHIR type, either a resource, or a
|
||||
* FHIR-defined
|
||||
* type corresponding to the CQL return type, as defined in the Using
|
||||
* CQL section of
|
||||
* this implementation guide. If the result of an expression is a list
|
||||
* of resources,
|
||||
* that parameter will be repeated for each element in the result
|
||||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_EVALUATE, idempotent = true, type = Library.class)
|
||||
public Parameters evaluate(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "expression") List<String> theExpression,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters.ParametersParameterComponent> thePrefetchData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails) {
|
||||
return (Parameters) myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.evaluate(
|
||||
Eithers.forMiddle3(theId),
|
||||
theSubject,
|
||||
theExpression,
|
||||
theParameters,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theData,
|
||||
thePrefetchData,
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_EVALUATE, idempotent = true, type = Library.class)
|
||||
public Parameters evaluate(
|
||||
@OperationParam(name = "library") String theLibrary,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "expression") List<String> theExpression,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters.ParametersParameterComponent> thePrefetchData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails) {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theLibrary, null, null);
|
||||
return (Parameters) myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.evaluate(
|
||||
Eithers.forLeft3(canonicalType),
|
||||
theSubject,
|
||||
theExpression,
|
||||
theParameters,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theData,
|
||||
thePrefetchData,
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.library;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.ILibraryProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Library;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class LibraryPackageProvider {
|
||||
@Autowired
|
||||
ILibraryProcessorFactory myLibraryProcessorFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Library.class)
|
||||
public IBaseBundle packagePlanDefinition(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageLibrary(
|
||||
Eithers.for3(canonicalType, theId, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Library.class)
|
||||
public IBaseBundle packagePlanDefinition(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IIdType id = getIdType(FhirVersionEnum.DSTU3, "Library", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageLibrary(
|
||||
Eithers.for3(canonicalType, id, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
}
|
|
@ -42,6 +42,8 @@ import org.opencds.cqf.fhir.utility.monad.Eithers;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
@Component
|
||||
|
@ -104,6 +106,7 @@ public class PlanDefinitionApplyProvider {
|
|||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters.ParametersParameterComponent> thePrefetchData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
|
@ -126,7 +129,7 @@ public class PlanDefinitionApplyProvider {
|
|||
theParameters,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theData,
|
||||
null,
|
||||
thePrefetchData,
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
|
@ -150,6 +153,7 @@ public class PlanDefinitionApplyProvider {
|
|||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters.ParametersParameterComponent> thePrefetchData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
|
@ -172,7 +176,7 @@ public class PlanDefinitionApplyProvider {
|
|||
theParameters,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theData,
|
||||
null,
|
||||
thePrefetchData,
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.plandefinition;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.PlanDefinition;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class PlanDefinitionDataRequirementsProvider {
|
||||
@Autowired
|
||||
IPlanDefinitionProcessorFactory myPlanDefinitionProcessorFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = PlanDefinition.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myPlanDefinitionProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, theId, null), null);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = PlanDefinition.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IIdType id = getIdType(FhirVersionEnum.DSTU3, "PlanDefinition", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myPlanDefinitionProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, id, null), null);
|
||||
}
|
||||
}
|
|
@ -33,10 +33,12 @@ import org.hl7.fhir.dstu3.model.PlanDefinition;
|
|||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class PlanDefinitionPackageProvider {
|
||||
@Autowired
|
||||
|
@ -68,7 +70,7 @@ public class PlanDefinitionPackageProvider {
|
|||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IdType id = theId == null ? null : new IdType("PlanDefinition", theId);
|
||||
IIdType id = getIdType(FhirVersionEnum.DSTU3, "PlanDefinition", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myPlanDefinitionProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.questionnaire;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class QuestionnaireDataRequirementsProvider {
|
||||
@Autowired
|
||||
IQuestionnaireProcessorFactory myQuestionnaireFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = Questionnaire.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myQuestionnaireFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, theId, null), null);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = Questionnaire.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IIdType id = getIdType(FhirVersionEnum.DSTU3, "Questionnaire", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myQuestionnaireFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, id, null), null);
|
||||
}
|
||||
}
|
|
@ -26,14 +26,13 @@ import ca.uhn.fhir.rest.annotation.Operation;
|
|||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.*;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class QuestionnairePackageProvider {
|
||||
@Autowired
|
||||
|
@ -44,10 +43,10 @@ public class QuestionnairePackageProvider {
|
|||
* "https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html">CRMI IG</a>.
|
||||
*
|
||||
* @param theId The id of the Questionnaire.
|
||||
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
|
||||
* @param theCanonical The canonical identifier for the Questionnaire (optionally version-specific).
|
||||
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
|
||||
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
|
||||
* @Param theIsPut A boolean value to determine if the Bundle returned uses PUT or POST request methods. Defaults to false.
|
||||
* @Param theIsPut A boolean value to determine if the Bundle returned uses PUT or POST request methods. Defaults to false.
|
||||
* @param theRequestDetails The details (such as tenant) of this request. Usually
|
||||
* autopopulated by HAPI.
|
||||
* @return A Bundle containing the Questionnaire and all related Library, CodeSystem and ValueSet resources
|
||||
|
@ -58,24 +57,30 @@ public class QuestionnairePackageProvider {
|
|||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") String theIsPut,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails) {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (Bundle) myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageQuestionnaire(Eithers.for3(canonicalType, theId, null), Boolean.parseBoolean(theIsPut));
|
||||
.packageQuestionnaire(
|
||||
Eithers.for3(canonicalType, theId, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Questionnaire.class)
|
||||
public Bundle packageQuestionnaire(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") String theIsPut,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails) {
|
||||
IIdType id = getIdType(FhirVersionEnum.DSTU3, "Questionnaire", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (Bundle) myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageQuestionnaire(Eithers.for3(canonicalType, null, null), Boolean.parseBoolean(theIsPut));
|
||||
.packageQuestionnaire(
|
||||
Eithers.for3(canonicalType, id, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,216 +0,0 @@
|
|||
package ca.uhn.fhir.cr.dstu3.questionnaire;
|
||||
|
||||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Endpoint;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
public class QuestionnairePopulateProvider {
|
||||
@Autowired
|
||||
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
|
||||
|
||||
/**
|
||||
* Implements a modified version of the <a href=
|
||||
* "http://build.fhir.org/ig/HL7/sdc/OperationDefinition-Questionnaire-populate.html">$populate</a>
|
||||
* operation found in the
|
||||
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
|
||||
* This implementation will return a Questionnaire resource with the initialValues set rather
|
||||
* than a QuestionnaireResponse with the answers filled out.
|
||||
*
|
||||
* @param theId The id of the Questionnaire to populate.
|
||||
* @param theQuestionnaire The Questionnaire to populate. Used when the operation is invoked at the 'type' level.
|
||||
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
|
||||
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
|
||||
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
|
||||
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
|
||||
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
|
||||
* @param theData Data to be made available during CQL evaluation.
|
||||
* @param theUseServerData Whether to use data from the server performing the evaluation.
|
||||
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
|
||||
* referenced by the Questionnaire.
|
||||
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire.
|
||||
* @param theTerminologyEndpoint An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing)
|
||||
* referenced by the Questionnaire.
|
||||
* @param theRequestDetails The details (such as tenant) of this request. Usually
|
||||
* autopopulated HAPI.
|
||||
* @return The partially (or fully)-populated set of answers for the specified Questionnaire.
|
||||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PREPOPULATE, idempotent = true, type = Questionnaire.class)
|
||||
public Questionnaire prepopulate(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.prePopulate(
|
||||
Eithers.for3(canonicalType, theId, theQuestionnaire),
|
||||
theSubject,
|
||||
theParameters,
|
||||
theData,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PREPOPULATE, idempotent = true, type = Questionnaire.class)
|
||||
public Questionnaire prepopulate(
|
||||
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.prePopulate(
|
||||
Eithers.for3(canonicalType, null, theQuestionnaire),
|
||||
theSubject,
|
||||
theParameters,
|
||||
theData,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <a href=
|
||||
* "http://build.fhir.org/ig/HL7/sdc/OperationDefinition-Questionnaire-populate.html">$populate</a>
|
||||
* operation found in the
|
||||
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
|
||||
*
|
||||
* @param theId The id of the Questionnaire to populate.
|
||||
* @param theQuestionnaire The Questionnaire to populate. Used when the operation is invoked at the 'type' level.
|
||||
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
|
||||
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
|
||||
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
|
||||
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
|
||||
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
|
||||
* @param theData Data to be made available during CQL evaluation.
|
||||
* @param theUseServerData Whether to use data from the server performing the evaluation.
|
||||
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
|
||||
* referenced by the Questionnaire.
|
||||
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire.
|
||||
* @param theTerminologyEndpoint An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing)
|
||||
* referenced by the Questionnaire.
|
||||
* @param theRequestDetails The details (such as tenant) of this request. Usually
|
||||
* autopopulated HAPI.
|
||||
* @return The partially (or fully)-populated set of answers for the specified Questionnaire.
|
||||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_POPULATE, idempotent = true, type = Questionnaire.class)
|
||||
public QuestionnaireResponse populate(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (QuestionnaireResponse) myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.populate(
|
||||
Eithers.for3(canonicalType, theId, theQuestionnaire),
|
||||
theSubject,
|
||||
theParameters,
|
||||
theData,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_POPULATE, idempotent = true, type = Questionnaire.class)
|
||||
public QuestionnaireResponse populate(
|
||||
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (QuestionnaireResponse) myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.populate(
|
||||
Eithers.for3(canonicalType, null, theQuestionnaire),
|
||||
theSubject,
|
||||
theParameters,
|
||||
theData,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
package ca.uhn.fhir.cr.dstu3.questionnaireresponse;
|
||||
|
||||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
import ca.uhn.fhir.cr.common.IQuestionnaireResponseProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class QuestionnaireResponseExtractProvider {
|
||||
@Autowired
|
||||
IQuestionnaireResponseProcessorFactory myQuestionnaireResponseProcessorFactory;
|
||||
|
||||
/**
|
||||
* Implements the <a href="http://build.fhir.org/ig/HL7/sdc/OperationDefinition-QuestionnaireResponse-extract.html>$extract</a>
|
||||
* operation found in the
|
||||
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
|
||||
*
|
||||
* @param theId The id of the QuestionnaireResponse to extract data from.
|
||||
* @param theQuestionnaireResponse The QuestionnaireResponse to extract data from. Used when the operation is invoked at the 'type' level.
|
||||
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
|
||||
* @param theData Data to be made available during CQL evaluation.
|
||||
* @param theRequestDetails The details (such as tenant) of this request. Usually
|
||||
* autopopulated HAPI.
|
||||
* @return The resulting FHIR resource produced after extracting data. This will either be a single resource or a Transaction Bundle that contains multiple resources.
|
||||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_EXTRACT, idempotent = true, type = QuestionnaireResponse.class)
|
||||
public IBaseBundle extract(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "questionnaire-response") QuestionnaireResponse theQuestionnaireResponse,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
return myQuestionnaireResponseProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.extract(Eithers.for2(theId, theQuestionnaireResponse), theParameters, theData);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_EXTRACT, idempotent = true, type = QuestionnaireResponse.class)
|
||||
public IBaseBundle extract(
|
||||
@OperationParam(name = "questionnaire-response") QuestionnaireResponse theQuestionnaireResponse,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
return myQuestionnaireResponseProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.extract(Eithers.for2(null, theQuestionnaireResponse), theParameters, theData);
|
||||
}
|
||||
}
|
|
@ -1,138 +0,0 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.structuredefinition;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.Endpoint;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.Parameters;
|
||||
import org.hl7.fhir.dstu3.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.StructureDefinition;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
public class StructureDefinitionQuestionnaireProvider {
|
||||
@Autowired
|
||||
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
|
||||
|
||||
/**
|
||||
* Implements the <a href=
|
||||
* "http://build.fhir.org/ig/HL7/sdc/OperationDefinition-Questionnaire-populate.html">$populate</a>
|
||||
* operation found in the
|
||||
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
|
||||
*
|
||||
* @param theId The id of the StructureDefinition.
|
||||
* @param theProfile The StructureDefinition to base the Questionnaire on. Used when the operation is invoked at the 'type' level.
|
||||
* @param theCanonical The canonical identifier for the StructureDefinition (optionally version-specific).
|
||||
* @param theUrl Canonical URL of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters.
|
||||
* @param theVersion Version of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters.
|
||||
* @param theSupportedOnly If true (default: false), the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition.
|
||||
* @param theRequiredOnly If true (default: false), the questionnaire will only include those elements marked as "min>0" in the StructureDefinition.
|
||||
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
|
||||
* @param theParameters Any input parameters defined in libraries referenced by the StructureDefinition.
|
||||
* @param theUseServerData Whether to use data from the server performing the evaluation.
|
||||
* @param theData Data to be made available during CQL evaluation.
|
||||
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
|
||||
* referenced by the StructureDefinition.
|
||||
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the StructureDefinition.
|
||||
* @param theTerminologyEndpoint An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing)
|
||||
* referenced by the StructureDefinition.
|
||||
* @param theRequestDetails The details (such as tenant) of this request. Usually
|
||||
* autopopulated HAPI.
|
||||
* @return The questionnaire form generated based on the StructureDefinition.
|
||||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_QUESTIONNAIRE, idempotent = true, type = StructureDefinition.class)
|
||||
public Questionnaire questionnaire(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "profile") StructureDefinition theProfile,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "supportedOnly") BooleanType theSupportedOnly,
|
||||
@OperationParam(name = "requiredOnly") BooleanType theRequiredOnly,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails) {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (Questionnaire) myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.generateQuestionnaire(
|
||||
Eithers.for3(canonicalType, theId, theProfile),
|
||||
theSupportedOnly == null ? Boolean.TRUE : theSupportedOnly.booleanValue(),
|
||||
theRequiredOnly == null ? Boolean.TRUE : theRequiredOnly.booleanValue(),
|
||||
theSubject,
|
||||
theParameters,
|
||||
theData,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint,
|
||||
null);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_QUESTIONNAIRE, idempotent = true, type = StructureDefinition.class)
|
||||
public Questionnaire questionnaire(
|
||||
@OperationParam(name = "profile") StructureDefinition theProfile,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "supportedOnly") BooleanType theSupportedOnly,
|
||||
@OperationParam(name = "requiredOnly") BooleanType theRequiredOnly,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails) {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (Questionnaire) myQuestionnaireProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.generateQuestionnaire(
|
||||
Eithers.for3(canonicalType, null, theProfile),
|
||||
theSupportedOnly == null ? Boolean.TRUE : theSupportedOnly.booleanValue(),
|
||||
theRequiredOnly == null ? Boolean.TRUE : theRequiredOnly.booleanValue(),
|
||||
theSubject,
|
||||
theParameters,
|
||||
theData,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint,
|
||||
null);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.valueset;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IValueSetProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
public class ValueSetDataRequirementsProvider {
|
||||
@Autowired
|
||||
IValueSetProcessorFactory myValueSetFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = ValueSet.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myValueSetFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, theId, null), null);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = ValueSet.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IdType id = theId == null ? null : new IdType("ValueSet", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return myValueSetFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, id, null), null);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.dstu3.valueset;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.IValueSetProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.dstu3.model.BooleanType;
|
||||
import org.hl7.fhir.dstu3.model.Bundle;
|
||||
import org.hl7.fhir.dstu3.model.IdType;
|
||||
import org.hl7.fhir.dstu3.model.StringType;
|
||||
import org.hl7.fhir.dstu3.model.ValueSet;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
public class ValueSetPackageProvider {
|
||||
@Autowired
|
||||
IValueSetProcessorFactory myValueSetProcessorFactory;
|
||||
|
||||
/**
|
||||
* Implements a $package operation following the <a href=
|
||||
* "https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html">CRMI IG</a>.
|
||||
*
|
||||
* @param theId The id of the ValueSet.
|
||||
* @param theCanonical The canonical identifier for the ValueSet (optionally version-specific).
|
||||
* @param theUrl Canonical URL of the ValueSet when invoked at the resource type level. This is exclusive with the ValueSet and canonical parameters.
|
||||
* @param theVersion Version of the ValueSet when invoked at the resource type level. This is exclusive with the ValueSet and canonical parameters.
|
||||
* @Param theIsPut A boolean value to determine if the Bundle returned uses PUT or POST request methods. Defaults to false.
|
||||
* @param theRequestDetails The details (such as tenant) of this request. Usually
|
||||
* autopopulated by HAPI.
|
||||
* @return A Bundle containing the ValueSet and all related CodeSystem and ValueSet resources
|
||||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = ValueSet.class)
|
||||
public Bundle packageValueSet(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails) {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (Bundle) myValueSetProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageValueSet(
|
||||
Eithers.for3(canonicalType, theId, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = ValueSet.class)
|
||||
public Bundle packageValueSet(
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails) {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
|
||||
return (Bundle) myValueSetProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageValueSet(
|
||||
Eithers.for3(canonicalType, null, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.r4.library;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.ILibraryProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.r4.model.IdType;
|
||||
import org.hl7.fhir.r4.model.Library;
|
||||
import org.hl7.fhir.r4.model.StringType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class LibraryDataRequirementsProvider {
|
||||
@Autowired
|
||||
ILibraryProcessorFactory myLibraryProcessorFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = Library.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, theId, null), null);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_DATAREQUIREMENTS, idempotent = true, type = Library.class)
|
||||
public IBaseResource getDataRequirements(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IIdType id = getIdType(FhirVersionEnum.R4, "Library", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.dataRequirements(Eithers.for3(canonicalType, id, null), null);
|
||||
}
|
||||
}
|
|
@ -17,30 +17,36 @@
|
|||
* limitations under the License.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.r4.cpg;
|
||||
package ca.uhn.fhir.cr.r4.library;
|
||||
|
||||
import ca.uhn.fhir.cr.r4.ILibraryEvaluationServiceFactory;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.ILibraryProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.r4.model.BooleanType;
|
||||
import org.hl7.fhir.r4.model.Bundle;
|
||||
import org.hl7.fhir.r4.model.CanonicalType;
|
||||
import org.hl7.fhir.r4.model.Endpoint;
|
||||
import org.hl7.fhir.r4.model.IdType;
|
||||
import org.hl7.fhir.r4.model.Library;
|
||||
import org.hl7.fhir.r4.model.Parameters;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LibraryEvaluationOperationProvider {
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
|
||||
public class LibraryEvaluateProvider {
|
||||
@Autowired
|
||||
ILibraryEvaluationServiceFactory myLibraryEvaluationServiceFactory;
|
||||
ILibraryProcessorFactory myLibraryProcessorFactory;
|
||||
|
||||
/**
|
||||
* Evaluates a CQL library and returns the results as a Parameters resource.
|
||||
*
|
||||
* @param theRequestDetails the {@link RequestDetails RequestDetails}
|
||||
* @param theId the library resource's Id
|
||||
* @param theSubject Subject for which the library will be evaluated.
|
||||
* This corresponds to the context in which the
|
||||
|
@ -62,6 +68,17 @@ public class LibraryEvaluationOperationProvider {
|
|||
* represented with a List in the input CQL. If a
|
||||
* parameter has parts, it is represented as a Tuple
|
||||
* in the input CQL
|
||||
* @param theUseServerData Whether to use data from the server performing the
|
||||
* evaluation. If this parameter is true (the default),
|
||||
* then the operation will use data first from any
|
||||
* bundles provided as parameters (through the data
|
||||
* and prefetch parameters), second data from the
|
||||
* server performing the operation, and third, data
|
||||
* from the dataEndpoint parameter (if provided).
|
||||
* If this parameter is false, the operation will use
|
||||
* data first from the bundles provided in the data or
|
||||
* prefetch parameters, and second from the dataEndpoint
|
||||
* parameter (if provided).
|
||||
* @param theData Data to be made available to the library
|
||||
* evaluation. This parameter is exclusive with the
|
||||
* prefetchData parameter (i.e. either provide all
|
||||
|
@ -86,6 +103,7 @@ public class LibraryEvaluationOperationProvider {
|
|||
* evaluation will attempt to use the server on which
|
||||
* the operation is being performed as the
|
||||
* terminology server
|
||||
* @param theRequestDetails the {@link RequestDetails RequestDetails}
|
||||
* @return The results of the library evaluation, returned as a
|
||||
* {@link Parameters} resource
|
||||
* with a parameter for each named expression defined in the library.
|
||||
|
@ -100,23 +118,54 @@ public class LibraryEvaluationOperationProvider {
|
|||
*/
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_EVALUATE, idempotent = true, type = Library.class)
|
||||
public Parameters evaluate(
|
||||
RequestDetails theRequestDetails,
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "expression") List<String> theExpression,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters> thePrefetchData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters.ParametersParameterComponent> thePrefetchData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint) {
|
||||
return myLibraryEvaluationServiceFactory
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails) {
|
||||
return (Parameters) myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.evaluate(
|
||||
theId,
|
||||
Eithers.forMiddle3(theId),
|
||||
theSubject,
|
||||
theExpression,
|
||||
theParameters,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theData,
|
||||
thePrefetchData,
|
||||
theDataEndpoint,
|
||||
theContentEndpoint,
|
||||
theTerminologyEndpoint);
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_EVALUATE, idempotent = true, type = Library.class)
|
||||
public Parameters evaluate(
|
||||
@OperationParam(name = "library") String theLibrary,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "expression") List<String> theExpression,
|
||||
@OperationParam(name = "parameters") Parameters theParameters,
|
||||
@OperationParam(name = "useServerData") BooleanType theUseServerData,
|
||||
@OperationParam(name = "data") Bundle theData,
|
||||
@OperationParam(name = "prefetchData") List<Parameters.ParametersParameterComponent> thePrefetchData,
|
||||
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
|
||||
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
|
||||
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
|
||||
RequestDetails theRequestDetails) {
|
||||
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theLibrary, null, null);
|
||||
return (Parameters) myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.evaluate(
|
||||
Eithers.forLeft3(canonicalType),
|
||||
theSubject,
|
||||
theExpression,
|
||||
theParameters,
|
||||
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
|
||||
theData,
|
||||
thePrefetchData,
|
||||
theDataEndpoint,
|
|
@ -0,0 +1,81 @@
|
|||
/*-
|
||||
* #%L
|
||||
* HAPI FHIR - Clinical Reasoning
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
|
||||
* %%
|
||||
* 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.
|
||||
* #L%
|
||||
*/
|
||||
package ca.uhn.fhir.cr.r4.library;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.cr.common.ILibraryProcessorFactory;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.r4.model.BooleanType;
|
||||
import org.hl7.fhir.r4.model.IdType;
|
||||
import org.hl7.fhir.r4.model.Library;
|
||||
import org.hl7.fhir.r4.model.StringType;
|
||||
import org.opencds.cqf.fhir.utility.monad.Eithers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
|
||||
import static ca.uhn.fhir.cr.common.IdHelper.getIdType;
|
||||
|
||||
public class LibraryPackageProvider {
|
||||
@Autowired
|
||||
ILibraryProcessorFactory myLibraryProcessorFactory;
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Library.class)
|
||||
public IBaseBundle packageLibrary(
|
||||
@IdParam IdType theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageLibrary(
|
||||
Eithers.for3(canonicalType, theId, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
|
||||
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Library.class)
|
||||
public IBaseBundle packageLibrary(
|
||||
@OperationParam(name = "id") String theId,
|
||||
@OperationParam(name = "canonical") String theCanonical,
|
||||
@OperationParam(name = "url") String theUrl,
|
||||
@OperationParam(name = "version") String theVersion,
|
||||
@OperationParam(name = "usePut") BooleanType theIsPut,
|
||||
RequestDetails theRequestDetails)
|
||||
throws InternalErrorException, FHIRException {
|
||||
IIdType id = getIdType(FhirVersionEnum.R4, "Library", theId);
|
||||
StringType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
|
||||
return myLibraryProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.packageLibrary(
|
||||
Eithers.for3(canonicalType, id, null),
|
||||
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
|
||||
}
|
||||
}
|
|
@ -19,32 +19,32 @@
|
|||
*/
|
||||
package ca.uhn.fhir.cr.r4.measure;
|
||||
|
||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
||||
import ca.uhn.fhir.cr.common.StringTimePeriodHandler;
|
||||
import ca.uhn.fhir.cr.r4.ICareGapsServiceFactory;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.rest.annotation.Operation;
|
||||
import ca.uhn.fhir.rest.annotation.OperationParam;
|
||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
import org.hl7.fhir.r4.model.BooleanType;
|
||||
import org.hl7.fhir.r4.model.CanonicalType;
|
||||
import org.hl7.fhir.r4.model.IdType;
|
||||
import org.hl7.fhir.r4.model.Measure;
|
||||
import org.hl7.fhir.r4.model.Parameters;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CareGapsOperationProvider {
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(CareGapsOperationProvider.class);
|
||||
private final ICareGapsServiceFactory myR4CareGapsProcessorFactory;
|
||||
private final StringTimePeriodHandler myStringTimePeriodHandler;
|
||||
|
||||
@Autowired
|
||||
IRepositoryFactory myRepositoryFactory;
|
||||
|
||||
@Autowired
|
||||
ICareGapsServiceFactory myR4CareGapsProcessorFactory;
|
||||
public CareGapsOperationProvider(
|
||||
ICareGapsServiceFactory theR4CareGapsProcessorFactory, StringTimePeriodHandler theStringTimePeriodHandler) {
|
||||
myR4CareGapsProcessorFactory = theR4CareGapsProcessorFactory;
|
||||
myStringTimePeriodHandler = theStringTimePeriodHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <a href=
|
||||
|
@ -74,14 +74,8 @@ public class CareGapsOperationProvider {
|
|||
* framework.
|
||||
* @param thePeriodStart the start of the gaps through period
|
||||
* @param thePeriodEnd the end of the gaps through period
|
||||
* @param theTopic the category of the measures that is of interest for
|
||||
* the care gaps report
|
||||
* @param theSubject a reference to either a Patient or Group for which
|
||||
* the gaps in care report(s) will be generated
|
||||
* @param thePractitioner a reference to a Practitioner for which the gaps in
|
||||
* care report(s) will be generated
|
||||
* @param theOrganization a reference to an Organization for which the gaps in
|
||||
* care report(s) will be generated
|
||||
* @param theStatus the status code of gaps in care reports that will be
|
||||
* included in the result
|
||||
* @param theMeasureId the id of Measure(s) for which the gaps in care
|
||||
|
@ -90,8 +84,8 @@ public class CareGapsOperationProvider {
|
|||
* care report(s) will be calculated
|
||||
* @param theMeasureUrl the canonical URL of Measure(s) for which the gaps
|
||||
* in care report(s) will be calculated
|
||||
* @param theProgram the program that a provider (either clinician or
|
||||
* clinical organization) participates in
|
||||
* @param theNonDocument defaults to 'false' which returns standard 'document' bundle for `$care-gaps`.
|
||||
* If 'true', this will return summarized subject bundle with only detectedIssue resource.
|
||||
* @return Parameters of bundles of Care Gap Measure Reports
|
||||
*/
|
||||
@Description(
|
||||
|
@ -101,31 +95,29 @@ public class CareGapsOperationProvider {
|
|||
@Operation(name = ProviderConstants.CR_OPERATION_CARE_GAPS, idempotent = true, type = Measure.class)
|
||||
public Parameters careGapsReport(
|
||||
RequestDetails theRequestDetails,
|
||||
@OperationParam(name = "periodStart", typeName = "date") IPrimitiveType<Date> thePeriodStart,
|
||||
@OperationParam(name = "periodEnd", typeName = "date") IPrimitiveType<Date> thePeriodEnd,
|
||||
@OperationParam(name = "topic") List<String> theTopic,
|
||||
@OperationParam(name = "periodStart") String thePeriodStart,
|
||||
@OperationParam(name = "periodEnd") String thePeriodEnd,
|
||||
@OperationParam(name = "subject") String theSubject,
|
||||
@OperationParam(name = "practitioner") String thePractitioner,
|
||||
@OperationParam(name = "organization") String theOrganization,
|
||||
@OperationParam(name = "status") List<String> theStatus,
|
||||
@OperationParam(name = "measureId") List<String> theMeasureId,
|
||||
@OperationParam(name = "measureIdentifier") List<String> theMeasureIdentifier,
|
||||
@OperationParam(name = "measureUrl") List<CanonicalType> theMeasureUrl,
|
||||
@OperationParam(name = "program") List<String> theProgram) {
|
||||
@OperationParam(name = "nonDocument") BooleanType theNonDocument) {
|
||||
|
||||
return myR4CareGapsProcessorFactory
|
||||
.create(theRequestDetails)
|
||||
.getCareGapsReport(
|
||||
thePeriodStart,
|
||||
thePeriodEnd,
|
||||
theTopic,
|
||||
myStringTimePeriodHandler.getStartZonedDateTime(thePeriodStart, theRequestDetails),
|
||||
myStringTimePeriodHandler.getEndZonedDateTime(thePeriodEnd, theRequestDetails),
|
||||
theSubject,
|
||||
thePractitioner,
|
||||
theOrganization,
|
||||
theStatus,
|
||||
theMeasureId,
|
||||
theMeasureId == null
|
||||
? null
|
||||
: theMeasureId.stream().map(IdType::new).collect(Collectors.toList()),
|
||||
theMeasureIdentifier,
|
||||
theMeasureUrl,
|
||||
theProgram);
|
||||
Optional.ofNullable(theNonDocument)
|
||||
.map(BooleanType::getValue)
|
||||
.orElse(false));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
package ca.uhn.fhir.cr.r4.measure;
|
||||
|
||||
import ca.uhn.fhir.cr.common.StringTimePeriodHandler;
|
||||
import ca.uhn.fhir.cr.r4.ICollectDataServiceFactory;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
|
@ -29,11 +30,18 @@ import ca.uhn.fhir.rest.server.provider.ProviderConstants;
|
|||
import org.hl7.fhir.r4.model.IdType;
|
||||
import org.hl7.fhir.r4.model.Measure;
|
||||
import org.hl7.fhir.r4.model.Parameters;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class CollectDataOperationProvider {
|
||||
@Autowired
|
||||
ICollectDataServiceFactory myR4CollectDataServiceFactory;
|
||||
private final ICollectDataServiceFactory myR4CollectDataServiceFactory;
|
||||
private final StringTimePeriodHandler myStringTimePeriodHandler;
|
||||
|
||||
public CollectDataOperationProvider(
|
||||
ICollectDataServiceFactory theR4CollectDataServiceFactory,
|
||||
StringTimePeriodHandler theStringTimePeriodHandler) {
|
||||
myR4CollectDataServiceFactory = theR4CollectDataServiceFactory;
|
||||
myStringTimePeriodHandler = theStringTimePeriodHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <a href=
|
||||
* "http://hl7.org/fhir/R4/measure-operation-collect-data.html">$collect-data</a>
|
||||
|
@ -70,6 +78,11 @@ public class CollectDataOperationProvider {
|
|||
RequestDetails theRequestDetails) {
|
||||
return myR4CollectDataServiceFactory
|
||||
.create(theRequestDetails)
|
||||
.collectData(theId, thePeriodStart, thePeriodEnd, theSubject, thePractitioner);
|
||||
.collectData(
|
||||
theId,
|
||||
myStringTimePeriodHandler.getStartZonedDateTime(thePeriodStart, theRequestDetails),
|
||||
myStringTimePeriodHandler.getEndZonedDateTime(thePeriodEnd, theRequestDetails),
|
||||
theSubject,
|
||||
thePractitioner);
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue