OHDSI / ROhdsiWebApi

An R package for interfacing with a WebAPI instance
https://ohdsi.github.io/ROhdsiWebApi
10 stars 17 forks source link

Add one or more vignettes #53

Closed schuemie closed 3 years ago

schuemie commented 4 years ago

For example just walking through the test code here

gowthamrao commented 4 years ago

Add to vignette https://github.com/OHDSI/ROhdsiWebApi/issues/37#issuecomment-618177373

schuemie commented 4 years ago

@gowthamrao: When you have time, would you mind drafting the vignette?

gowthamrao commented 4 years ago

Add insights from this discussion to Vignette https://github.com/OHDSI/ROhdsiWebApi/issues/60

gowthamrao commented 4 years ago

Model Vignette (in terms of length and style) based on http://ohdsi.github.io/DatabaseConnector/articles/UsingDatabaseConnector.html

ablack3 commented 4 years ago

Can we change the vignette so that it can be knitted without requiring access to a webapi server provided it has not changed since the last time it was knitted? Maybe we can use the cache = TRUE option to cache the chunks and not rerun them unless the vignette actually changes.

gowthamrao commented 4 years ago

Thank you @ablack3 Would you be able to make the initial attempt and do a PR?

ablack3 commented 4 years ago

I'm getting hung up on the post example in the vignette. @gowthamrao Are you able to successfully run the code below?


library(ROhdsiWebApi)
baseUrl <- 'http://api.ohdsi.org:80/WebAPI'

jsonExpression <- '{
  "items": [
    {
      "concept": {
        "CONCEPT_ID": 81097,
        "CONCEPT_NAME": "Feltys syndrome",
        "STANDARD_CONCEPT": "S",
        "STANDARD_CONCEPT_CAPTION": "Standard",
        "INVALID_REASON": "V",
        "INVALID_REASON_CAPTION": "Valid",
        "CONCEPT_CODE": "57160007",
        "DOMAIN_ID": "Condition",
        "VOCABULARY_ID": "SNOMED",
        "CONCEPT_CLASS_ID": "Clinical Finding"
      },
      "isExcluded": true,
      "includeDescendants": false,
      "includeMapped": false
    },
    {
      "concept": {
        "CONCEPT_ID": 80809,
        "CONCEPT_NAME": "Rheumatoid arthritis",
        "STANDARD_CONCEPT": "S",
        "STANDARD_CONCEPT_CAPTION": "Standard",
        "INVALID_REASON": "V",
        "INVALID_REASON_CAPTION": "Valid",
        "CONCEPT_CODE": "69896004",
        "DOMAIN_ID": "Condition",
        "VOCABULARY_ID": "SNOMED",
        "CONCEPT_CLASS_ID": "Clinical Finding"
      },
      "isExcluded": false,
      "includeDescendants": true,
      "includeMapped": false
    },
    {
      "concept": {
        "CONCEPT_ID": 4035611,
        "CONCEPT_NAME": "Seropositive rheumatoid arthritis",
        "STANDARD_CONCEPT": "S",
        "STANDARD_CONCEPT_CAPTION": "Standard",
        "INVALID_REASON": "V",
        "INVALID_REASON_CAPTION": "Valid",
        "CONCEPT_CODE": "239791005",
        "DOMAIN_ID": "Condition",
        "VOCABULARY_ID": "SNOMED",
        "CONCEPT_CLASS_ID": "Clinical Finding"
      },
      "isExcluded": false,
      "includeDescendants": true,
      "includeMapped": false
    }
  ]
}'
rExpression <- RJSONIO::fromJSON(jsonExpression)
conceptSetName <- '[ROhdsiWebApi Vignette] Rheumatoid Arthritis concept set'
ROhdsiWebApi::postConceptSetDefinition(baseUrl = baseUrl, 
                                       conceptSetDefinition = rExpression, 
                                       name = conceptSetName)
#> Error in postDefinition(name = name, baseUrl = baseUrl, category = "conceptSet", :

Created on 2020-07-14 by the reprex package (v0.3.0)

gowthamrao commented 3 years ago

tagging @azimov as he experienced similar issue

azimov commented 3 years ago

I removed the execution of posts in the vignette is #180, whoever produces the package documentation for github should

1) Set a good web api endpoint before generating the pdf doc that gets uploaded to github 2) Set eval= TRUE for the parts of the vignette that requires a conseptset/cohort to be posted to WebApi 3) Make sure the posted definitions are cleaned up from the webapi instance 4) Run the package maintenance script to remove the old pdf and create the new docs 5) Commit and push the new pdf.

The issue with posting concept sets should have also been fixed in #179

gowthamrao commented 3 years ago

Thank you @azimov !