Having problem while creating Search Parameter
Closed this issue · 2 comments
Deleted user commented
Hi, I trying to create new SearchParameter but I having an issue.
I couldn't understand why it Could not resolve element for expression ["patient"] ?
My request
PUT /SearchParameter/TrainingSchedules.patient
content-type: text/yaml
accept: text/yaml
name: patient
type: token
resource: {id: TrainingSchedules, resourceType: Entity}
expression: [[patient]] ```
> The response
```yaml
resourceType: OperationOutcome
text:
status: generated
div: Invalid resource
issue:
- severity: fatal
code: invalid
expression:
- SearchParameter.
diagnostics: Could not resolve element for expression ["patient"]
And my TrainingSchedules structure is
TrainingSchedules.days | string [ ] | A list of available days |
---|
TrainingSchedules.id | string |
---|
TrainingSchedules.patient* | Reference | Owner of the schedule |
---|
The structure of patient attribute
description: Owner of the schedule
path:
- patient
refers:
- Patient
type:
id: Reference
resourceType: Entity
resourceType: Attribute
module: fhir-4.0.1
id: TrainingSchedules.patient
resource:
id: TrainingSchedules
resourceType: Entity
order: 12
isRequired: true
_source: code
isSummary: true
spicyfalafel commented
Hello, @nyeroglu-actimi. _source: code
is intended for Attributes generated by Aidbox. Please remove this field.
Deleted user commented
Thanks @spicyfalafel. The main problem with search parameter is lowercase - uppercase.
Expression in my search parameter was like
expression:
-
- Patient
now :
expression:
-
- patient
- id
Major issue was that.
And second issue was:
We trying to search by id but in query its turned to default code without - id expression.
SELECT "trainingschedules".* FROM "trainingschedules" WHERE
"trainingschedules".resource @> ? LIMIT ? OFFSET ?
- '{"patient":{"code":"b2679cbc-fd85-4292-87e9-ab81273b3b66"}}'