Skip to content

match_cases() example not working with lab data #1

@AmyMikhail

Description

@AmyMikhail

Problem statement:

The match_cases() function example is not working. It appears that there is a bug in godataR::get_labresults_epiwindow(). Although this function is able to retrieve the lab data from Go.Data, the case information based on a query with a list of Go.Data case IDs is failing to export (the export log ID returns NULL).

Here is the json query that is failing:

{
  "filter": {
    "where": {
      "visualId": {
        "$in": ["C-2022-0002", "C-2022-0003", "C-2022-0004"]
      },
      "useDbColumns": "true",
      "dontTranslateValues": "true",
      "jsonReplaceUndefinedWithNull": "true"
    },
    "fields": ["id", "visualId", "firstName", "lastName", "dob", "age.years", "documents.number", "dateOfReporting", "dateOfOnset", "type"]
  }
} 

This query is passed to cases/exports/ as below:

# Send the Go.Data case ID query to Go.Data and fetch the export log ID:
    elid = httr::POST(url =

                        # Construct request API URL:
                        paste0(url,
                               "api/outbreaks/",
                               outbreak_id,
                               "/cases/export?access_token=",
                               get_access_token(url = url,
                                                username = username,
                                                password = password)),
                      # Set the content type:
                      httr::content_type_json(),

                      # Add query:
                      body = query_json_c,
                      encode = "raw") %>%

      # Fetch content:
      httr::content() %>%

      # Extract export log ID from content:
      purrr::pluck("exportLogId")

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions