Columns in wrong order
johngrimes opened this issue · comments
In the following tests, the columns in the expectation are in the wrong order:
- foreach > nested forEach
- foreach > nested forEach: select & column
In both cases, the order should be:
- id
- contact_type
- name
@johngrimes Do you mean the test should be
{
"expect": [
{
"id": "pt1"
"contact_type": "phone",
"name": "N1",
}
]
}
instead of
{
"expect": [
{
"contact_type": "phone",
"name": "N1",
"id": "pt1"
}
]
}
?
If the order of the field is important, maybe we should change the format of "expect" to something like:
{
"expect": [
[ {"name": "id", "value": "pt1"}
{"name": "contact_type", "value": "phone"}
...
]
[ {"name": "id", "value": "pt2"}
{"name": "contact_type", "value": "phone"}
...
]
]
}
Yes, I think you are right - we might have to change the structure of the expectations. I don't think that objects in JSON are ordered, and the keys could be reordered by parsers.
The order of the columns is important, but the order of the rows should be disregarded.
I've created a thread on Zulip here: https://chat.fhir.org/#narrow/stream/179219-analytics-on-FHIR/topic/Column.20ordering.20in.20SQL.20on.20FHIR.20views
Resolved by #228.