diff --git a/utils/fhir-server-import.py b/utils/fhir-server-import.py index 454ad62..f0d9ae3 100755 --- a/utils/fhir-server-import.py +++ b/utils/fhir-server-import.py @@ -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",