Delete EHR not finding the EHR ID in EHRBase 2.0

I was trying a simple create EHR → delete EHR workflow for testing purposes, using all default configuration in a fresh EHRBase 2.0 installation using the orders in the installation tutorial (so no security).
I created an EHR with the following code based on the client example and then I tried to delete it with the admin API


However, the server returns a 404 for the delete operation

The EHR exists (I can access it with https://localhost:8080/ehrbase/rest/openehr/v1/ehr/fd4ba265-1a6e-43e3-a8d2-c02de1854785)
The delete code is creating the uri http://localhost:8080/ehrbase/rest/admin/ehr/fd4ba265-1a6e-43e3-a8d2-c02de1854785 which also gives me 404 even executing it directly over REST

Also tried with setModifiable as true just in case, same result

Am I missing anything?

@yampeku these admin endpoints are de-activated by default in the application.yml (ehrbase/configuration/src/main/resources/application.yml at develop · ehrbase/ehrbase · GitHub):

Bildschirmfoto 2024-04-29 um 20.10.59

So it should work after making this adjustment

1 Like

Oh, I completely misunderstood the “(de)activate” part of the documentation


1 Like

Is it possible to activate admin mode with a parameter when loading the docker image? Does admin mode have a prerequisite of having some kind of security other than “None”?

You can overwrite the variables like the following:

docker run --network ehrbase-net --name ehrbase -e DB_URL=jdbc:postgresql://ehrbase-postgres:5432/ehrbase -e DB_USER=ehrbase_restricted -e DB_PASS=ehrbase_restricted -e DB_USER_ADMIN=ehrbase -e DB_PASS_ADMIN=ehrbase -e -e ADMINAPI_ACTIVE=true -e SPRING_PROFILES_ACTIVE=local -d -p 8080:8080 ehrbase/ehrbase

In this case, use the “ehrbase” password with basic auth.


Can confirm it works :smiley: