← Back to team overview

dhis2-devs team mailing list archive

[Bug 1512098] [NEW] IN operator in trackedEntityInstances Web API endpoint not working

 

Public bug reported:


IN operator in trackedEntityInstances Web API endpoint not working in tracker module

When I used the web request below,


https://domain.name/demo/api/trackedEntityInstances.json?ou=WmxhguWbumu&fields=orgUnit,trackedEntityInstance,attributes[displayName,attribute,value]&filter=VPd258dmpNi:IN:1;2

I get this response,

HTTP Status 500 - Request processing failed; nested exception is
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST
node: ( near line 1, column 342 [select distinct tei from
org.hisp.dhis.trackedentity.TrackedEntityInstance tei left join fetch
tei.attributeValues where tei.organisationUnit.uid in ('WmxhguWbumu')
and exists (from
org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue
teav where teav.entityInstance=tei and teav.attribute.uid='VPd258dmpNi'
and teav.valuein('1','2'))]

And looking at the error, it seams this "...and teav.valuein( ......"
should be  "....and teav.value in(..."

 This affects 2.21
Build 20850

** Affects: dhis2
     Importance: Undecided
         Status: New

** Attachment added: "Screenshot showing error returned"
   https://bugs.launchpad.net/bugs/1512098/+attachment/4510350/+files/IN%20operator%20not%20working%20in%20trackedEntityInstances%20API%20endpoint.png

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1512098

Title:
  IN operator in trackedEntityInstances Web API endpoint not working

Status in DHIS:
  New

Bug description:
  
  IN operator in trackedEntityInstances Web API endpoint not working in tracker module

  When I used the web request below,

  
  https://domain.name/demo/api/trackedEntityInstances.json?ou=WmxhguWbumu&fields=orgUnit,trackedEntityInstance,attributes[displayName,attribute,value]&filter=VPd258dmpNi:IN:1;2

  I get this response,

  HTTP Status 500 - Request processing failed; nested exception is
  org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST
  node: ( near line 1, column 342 [select distinct tei from
  org.hisp.dhis.trackedentity.TrackedEntityInstance tei left join fetch
  tei.attributeValues where tei.organisationUnit.uid in ('WmxhguWbumu')
  and exists (from
  org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue
  teav where teav.entityInstance=tei and
  teav.attribute.uid='VPd258dmpNi' and teav.valuein('1','2'))]

  And looking at the error, it seams this "...and teav.valuein( ......"
  should be  "....and teav.value in(..."

   This affects 2.21
  Build 20850

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1512098/+subscriptions


Follow ups