coforma / acme-tech-challenge

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

Get list of disaster impacts to facility #37

Open malak-coforma opened 2 years ago

malak-coforma commented 2 years ago

Description

Endpoint acme/disaster/list
Method GET
Roles Government Systems Coordinator, Facility System Administrator

See a facilities list of summaries for patient impacts during a disaster. Functionally identical to #36, just in list format.

Arbitrarily return the first 10, we can add pagination later after feedback if needed.

User Story

As a Government Systems Coordinator or Facility System Administrator I want to see a summary of disaster impacts So that I can understand how the facility has responded to disasters over time Because I need to evaluate if facilities are meeting standards of care during disasters.

Request Body

{
  "facilityNpi": int,
}

Response Body

200

[
  {
    "disasterId": int,
    "disasterName": string,
    "disasterStartDate": date,
    "disasterEndDate": date,
    "unaffected": int,
    "injured": int,
    "illInFacility": int,
    "illNotInFacility": int,
    "deceased": int,
    "isolated": int,
  },
  ...
]

400

If request body sent is syntactically invalid.

403

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

422

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

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 403 if request is made by a role other than a Government Systems Coordinators or Facility System Administrators.
  4. Returns 422 if request body is missing required data.
  5. Returns 422 if the request body contains data that doesn't make sense.

Tech Notes

Overall schema plan (Lucidchart)

Image

malak-coforma commented 2 years ago

Duplicated by #53, closing this.