Skip to content

Commit

Permalink
add copy of sql-on-fhir test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Sep 9, 2024
1 parent 01f3257 commit e3ccdd4
Show file tree
Hide file tree
Showing 21 changed files with 6,044 additions and 0 deletions.
485 changes: 485 additions & 0 deletions sql-on-fhir/basic.json

Large diffs are not rendered by default.

239 changes: 239 additions & 0 deletions sql-on-fhir/collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
{
"title": "collection",
"description": "TBD",
"fhirVersion": ["5.0.0", "4.0.1", "3.0.2"],
"resources": [
{
"resourceType": "Patient",
"id": "pt1",
"name": [
{
"use": "official",
"family": "f1.1",
"given": ["g1.1"]
},
{
"family": "f1.2",
"given": ["g1.2", "g1.3"]
}
],
"gender": "male",
"birthDate": "1950-01-01",
"address": [
{
"city": "c1"
}
]
},
{
"resourceType": "Patient",
"id": "pt2",
"name": [
{
"family": "f2.1",
"given": ["g2.1"]
},
{
"use": "official",
"family": "f2.2",
"given": ["g2.2", "g2.3"]
}
],
"gender": "female",
"birthDate": "1950-01-01"
}
],
"tests": [
{
"title": "fail when 'collection' is not true",
"view": {
"resource": "Patient",
"status": "active",
"select": [
{
"column": [
{
"name": "id",
"path": "id",
"type": "id"
},
{
"name": "last_name",
"path": "name.family",
"type": "string",
"collection": false
},
{
"name": "first_name",
"path": "name.given",
"type": "string",
"collection": true
}
]
}
]
},
"expectError": true
},
{
"title": "collection = true",
"view": {
"resource": "Patient",
"status": "active",
"select": [
{
"column": [
{
"name": "id",
"path": "id",
"type": "id"
},
{
"name": "last_name",
"path": "name.family",
"type": "string",
"collection": true
},
{
"name": "first_name",
"path": "name.given",
"type": "string",
"collection": true
}
]
}
]
},
"expect": [
{
"id": "pt1",
"last_name": ["f1.1", "f1.2"],
"first_name": ["g1.1", "g1.2", "g1.3"]
},
{
"id": "pt2",
"last_name": ["f2.1", "f2.2"],
"first_name": ["g2.1", "g2.2", "g2.3"]
}
]
},
{
"title": "collection = false relative to forEach parent",
"view": {
"resource": "Patient",
"status": "active",
"select": [
{
"column": [
{
"name": "id",
"path": "id",
"type": "id"
}
],
"select": [
{
"forEach": "name",
"column": [
{
"name": "last_name",
"path": "family",
"type": "string",
"collection": false
},
{
"name": "first_name",
"path": "given",
"type": "string",
"collection": true
}
]
}
]
}
]
},
"expect": [
{
"id": "pt1",
"last_name": "f1.1",
"first_name": ["g1.1"]
},
{
"id": "pt1",
"last_name": "f1.2",
"first_name": ["g1.2", "g1.3"]
},
{
"id": "pt2",
"last_name": "f2.1",
"first_name": ["g2.1"]
},
{
"id": "pt2",
"last_name": "f2.2",
"first_name": ["g2.2", "g2.3"]
}
]
},
{
"title": "collection = false relative to forEachOrNull parent",
"view": {
"resource": "Patient",
"status": "active",
"select": [
{
"column": [
{
"name": "id",
"path": "id",
"type": "id"
}
],
"select": [
{
"forEach": "name",
"column": [
{
"name": "last_name",
"path": "family",
"type": "string",
"collection": false
},
{
"name": "first_name",
"path": "given",
"type": "string",
"collection": true
}
]
}
]
}
]
},
"expect": [
{
"id": "pt1",
"last_name": "f1.1",
"first_name": ["g1.1"]
},
{
"id": "pt1",
"last_name": "f1.2",
"first_name": ["g1.2", "g1.3"]
},
{
"id": "pt2",
"last_name": "f2.1",
"first_name": ["g2.1"]
},
{
"id": "pt2",
"last_name": "f2.2",
"first_name": ["g2.2", "g2.3"]
}
]
}
]
}
Loading

0 comments on commit e3ccdd4

Please sign in to comment.