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

Issue 5173 get gateway everything doesnt return all patients #5199

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
902df2d
version bump
tadgh Jul 21, 2023
9a996ce
Bump to core release 6.0.22 (#5028)
dotasek Jul 24, 2023
1697783
Resolve 5126 hfj res ver prov might cause migration error on db that …
TynerGjs Jul 26, 2023
ff507cd
5123 - Use DEFAULT partition for server-based requests if none specif…
steve-corbett-smilecdr Jul 27, 2023
4820759
consent remove all suppresses next link in bundle (#5119)
fil512 Jul 27, 2023
e077393
5117 MDM Score for No Match Fields Should Not Be Included in Total Sc…
jdar8 Jul 27, 2023
4ec17c9
_source search parameter needs to support modifiers (#5095)
volodymyr-korzh Jul 31, 2023
ca2c7bd
Fix HFQL docs (#5151)
nathandoef Aug 1, 2023
b816844
Expunge operation on codesystem may throw 500 internal error with pre…
epeartree Aug 2, 2023
d970ca5
documentation update (#5154)
TipzCM Aug 2, 2023
f82da96
Fix hsql jdbc driver deps (#5168)
michaelabuckley Aug 2, 2023
4fc99e7
$delete-expunge over 10k resources will now delete all resources (#5144)
lukedegruchy Aug 3, 2023
f6f855b
updating documentation (#5170)
TipzCM Aug 3, 2023
4cd93fd
_source search parameter modifiers for Subscription matching (#5159)
volodymyr-korzh Aug 3, 2023
a6d64bf
Removal of meta tags during updates do not trigger subscription (#5181)
epeartree Aug 8, 2023
7a13fcc
Issue 5173 get gateway everything doesnt return all patients (#5174)
jmarchionatto Aug 8, 2023
5e30780
Do not 500 and continue IG ingestion when different IGs try to save d…
lukedegruchy Aug 8, 2023
6d1bfde
Tentative fix
Aug 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hapi-deployable-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ public enum UriParamQualifierEnum {
* Value <code>:below</code>
* </p>
*/
BELOW(":below");
BELOW(":below"),

/**
* The contains modifier allows clients to indicate that a supplied URI input should be matched
* as a case-insensitive and combining-character insensitive match anywhere in the target URI.
* <p>
* Value <code>:contains</code>
* </p>
*/
CONTAINS(":contains");

private static final Map<String, UriParamQualifierEnum> KEY_TO_VALUE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,45 @@
*/
package ca.uhn.fhir.util;

import java.util.StringTokenizer;
import ca.uhn.fhir.i18n.Msg;
import org.apache.commons.lang3.ArrayUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;

import static org.apache.commons.lang3.StringUtils.isBlank;

public class UrlPathTokenizer {

private final StringTokenizer myTok;
private String[] tokens;
private int curPos;

public UrlPathTokenizer(String theRequestPath) {
myTok = new StringTokenizer(theRequestPath, "/");
if (theRequestPath == null) {
theRequestPath = "";
}
tokens = removeBlanksAndSanitize(theRequestPath.split("/"));
curPos = 0;
}

public boolean hasMoreTokens() {
return myTok.hasMoreTokens();
return curPos < tokens.length;
}

public int countTokens() {
return tokens.length;
}

/**
* Returns the next token without updating the current position.
* Will throw NoSuchElementException if there are no more tokens.
*/
public String peek() {
if (!hasMoreTokens()) {
throw new NoSuchElementException(Msg.code(2420) + "Attempt to retrieve URL token out of bounds");
}
return tokens[curPos];
}

/**
Expand All @@ -43,6 +70,22 @@ public boolean hasMoreTokens() {
* @see UrlUtil#unescape(String)
*/
public String nextTokenUnescapedAndSanitized() {
return UrlUtil.sanitizeUrlPart(UrlUtil.unescape(myTok.nextToken()));
String token = peek();
curPos++;
return token;
}

/**
* Given an array of Strings, this method will return all the non-blank entries in that
* array, after running sanitizeUrlPart() and unescape() on them.
*/
private static String[] removeBlanksAndSanitize(String[] theInput) {
List<String> output = new ArrayList<>();
for (String s : theInput) {
if (!isBlank(s)) {
output.add(UrlUtil.sanitizeUrlPart(UrlUtil.unescape(s)));
}
}
return output.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
}
}
35 changes: 35 additions & 0 deletions hapi-fhir-base/src/main/java/ca/uhn/fhir/util/UrlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
Expand Down Expand Up @@ -602,6 +604,39 @@ public static List<NameValuePair> translateMatchUrl(String theMatchUrl) {
return parameters;
}

/**
* Creates list of sub URIs candidates for search with :above modifier
* Example input: https://[host]/[pathPart1]/[pathPart2]
* Example output: https://[host], https://[host]/[pathPart1], https://[host]/[pathPart1]/[pathPart2]
*
* @param theUri String URI parameter
* @return List of URI candidates
*/
public static List<String> getAboveUriCandidates(String theUri) {
try {
URI uri = new URI(theUri);
if (uri.getScheme() == null || uri.getHost() == null) {
throwInvalidRequestExceptionForNotValidUri(theUri, null);
}
} catch (URISyntaxException theCause) {
throwInvalidRequestExceptionForNotValidUri(theUri, theCause);
}

List<String> candidates = new ArrayList<>();
Path path = Paths.get(theUri);
candidates.add(path.toString().replace(":/", ":https://"));
while (path.getParent() != null && path.getParent().toString().contains("/")) {
candidates.add(path.getParent().toString().replace(":/", ":https://"));
path = path.getParent();
}
return candidates;
}

private static void throwInvalidRequestExceptionForNotValidUri(String theUri, Exception theCause) {
throw new InvalidRequestException(
Msg.code(2419) + String.format("Provided URI is not valid: %s", theUri), theCause);
}

public static class UrlParts {
private String myParams;
private String myResourceId;
Expand Down
4 changes: 2 additions & 2 deletions hapi-fhir-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-bom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<packaging>pom</packaging>
<name>HAPI FHIR BOM</name>

<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client-okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>6.7.15-SNAPSHOT</version>
<version>6.8.0-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: add
issue: 5095
title: "Added support for :above, :below, :contains and :missing _source search parameter modifiers."
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: fix
issue: 5117
title: "Previously, all MDM field scores, including `NO_MATCH`es, were included in the final total MDM score. This has
now been fixed so that only `MATCH`ed fields are included in the total MDM score."
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: fix
issue: 5119
jira: SMILE-7090
title: "Previously, when the consent service would remove all resources to be returned, the response bundle would
not provide the previous/next link(s). This has been corrected."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: fix
issue: 5126
title: "Previously, updating from Hapi-fhir 6.6.0 to 6.8.0 would cause migration error, it is now fixed."
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: fix
issue: 5150
title: "When running a $delete-expunge with over 10,000 resources, only the first 10,000 resources were deleted.
This is now fixed."
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: fix
issue: 5155
title: "Previously, requesting an $expunge operation on CodeSystem resources while CS batch deletion is underway would return HTTP 500.
This has been fixed to return HTTP 412 (precondition failed)."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: add
issue: 5158
title: "Added support for Subscription matching of ':above', ':below', ':contains' and ':missing' '_source' search parameter modifiers."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: fix
issue: 5167
title: "Fixed a dependency in the HSQL JDBC driver referencing a non-bundled class (javax.ServletOutputStream)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: fix
issue: 5173
title: "Fix gateway `$everything` operation to respect server configured default and maximum page sizes."
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: fix
issue: 5182
jira: SMILE-6857
title: "Previously, removing tags in a resource update with proper headers and versioning flag would not trigger a
new subscription. This has been fixed."
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: fix
issue: 5183
title: "The latest US Core IG includes two ValueSets with different contents, but the same FHIR Id and OID via two different included IGs (i.e. `2.16.840.1.113762.1.4.1010.9` via us.cdc.phinvads and us.nlm.vsac). Ingesting these duplicates in US Core failed with a 500 error. This has been resolved by logging the error and allowing the rest of the ingestion to proceed."
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ A simple example query is shown below:

```sql
SELECT
name.family as family,
name.given as given,
name[0].family as family,
name[0].given[0] as given,
birthDate,
identifier.where(system='https://hl7.org/fhir/sid/us-ssn').value as SSN
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ Below are some simplifying principles HAPI MDM follows to reduce complexity and

1. The only source resources in the system that do not have a MATCH link are those that have the 'NO-MDM' tag or those that have POSSIBLE_MATCH links pending review.

1. The HAPI MDM rules define a single identifier system that holds the external enterprise id ("EID"). If a source resource has an external EID, then the Golden Resource it links to always has the same EID. If a source resource has no EID when it arrives, a unique UUID will be assigned as that source resource's EID.

1. A Golden Resource can have both an internal EID (auto-created by HAPI), and an external EID (provided by an
external system).
1. The HAPI MDM rules define a single identifier system that holds the external enterprise id ("EID"). If a source resource has an external EID, then the Golden Resource it links to always has the same EID.

1. Two different Golden Resources cannot have the same EID.

Expand Down Expand Up @@ -85,7 +82,7 @@ possible that hundreds of John Doe's could be linked to the same Golden Resource

When a new source resource is compared with all other resources of the same type in the repository, there are four possible outcomes:

* CASE 1: No MATCH and no POSSIBLE_MATCH outcomes -> a new Golden Resource is created and linked to that source resource as MATCH. If the incoming resource has an EID, it is copied to the Golden Resource. Otherwise a new UUID is generated and used as the internal EID.
* CASE 1: No MATCH and no POSSIBLE_MATCH outcomes -> a new Golden Resource is created and linked to that source resource as MATCH. If the incoming resource has an EID, it is copied to the Golden Resource.

* CASE 2: All of the MATCH source resources are already linked to the same Golden Resource -> a new Link is created between the new source resource and that Golden Resource and is set to MATCH.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# MDM Enterprise Identifiers

An Enterprise Identifier (EID) is a unique identifier that can be attached to source resources. Each implementation is expected to use exactly one EID system for incoming resources, defined in the MDM Rules file. If a source resource with a valid EID is submitted, that EID will be copied over to the Golden Resource that was matched. In the case that the incoming source resource had no EID assigned, an internal EID will be created for it. There are thus two classes of EID:
* Internal EIDs, created by HAPI-MDM, and
* External EIDs, provided by the submitted resources.
An Enterprise Identifier (EID) is a unique identifier that can be attached to source resources.
Each implementation is expected to use exactly one EID system for incoming resources,
defined in the MDM Rules file.
If a source resource with a valid EID is submitted, that EID will be copied over to the Golden Resource that was matched.

## MDM EID Settings

Expand Down
Loading
Loading