Giter Site home page Giter Site logo

inferno-framework / inferno-reference-server Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 3.0 12.82 MB

Simulated FHIR API for US Core and the Inferno ONC (g)(10) certification tests.

Home Page: https://inferno.healthit.gov/reference-server

License: Apache License 2.0

Dockerfile 0.18% Ruby 1.04% Java 67.11% HTML 4.82% JavaScript 12.06% CSS 14.79%
inferno fhir-server

inferno-reference-server's Introduction

Inferno US Core R4 Reference Server

This is an HL7® FHIR® reference implementation server supporting the US Core R4 IG and SMART Launches.

By default, you can browse the server at

http://localhost:8080/reference-server, and the FHIR endpoint is at http://localhost:8080/reference-server/r4

Running with Docker

The server runs using two containers, one for the server, and one for the database. You can build the containers with docker-compose build and run both containers with docker-compose up.

Note that sometimes on the initial start up, the database initialization might cause the inferno reference server container to not start correctly, so you may need to stop the container with docker-compose down and restart it with docker-compose up .

Resetting the server

You can delete the server's data by stopping the containers with docker-compose down and then running docker volume rm inferno-reference-server_fhir-pgdata to remove the existing volume. Note that the default data will be reloaded when starting the containers.

The database will be initially populated with the resources in ./resources/ the next time the server starts. This folder by default contains 3 files, but you can add additional files in the form of transaction Bundles or individual resources, or you can remove the original files to start with an empty server.
If the server contains any Patient resources the initial loading process will be skipped, but you can force loading the files in this folder by setting the FORCE_LOAD_RESOURCES environment variable to true. Note that if the original files are re-loaded in this way, this will result in duplicate data being populated.

Running without Docker

System Requirements: The reference server requires Java 11 or above.

If you cannot run docker, you will need to create a postgres database.

Once you have done that, update the src/main/resources/hapi.properties to connect datasource.url, datasource.username, datasource.password, datasource.schema (or make your existing postgres db have the provided values).

Once that is done, you can run an instance of the fhir-reference server using ./mvnw jetty:run (Linux/Mac) or .\mvnw.cmd jetty:run (Windows). You should be able to go to localhost:8080 to see information about the fhir server.

Using with Apps

Currently, there is no registration process. To use with an app, use the default client ids:

To use as a public client, use SAMPLE_PUBLIC_CLIENT_ID as the client id.

To use as a confidential client, use SAMPLE_CONFIDENTIAL_CLIENT_ID as the client id, and SAMPLE_CONFIDENTIAL_CLIENT_SECRET as the client secret.

To launch an app from the EHR go to reference-server/app/app-launch

The Bulk Data Token Endpoint is /reference-server/oauth/bulk-token

The registered Bulk Data Client ID is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlZ2lzdHJhdGlvbi10b2tlbiJ9.eyJqd2tzX3VybCI6Imh0dHA6Ly8xMC4xNS4yNTIuNzMvaW5mZXJuby8ud2VsbC1rbm93bi9qd2tzLmpzb24iLCJhY2Nlc3NUb2tlbnNFeHBpcmVJbiI6MTUsImlhdCI6MTU5NzQxMzE5NX0.q4v4Msc74kN506KTZ0q_minyapJw0gwlT6M_uiL73S4.

./resources/ provides the following resources:

  • Patients with ids 85 and 355
  • a Group with id 1a, containing patients 85 and 355 as members.

upload.rb includes the resources above, except the Group with id 1a.

Custom Authentication Token

If you would like to execute requests without going through the process to get a token, you can set the environment variable CUSTOM_BEARER_TOKEN to a value of your choice.

Revoking a token

To revoke a token, go to reference-server/oauth/token/revoke-token

The tokens are currently saved in memory, so if the reference server is restarted, all existing tokens will be invalid

Running Read-Write Mode

By default, the Dockerized server runs in read-only mode – meaning, operations modifying the state of the server are not supported. For example, requests to CREATE, UPDATE, or DELETE a resource will receive a 405 Method Not Allowed error. To adjust this while running Docker, change the READ_ONLY environment variable to false in ./docker-compose.yml. If running without Docker, run ./mvnw jetty:run -DREAD_ONLY=false when starting the server.

Running Tests

Tests can be run with:

./mvnw test

Running Checkstyle

Checkstyle can be run with:

./mvnw checkstyle:check

Contact Us

The Inferno development team can be reached by email at [email protected]. Inferno also has a dedicated HL7 FHIR chat channel.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Trademark Notice

HL7, FHIR and the FHIR [FLAME DESIGN] are the registered trademarks of Health Level Seven International and their use does not constitute endorsement by HL7.

inferno-reference-server's People

Contributors

360dgries avatar arscan avatar bmath10 avatar chris-at-work avatar dehall avatar dependabot[bot] avatar emichaud998 avatar hershilpatel avatar jammjammjamm avatar ms-k1ngk0ng avatar radamson avatar yunwwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

inferno-reference-server's Issues

Typos in Sample Bundles make them invalid

  • Bundle.entry[0].resource.id must match Bundle.entry[0].request.url for PUT
  • Bundle.entry[].request.url: Typo rul instead of url for some entries
  • Bundle.entry[].request.url: Typo Obervation instead of Observation for some entries

Bug in US Core 5.0.1 / USCDI v2, SMART App launch 2.0.0 (1.3.08)

1.3.08 expects the scopes to have the same order.
standalone_requested_scopes = standalone_received_scopes but the order of the scopes is incorrect, it errors out.

standalone_requested_scopes launch/patient openid fhirUser offline_access patient/Medication.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Patient.read patient/Practitioner.read patient/Procedure.read patient/Provenance.read patient/PractitionerRole.read
standalone_received_scopes launch/patient openid fhirUser patient/Medication.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Patient.read patient/Practitioner.read patient/Procedure.read patient/Provenance.read patient/PractitionerRole.read offline_access

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.