Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was 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

@wetret

Description

@wetret

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()));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions