fac-15 / Curenetics

https://curenetics.netlify.com/
3 stars 2 forks source link

API for trial info #4

Closed jbrough closed 5 years ago

jbrough commented 5 years ago

we have a basic api that lets you search for all available trails with a km distance of a postcode (full or outcode):

http://35.234.148.3:8090/data/trials/uk/{postcode}/{km}/{sex}/{age}/.json

eg:

http://35.234.148.3:8090/data/trials/uk/YO18/10/m/70/.json

Initially the size attribute is prob the most useful - number of matching trials. We can add other UI-friendly attributes to these results like cost of travel etc.

{
    size: 1,
    results: [{
        Conditions: [
            "Prostate Cancer"
        ],
        Gender: "Male",
        IDInfo: {
            OrgStudyID: "CDR0000495321",
            SecondaryID: "EU-20630",
            NCTID: "NCT00363285"
        },
        Keywords: [
            "adenocarcinoma of the prostate",
            "stage III prostate cancer",
            "stage IV prostate cancer"
        ],
        Locations: [{
                Contact: {
                    Email: "r.t.oliver@qmul.ac.uk",
                    Note: "R. T. Oliver, MD",
                    Phone: "44-207-601-8522",
                    PhoneExt: ""
                },
                Facility: {
                    Address: {
                        City: "London",
                        Country: "United Kingdom",
                        State: "England",
                        Zip: "EC1A 7BE"
                    },
                    Name: "Saint Bartholomew's Hospital"
                },
                Status: "Recruiting"
            },
            {
                Contact: {
                    Email: "",
                    Note: "Simon Hawkyard, MD",
                    Phone: "44-1723-342-085",
                    PhoneExt: ""
                },
                Facility: {
                    Address: {
                        City: "Scarborough",
                        Country: "United Kingdom",
                        State: "England",
                        Zip: "YO12 6QL"
                    },
                    Name: "Scarborough General Hospital"
                },
                Status: "Recruiting"
            }
        ],
        MESHTerms: [
            "Prostatic Neoplasms"
        ],
        MaxAge: "79 Years",
        MinAge: "N/A",
        OverallStatus: "Unknown status",
        XMLName: {
            Space: "",
            Local: "clinical_study"
        }
    }]
}
martinbagshaw commented 5 years ago

Hi Jamie,

We were wondering if there is a way to limit search results from the API to UK only results?

For example, if I add my postcode ('CM2', which I assume should be in a 3 digit format), and limited to 10 kilometres, I receive results results from all over the world for one trial.

http://35.234.148.3:8090/data/trials/uk/CM2/10/m/70/.json

If there is a way to build this in, it would probably be handy for us.

Thanks, Martin

sesola commented 5 years ago

@jbrough, could you help with this please? Thanks

jbrough commented 5 years ago

Hi Martin,

Needs a full postcode or a full and valid outcode at miminum, eg

http://35.234.148.3:8090/data/trials/uk/CM23/10/m/70/.json

I don't think CM2 is a full outcode. But it's a bug that you get results if the postcode doesn't match, will fix it.

Jamie

On Wed, 6 Feb 2019, 10:46 Mr Bagglesworth <notifications@github.com wrote:

Hi Jamie,

We were wondering if there is a way to limit search results from the API to UK only results?

For example, if I add my postcode ('CM2', which I assume should be in a 3 digit format), and limited to 10 kilometres, I receive results results from all over the world for one trial.

http://35.234.148.3:8090/data/trials/uk/CM2/10/m/70/.json

If there is a way to build this in, it would probably be handy for us.

Thanks, Martin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fac-15/Curenetics/issues/4#issuecomment-460978922, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIxETk3EAPaOEqzuNz_OPS2EybQ_efPks5vKrKAgaJpZM4ahFCl .

jbrough commented 5 years ago

Note that some outcodes are first three letters:

http://35.234.148.3:8090/data/trials/uk/w1a/10/m/70/.json

But many are first 4. Providing the full postcode is safest as it will do the correct matching automatically.

Jamie

On Wed, 6 Feb 2019, 15:09 Jamie <jamie1612@gmail.com wrote:

Hi Martin,

Needs a full postcode or a full and valid outcode at miminum, eg

http://35.234.148.3:8090/data/trials/uk/CM23/10/m/70/.json

I don't think CM2 is a full outcode. But it's a bug that you get results if the postcode doesn't match, will fix it.

Jamie

On Wed, 6 Feb 2019, 10:46 Mr Bagglesworth <notifications@github.com wrote:

Hi Jamie,

We were wondering if there is a way to limit search results from the API to UK only results?

For example, if I add my postcode ('CM2', which I assume should be in a 3 digit format), and limited to 10 kilometres, I receive results results from all over the world for one trial.

http://35.234.148.3:8090/data/trials/uk/CM2/10/m/70/.json

If there is a way to build this in, it would probably be handy for us.

Thanks, Martin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fac-15/Curenetics/issues/4#issuecomment-460978922, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIxETk3EAPaOEqzuNz_OPS2EybQ_efPks5vKrKAgaJpZM4ahFCl .

martinbagshaw commented 5 years ago

Hi Jamie,

Thanks for your response.

I have tried a few different combinations of my postcode, but with '10' entered in the url for distance of km, I keep getting San Diego as the top result for me. For example:

http://35.234.148.3:8090/data/trials/uk/cm2/10/m/70/.json

http://35.234.148.3:8090/data/trials/uk/CM27/10/m/70/.json

http://35.234.148.3:8090/data/trials/uk/cm27jp/10/m/70/.json

If we are to have the ability to limit results by kilometres (as mentioned in your comment above regarding the request url), it would be handy to not have to do any further filtering.

Thanks for your assistance, Martin

sesola commented 5 years ago

Hi Jamie. Let me know if you have further inputs to Martin's comments above. Thanks

zurda commented 5 years ago

@sesola @jbrough , We're at the process of using and displaying the data, and just wanted to make sure - is this the best data structure we could get? What we mean is this api is pretty nested, and if there's any chance of getting a flatter data structure it would help us handle search results and filter better.

sesola commented 5 years ago

Thanks Michal.

I’ve just tried to remind Jamie to help with the query.

Let me know if you need anything else

Sola

On 11 Feb 2019, at 18:16, Michal Weizman notifications@github.com wrote:

@sesola @jbrough , We're at the process of using and displaying the data, and just wanted to make sure - is this the best data structure we could get? What we mean is this api is pretty nested, and if there's any chance of getting a flatter data structure it would help us handle search results and filter better.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.