How to use a numeric id in Google Healthcare api FHIR [closed] - hl7-fhir

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I need to change uuid to numeric id, but I can't find how to make this.
Someone can help me, please?

You can create resources with any ID you want (that is allowed by the FHIR spec) if you set enabledUpdateCreate to true in your FHIR store config.
This determines if the client can use an Update operation to create a new resource with a client-specified ID.
For example
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
--data '{
"enableUpdateCreate": true
}' "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID?updateMask=enableUpdateCreate"
Then you can create a new Patient with ID 1 like this
curl -X PUT \
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/fhir+json; charset=utf-8" \
--data '{
"resourceType": "Patient",
"id": "1"
}' \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/1"

Related

Send HTTP POST request to InfluxDB manually with browser

Hello,
I'm currently using grafana to visualize data from InfluxDB, and would like to use a hyperlink in form of a HTTP request from a dashboard to insert data into the database.
Is something like this possible?
This is possible.
In InfluxDB v1.X, you could do:
curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
In InfluxDB v2.X, you could do:
curl --request POST \
"http://localhost:8086/api/v2/write?
org=YOUR_ORG&bucket=YOUR_BUCKET&precision=ns" \
--header "Authorization: Token YOUR_API_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary '
airSensors,sensor_id=TLM0201 temperature=73.97038159354763,humidity=35.23103248356096,co=0.48445310567793615 1630424257000000000
airSensors,sensor_id=TLM0202 temperature=75.30007505999716,humidity=35.651929918691714,co=0.5141876544505826 1630424257000000000
'
See more details here and there.

Event-driven Travis build

I'm looking for an "event-driven" way to use travis, I need to notify him when something occurred but in the meanwhile the build should be in 'yellow' state, it may takes up to 2 hours.
Does anybody knows a way? or another CI supports that?
Thanks!
You can trigger builds using travis API.
For example, to trigger a build for the most recent commit, you can send the following POST request:
body='{
"request": {
"branch":"master"
}}'
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token xxxxxx" \
-d "$body" \
https://api.travis-ci.com/repo/travis-ci%2Ftravis-core/requests

How to create an Order using Square Connect API?

I tried the following request to create an order using Square Connect's Orders API (https://docs.connect.squareup.com/api/connect/v1/#navsection-orders). The response I got back was "not found". I wonder if I am missing anything in my request?
Request:
curl -H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer repace-with-real-access-token" \
-d '{}' \
https://connect.squareup.com/v1/locationId/orders
Response:
{"type":"not_found","message":"NotFound"}
If this is not the correct way to create an order, can you please let me know how to do it using Square Connect API?
Thanks!
Remove the -d '{}'. The endpoint takes GET requests and by default, this argument will make curl send POST instead of GET requests.

Yammer Activity changes Message

Is it possible to use a URL in both a message and an activity in Yammer ?
Using the messages API, it is possible to construct a message which is:
Properly linked (in this example clicking on Title goes to example.com/id/1/); and
Includes an image (placehold.it/100x100).
For example:
#!/bin/bash
GROUP={GROUP}
TOKEN={TOKEN}
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
--data "body=hello" \
--data "group_id=$GROUP" \
--data "og_fetch=false" \
--data "og_url=http%3A%2F%2Fwww.example.com%2Fid%2F2%2F" \
--data "og_title=Title" \
--data "og_image=http%3A%2F%2Fplacehold.it%2F100x100" \
--data "og_description=Description" \
--data "og_object_type=page" \
--data "og_private=true" \
https://www.yammer.com/api/v1/messages.json
Using the activity API it is possible to make an Open Graph object:
Example:
#!/bin/bash
TOKEN={TOKEN}
EMAIL={EMAIL}
curl -X POST \
-H "Content-type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"activity":{"actor":{"email":"'$EMAIL'"},"action":"create","object":{"url":"http://www.example.com/id/1/","image":"http://placehold.it/110x110","title":"Title","type":"page"}},"private":"false","message":"This is an update"}' \
https://www.yammer.com/api/v1/activity.json
The problem is that now the original message from Step 1:
No longer links to the actual content (it links to https://www.yammer.com/{network}/graph/{id})
Loses its image (it is now mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png)
As an aside, the open graph object doesn't update for the new image provided in the activity post (110x110 vs 100x100). The docs (https://developer.yammer.com/v1.0/docs/open-graph) say "when an OG object exists (with the same URL), it is updated appropriately."
In one example you have the open graph object set to private and the other is to public. That may be causing the weird issue you are seeing.
"og_private=true"

Sending POST via CURL error [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to send a HTTP POST via CURL on the command line. I am doing something wrong. Could someone advise me on what's wrong with my command? I am doing the following:
curl -X POST -H "Content-Type:application/json" https://www.url-here.com -d {JSON OBJECT HERE}
If you add -v you'll get a verbose error message, could help with debugging.
According to the manual, you should put options before the url.
This is a curl call I'm using for testing at the moment, which work just fine:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{}' http://example.com

Resources