Stream: implementers
Topic: Bundle with POST
Yunwei Wang (Feb 28 2017 at 14:10):
I need to add POST transactions into a Bundle. How do I attach POST body? The only example I find is from Facebook API which attaches POST body as Base64 encoded string. Thanks.
Jose Costa Teixeira (Feb 28 2017 at 14:37):
What's the use case? (sorry, can't understand from your question)
Yunwei Wang (Feb 28 2017 at 14:42):
When using ValueSet $validate-code operation, client can use HTTP POST with body of Parameters. Here is the example from the spec:
Yunwei Wang (Feb 28 2017 at 14:42):
POST [base]/ValueSet/$validate-code
[other headers]
{
"ResourceType" : "Parameters",
"parameter" : [
{
"name" : "coding",
"valueCodeableConcept" : {
"coding" : {
"system" : "http://loinc.org",
"code" : "1963-8",
"display" : "test"
}
}
},
{
"name" : "valueSet",
"resource": {
"resourceType" : "ValueSet",
[etc]
}
}
]
}
Yunwei Wang (Feb 28 2017 at 14:45):
If I want to validate several codes in one server request, I can add all requests into a Bundle, like this:
Yunwei Wang (Feb 28 2017 at 14:47):
{
"resourceType": "Bundle",
"type": "batch",
"entry": [{
"request": {
"method": "POST",
"url": "ValueSet/$validate-code"
}
},
{
"request": {
"method": "POST",
"url": "ValueSet/$validate-code"
}
}]
}
Yunwei Wang (Feb 28 2017 at 14:47):
How do I attach Parameters body in each entry?
Lloyd McKenzie (Feb 28 2017 at 16:15):
The Parameters instance would be inside the "resource" component of the entry
Yunwei Wang (Feb 28 2017 at 16:16):
thanks @Lloyd McKenzie
Last updated: Apr 12 2022 at 19:14 UTC