Code Monkey home page Code Monkey logo

fastenhealth / fasten-onprem Goto Github PK

View Code? Open in Web Editor NEW
1.4K 15.0 67.0 967.04 MB

Fasten is an open-source, self-hosted, personal/family electronic medical record aggregator, designed to integrate with 100,000's of insurances/hospitals/clinics

License: GNU General Public License v3.0

Go 52.29% JavaScript 0.59% TypeScript 38.89% HTML 7.54% Dockerfile 0.10% Makefile 0.13% Shell 0.04% MDX 0.42%
electronic-health-record electronic-medical-record emr open-source personal-health-record healthcare

fasten-onprem's Introduction

fasten_view

Fasten - On Premise/Self-Hosted

CI Discord Join Request Providers Join Newsletter

Fasten securely connects your healthcare providers together, creating a personal health record that never leaves your hands

Note

NOTE: Fasten is a Work-in-Progress and can only communicate with a limited number of Healthcare Instutions (approx 25,000 at last count). Please fill out this Google Form if you'd like to be kept up-to-date on Fasten

Important

To ensure Fasten's long-term sustainability, we're exploring some funding options. While we're still deciding a long-term monetization strategy, I'm kicking off with a crowdfunding/fundraising experiment for the first 500 users (including a surprise desktop app):

Got questions or want to learn more about our fundraising experiment? Click here to dive into the details & FAQs



newsletter documentation

fasten_view
See more Fasten screenshots

Introduction

Like many of you, I've worked for many companies over my career. In that time, I've had multiple health, vision and dental insurance providers, and visited many different clinics, hospitals and labs to get procedures & tests done.

Recently I had a semi-serious medical issue, and I realized that my medical history (and the medical history of my family members) is a lot more complicated than I realized and distributed across the many healthcare providers I've used over the years. I wanted a single (private) location to store our medical records, and I just couldn't find any software that worked as I'd like:

  • self-hosted/offline - this is my medical history, I'm not willing to give it to some random multi-national corporation to data-mine and sell
  • It should aggregate my data from multiple healthcare providers (insurance companies, hospital networks, clinics, labs) across multiple industries (vision, dental, medical) -- all in one dashboard
  • automatic - it should pull my EMR (electronic medical record) directly from my insurance provider/clinic/hospital network - I dont want to scan/OCR physical documents (unless I have to)
  • open source - the code should be available for contributions & auditing

So, I built it

Fasten is an open-source, self-hosted, personal/family electronic medical record aggregator, designed to integrate with 1000's of insurances/hospitals/clinics

Features

It's pretty basic right now, but it's designed with a easily extensible core around a solid foundation:

  • Self-hosted
  • Designed for families, not Clinics (unlike OpenEMR and other popular EMR systems)
  • Supports the Medical industry's (semi-standard) FHIR protocol
  • Uses OAuth2 (Smart-on-FHIR) authentication (no passwords necessary)
  • Uses OAuth's offline_access scope (where possible) to automatically pull changes/updates
  • Multi-user support for household/family use
  • Condition specific user Dashboards & tracking for diagnostic tests
  • (Future) Vaccination & condition specific recommendations using NIH/WHO clinical care guidelines (HEDIS/CQL)
  • (Future) ChatGPT-style interface to query your own medical history (offline)
  • (Future) Integration with smart-devices & wearables

Getting Started

There are 2 flavors of Fasten:

  • ghcr.io/fastenhealth/fasten-onprem:sandbox - This version only allows you to connect to a handful of Healthcare providers, using Sandbox accounts that are meant for testing, and contain synthetic(fake) data to give you an idea what Fasten will look like, without requiring personal medical information.
  • ghcr.io/fastenhealth/fasten-onprem:main - This version allows you to connect to 25,000+ different Healthcare providers, using your existing accounts. It will allow you to connect and retrieve your personal electronic medical record and store it within Fasten. Be careful, this is YOUR health data

Instructions

GitHub release (latest by date)

First, if you don't have Docker installed on your computer, get Docker by following this install guide.

Next, run the following commands from the Windows command line or Mac/Linux terminal in order to download and start the Fasten docker container.

docker pull ghcr.io/fastenhealth/fasten-onprem:main 

docker run --rm \
-p 9090:8080 \
-v ./db:/opt/fasten/db \
-v ./cache:/opt/fasten/cache \
ghcr.io/fastenhealth/fasten-onprem:main 

Next, open a browser to http://localhost:9090

