-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recommendation Foracast operation in progress, Interface created for …
…services present across R4 and R5 config
- Loading branch information
Showing
13 changed files
with
309 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...java/org/immregistries/iis/kernal/fhir/immdsForecast/IRecommendationForecastProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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"; | ||
|
||
@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); | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...ava/org/immregistries/iis/kernal/fhir/immdsForecast/RecommendationForecastProviderR4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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.IPrimitiveType; | ||
import org.hl7.fhir.r4.model.Immunization; | ||
import org.hl7.fhir.r4.model.ImmunizationRecommendation; | ||
import org.hl7.fhir.r4.model.Parameters; | ||
import org.hl7.fhir.r4.model.Patient; | ||
import org.immregistries.iis.kernal.fhir.annotations.OnR4Condition; | ||
import org.immregistries.iis.kernal.fhir.security.ServletHelper; | ||
import org.immregistries.iis.kernal.logic.ImmunizationRecommendationServiceR4; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Conditional; | ||
import org.springframework.stereotype.Controller; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
@Controller | ||
@Conditional(OnR4Condition.class) | ||
public class RecommendationForecastProviderR4 implements IRecommendationForecastProvider<Parameters, Patient, Immunization> { | ||
|
||
@Autowired | ||
ImmunizationRecommendationServiceR4 immunizationRecommendationServiceR4; | ||
|
||
@Override | ||
@Operation(name = $_IMMDS_FORECAST) | ||
public 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 | ||
) { | ||
Parameters out = new Parameters(); | ||
ImmunizationRecommendation immunizationRecommendation = immunizationRecommendationServiceR4.generate(ServletHelper.getTenant(), new Date(), patient);// generate(assessmentDate.getValue(), patient); | ||
out.addParameter().setName(RECOMMENDATION).setResource(immunizationRecommendation); | ||
return out; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...ava/org/immregistries/iis/kernal/fhir/immdsForecast/RecommendationForecastProviderR5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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.IPrimitiveType; | ||
import org.hl7.fhir.r5.model.Immunization; | ||
import org.hl7.fhir.r5.model.ImmunizationRecommendation; | ||
import org.hl7.fhir.r5.model.Parameters; | ||
import org.hl7.fhir.r5.model.Patient; | ||
import org.immregistries.iis.kernal.fhir.annotations.OnR5Condition; | ||
import org.immregistries.iis.kernal.fhir.security.ServletHelper; | ||
import org.immregistries.iis.kernal.logic.ImmunizationRecommendationServiceR5; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Conditional; | ||
import org.springframework.stereotype.Controller; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
@Controller | ||
@Conditional(OnR5Condition.class) | ||
public class RecommendationForecastProviderR5 implements IRecommendationForecastProvider<Parameters, Patient, Immunization> { | ||
|
||
@Autowired | ||
ImmunizationRecommendationServiceR5 immunizationRecommendationServiceR5; | ||
|
||
@Override | ||
@Operation(name = $_IMMDS_FORECAST) | ||
public 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 | ||
) { | ||
Parameters out = new Parameters(); | ||
ImmunizationRecommendation immunizationRecommendation = immunizationRecommendationServiceR5.generate(ServletHelper.getTenant(), new Date(), patient);// generate(assessmentDate.getValue(), patient); | ||
out.addParameter().setName(RECOMMENDATION).setResource(immunizationRecommendation); | ||
return out; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ain/java/org/immregistries/iis/kernal/fhir/interceptors/IIdentifierSolverInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.immregistries.iis.kernal.fhir.interceptors; | ||
|
||
import ca.uhn.fhir.rest.api.server.RequestDetails; | ||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; | ||
import org.hl7.fhir.instance.model.api.IDomainResource; | ||
|
||
public interface IIdentifierSolverInterceptor<Identifier, Immunization extends IDomainResource, Group extends IDomainResource> { | ||
/** | ||
* Resolves business identifier resources to actual resources references id | ||
* Currently only Immunization supported | ||
* TODO support Observation and other | ||
* TODO add flavours | ||
*/ | ||
void handle(RequestDetails requestDetails) throws InvalidRequestException; | ||
|
||
void handleImmunization(RequestDetails requestDetails, Immunization immunization); | ||
|
||
void handleGroup(RequestDetails requestDetails, Group group); | ||
|
||
String solvePatientIdentifier(RequestDetails requestDetails, Identifier identifier); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.