Last active
December 20, 2021 19:52
-
-
Save niquola/02cd26348552c43420e85259aa2c6743 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from list | |
where | |
resource#>'{code,coding}' | |
@> jsonb_build_array( | |
jsonb_build_object( | |
'system', 'http://physicianslab.com/fhir/List/testing-method', | |
'code', {{params.teting-method}}), | |
jsonb_build_object( | |
'system', 'http://physicianslab.com/fhir/List/testing-category', | |
'code', {{params.teting-category}}), | |
jsonb_strip_nulls( | |
jsonb_build_object( | |
'system', 'http://physicianslab.com/fhir/List/batch-status', | |
'code', {{params.batch-status}})), | |
jsonb_strip_nulls( | |
jsonb_build_object( | |
'system', 'http://physicianslab.com/fhir/List/batch-id', | |
'code', {{params.batch-id}})), | |
jsonb_strip_nulls( | |
jsonb_build_object( | |
'system', 'http://physicianslab.com/fhir/List/batch-type', | |
'code', {{params.batch-type}}))) | |
order by resource->>'date' | |
limit {{params.count}} | |
offset {{params.skip}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CREATE INDEX list_code on "list" using GIN ( ( resource#>'{code,coding}' ));