Open agusenko opened 8 years ago
I added a custom search parameter Flag-status:
insert into searchparameter(id,version_id,resource,created_at,updated_at) values ( 'Flag-status','Flag-status-1', ' {"id": "Flag-status", "url": "http://hl7.org/fhir/SearchParameter/Flag-status", "base": "Flag", "code": "status", "date": "2016-03-31T08:01:25+11:00", "name": "status", "type": "string", "xpath": "f:Flag/f:status", "contact": [{"telecom": [{"value": "http://hl7.org/fhir", "system": "other"}]}, {"telecom": [{"value": "http://www.hl7.org/Special/committees/pafm/index.cfm", "system": "other"}]}], "publisher": "Health Level Seven International (Flag Administration)", "expression": "Flag.status", "xpathUsage": "normal", "description": "status of the Flag", "resourceType": "SearchParameter"} ' , current_timestamp,current_timestamp );
But this fhir_search query: SELECT fhir_search('{"resourceType": "Flag", "queryString": "status=active"}');
throws an error Error: NORMALIZE: Not registered search type [code]
What did I do wrong?
Alex, read the code, looks like you missed some essential attribute in searchparameter.
Create SP by analogy with working one
It works! Thanks! ))
I added a custom search parameter Flag-status:
insert into searchparameter(id,version_id,resource,created_at,updated_at) values ( 'Flag-status','Flag-status-1', ' {"id": "Flag-status", "url": "http://hl7.org/fhir/SearchParameter/Flag-status", "base": "Flag", "code": "status", "date": "2016-03-31T08:01:25+11:00", "name": "status", "type": "string", "xpath": "f:Flag/f:status", "contact": [{"telecom": [{"value": "http://hl7.org/fhir", "system": "other"}]}, {"telecom": [{"value": "http://www.hl7.org/Special/committees/pafm/index.cfm", "system": "other"}]}], "publisher": "Health Level Seven International (Flag Administration)", "expression": "Flag.status", "xpathUsage": "normal", "description": "status of the Flag", "resourceType": "SearchParameter"} ' , current_timestamp,current_timestamp );
But this fhir_search query: SELECT fhir_search('{"resourceType": "Flag", "queryString": "status=active"}');
throws an error Error: NORMALIZE: Not registered search type [code]
What did I do wrong?