Skip to content

Commit

Permalink
Add all resources to upload script
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c committed Jun 21, 2023
1 parent 0bf629e commit ff092e9
Showing 1 changed file with 55 additions and 16 deletions.
71 changes: 55 additions & 16 deletions utils/fhir-server-import.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,41 +41,80 @@
"valueCode": "application/fhir+ndjson"
}, {
"name": "inputSource",
"valueUri": "http://example.com/fhir/"
"valueUri": base_url,
}, {
"name": "storageDetail",
"part": [ {
"name": "type",
"valueCode": "https"
}, {
"name": "credentialHttpBasic",
"valueString": "admin:password"
}, {
"name": "maxBatchResourceCount",
"valueString": "500"
} ]
}, {
"name": "input",
"part": [ {
"name": "type",
"valueCode": "Observation"
}, {
"name": "url",
"valueUri": "https://example.com/observations.ndjson"
"valueString": "1000"
} ]
}, {
"name": "input",
"part": [ {
"name": "type",
"valueCode": "Patient"
"valueCode": "Measure"
}, {
"name": "url",
"valueUri": "https://example.com/patients.ndjson"
"valueUri": "https://raw.githubusercontent.com/uwcirg/fhir-eval-environments/bfa6570/tests/data/21340.Measure.ndjson"
} ]
} ]
}


input_base_url = "https://raw.githubusercontent.com/uwcirg/fhir-eval-environments/22d319d/"


export_resources = (
"tests/data/21340.Measure.ndjson",
"tests/data/21364.Organization.ndjson",
"tests/data/21365.Location.ndjson",

"tests/data/21318.MeasureReport.ndjson",
"tests/data/21319.MeasureReport.ndjson",
"tests/data/21320.MeasureReport.ndjson",
"tests/data/21321.MeasureReport.ndjson",
"tests/data/21322.MeasureReport.ndjson",
"tests/data/21323.MeasureReport.ndjson",
"tests/data/21324.MeasureReport.ndjson",
"tests/data/21325.MeasureReport.ndjson",
"tests/data/21326.MeasureReport.ndjson",
"tests/data/21327.MeasureReport.ndjson",
"tests/data/21328.MeasureReport.ndjson",
"tests/data/21329.MeasureReport.ndjson",
"tests/data/21330.MeasureReport.ndjson",
"tests/data/21331.MeasureReport.ndjson",
"tests/data/21332.MeasureReport.ndjson",
"tests/data/21333.MeasureReport.ndjson",
"tests/data/21334.MeasureReport.ndjson",
"tests/data/21335.MeasureReport.ndjson",
"tests/data/21336.MeasureReport.ndjson",
"tests/data/21337.MeasureReport.ndjson",
"tests/data/21338.MeasureReport.ndjson",
)

for resource in export_resources:
resource_type = resource.split(".")[-2]
full_url = f"{input_base_url}{resource}"

param = {
"name": "input",
"part": [
{
"name": "type",
"valueCode": resource_type
},
{
"name": "url",
"valueUri": full_url
}
]
}

payload["parameter"].append(param)

headers = {
"Accept": "application/fhir+json",
"Prefer": "respond-async",
Expand Down

0 comments on commit ff092e9

Please sign in to comment.