coforma / acme-tech-challenge

For Phase 3 of the ACME Tech Challenge
3 stars 1 forks source link

Get multiple facilities' patient summary data #53

Open malak-coforma opened 2 years ago

malak-coforma commented 2 years ago

Description

Endpoint acme/disaster/list
Method GET
Possible Parameters disasterId (int), stateCode (string), startDate (date), endDate (date), statusId (int)
Roles Government Systems Coordinator, Facility System Administrator

Get summaries of all facilities' data within specific query parameters:

User Story

As a Government Systems Coordinator or Facility System Administrator I want to see a summary of patient impact data So that I can get a "big picture" view of how patients are impacted by disasters Because I need to monitor overall quality of care for patients during disasters.

GET Parameters

Parameter Data Type Optional?
disasterId int OPTIONAL
stateCode string OPTIONAL
startDate date OPTIONAL (but required if endDate present)
endDate date OPTIONAL (but required if startDate present)
statusId int OPTIONAL (but should match existing status ID)

Response Body

200

[
  {
    "facilityNpi": int,
    "disasterId": int,
    "unaffected": int,
    "injured": int,
    "illInFacility": int,
    "illNotInFacility": int,
    "deceased": int,
    "isolated": int,
  },
  ...
]

400

If request body sent is syntactically invalid.

If request body sent is not processable (missing or malformed data).

403

This endpoint is not authorized for roles who are not Government Systems Coordinators or Facility System Administrators.

Acceptance Criteria

  1. Returns 200 with response body when well-formatted data is sent by a Government Systems Coordinators or Facility System Administrators.
  2. Returns 400 if request body is malformed.
  3. Returns 400 if request body is missing required data.
  4. Returns 400 if the request body contains data that doesn't make sense.
  5. Returns 403 if request is made by a role other than a Government Systems Coordinators or Facility System Administrators.

Tech Notes

If the state comes in as other than just two letters then reject the input. (cap agnostic)

Overall schema plan (Lucidchart)

Image

TheDanMiller commented 2 years ago

Rolling over