arnabnference / personal

0 stars 0 forks source link

Support for WHO trials #3

Open arnabnference opened 3 years ago

arnabnference commented 3 years ago

Add support for searching WHO trials. Implement logic to allow the user to search for clinical trials in clinicaltrials.gov data, the WHO data or BOTH. There will be a new field in the records (Mongo) and a new column in HyC data that will indicate the source of the data. So the user will have an option to choose the data source, (Only CT, Only WHO, BOTH).

arnabnference commented 3 years ago

https://docs.google.com/document/d/1OgNCKWlFQ-w5v6VdEVEoH-86LS6NgVS8dEpa3uzIDmE/edit https://arnab.nferx.com/records/results?token=+"enrollment"%3A%28>%3D+210+and+<+700%29

arnabnference commented 3 years ago

rest attached


POST https://preview.nferx.com/dv/clinical_trial_20191205/semantics/v2/get_column_data?corpus=clinical_trial HTTP/1.1
accept: application/json, text/plain, */*
accept-encoding: gzip, deflate, br
accept-language: en-GB,en-US;q=0.9,en;q=0.8
content-length: 291
content-type: application/json
cookie: csrftoken=Q6IOuVye9r8TH3vAnkVvGcMzb2JHFKGD; sessionid=ar2fq32gz13lsi11jqii3u9i6ry84ss3
origin: https://preview.nferx.com
referer: https://preview.nferx.com/records/results?token=+%22enrollment%22%3A%28%3E%3D+210+and+%3C+700%29
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
x-xsrf-token: Q6IOuVye9r8TH3vAnkVvGcMzb2JHFKGD

{
    "cohort":{
        "definition":[{
            "type":"filter",
            "operation":{
                "operator":"and",
                "operands":[
                    {
                        "operator":"gte",
                        "key":"enrollment",
                        "value":210
                    },
                    {
                        "operator":"lt",
                        "key":"enrollment",
                        "value":700
                    }
                ]
            }
        }],
        "select":["trial_id"]
    },
    "max_count":1000000000,
    "minimal":false,
    "exact_tag_match":true,
    "only_unique":true
}

Response

HTTP/1.1 200 OK
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Origin: *
Content-Length: 1174
Content-Type: application/json; char-set: utf-8
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
Date: Thu, 15 Oct 2020 06:05:05 GMT
Connection: close
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload;

{
  "tokens": [
    "enrollment:210$to$179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "enrollment:-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000$to$699.9"
  ],
  "not_tokens": null,
  "doc_tokens": [
    "trial_id"
  ],
  "cohort_count": 51172,
  "total_count": 354363,
  "sample_size": 1000000000,
  "scale_factor": 0.000051172,
  "corpus": "corpus",
  "parsed_query": {
    "cohort": {
      "definition": [
        {
          "type": "filter",
          "operation": {
            "operator": "and",
            "operands": [
              {
                "operator": "gte",
                "key": "enrollment",
                "value": 210
              },
              {
                "operator": "lt",
                "key": "enrollment",
                "value": 700
              }
            ]
          }
        }
      ],
      "select": [
        "trial_id"
      ]
    }
  },
  "result": [
    {
      "record_id": {
        "type": "integer",
        "value": 51172
      },
      "trial_id": {
        "type": "integer",
        "value": 51172
      }
    }
  ],
  "success": true
}