Skip to content
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

End-to-End Philly Message Parser Workflow #2675

Open
wants to merge 88 commits into
base: main
Choose a base branch
from

Conversation

JNygaard-Skylight
Copy link
Collaborator

@JNygaard-Skylight JNygaard-Skylight commented Oct 4, 2024

PULL REQUEST

Summary

Enables end-to-end use of the Philly Orchestration config. Specifically saving the extended metadata to SQL Server.

Related Issue

Fixes #2416

Acceptance Criteria

Given the env vars DATABASE_SCHEMA='extended', DATABASE_TYPE='sqlserver' and using the orchestration config philadelphia-ecr-viewer :

  • Write out the full eCR data json object returned from the parser into the extended schema tables. Important notes below!!!!!
  • Tests/Test updates for new and updated functions

Additional Information

You will need the following eCR-viewer environment variables set:

# Metadata Config
METADATA_DATABASE_TYPE=sqlserver
METADATA_DATABASE_SCHEMA=extended
SQL_SERVER_USER=sa
SQL_SERVER_PASSWORD=Password1!
SQL_SERVER_SERVER=sqlserver

Primarily you can test this by running the process-message endpoint:

  1. In containers/orchestatrion Start orchestration and the relevant services with docker compose up trigger-code-reference-service message-parser-service ingestion-service fhir-converter-service validation-service orchestration-service ecr-viewer postgres sqlserver --build
  2. You'll want to remove all FHIR bundles that were added to your save source
  3. Hit the message-process endpoint with this body:
{
  "message_type": "ecr",
  "data_type": "ecr",
  "config_file_name": "philadelphia-ecr-viewer.json",
  "message": "<EICR_DATA>",
  "rr_data": "<RR_DATA>"
}
  1. Then confirm that the FHIR bundle has been saved whereever you saved it (the Philly orchestration config saves it to S3, but you should be able to change that to Postgres or Azure), and the metadata has been saved to SQL Server.

To test just the save-fhir-data you need to first get metadata. The extended metadata is quite large so you will not want to write it manually. You can run the message-parser seperately by:

  1. Follow the instructions in the README.md in containers/message-parser to start the service.
  2. Hit the localhost:8080/parse-message with this body:
{
  "message_format": "fhir",
  "parsing_schema_name": "philly_ecr.json",
  "message": "<FHIR_BUNDLE_JSON>"
}
  1. This should return a big JSON full of the metadata

  2. You will need the following ENV variables set:

1) In `containers/ecr-viewer` Start the eCR with `npm run local-dev-sqlserver`.
2) Hit the `save-fhir-data` endpoint with this body:

{
"fhirBundle": "<FHIR_BUNDLE_JSON>",
"metadata": "<METADATA_JSON>",
"saveSource": "postgres" // Or wherever you want
}

3) Then confirm the FHIR bundle is saved in Postgres, and the metadata is in the SQL Server.

## Checklist

- [ ] If this code affects the other scrum team, have they been notified? (In Slack, as reviewers, etc.)

[//]: # (PR title: Remember to name your PR descriptively!)

JNygaard-Skylight and others added 30 commits August 28, 2024 13:07
…-jnygaard-skylight:CDCgov/phdi into josh/update-ecr-save-to-inclide-metadata
…aard-skylight:CDCgov/phdi into josh/save-metadata-in-orchestration
Copy link
Collaborator

@BobanL BobanL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save endpoint can now save to a DB using the extended schema
3 participants