Code Monkey home page Code Monkey logo

fhir-server's Introduction

FHIR Server for Azure

A .NET Core implementation of the FHIR standard.

CI Build & Deployment Production
Build Status Production Status

FHIR Server for Azure is an open-source implementation of the emerging HL7 Fast Healthcare Interoperability Resources (FHIR) specification designed for the Microsoft cloud. The FHIR specification defines how clinical health data can be made interoperable across systems, and the FHIR Server for Azure helps facilitate that interoperability in the cloud. The goal of this Microsoft Healthcare project is to enable developers to rapidly deploy a FHIR service.

With data in the FHIR format, the FHIR Server for Azure enables developers to quickly ingest and manage FHIR datasets in the cloud, track and manage data access and normalize data for machine learning workloads. FHIR Server for Azure is optimized for the Azure ecosystem:

  • Scripts and ARM templates are available for immediate provisioning in the Microsoft Cloud.
  • Scripts are available to map to Azure AAD and enable role-based access control (RBAC).

FHIR Server for Azure is built with logical separation, enabling developers with flexibility to modify how it is implemented, and extend its capabilities as needed. The logic layers of the FHIR server are:

  • Hosting Layer – Supports hosting in different environments, with custom configuration of Inversion of Control (IoC) containers.
  • RESTful API Layer – The implementation of the APIs defined by the HL7 FHIR specification.
  • Core Logic Layer – The implementation of the core FHIR logic.
  • Persistence Layer – A pluggable persistence provider enabling the FHIR server to connect to virtually any data persistence utility. FHIR Server for Azure includes a ready-to-use data persistence provider for Azure Cosmos DB (a globally replicated database service that offers rich querying over data).

FHIR Server for Azure empowers developers – saving time when they need to quickly integrate a FHIR server into their own applications or providing them with a foundation on which they can customize their own FHIR service. As an open source project, contributions and feedback from the FHIR developer community will continue to improve this project.

Privacy and security are top priorities and the FHIR Server for Azure has been developed in support of requirements for Protected Health Information (PHI). All the Azure services used in FHIR Server for Azure meet the compliance requirements for Protected Health Information.

This open source project is fully backed by the Microsoft Healthcare team, but we know that this project will only get better with your feedback and contributions. We are leading the development of this code base, and test builds and deployments daily.

There are also two managed offerings in Azure. One is a generally available offering called the Azure API for FHIR. The second is the Azure Healthcare APIs. The Azure Healthcare APIs includes the ability to deploy a FHIR server and a DICOM server in a single workspace. These Platform as a Service (PaaS) FHIR servers are backed by the open source project in this repository and offer a turn key solution to provisioning a compliant, secure FHIR service.

Release Notes

To see what is releasing in the FHIR Server, please refer to the releases section on this project. Starting in November 2020, we have tags on the PRs to better describe what is releasing. We have also released documentation on how to test the most recent build.

Documentation

Getting Started

  • Quickstart guides to deploy open source using portal, CLI, and PowerShell.
  • Sql Schema Migration Guide: Describes how to upgrade Schema for Sql Server.
  • Register a resource application: Learn how to register a resource application, which is an Azure Active Directory representation of the FHIR server API.
  • Register a client application: Learn how to register a client application registration, which is an Azure Active Directory representation of an application that can be used to authenticate on behalf of a user and request access to resource applications.

Core FHIR Capabilities

  • Azure Healthcare APIs FHIR documentation: Includes all FHIR service documentation which has many conceptual, how-to guides, and tutorials that can be leveraged in the open-source as well.
  • Features: This document lists the main features of the Azure Healthcare APIs and the Azure API for FHIR. In general, you can use the features of the Azure Healthcare APIs as a view to the SQL open-source FHIR service and the Azure API for FHIR as a view to the Cosmos DB open-source FHIR server.
  • Authentication: Describes the authentication settings for the FHIR server and how to make use of it in development and test scenarios.
  • Roles: Describes how the FHIR Server for Azure role-based access control (RBAC) system works.
  • Search: Describes how search is implemented for the FHIR Server for Azure.

Additional Capabilities

  • Bulk Export: Describes using Bulk Export within the FHIR Server.
  • Convert Data: Describes how to use $convert-data to convert data into FHIR.
  • FHIR Proxy: Secure FHIR Gateway and Proxy to FHIR Servers.

Tutorials & How-to Guides

Blog Posts

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

There are many other ways to contribute to FHIR Server for Azure.

See Contributing to FHIR Server for Azure for more information.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

FHIR® is the registered trademark of HL7 and is used with the permission of HL7.

fhir-server's People

Contributors

