Skip to content

Commit

Permalink
Canonical Urls added in operation definitions, Recommendation immds-f…
Browse files Browse the repository at this point in the history
…orecast oepration implemented and ready
  • Loading branch information
cerbeor committed Oct 21, 2024
1 parent a2a0fad commit 4582ec6
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public RestfulServer restfulServer(IFhirSystemDao<?, ?> fhirSystemDao, AppProper

//register the IPS Provider
theIpsOperationProvider.ifPresent(fhirServer::registerProvider);
// recommendationForecastProvider.ifPresent(fhirServer::registerProvider);
recommendationForecastProvider.ifPresent(fhirServer::registerProvider);

// register custom interceptors
fhirServer.registerInterceptor(sessionAuthorizationInterceptor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
import ca.uhn.fhir.jpa.provider.BaseJpaResourceProviderPatient;
import ca.uhn.fhir.jpa.rp.r4.GroupResourceProvider;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import org.immregistries.iis.kernal.fhir.annotations.OnR4Condition;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
import ca.uhn.fhir.parser.IParser;
Expand All @@ -22,7 +18,10 @@
import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
import ca.uhn.fhir.rest.param.DateRangeParam;
import ca.uhn.fhir.rest.param.TokenParam;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
import ca.uhn.fhir.util.JsonUtil;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -31,6 +30,7 @@
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.hl7.fhir.r4.model.*;
import org.immregistries.iis.kernal.fhir.annotations.OnR4Condition;
import org.immregistries.iis.kernal.fhir.interceptors.IdentifierSolverInterceptorR4;
import org.immregistries.iis.kernal.fhir.interceptors.PartitionCreationInterceptor;
import org.immregistries.iis.kernal.servlet.PopServlet;
Expand All @@ -43,7 +43,10 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Controller
Expand Down Expand Up @@ -284,7 +287,7 @@ public void groupInstanceSynchExport(
/**
* Group/123/$member-add
*/
@Operation(name = "$member-add", idempotent = true)
@Operation(name = "$member-add", idempotent = true, canonicalUrl = "http://hl7.org/fhir/us/davinci-atr/OperationDefinition/member-add")
public Group groupInstanceMemberAdd(

@IdParam
Expand Down Expand Up @@ -358,7 +361,7 @@ public Group groupInstanceMemberAdd(
/**
* Group/123/$member-remove
*/
@Operation(name = "$member-remove", idempotent = true, bundleType = BundleTypeEnum.SEARCHSET)
@Operation(name = "$member-remove", idempotent = true, bundleType = BundleTypeEnum.SEARCHSET, canonicalUrl = "http://hl7.org/fhir/us/davinci-atr/OperationDefinition/member-remove")
public Group groupInstanceMemberRemove(

@IdParam
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void groupInstanceSynchExport(
/**
* Group/123/$member-add
*/
@Operation(name = "$member-add", idempotent = true)
@Operation(name = "$member-add", idempotent = true, canonicalUrl = "http://hl7.org/fhir/us/davinci-atr/OperationDefinition/member-add")
public Group groupInstanceMemberAdd(

@IdParam
Expand Down Expand Up @@ -358,7 +358,7 @@ public Group groupInstanceMemberAdd(
/**
* Group/123/$member-remove
*/
@Operation(name = "$member-remove", idempotent = true, bundleType = BundleTypeEnum.SEARCHSET)
@Operation(name = "$member-remove", idempotent = true, bundleType = BundleTypeEnum.SEARCHSET, canonicalUrl = "http://hl7.org/fhir/us/davinci-atr/OperationDefinition/member-remove")
public Group groupInstanceMemberRemove(

@IdParam
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
package org.immregistries.iis.kernal.fhir.immdsForecast;

import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import org.hl7.fhir.instance.model.api.IBaseParameters;
import org.hl7.fhir.instance.model.api.IDomainResource;
import org.hl7.fhir.instance.model.api.IPrimitiveType;

import java.util.Date;
import java.util.List;

public interface IRecommendationForecastProvider<Parameters extends IBaseParameters, Patient extends IDomainResource, Immunization extends IDomainResource> {
String $_IMMDS_FORECAST = "$immds-forecast";
String ASSESSMENT_DATE = "assessmentDate";
String PATIENT = "patient";
String RECOMMENDATION = "recommendation";
String IMMUNIZATION = "immunization";
public static final String $_IMMDS_FORECAST = "$immds-forecast";
public static final String ASSESSMENT_DATE = "assessmentDate";
public static final String PATIENT = "patient";
public static final String RECOMMENDATION = "recommendation";
public static final String IMMUNIZATION = "immunization";
public static final String IMM_DSFORECAST_CANONICAL_URL = "http://hl7.org/fhir/us/immds/OperationDefinition/ImmDSForecastOperation";

@Operation(name = $_IMMDS_FORECAST)
Parameters immdsForecastOperation(
@Description(shortDefinition = "The date on which to assess the forecast.")
@OperationParam(name = ASSESSMENT_DATE, min = 1, max = 1, typeName = "date")
IPrimitiveType<Date> assessmentDate,
@Description(shortDefinition = "Patient information.")
@OperationParam(name = PATIENT, min = 1, max = 1)
Patient patient,
@Description(shortDefinition = "Patient immunization history.")
@OperationParam(name = IMMUNIZATION)
List<Immunization> immunization);
// @Operation(name = $_IMMDS_FORECAST)
// @Operation(name = $_IMMDS_FORECAST,
// idempotent = true,
// canonicalUrl = IMM_DSFORECAST_CANONICAL_URL, typeName = "")
// abstract Parameters immdsForecastOperation(
// @Description(shortDefinition = "The date on which to assess the forecast.")
// @OperationParam(name = ASSESSMENT_DATE, min = 1, max = 1, typeName = "date")
// IPrimitiveType<Date> assessmentDate,
// @Description(shortDefinition = "Patient information.")
// @OperationParam(name = PATIENT, min = 1, max = 1)
// Patient patient,
// @Description(shortDefinition = "Patient immunization history.")
// @OperationParam(name = IMMUNIZATION)
// List<Immunization> immunization);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@

@Controller
@Conditional(OnR4Condition.class)
public class RecommendationForecastProviderR4 implements IRecommendationForecastProvider<Parameters, Patient, Immunization> {
public class RecommendationForecastProviderR4
implements IRecommendationForecastProvider<Parameters, Patient, Immunization> {

@Autowired
ImmunizationRecommendationServiceR4 immunizationRecommendationServiceR4;

@Override
@Operation(name = $_IMMDS_FORECAST)
@Operation(name = $_IMMDS_FORECAST,
idempotent = true,
canonicalUrl = IMM_DSFORECAST_CANONICAL_URL,
typeName = "")
public Parameters immdsForecastOperation(
@Description(shortDefinition = "The date on which to assess the forecast.")
@OperationParam(name = ASSESSMENT_DATE, min = 1, max = 1, typeName = "date")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public class RecommendationForecastProviderR5 implements IRecommendationForecast
@Autowired
ImmunizationRecommendationServiceR5 immunizationRecommendationServiceR5;

@Override
@Operation(name = $_IMMDS_FORECAST)
@Operation(name = $_IMMDS_FORECAST,
idempotent = true,
canonicalUrl = IMM_DSFORECAST_CANONICAL_URL,
typeName = "")
public Parameters immdsForecastOperation(
@Description(shortDefinition = "The date on which to assess the forecast.")
@OperationParam(name = ASSESSMENT_DATE, min = 1, max = 1, typeName = "date")
Expand Down

0 comments on commit 4582ec6

Please sign in to comment.