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

Duplicate ActivityDefinition Resources Prevent Processes From Being Executed #247

Open
hhund opened this issue Oct 22, 2024 · 0 comments · Fixed by #250
Open

Duplicate ActivityDefinition Resources Prevent Processes From Being Executed #247

hhund opened this issue Oct 22, 2024 · 0 comments · Fixed by #250
Assignees
Labels
bug Something isn't working ready for release Issue is fixed and merged into develop, ready for next release
Milestone

Comments

@hhund
Copy link
Member

hhund commented Oct 22, 2024

Description

Duplicate ActivityDefinition resources (as in the same url and version) prevent processes from being executed. Task resources with status requested can not be created, if a corresponding ActivityDefinition resource exists with the same url and version more than once.

Effected DSF Version

  • 1.6.0

Expected Behavior

Duplicate ActivityDefinition resources (as in the same url and version) should not exists on the DSF FHIR server.

Logs

FHIR:

2024-10-22 13:10:08,638 [jetty-server-715] WARN  dev.dsf.fhir.service.ReferenceResolverImpl - Found 2 matches for reference at Task.instantiatesCanonical with url '<some url>|<some version>'
2024-10-22 13:10:08,638 [jetty-server-715] WARN  dev.dsf.fhir.help.ResponseGenerator - Reference target <some url>|<some version> of reference at Task.instantiatesCanonical in resource of type Task with id null not found
2024-10-22 13:10:08,638 [jetty-server-715] INFO  dsf-audit-logger - Create of resource Task for user '<some user>' failed, status: 403 Forbidden

with for example:
<some url> = http://medizininformatik-initiative.de/bpe/Process/feasibilityExecute
<some version> = 1.0

Workaround

To check if there are duplicate ActivityDefinition resources in the DSF FHIR server database execute in /opt/fhir:

docker compose exec db psql -U liquibase_user fhir -c "select concat(activity_definition->>'url','|',activity_definition->>'version') as url, count(concat(activity_definition->>'url','|',activity_definition->>'version')) from current_activity_definitions group by url having count (concat(activity_definition->>'url','|',activity_definition->>'version')) > 1;"

To delete duplicate ActivityDefinition resources from the DSF FHIR server database execute in /opt/fhir:

docker compose exec db psql -U liquibase_user fhir -c "delete from activity_definitions where activity_definition_id in (select a.activity_definition_id from current_activity_definitions a, current_activity_definitions b where concat(a.activity_definition->>'url','|',a.activity_definition->>'version') = concat(b.activity_definition->>'url','|',b.activity_definition->>'version') and a.activity_definition_id > b.activity_definition_id);"
@hhund hhund added the bug Something isn't working label Oct 22, 2024
@hhund hhund added this to the 1.6.1 milestone Oct 22, 2024
@hhund hhund self-assigned this Nov 19, 2024
@hhund hhund linked a pull request Dec 18, 2024 that will close this issue
@hhund hhund added the ready for release Issue is fixed and merged into develop, ready for next release label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for release Issue is fixed and merged into develop, ready for next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant