-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
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
SNOMED Hydrating, Filtering, Special MR Generation #1648
base: develop
Are you sure you want to change the base?
Changes from 1 commit
6e2f2cf
9dfda6c
f35535f
1565f67
0033587
8c132e8
b5e9d1a
4df103b
bb865d7
28fb18b
4f48c40
b823225
28b190c
9363f91
f3fd24f
21e3e3f
e7eb48f
d0b04b6
960040b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Refs: #1442
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add documentation explaining what it does and how to use it, please. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,24 +113,22 @@ export function convertHtmlTablesToCsv(html: string) { | |
} | ||
|
||
function main() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. utility to call in the command line |
||
const filePath = process.argv[2]; // Get the file path from command line arguments | ||
const filePath = process.argv[2]; | ||
|
||
if (!filePath) { | ||
console.error("Please provide an HTML file path."); | ||
process.exit(1); | ||
} | ||
|
||
try { | ||
const htmlContent = readFileSync(filePath, "utf8"); // Read the HTML file content | ||
const csvContent = convertHtmlTablesToCsv(htmlContent); // Convert HTML to CSV | ||
const htmlContent = readFileSync(filePath, "utf8"); | ||
const csvContent = convertHtmlTablesToCsv(htmlContent); | ||
|
||
// Construct the CSV file path by changing the extension | ||
const csvFilePath = path.join( | ||
path.dirname(filePath), | ||
path.basename(filePath, path.extname(filePath)) + ".csv" | ||
); | ||
|
||
// Write the CSV content to the new file | ||
writeFileSync(csvFilePath, csvContent); | ||
console.log(`CSV file has been created at: ${csvFilePath}`); | ||
// eslint-disable-next-line | ||
|
@@ -139,7 +137,6 @@ function main() { | |
} | ||
} | ||
|
||
// Call main if this script is run directly | ||
if (require.main === module) { | ||
main(); | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the main customer facing output of this PR. A script that for a given customer, gets all their patients consolidated data and performs the filtering and MR summary generation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Full script for running this whole process |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add documentation explaining what it does and how to use it, please. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { bundleToHtml } from "@metriport/core/external/aws/lambda-logic/bundle-to-html"; | ||
import fs from "fs"; | ||
|
||
// Check if a file path is provided | ||
if (process.argv.length < 3) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. utility to call in command line |
||
console.log("Usage: node medical-records-local.js <path-to-json-file>"); | ||
process.exit(1); | ||
|
@@ -11,10 +10,8 @@ const filePath = process.argv[2]; | |
const bundle = fs.readFileSync(filePath, "utf8"); | ||
const bundleParsed = JSON.parse(bundle); | ||
|
||
// FHIR Bundle | ||
const html = bundleToHtml(bundleParsed); | ||
|
||
// Determine the output file name by replacing .json with .html | ||
const outputFilePath = filePath.replace(".json", ".html"); | ||
|
||
fs.writeFileSync(outputFilePath, html); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add documentation explaining what it does and how to use it, please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grabbing conditions linked to medications.
This gets us a few more conditions but which empirically seem to not be the most valuable. Optional to keep this, though my preference is to default on the side of getting as much data from the convert and filtering out downstream.