abiisnn avatar apurvabhalems avatar brandonpollett avatar brendankowitz avatar caitlinv39 avatar cunninghamjc avatar dependabot[bot] avatar feordin avatar fhibf avatar garamamo avatar hansenms avatar jackliums avatar johnstairs avatar lta-thinking avatar mahajan-xor avatar microsofthealthservice avatar mikaelweave avatar moria97 avatar namadabu avatar poadhika avatar ptaladay avatar rajithaalurims avatar rbans96 avatar rotodd avatar sergeygaluzo avatar tom-markoch avatar tongwu-sh avatar v-iyamauchi avatar v-mserdar avatar yazanmsft 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  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

fhir-server's Issues

Documentation and scripts for creating AAD registrations.

The documentation for creating AAD registrations is currently embedded in the deployment instructions. It should be split out in a separate markdown file (referenced from the deployment instructions). There should also be instructions for Azure CLI.

Limit APIs based on the configured permissions.

Each API we should honor the permission based on the role of the user is in.

Acceptance:

  • Verify user can perform CRUD operation on resources that their role has access to.
  • Verify user cannot perform CRUD operation on any resources that their role does not have access to.

Limit writes based on the configured permissions

The following operations are considered writes: Create, Update, Delete

A write should be limited given the permissions such that it will succeed if:
Update: The filter for the permission would match the new resource and the existing resource
Create: The new resource matches the filter
Delete: The existing resource matches the filter

NOTE: There is an issue with data leakage when an update is attempted and the user doesn't have permission to read the existing resource. If the user knows the policies in force and crafts the resource in such a way that the new one would be allowed, they could determine if the existing resource contains filtered data

Acceptance:

  • A user can update an existing resource when the new and old resource both match the filter
  • A user cannot update an existing resource when the new resource doesn't match the filter
  • A user cannot update an existing resource when the old resource doesn't match the filter
  • A user can create a resource if the resource matches the filter
  • A user cannot create a resource if the resource doesn't match the filter
  • A user can delete a resource if the resource matches the filter
  • A user cannot delete a resource if the resource doesn't match the filter

Support reference search by [id], [type]/[id], and [url]

Enable search capability on reference search parameters with [parameter]=[id] and [parameter]=[url].

http://hl7.org/fhir/search.html#reference

Example:

{
resourceType: "Observation",

...// Stuff

subject: {
    "reference": "Patient/1234"
}
...// Stuff

}

These should work (and are currently supported by HAPI):

GET https://my-fhir-server/Observation?subject=1234
GET https://my-fhir-server/Observation?subject=Patient/1234

Acceptance:

  • Verify that search using [parameter]=[id] works correctly.
  • Verify that search using [parameter]=[type]/[id] works correctly.
  • Verify that search using [parameter]=[url] works correctly against resource which contains full or relative URLs.

Component search not working as expected

Add the following blood pressure Observation to a new FHIR server:
https://www.hl7.org/fhir/observation-example-bloodpressure.json
The systolic component is 107 and diastolic component is 60.
How if I do this search:
http://localhost:53727/Observation?component-code-value-quantity=http://loinc.org|8480-6$lt107
I expect to not get any results, because it is searching for systolic values less than 107. Instead, it returns the resource, because it is matching on the diastolic component.

Remove ExceptionThrowerMiddleware.

This is a test-only middleware component that pollutes the codebase and config. Replace with an E2E test that customizes the middleware pipeline.

Limit reads based on the configured permissions

Read APIs (read, vread, search) should honor the permissions based on the role the user is in.

Acceptance:

  • A user can only read resources that match the permission filters for their roles
  • A user is unable to read a resource that doesn't match the permission filter.

Naming of Authorization Parameters.

Current naming of Authorization parameters is Security:Authentication:*, e.g. Security:Authentication:Mode, etc. It may make sense to rename to Security:Authorization:*

Investigate integration with AAD or IdentityServer for testing scenario

Currently, we are using open source IdentityServer in the FHIR server project so that we can run local integration tests. Since our main goal is to support AAD, we need to evaluate and see if we want to take the hard dependency on AAD (in which case, we might need scripts and what not to be able to setup application for convenience) or if we want to continue support IdentityServer as well as AAD (in which case, we will have to create generic interfaces to abstract some of the difference between the two).

Acceptance:

  • Review the finding and the recommendation with the rest of the team.

Restructure entrypoint executable

  • The current Microsoft.Health.Fhir.Web project should really called something like Microsoft.Health.Fhir.SampleServer.
  • The module approach for service configuration taken in the project is not the standard practice in asp.net core and has too much code that would need to be updated/modified for different environments. Instead, the project should be really lean with code like:
services.AddFhir().AddCosmosDB().AddAuthrorization(...);