At this point you'll be redirected to the login page.

Logging In

Before you can use the Fasten BETA, you'll need to Create an Account.

It can be as simple as

  • Username: testuser
  • Password: testuser

Usage

If you're using the sandbox version of Fasten, you'll only be able to connect to Sources using test credentials

https://docs.fastenhealth.com/getting-started/sandbox.html#connecting-a-new-source

FAQ's

See FAQs for common questions (& answers) regarding Fasten

Support

Have questions? Need help? Found a bug? Create an issue and we'll do our best to help you out. You can also join us on Discord to chat with other Fasten users.

Discord Join

Contributing

CI codecov

Please see the CONTRIBUTING.md for instructions for how to develop and contribute to the Fasten codebase.

Work your magic and then submit a pull request. We love pull requests!

If you find the documentation lacking, help us out and update this README.md. If you don't have the time to work on Fasten, but found something we should know about, please submit an issue.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

Jason Kulatunga - Initial Development - @AnalogJ

Licenses

GitHub license

Fundraising & Sponsorships

To ensure Fasten's long-term sustainability, we're exploring some funding options. While we're still deciding a long-term monetization strategy, I'm kicking off with a crowdfunding/fundraising experiment for the first 500 users (including a surprise desktop app):

Got questions or want to learn more about our fundraising experiment? Click here to dive into the details & FAQs

I'd also like to thank the following Corporate Sponsors:

fasten-onprem's People

Contributors

