Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODOs and hint at code change for backported sub topic criteria valid… #5950

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ void validateSubmittedSubscription(

if (!finished) {

// LUKETODO: we're not going into the else which is why the crtieria is not being validated
if (subscription.isTopicSubscription()) {
if (myFhirContext.getVersion().getVersion()
!= FhirVersionEnum
Expand All @@ -160,7 +161,13 @@ void validateSubmittedSubscription(
throw new UnprocessableEntityException(
Msg.code(2322) + "No SubscriptionTopic exists with topic: " + subscription.getTopic());
}
} else {
// validateQuery(subscription.getCriteriaString(), "Subscription.criteria");
// LUKETODO: where do we stored the criteria in the backport?
// LUKETODO: read the R4 subscription backport tests and see what they're doing... there may be MULTIPLE URLS
validateQuery(subscription.getCriteriaString(), "Subscription.criteria");
}
// LUKETODO: this is the branch we're executing namely nothing
} else {
validateQuery(subscription.getCriteriaString(), "Subscription.criteria");

Expand Down Expand Up @@ -290,6 +297,19 @@ protected void validateChannelType(CanonicalSubscription theSubscription) {

@SuppressWarnings("WeakerAccess")
protected void validateChannelEndpoint(CanonicalSubscription theResource) {
// LUKETODO: this is valid as per the spec
// LUKETODO: check for URL valid that is conformant for rest hooks (http or https) spec: regex \s*

/*
1) Missing and wrong criteria should be validated. Subscription.critieria contains a canonical URL for the SubscriptionTopic that is valid and supported by the server >>> valid
2) Subscription.channel.endpoint is valid for the channel type provided (e.g. valid URL excluding handshake to validate connectivity) >> invalid
3) Validate mandatory elements of R4 backport subscription resource
reason is NOT mandatory: https://hl7.org/fhir/subscription.html (look for 1.. as opposed to 0...)
subscription topic query criteria IS mandatory according to spec
criteria in R4 is 1-1


*/
if (isBlank(theResource.getEndpointUrl())) {
throw new UnprocessableEntityException(
Msg.code(21) + "Rest-hook subscriptions must have Subscription.channel.endpoint defined");
Expand Down