Skip to content

Commit

Permalink
Merge pull request #51 from smart-on-fhir/mikix/better-null-check
Browse files Browse the repository at this point in the history
q_system_use: ignore codeable concepts that are all nulls inside
  • Loading branch information
mikix authored Jul 3, 2024
2 parents 5cd0e5a + 1b97ce2 commit c043285
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SELECT
{{ field }}
FROM rejoined_src
WHERE
{{ field }} IS NOT NULL
{{ utils.is_concept_valid(field) }}
AND (
has_target_system IS NULL
OR NOT has_target_system
Expand Down
5 changes: 5 additions & 0 deletions tests/data/q_system_use/general/expected_procedure_code.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,status,code
missing-system,,"{'id': NULL, 'coding': [{'id': NULL, 'code': NULL, 'display': No system, 'system': NULL, 'userSelected': NULL, 'version': NULL}], 'text': NULL}"
missing-coding,,"{'id': NULL, 'coding': NULL, 'text': No coding}"
empty-coding,,"{'id': NULL, 'coding': [], 'text': NULL}"
bad-system,,"{'id': NULL, 'coding': [{'id': NULL, 'code': NULL, 'display': NULL, 'system': nope, 'userSelected': NULL, 'version': NULL}], 'text': NULL}"
4 changes: 2 additions & 2 deletions tests/data/q_system_use/general/expected_summary.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource,field,numerator,denominator,percentage
# Various edge cases here in procedure
Procedure,cumulus__all,4,12,33.33
Procedure,code,4,12,33.33
Procedure,cumulus__all,4,13,30.77
Procedure,code,4,13,30.77
# Rest are often short happy-path checks to confirm that we look at the right json field
Observation,valueCodeableConcept,0,2,0.00
Observation,cumulus__all,0,2,0.00
Expand Down
1 change: 1 addition & 0 deletions tests/data/q_system_use/general/procedure/0.ndjson
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
{"resourceType": "Procedure", "id": "missing-system", "code": {"coding": [{"display": "No system"}]}}
{"resourceType": "Procedure", "id": "empty-coding", "code": {"coding": []}}
{"resourceType": "Procedure", "id": "missing-coding", "code": {"text": "No coding"}}
{"resourceType": "Procedure", "id": "invalid-code", "code": {"id": "no content"}}
{"resourceType": "Procedure", "id": "missing-code"}

0 comments on commit c043285

Please sign in to comment.