akash-pandey1729 avatar analogj avatar bdruth avatar beckyosb avatar beekter avatar crosskayla avatar ericlathrop avatar hjmuller avatar jc00ke avatar jean-the-coder avatar mohanish2504 avatar mrwacky42 avatar nickmurray47 avatar ohheyalan avatar packagr-io[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fasten-onprem's Issues

RBAC/Role based access control

Parents want to be "editors" on childrens records
Spouses want to be "viewers" on each other
Patient wants to be able to share records with Doctor/caregiver (temporarily & long term)

[AddressBook]

Create an address book of all Doctors, Hospitals and Clinics that a Patient interacted with

  • include contact information and a simple history

[Feature] Multi Factor Auth

What is this

Feature request for multi factor authentication. Considering this is storing private health data it is important that it be as secure as possible.

Why is this needed?

Ideally MFA would be handled by an external authentication provider such as OIDC or Forward Authentication (preferred). However, in order to develop a zero knowledge model, Fasten would require a user-inputted secret, which neither OIDC and Forward Auth make available.

Hence, the MFA burden falls on the app itself. This is a similar problem to what BitWarden/VaultWarden face with their zero knowledge model.

Implementation

Lots of options out there, but I would personally request support for the following modes:

  • Duo.com
  • TOTP
  • WebAuthn

I specifically request that email and SMS 2nd factor not be supported because of how insecure they are.

When is this needed?

Not now. This is obviously an advanced feature and other core features are higher priority in order to deliver basic functionality.

[Patient Profile] Tasks

  • Primary care provider is fake, find a way to determine the real one.
  • Remove fake Latex allergy.
  • Add dates to Allergies
  • Fix Ethnicity
Screen Shot 2023-11-07 at 3 30 57 PM

When syncing, extract non-searchable references from FHIR resources

We attempt to sync all FHIR resources by searching for all resources associated with a Patient ID.
We need to find a way to extract references to certain resources that cannot be searched in this manner.

  //"Binary",
  //"Location",
  //"Medication",
  //"MedicationRequest",
  //"Organization",
  //"Patient",
  //"Practitioner",
  //"Provenance",
  • Others

[Feature] External LDAP or LDAP import

What is this?

Enable the ability to use LDAP for Fasten. To simplify user management, enable the importing from and querying against of an LDAP server for authentication.

Implementation

Import users with live query on login - This is the preferred method, where an import form LDAP is enabled, either as a recurring job, or as a one time user triggered action, against a user-defined filter (e.g. memberOf=cn=fastenUsers,cn=groups,dc=domain,dc=com). Import would create a local user entity, tagged with LDAP and with no password defined. Upon login for an LDAP tagged user, an LDAP lookup is made to verify the password. This ensures that the user is always logged in against their most recent password, however it requires the LDAP server always be available, which is generally a safe assumption with LDAP.

Caching passwords - There is an option to cache the salted passwords locally so that there isn't a dependency on LDAP being live when login occurs, however this method is not recommended. If a user changes their password in LDAP, it would be up to either the Admin or a scheduled job to import the new salted password. This becomes a security risk during the all too common database leaks that are happening these days, e.g. LastPass, because old passwords would live longer than necessary after being changed.

Password Changes - There are two options here depending on if the admin wants to enable write access to the LDAP server. If write access is enabled, then a simple LDAP writeback can be performed upon password changes. If permissions are read only, the administrator can disable password changes for LDAP users and provide an external link to a password change tool.

Workflow

  • Initial Configuration
    • Administrator configures LDAP search filters and access credentials
    • Administrator clicks "Test Import" and Fasten performs an LDAP look up and presents a preview of users who will be imported
    • Administrator clicks "Import" OR relies on a built in sync job (e.g. every 24 hours)
      • Fasten creates a user entity for every user imported. May import additional information such as email, displayName, photo, etc
  • User attempts to login
    • Fasten checks if a user is flagged as LDAP
      • If not flagged as LDAP, regular login pathway is followed
    • Fasten opens a connection and bind request to the LDAP server to authenticate the user
    • If bind succeeds, user is logged in and may proceed as usual.

Security

LDAP protocol requires plaintext password exchange, which would necessitate ldaps for security. Optionally, Fasten may be able to reference the userPassword property of the LDAP query and salt the password internally to perform a comparison using Base64Encode(SHA1(password+salt)+salt). This would replace the second bind with the user submitted plaintext credentials.

When is this needed?

Sooner rather than later. While the current mechanism would work for myself as a single user, I would block rollout to my family contingent on LDAP. The only workaround would be if a functional export/import feature existed that would allow migrating to LDAP-imported accounts down the line.

[Sources] Tasks

  • Fix filtering & Categories
  • Add logos for all Cerner sources
  • Add table for all manually uploaded sources
  • Add overlay if the connected source is older than x days
  • When scrolling down the long list, add a "back to top" button.

[Medical History Report] Tasks

  • Each condition should have a "Summary" in patient friendly (non-clinical) format
  • CareTeam email addresses should be linked if provided.
  • Binary resources should be added under an attachment section
  • If no Location is specified in the Encounter, see if theres an associated Location resource.
  • DiagnosticReports should forward the user to the Observations Report.
  • BUG cannot merge composition types
    • Introduced in #20
  • Add Goals/CarePlan information to the condition
  • Add Pagination & Caching (large histories take 8+ seconds to load)

are all the tiles listed in "add source" actually supposed to work?

Just trying to get started ... clicking "Anthem" tile redirects me to auth'ing Anthem ... but if I try another tile, it just stares back at me ... no action, plenty of errors in the console. e.g. hitting the SSM Health tile doesn't do anything.

Super happy that you're getting this off the ground - lemme know what else would be helpful.

CORS error when connecting to some Epic Sources

When attempting to connect to some Epic Sources, either the OAuth2 flow will fail or the syncing of the resources after getting the authorization token will fail due to a strict CORS configuration for the Epic instance we're trying to connect to.

I tested this against OptumCare East, which I know has their CORS set incorrectly for both their OAuth Endpoints and their FHIR endpoints but I know other health systems sometimes have the OAuth endpoints set correctly but the FHIR ones set incorrectly.

Screen.Recording.2023-02-08.at.12.35.42.PM.mp4

[Billing Report] Tasks

  • Create a billing report page
  • include a summary of insurance information & billing codes for each encounter.
  • Cost of Benefits / Explaination of Benefits

[Lab Report] Tasks

  • Show grouping dropdown, allowing user to select specific DiagnosticReports
  • Add Patient Friendly summary to each Observation type.
  • Add Sort By dropdown
    • Status (acceptable, problematic results)
    • Date
    • Name
    • Report
    • Panel type

Coding Systems

Aetna Source issue

Trying to add the Aetna source immediately results in:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<status>
<statusCode>400</statusCode>
<detail>Bad Request</detail>
<severity>E</severity>
<additionalStatus>
<statusCode>400</statusCode>
<serviceName>v1fhirserverauthoauth2authorization</serviceName>
<detail>Missing client_id in Request</detail>
<severity>E</severity>
<loginAttempts>No Login Attempts made</loginAttempts>
</additionalStatus>
</status>

Url:
https://vteapif1.aetna.com/fhirdemo/v1/fhirserver_auth/oauth2/authorize?redirect_uri=https%3A%2F%2Flighthouse.fastenhealth.com%2Fv1%2Fcallback%2Faetna&response_type=code&response_mode=fragment&state=3b587e1c-7544-4a35-a8b8-383d8e337b5f&client_id=&scope=fhirUser+launch%2Fpatient+patient%2F*.read+profile&aud=https%3A%2F%2Fvteapif1.aetna.com%2Ffhirdemo%2Fv1%2Fpatientaccess&code_challenge=Tgfyx_93THXCgpdtQwDFAuaD8wdLP3vgmTomPhbO5xk&code_challenge_method=S256

Installed via Docker from today's email.

Broken Healthcare Providers/Sources

  • Aetna - missing Production - requested Access. see #33
  • Kaiser - waiting for sandbox creds, requires PKCE with Confidential = true
  • Cigna - requires Audit.
  • CVS - broken portal see #65
  • Anthem - timeout occassionally, requires retries. see #99
  • Optum/Epic/Allscripts sources require CORS during auth. see #64
  • Medicare - 401 - 401 Unauthorized [{\"detail\":\"Authentication credentials were not provided.\"}]"}}"
  • Aetna Sandbox broken.
  • Kaiser prod is broken (extra sandbox scope)

support FHIR launch mode

EMR systems can "launch" external applications with the authentication partially completed. (See Logica) It would be interesting to support this usescase in Fasten, as the self-hosted application could parse the data (users could enter their "selfhosted" url -- including localhost)

https://build.fhir.org/ig/HL7/smart-app-launch/scopes-and-launch-context.html#apps-that-launch-from-the-ehr

http://localhost:9090/fhir-app/launch.html?iss=https%3A%2F%2Fgw.interop.community%2FFastenSandbox%2Fdata&launch=ZrWdC2

No Database file is generated at /opt/fasten/db/

This application looks very promising and I'm so glad something like this is finally being created. I just setup a docker instance, and this is what I found:

When using the following command, no database file is generated:

docker run --name=FastenHealth -p 9090:8080 -v /mnt/12Bay/docker/FastenHealth/db/:/opt/fasten/db/ ghcr.io/fastenhealth/fasten-onprem:main

SubtleCrypto is required, but not checked for and no error presented

crypto.subtle is only available on either secure contexts (HTTPS) or local non-secure contexts (localhost, *.localhost, 127.0.0.1).

When self-hosting things (especially when quickly testing something new) things may be non-local, but not https (e.g. accessed by IP or internal DNS). There should probably be some sort of check when accessing the page (which could be done even before login) as to whether the context is secure and SubtleCrypto is available. The only indication of this issue I have found is a console message when attempting to add a provider (ERROR Error: Uncaught (in promise): TypeError: can't access property "digest", crypto.subtle is undefined)

edit: It may also be desirable to have some sort of way to set a "base url" that users get redirected to when attempting to access fasten from the "wrong" URL, and that is used for any links within the app. The app could refuse to even start if the "base url" is a context that would allow the usage of SubtleCrypto. This is also important if the app were to e.g. send an email, it needs to know what URL to reolve relative paths and such against without the benefit of a user being on a page that it can use to determine that.

enhancements to the record editor/creator for manually entering medical history

as discussed in FHIR Zulip

We've received constant feedback that users would also like the ability to create records themselves:

  • their institution may not be supported by Fasten
  • their institution may be international (and not have a patient-accessible portal)
  • they have old records that no longer exist
  • they have relevant medical data that has never been tracked by an institution
  • etc.

Since our system already uses and understands FHIR documents, we should store patient manually-created documents in the same format, however FHIR editors seem complicated, requiring patients to understand the FHIR spec.


Some ideas for how medical history can be "manually" ingested by Fasten

  • a UI library that generates "simple" forms for each (or multiple) FHIR resource type?
  • using the FHIR Questionnaire resource/wizard for prompting users for their medical information?
  • an ML based system to parse free-text into records.
  • a simple DSL (similar to FSH) that can generate FHIR records.
  • a question/answer style chatbot for generating records

International Sources/Healthcare Institution Endpoints & Documentation

Localization for Fasten

A localization would be great to expand accessibility to people who are not comfortable with English.

i18n (other variants exist) is a frequently used module in self hosted projects. Most of them use Crowdin to aggregate translations. They offer free plan for open source projects.

image

I personally recommend it (as least as translator and proofreader).

Voilà!

I could help you, by promoting me to manager on Crowdin :)

Have a great day

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.