GithubHelp home page GithubHelp logo

lets-build's Introduction

HAPI-FHIR Let's Build

Precursors

  • Check this project out to your local hard drive.
  • Open it in an IDE
  • Have the following tools installed:

Hour 1 - Build a FHIR Data Mapper

Rationale: When adopting FHIR, a common scenario is needing to convert your existing data into the FHIR model. This can be a challenging first step, but if you approach it systematically it can be easy.

Exercise: For this exercise, we will be building a mapper that converts existing data a CSV file into FHIR Patient and Observation resources.

We'll be using a sample data file from the CDC NHANES (National Health and Nutrition Examination Study) publicly available sample data set. The format of the data set is described at this link but we have reworked the format a bit to add fake patient identities and timestamps to the data.

The input CSV file can be found here: https://github.com/hapifhir/lets-build/blob/main/src/main/resources/sample-data.csv

Approach

The input data looks like the following:

SEQN   , TIMESTAMP               , PATIENT_ID, PATIENT_FAMILYNAME, PATIENT_GIVENNAME, PATIENT_GENDER, WBC, RBC, HB
93704.0, 2020-11-13T07:47:35.964Z, PT00002   , Simpson           , Marge            , F             , 7.4, 0.1, 13.1

Note the columns:

  • SEQN: This is a unique identifier for the test
  • TIMESTAMP: This is the timestamp for the test
  • Patient detail columns (note that the patients repeat so you will want to ):
    • PATIENT_ID: This is the ID of the patient
    • PATIENT_FAMILYNAME: This is the family (last) name of the patient
    • PATIENT_GIVENNAME: This is the given (first) name of the patient
    • PATIENT_GENDER: This is the gender of the patient
  • Test result columns (each of these will be a separate Observation resource):
    • WBC: "White Blood Cell Count": This is a count of the number of white blood cells in your blood (These cells deliver oxygen)
    • RBC: "Red Blood Cell Count": This is a count of the number of red blood cells in your blood (These cells are an important part of the immune system)
    • HB: "Hemoglobin": This a measurement of the amount of hemoglobin protein in your blood (this iron-rich protein carries oxygen, among other things)

Writing a Mapper

Hints:

  • Don't optimize at first! There are lots of ways this code can be made efficient, but it's better to start by getting it working, then worry about performance later.

  • You can use the PATIENT_ID column as the resource ID for the Patient resource. Using a client-assigned ID for your resources makes the outcome predictable, and means that you can re-run your uploader as many times as you like without constantly creating new datasets.

  • You can use the SEQN column as the resource ID for the Observation resources, but you will need to append something to it since there are 3 Observations per row.

Hour 2 - Upload the Resources to a FHIR Server

Bonus - Secure Your FHIR Server

In this exercise we will add simple authentication and authorization to our server. To keep things simple:

  • We will secure only read operations, and we'll leave write operations unsecured. Obviously this isn't a setup you would use for real, but all of the read security principles work exactly the same for writing and can be used for those operations too.

  • We will hardcode our credentials in the server code. This is also not a practice you should ever use in a real system, but it makes it easy to show the concepts and can be replaced with something more robust as needed.

Approach

Open the class ServerAuthorizationInterceptor and

lets-build's People

Contributors

jamesagnew avatar patrick-werner avatar

Watchers

 avatar

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.