Insertion of external FHIR Artifacts
# support
a
@rahul1 , a question: is Medplum prepared to insert custom artifacts? For example, I'm trying to insert the following artifact through the Endpoint https://medplum.saude.go.gov.br/fhir/R4/ValueSet: { "resourceType": "ValueSet", "id": "96967653-45a0-4a82-a621-3e2c0bbcbe5e", "goal": { "lastUpdated": "2020-03-13T21:12:15.917+00:00" }, "language": "pt-BR", "url": "http://www.saude.gov.br/fhir/r4/ValueSet/BRPais-1.0", "version": "1.0", "name": "Country", "status": "active", "experimental": false, "date": "2020-03-13T21:12:40.0380164+00:00", "publisher": "Brazilian Ministry of Health", "description": "Codes for country representation.", "immutable": false, "compose": { "include": [ { "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRPais" } ] } } The result of the Operation is a Bundle, which has the URL of the ValueSet that I inserted, but in a modified form (not reflecting the real URL). I also realized that the return is a Bundle of several ValueSets, but I couldn't actually find what I entered. Is there any specific way to insert custom FHIR Artifacts into Medplum? And how would you insert many custom artifacts at once? I appreciate any help. Thanks!
r
Hi @Adriano Freitas , are you making a
GET
or
Post
request? I just tried this using the Medplum CLI:
Copy code
medplum post 'ValueSet' '{
  "resourceType": "ValueSet",
  "id": "96967653-45a0-4a82-a621-3e2c0bbcbe5e",
  "goal": {
    "lastUpdated": "2020-03-13T21:12:15.917+00:00"
  },
  "language": "pt-BR",
  "url": "http://www.saude.gov.br/fhir/r4/ValueSet/BRPais-1.0",
  "version": "1.0",
  "name": "Country",
  "status": "active",
  "experimental": false,
  "date": "2020-03-13T21:12:40.0380164+00:00",
  "publisher": "Brazilian Ministry of Health",
  "description": "Codes for country representation.",
  "immutable": false,
  "compose": {
    "include": [
      {
        "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRPais"
      }
    ]
  }
}'
which returned the following error:
Copy code
Error: Invalid additional property "goal" (ValueSet.goal)
removing the "goal" property worked
Copy code
medplum post 'ValueSet' '{
  "resourceType": "ValueSet",
  "id": "96967653-45a0-4a82-a621-3e2c0bbcbe5e",
  "language": "pt-BR",
  "url": "http://www.saude.gov.br/fhir/r4/ValueSet/BRPais-1.0",
  "version": "1.0",
  "name": "Country",
  "status": "active",
  "experimental": false,
  "date": "2020-03-13T21:12:40.0380164+00:00",
  "publisher": "Brazilian Ministry of Health",
  "description": "Codes for country representation.",
  "immutable": false,
  "compose": {
    "include": [
      {
        "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRPais"
      }
    ]
  }
}'
a
Good morning Rahul! I hope you are well! I'm sorry for the delay, but now I'm back to the project. Glad you made it! Well, firstly I'm using the Postman tool to consume the endpoints. I am sending a POST request to (http://fhir.saude.go.gov.br/fhir/R4), this is the domain where we host our Medplum server. Can you give me an example of using the Medplum CLI? I'm making requests in the Spark environment, if you could help me with how to use the Medplum CLI with conventional Python requests, thank you! Furthermore, I am grateful for all your support and help and I am willing to do whatever is necessary to help the community. A big hug!
r
Here's the documentation on the CLI https://www.medplum.com/docs/cli
154 Views