GithubHelp home page GithubHelp logo

Comments (3)

smtth-stve avatar smtth-stve commented on September 27, 2024

@jawalonoski Having the exact same issue listed here. Getting back information that just borderline makes no sense based on my queries. This documentation seriously needs major updating. Not sure how you guys are expecting companies to use your gem if things like this are not addressed in the readme.

from fhir_client.

jawalonoski avatar jawalonoski commented on September 27, 2024

@smtth-stve While it is true that we should update our documentation, insults are not a great way to get help or a productive response. You do realize that you are complaining about a free open-source project, right? If you don't like the gem, move along. Better yet, make a contribution.

@masenmatthews At this point your observations variable is an Array containing FHIR::DSTU2::Observation objects. The result is a “ridiculous amount of information” because that is the result of the search you made.

Each of the ruby objects within that array look like this:
https://github.com/fhir-crucible/fhir_dstu2_models/blob/master/lib/fhir_dstu2_models/fhir/resources/Observation.rb

You can see that this structure maps to the DSTU2 version of the FHIR spec:
http://hl7.org/fhir/DSTU2/observation.html#resource

Let me start with your script with one small change:

client = FHIR::Client.new('http://r2.smarthealthit.org')
# explicitly use DSTU2
client.use_dstu2
reply = client.search(FHIR::DSTU2::Observation, { :search => { :parameters => { 'patient' => "b5b32f55-c4a5-4c4e-aac8-9b08386b2752,0b1242d9-fd7e-4dbf-8e2d-c8428557b720" }}})
observations = reply.resource.entry.map(&:resource)

Now, let's see what we've got. We can use the class definition (linked above) to navigate the object model and print some data to screen.

observations.count # => 50
observations.each {|x| puts x.effective + " - " + x.code.coding.first.display + " - " + x.value.try(:value).to_s }; nil

The put output from that loop produces this:

2015-07-06T07:10:12-04:00 - Hemoglobin A1c/Hemoglobin.total in Blood - 6.2
2009-04-01T13:37:09-04:00 - Calcium - 9.888101113103083
2016-08-15T08:34:23-04:00 - Body Height - 184.37208149819415
2008-01-07T22:52:10-05:00 - Oral temperature - 37
2014-07-09T14:34:58-04:00 - Body Mass Index - 35.92049073258461
2014-07-09T14:34:58-04:00 - Triglycerides - 108
2010-03-20T18:06:24-04:00 - Glucose - 65
2011-05-24T12:36:19-04:00 - Blood Pressure - 
2014-07-09T14:34:58-04:00 - Hemoglobin A1c/Hemoglobin.total in Blood - 5.9
2011-05-24T12:36:19-04:00 - Glucose - 89
2011-05-24T12:36:19-04:00 - Creatinine - 1
2011-05-24T12:36:19-04:00 - Calcium - 9.807423278342613
2011-05-24T12:36:19-04:00 - Sodium - 144
2011-05-24T12:36:19-04:00 - Potassium - 5.004328301838885
2011-05-24T12:36:19-04:00 - Chloride - 102
2011-05-24T12:36:19-04:00 - Carbon Dioxide - 23
2011-05-24T12:36:19-04:00 - Urea Nitrogen - 13
2012-05-25T05:42:13-04:00 - Body Mass Index - 36.23530252855906
2015-07-06T07:10:12-04:00 - Body Height - 184.37208149819415
2007-12-17T01:36:18-05:00 - Blood Pressure - 
2007-12-17T01:36:18-05:00 - Body Mass Index - 28.370362836645747
2008-05-18T01:46:27-04:00 - Glucose - 95
2009-04-01T13:37:09-04:00 - Potassium - 4.962384559196439
2007-11-21T10:13:03-05:00 - Soybean IgE Ab in Serum - 0.259228968017552
2007-11-21T10:13:03-05:00 - Cat dander IgE Ab in Serum - 0.2222243156139423
2007-11-21T10:13:03-05:00 - White oak IgE Ab in Serum - 0.1989811699063049
2015-07-06T07:10:12-04:00 - Body Weight - 120.64247397529012
2016-08-15T08:34:23-04:00 - Sodium - 143
2014-07-09T14:34:58-04:00 - Urea Nitrogen - 20
2014-03-02T00:21:19-05:00 - Blood Pressure - 
2016-08-15T08:34:23-04:00 - Body Weight - 118.67991005830676
2010-03-20T18:06:24-04:00 - Creatinine - 1
2013-06-03T03:43:21-04:00 - Carbon Dioxide - 26
2009-04-01T13:37:09-04:00 - Glucose - 75
2016-11-17T16:54:58-05:00 - Body Mass Index - 33.7519872392562
2012-05-25T05:42:13-04:00 - Hemoglobin A1c/Hemoglobin.total in Blood - 5.9
2014-07-09T14:34:58-04:00 - High Density Lipoprotein Cholesterol - 76
2014-03-02T00:21:19-05:00 - Body Mass Index - 32.063844080909945
2013-06-03T03:43:21-04:00 - Potassium - 5.057501107333054
2015-07-06T07:10:12-04:00 - Creatinine - 1
2011-05-24T12:36:19-04:00 - Body Weight - 123.17489737104194
2012-05-25T05:42:13-04:00 - Glucose - 68
2012-05-25T05:42:13-04:00 - Urea Nitrogen - 10
2012-05-25T05:42:13-04:00 - Creatinine - 1
2012-05-25T05:42:13-04:00 - Potassium - 4.437865365724158
2012-05-25T05:42:13-04:00 - Chloride - 107
2012-05-25T05:42:13-04:00 - Carbon Dioxide - 28
2012-05-25T05:42:13-04:00 - Calcium - 8.937266209963536
2012-05-25T05:42:13-04:00 - Sodium - 136
2010-12-13T07:03:12-05:00 - Oral temperature - 37

Hope this helps.

from fhir_client.

EtienneDepaulis avatar EtienneDepaulis commented on September 27, 2024

@smtth-stve not really the correct attitude regarding the usefulness of this gem ! We do use this gem in production on many of our internal and external services and it works really well.
As every open-source project it is not perfect but when we find an issue, we try to contribute by fixing it, not by insulting the maintainers ...

from fhir_client.

Related Issues (20)

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.