nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
921 stars 277 forks source link

[IDEA] A DB schema viewer in MCA #5912

Open rogin opened 1 year ago

rogin commented 1 year ago

Is your feature request related to a problem? Please describe. Users, when they're not losing the link for the Mirth ERD, rely on a community image to investigate Mirth's schema.

Describe your use case I need this feature so I can write various SQL and channels that interact with the Mirth schema.

Describe the solution you'd like A DB schema viewer in MCA that loads this image (or better!) and shows it to the user.

Describe alternatives you've considered Memorizing the schema, retaining a link to the ERD created by the community

jonbartels commented 1 year ago

There is also a nice HTML rendering at https://github.com/pacmano1/Mirth-Snippets/blob/main/mirth.html

jonbartels commented 1 year ago

I was thinking about how to do this. I found out that one can introspect the schema using JDBC like this http://www.java2s.com/Code/Java/Database-SQL-JDBC/Getalltableschemas.htm

Once you can iterate over the tables, columns, constraints, indexes, etc. from JDBC then that data can be put into a JSON blob and mapped to HTML.

This should be doable in a channel as a prototype then a server-side plugin to expose the API then a client-side plugin to add the "show me" button.

ChristopherSchultz commented 1 year ago

The important part of all of this is being able to understand what all the tables mean. It's great to see visually that d_mm1 and d_mc1 and d_ma1 are all related to one another but if you don't know what's supposed to be in d_mm1 in the first place, it's not useful.

The tables need to be labelled like d_mm1 - Message Metadata for Channel 1 / My Great Channel Name to use useful in any way.

ChristopherSchultz commented 1 year ago

It would be great to have some additional material nearby / referenced where you can find out the answer to the question "what exactly is message metadata?" versus "what exactly is message attachments?" and "what exactly is message content?" and maybe "why bother having message metadata in a table separate from message contents?".

It would be helpful to know for example that a "single message" may appear in more than one record in a table because it represents the message in different stages of the pipeline. That's something I had to discover for myself looking at the table data because, of course, I couldn't be bothered to RTFM.

pacmano1 commented 10 months ago

There is also a nice HTML rendering at https://github.com/pacmano1/Mirth-Snippets/blob/main/mirth.html

https://htmlpreview.github.io/?https://github.com/pacmano1/Mirth-Snippets/blob/main/mirth.html. But if it is truly hosted all the links work on the page.

pacmano1 commented 5 months ago

https://mirthschema.diridium.com/