Problems with build-time code generator tool

  1. The order of members is not deterministic, potentially leading to the output file marked being as modified in a developer's local repo.
  2. #73 exposed erratic behavior, stemming from the fact that the CSharpCompilation could most system types.

Limit hard delete based on the configured permissions.

A hard delete can only occur if the filter matches the existing resource.

Acceptance:

  • A user can hard delete a resource if the resource matches the filter
  • A user cannot hard delete a resource if the resource doesn't match the filter

Run search E2E tests in parallel

Right now, the parallel execution is disabled because search test needs to setup the data (by deleting known resources first). This is invasive since it's deleting all Patients or all Observation resources and requires the tests to be executed serially. One thing we could do is to attach custom identifiers to the search tests and update the search tests to include this identifier in the search itself. The downside is that string search becomes string search + token search (for identifier) but it should speed up the tests and will not accidentally wipe off data if executed against wrong database.

Empty "actions" in role config throws 500

The following role configuration will throw a 500 error on startup:

{
    "name": "clinician",
    "resourcePermissions": [
        {
            "actions": [
            ]
        }
    ]
},

Expected:

To get a configuration error.

Error message:

image

Remove auto registration of IProvideCapability

The code currently tries to automatically register all classes that implements IProvideCapability as transient. We should remove this logic because:

  1. Different component has different lifetime (they are not all transient)
  2. For component that is manually registered, the runs twice, which could result in unexpected behavior.

App Service Environment (ASE) template

In addition to the "default" Azure deployment template, we need one that deploys into and ASE with an App Gw in front. This will guarantee only HTTPS access and also be the more likely production deployment scenario.

Extract the role the user is in

We need to be able to assign users to roles and extract that role information from the claim so that the appropriate authorization permissions can be applied.

This user story only implements the infrastructure to be able to evaluate authorization permissions based on role but does not actually involve implementing the authorization check itself.

Acceptance:

  • Verify that the roles can be extracted from AAD and IdentityServer claims and the permission assigned to the roles are evaluated.

Add sample RolePermissionJson to Fhir.Core

a) Add a sample RolePermissionJson to the Fhir.Core project
b) Deserialize into a RoleConfiguration object during startup and have it available in memory during runtime.
c) Unit Tests

Acceptance:

  • Verify that the server can read and understand the authorization setting config file.
  • Verify that the server throws error if the authorization setting config file is invalid.

The FHIR NuGet package should be debuggable

We need to make sure the FHIR NuGet package is debuggable and the source is linked correctly for open source community.

Acceptance:

  • Verify that user can debug published FHIR server NuGet packages using Visual Studio.

Document how authentication works

We need a documentation describing how authentication mechanisms are architected and implemented, how customers can manage roles and users, and how customers can manage roles and permissions.

Acceptance:

  • Verify that there is a markdown file describing the authentication architecture, how to manage roles and users, and how to configure roles and permissions.

Documentation for RBAC

We should have documentation for how RBAC works.

Acceptance:

  • Verify that there is a documentation describing how RBAC works.

Problems with invalid date search

Add this resource to a FHIR server:
https://www.hl7.org/fhir/diagnosticreport-example.json
note the field "issued": "2011-03-04T11:45:33+11:00",

Perform the search:
/DiagnosticReport?issued=2011-03-04T10:45:33
It matches. Cool.

Now try this one:
/DiagnosticReport?issued=0-03-04T10:45:33
You get a 500.

Now this one:
/DiagnosticReport?issued=201111111-03-04T10:45:33
It actually matches the document!
So does this one:
/DiagnosticReport?issued=2011jasdlka-03-04T10:45:33

Change error codes for unsupported and invalid search parameters

Proposal:

Invalid search syntax:
/Observation?component-value-quantity=http://loinc.org|8480-6$lt107|http://unitsofmeasure.org|mm[Hg]$ (invalid trailing $) => 400 (current is 403)

Invalid search parameter name: /Observation?xyz=http://loinc.org|8480-6$lt107|http://unitsofmeasure.org|mm[Hg] => 400 (current is 200 with ignored parameter as reflected in self link)

/DiagnosticReport?subject.name=peter => 403 (which is the current behavior)

Use https for local development

ASP.NET core now has tooling to install a trusted localhost TLS certificate, so we should start using https for all local development.

'ap' prefix on a search for an integer quantity does not behave as expected

Given a service where the following returns a single item:
http://localhost:53727/Observation?component-value-quantity=eq107
Then this should also find the item:
http://localhost:53727/Observation?component-value-quantity=ap105
But it does not.

From http://hl7.org/fhir/stu3/search.html#prefix:

the value for the parameter in the resource is approximately the same to the provided value.
Note that the recommended value for the approximation is 10% of the stated value (or for a date, 10% of the gap between now and the date), but systems may choose other values where appropriate

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.