Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

logical references are not recognized if resource type information is missing #267

Open
wetret opened this issue Sep 3, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@wetret
Copy link
Member

wetret commented Sep 3, 2021

Logical references as this one:

"valueReference": {
    "identifier": {
        "system": "http://www.netzwerk-universitaetsmedizin.de/sid/dic-pseudonym",
        "value": "source/original"
    }
}

are not recognized as logical references because the resource type information is missing. Valid logical references have the form:

"valueReference": {
    "type": "Patient",
    "identifier": {
        "system": "http://www.netzwerk-universitaetsmedizin.de/sid/dic-pseudonym",
        "value": "source/original"
     }
}

This is caused because of the following code:

else if (reference.hasType() && reference.hasIdentifier() && reference.getIdentifier().hasSystem()

We could either enforce resource type information and add a debug log message before returning ResourceReference.UNKNOWN or we could remove the type check from the code above and change the code that checks if logical references are resolvable:

private boolean logicalReferenceCanBeCheckedAndResolved(ResourceReference reference, Connection connection)
{
ReferenceType type = reference.getType(serverBase);
if (!ReferenceType.LOGICAL.equals(type))
throw new IllegalArgumentException("Not a logical reference");
NamingSystemDao namingSystemDao = daoProvider.getNamingSystemDao();
return exceptionHandler
.handleSqlException(() -> namingSystemDao.existsWithUniqueIdUriEntryResolvable(connection,
reference.getReference().getIdentifier().getSystem()));
}

@wetret wetret added the enhancement New feature or request label Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant