diff --git a/src/main/java/org/highmed/numportal/service/ehrbase/EhrBaseService.java b/src/main/java/org/highmed/numportal/service/ehrbase/EhrBaseService.java index 1db0a363..ddebe0c3 100644 --- a/src/main/java/org/highmed/numportal/service/ehrbase/EhrBaseService.java +++ b/src/main/java/org/highmed/numportal/service/ehrbase/EhrBaseService.java @@ -60,6 +60,7 @@ public class EhrBaseService { private static final String NAME = "name"; private static final String PATH = "path"; private static final String PSEUDONYM = "pseudonym"; + private static final String EXTERNAL_REF_ID_VALUE = "/subject/external_ref/id/value"; private final DefaultRestClient restClient; private final CompositionResponseDataBuilder compositionResponseDataBuilder; @@ -320,7 +321,7 @@ private List getAndRemoveEhrStatusColumn(QueryResponseData compositions) throw new BadRequestException(EhrBaseService.class, NO_DATA_COLUMNS_IN_THE_QUERY_RESULT); } String ehrStatusPath = columns.get(0).get(PATH); - if (ehrStatusPath == null || !ehrStatusPath.equals("/" + ehrBaseProperties.getIdPath())) { + if (ehrStatusPath == null || !ehrStatusPath.endsWith(EXTERNAL_REF_ID_VALUE)) { throw new SystemException(EhrBaseService.class, QUERY_RESULT_DOESN_T_CONTAIN_EHR_STATUS_COLUMN); } columns.remove(0);