Skip to content

Instantly share code, notes, and snippets.

@pgwilliams
Created December 15, 2020 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgwilliams/1c46c57b173b84d44f66a92acf6cbe9a to your computer and use it in GitHub Desktop.
Save pgwilliams/1c46c57b173b84d44f66a92acf6cbe9a to your computer and use it in GitHub Desktop.
curl --location --request POST 'http://localhost:8090/fhir/ValueSet/$expand' \
--header 'Content-Type: application/json' \
--data-raw '{
"resourceType": "Parameters",
"parameter": [
{
"name": "valueSet",
"resource": {
"resourceType": "ValueSet",
"compose": {
"include": [
{
"valueSet": "http://snomed.info/sct?fhir_vs=ecl/^ 32570581000036105 : << 263502005 = << 90734009%7CChronic%7C"
}
]
}
}
}
]
}'
curl --location --request POST 'https://r4.ontoserver.csiro.au/fhir/ValueSet/$expand' \
--header 'Content-Type: application/json' \
--data-raw '{
"resourceType": "Parameters",
"parameter": [
{
"name": "valueSet",
"resource": {
"resourceType": "ValueSet",
"compose": {
"include": [
{
"valueSet": "http://snomed.info/sct?fhir_vs=ecl/^ 32570581000036105 : << 263502005 = << 90734009%7CChronic%7C"
}
]
}
}
}
]
}'
@Tyler-Cooksey
Copy link

Tyler-Cooksey commented Jan 13, 2021

As this example currently stands, it will not work within the Snowstorm due to include not containing either concept or filter. As it currently stands, it will not be able to produce a valid ECL query and will throw an error. After a recent change, POST operations are now supported via ValueSet Expansion (with/without IdType). Here is an example which illustrates that using a POST request works inside Snowstorm for VS Expansion:

curl --location --request POST 'http://localhost:8080/fhir/ValueSet/$expand' \
--header 'Content-Type: application/json' \
--data-raw '{
    "resourceType": "Parameters",
    "parameter": [
        {
            "name": "valueSet",
            "resource": {
                "resourceType": "ValueSet",
                "compose": {
                    "include": [
                        {
                            "filter": [
                                {
                                    "property": "concept",
                                    "op": "is-a",
                                    "value": "21351003"
                                }
                            ]
                        }
                    ]
                }
            }
        },
        {
            "name": "system-version",
            "valueString": "http://snomed.info/sct/900000000000207008/version/20200731"
        },
        {
            "name": "displayLanguage",
            "valueString": "en-GB"
        },
        {
            "name": "offset",
            "valueString": "0"
        },
        {
            "name": "count",
            "valueString": "10"
        }
    ]
}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment