We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be useful to be able to export as a CSV to share with healthcare professionals.
I've made a node script to do this:
const converter = require("json-2-csv"); const fs = require("fs"); const input = require("./backup20230818T2113110100.json"); const flat = []; const newRow = (date, time, logType, details) => ({ date, time, logType, details, }); for (const day of input?.days) { // TODO: symptomOverviews for (const symptom of day.symptoms) { for (const log of symptom?.logs) { flat.push( newRow( day.date, log.time, "symptom", `${log.key}, intensity: ${log.pain}/5`, ), ); } } for (const log of day.logs) { flat.push(newRow(day.date, log.time, "note", log.key)); } for (const med of day.meds) { flat.push(newRow(day.date, med.time, "medication", med.key)); } for (const meal of day.meals) { flat.push( newRow( day.date, meal.time, "meal", meal.detail ? `${meal.key}. ${meal.detail}` : meal.key, ), ); } // TODO: wakeUp and goToBed } flat.sort((a, b) => { const dateTime = (n) => new Date(`${n.date}T${n.time}:00Z`); return dateTime(b) - dateTime(a); }); const output = converter.json2csv(flat); fs.writeFileSync("./diary.csv", output);
To use, save the backup from the app, and copy it to your working folder as backup.json. Save the script above as convert.js.
backup.json
convert.js
Then, run:
npm install json-2-csv@5.0.1 node ./convert.js
The output will be saved as diary.csv.
diary.csv
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be useful to be able to export as a CSV to share with healthcare professionals.
I've made a node script to do this:
To use, save the backup from the app, and copy it to your working folder as
backup.json
. Save the script above asconvert.js
.Then, run:
The output will be saved as
diary.csv
.The text was updated successfully, but these errors were encountered: