Open Andrzej-Pietrzak opened 8 years ago
What's the status on this issue ?
The reason is when constructing the index name javascript "replace" function is used which will only replace the first occurrence e.g. select fhir_index_parameter('{"resourceType":"Observation","name":"data-absent-reason"}') idx_name = "#{meta.resourceType.toLowerCase()}#{meta.name.replace('-','')}_token" So the index name for the above example is constructed as "name":"observation_data_absent-reason_token"
Suggestion: Solution could be to use split and join instead of replace idxname = "#{meta.resourceType.toLowerCase()}#{meta.name.split('-').join('')}_token"
SELECT fhir_index_parameter('{"resourceType": "Observation", "name": "component-value-quantity"}');
ERROR: Error: syntax error at or near "-"
DETAIL: plv8_init() LINE 195: return plv8.execute.call(plv8, q[0], q.slice(1));