OHDSI / ROhdsiWebApi

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

Export human readable specifications into Word or pdf #8

Closed gowthamrao closed 3 years ago

gowthamrao commented 5 years ago

Atlas generates human readable cohort definitions. During protocol creation process, we tend to copy these specifications into Microsoft Office for each cohort definition. During this process of html to word copy pasting - formatting is lost and so is time.

It would be awesome to have a function where 1 (or n) cohorts are automatically populated into a word/pdf - that may then be merged as an appendix to the main protocol body.

One option would be to read the appropriate API endpoint and render the document using Knitr.

alondhe commented 5 years ago

Hi @gowthamrao -- WebAPI currently does not provide this text directly, rather, the Atlas JavaScript creates it based on the cohort definition expression.

There is an issue open for WebAPI to address this: https://github.com/OHDSI/WebAPI/issues/617

Once that is available, we can add a function here.

gowthamrao commented 4 years ago

@chrisknoll is the Atlas Java script callable thru R? @schuemie have you worked on a similar problem?

chrisknoll commented 4 years ago

Already working on this. Issue is: https://github.com/OHDSI/circe-be/issues/118.

The implementation will be a server side template rendering and the output will be HTML, but I have done some tests and I can get the proper HTML formatting and indentation using <p> tags and margins for indentation so that it looks correct in Word. Should work out, just need to carve out time to finish it off.

gowthamrao commented 4 years ago

@chrisknoll great!

From ROhdsiWebApi perspective, it would be great to 'post' to WebApi the JSON expression and for the API to return the human readable text.

gowthamrao commented 3 years ago

@chrisknoll has created circeR package that performs this.