Giter Club home page Giter Club logo

geekmdtravis / geekmdsuite Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.51 MB

A software suite designed to compliment preventative medicine practices or practices that employ technologies common to those practices. Core and Analytics API users will find complex object creation to be simple. The web API is robust, serves XML and JSON, provides API endpoints for persistence of core objects, and analytics modules which can be extended to web API users who do not have patient data in our persistence infrastructure.

Home Page: https://www.geekmd.io

C# 100.00%

geekmdsuite's Issues

QUESTION: Redesign Analytics Controllers?

Should analytics services process only data from GET requests, or should they make DB calls based on patient Id's, etc? Consider redesigning current for flexibility in services provided.

Allow Overriding the HTTP Method

Allow overriding HTTP method

Some proxies support only POST and GET methods. To support a RESTful API with these limitations, the API needs a way to override the HTTP method.

Use the custom HTTP Header X-HTTP-Method-Override to overrider the POST Method.

Controllers should provide 'Example' data.

Contract all entity classes to provide an "Example" as an assistance to developers using the API.

E.g. .../api/controller/expample

Yields JSON object which represents the objected served by that controller.

FEATURE: Give enumerable's fixed values.

When entities are stored in a database, their enum properties will have their value stored as an integer. In order to keep the 'reordering', addition, or subtraction of enum items from becoming a problem all enums are owned by entities should have discrete values associated with them.

FEATURE: Patient class should contain list of active chronic medical conditions.

Several composite scores and other risk stratification tools will need to have access to information about a patient's health. Eg. existence of diabetes, hypertension, and prior diagnosis of atherosclerotic cardiovascular disease are necessary for the proper calculate of the ASCVD 10-year risk score.

The approach we will take is adding a new property called "Comorbidities" which is a list of enum type Comorbidity. This way lists can be parsed when the patient object is utilized by methods or classes without having to make additional database calls or perform additional queries.

Update HTTP Status Codes

https://raw.githubusercontent.com/for-GET/http-decision-diagram/master/httpdd.png
200 – OK – Eyerything is working. Empty arrays should be returned as 200 OK.
201 – OK – New resource has been created
204 – OK – The resource was successfully deleted; this is not meant to return an object of any sort. This is not for empty arrays.

304 – Not Modified – The client can use cached data

400 – Bad Request – The request was invalid or cannot be served. The exact error should be explained in the error payload. E.g. „The JSON is not valid“
401 – Unauthorized – The request requires an user authentication
403 – Forbidden – The server understood the request, but is refusing it or the access is not allowed.
404 – Not found – There is no resource behind the URI. This is not for empty lists for successful requests. Code already has a number of these implemented, incorrect.
422 – Unprocessable Entity – Should be used if the server cannot process the enitity, e.g. if an image cannot be formatted or mandatory fields are missing in the payload.

500 – Internal Server Error – API developers should avoid this error. If an error occurs in the global catch blog, the stracktrace should be logged and not returned as response.

REFACTOR: Move all 'entity' responsibility to the core library objects.

Currently there is excessive abstraction in the code. It makes sense to simply bring a few features from the ObjectEntity classes back tot he base Object class and simply remove the abstraction. this has already been performed for the Patients class and should be performed for all other core classes.

Provide filtering, sorting, field selection and paging

Filtering:

Use a unique query parameter for all fields or a query language for filtering.

GET /cars?color=red Returns a list of red cars
GET /cars?seats<=2 Returns a list of cars with a maximum of 2 seats
Sorting:

Allow ascending and descending sorting over multiple fields.

GET /cars?sort=-manufactorer,+model
This returns a list of cars sorted by descending manufacturers and ascending models.

Field selection

Mobile clients display just a few attributes in a list. They don’t need all attributes of a resource. Give the API consumer the ability to choose returned fields. This will also reduce the network traffic and speed up the usage of the API.

GET /cars?fields=manufacturer,model,id,color
Paging

Use limit and offset. It is flexible for the user and common in leading databases. The default should be limit=20 and offset=0

GET /cars?offset=10&limit=5
To send the total entries back to the user use the custom HTTP header: X-Total-Count.

Links to the next or previous page should be provided in the HTTP header link as well. It is important to follow this link header values instead of constructing your own URLs.

Link: https://blog.mwaysolutions.com/sample/api/v1/cars?offset=15&limit=5; rel="next",
https://blog.mwaysolutions.com/sample/api/v1/cars?offset=50&limit=3; rel="last",
https://blog.mwaysolutions.com/sample/api/v1/cars?offset=0&limit=5; rel="first",
https://blog.mwaysolutions.com/sample/api/v1/cars?offset=5&limit=5; rel="prev",

Use Error Payloads with HTTP Status Code Responses

{
    "errors": [
           "userMessage": "Sorry, the requested resource does not exist",
           "internalMessage": "No patient was found in the database",
           "code": 34,
           "moreInfo": "http://dev.oururl.com/docs/errors"
      ]
}

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.