Stream: implementers
Topic: update StructureDefinition
Werner De Mulder (Nov 10 2020 at 20:49):
I want to update a structureDefinition on VONK using postman. I'm using a PUT command http://localhost:4080/administration/StructureDefinition
In the body content I placedthe updated structuredefinition. This is not accepted by VONK. The argument StructureDefinition seems not to be supported. What is not correct in the applied syntax?
Lloyd McKenzie (Nov 10 2020 at 20:56):
What error are you getting?
Werner De Mulder (Nov 10 2020 at 20:58):
{
"resourceType": "OperationOutcome",
"id": "3d7e126b-6322-44e6-bbe4-ce9857704b44",
"meta": {
"versionId": "5f98a3a7-b3f5-43f3-a7d8-39f723f510bf",
"lastUpdated": "2020-11-10T20:42:31.096+00:00"
},
"issue": [
{
"severity": "warning",
"code": "not-supported",
"details": {
"coding": [
{
"system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
"code": "5003"
}
],
"text": "Argument is not supported"
},
"diagnostics": "/StructureDefinition"
}
]
}
Lloyd McKenzie (Nov 10 2020 at 21:02):
What URL are you PUTing to?
Werner De Mulder (Nov 10 2020 at 21:05):
PUT http://localhost:4080/administration/StructureDefinition
Werner De Mulder (Nov 10 2020 at 21:05):
body content contains structuredefinition. I didn't apply the Content-Type
Lloyd McKenzie (Nov 10 2020 at 21:07):
Most servers expect Content-Type to be declared
Werner De Mulder (Nov 10 2020 at 21:08):
When I add Content-Type, I receive a message that the argument is not supported
Lloyd McKenzie (Nov 10 2020 at 21:09):
@Vadim Peretokin
ryan moehrke (Nov 11 2020 at 00:03):
are you using the right application/fhir+json or application/fhir+xml content-type headers? because everything else looks right according to their docs https://docs.fire.ly/vonk/features/conformanceresources.html#example
Werner De Mulder (Nov 11 2020 at 08:13):
Yes seems to be fine. Something is not correct. If I perform a database reset using POST HTTP://127.0.0.1:4080/administration/reset I get a status code 200 which means that it is ok. If I search afterwards for structuredefinitions in my database, still some structuredefinitions are in (GET http://127.0.0.1:4080/administration/StructureDefinition?Content-Type=application/fhir+json). How to delete a structuredefintion?
DELETE http://127.0.0.1:4080/administration/StructureDefinition doesn't work here.
Vadim Peretokin (Nov 11 2020 at 10:46):
It should be DELETE http://127.0.0.1:4080/administration/StructureDefinition/<resource ID>
Vadim Peretokin (Nov 11 2020 at 10:47):
@Werner De Mulder you need to do a POST
if you aren't specifying an ID. See https://www.hl7.org/fhir/http.html#create
Marc Sandberg (Nov 11 2020 at 11:01):
When using the PUT the url should contain parameters to specify which StructureDefinition should be updated; adding the url from your new StructureDefinition might help; try PUT http://127.0.0.1:4080/administration/StructureDefinition?url=
with the specified url after this.
ryan moehrke (Nov 11 2020 at 15:26):
wait why is your "Content-Type=application/fhir+json" in your url parameters? it should be a header right?
Werner De Mulder (Nov 11 2020 at 17:47):
Thank you all for your input.
Still one question about the reset parameter. I should assume that when using POST http://<vonk-endpoint>/administration/reset all the content is cleared, even the structuredefintions. This is not the case. In appsettings.json, I commented out the security element.
//"Security": {
//"AllowedNetworks": [ "127.0.0.1", "::1", "10.51.244.67" ], // i.e.: ["127.0.0.1", "::1" (ipv6 localhost), "10.1.50.0/24", "10.5.3.0/24", "31.161.91.98"]
//"OperationsToBeSecured": [ "reindex", "reset", "preload", "importResources" ]
//}
}
I receive no error, return code 200, but my structuredefinitions are still in.
Marc Sandberg (Nov 12 2020 at 08:54):
I haven't used Vonk, but based on https://docs.fire.ly/vonk/features/resetdb.html I would assume that this POST should have worked (especially since you received a 200 response code). Maybe you could try the documented alternative. It could also be helpful to check the logs for an error that could have occurred after the 200 response. Since I'm no Vonk user I don't know if the response will be send before the operation is complete (since large databases could take a while), or just wait until it's all done.
Last updated: Apr 12 2022 at 19:14 UTC