Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Latest commit

 

History

History
131 lines (86 loc) · 3.36 KB

File metadata and controls

131 lines (86 loc) · 3.36 KB

Table of Contents

Update

This works as a data pipeline by handling and updating patient and allergy data from the Patient Records Database from the data source to the MongoDB Data Lake

Command

curl http://localhost:3000/api/v1/update -X PUT

Response

Success: The response is a 200 status code.

Data not transferred: When the data is not transferred and updated in the Data Lake (ex. can't access database), the response is a 500 status code.

Data Source error: When there is an error calling the APIs associated with the data source, the response is a 502 status code.

Generate

This is used as an alternative data pipeline to the data source by using locally generated Synthea data to populate the MongoDB Data Lake

Command

curl http://localhost:3000/api/v1/generate -H "Content-Type: application/json" -X PUT -d "@apidata.json"

Response

Success: The response is a 200 status code.

Data not transferred: When the data is not transferred and updated in the Data Lake (ex. can't access database), the response is a 500 status code.

Population

This returns the total population of the patients in a given state.

{
	"population": Int
}

Command

curl http://localhost:3000/api/v1/population -X GET

Response

Success: The response is a 200 status code. The response body is a JSON object containing the population.

Internal Error: When there is an internal error (ex. can't access database), the response is a 500 status code. The response body is a JSON object containing an error message.

Cities

This returns a list of cities where there are patients in a given state.

{
	"cities": [{
		"city": String,
		"population": Int,
		"allergies": [{
			"allergy": String,
			"type": String,
			"developed": [Int], //age
			"outgrown": [Int] //age
		}]
}

Command

curl http://localhost:3000/api/v1/cities -X GET

Response

Success: The response is a 200 status code. The response body is a JSON object containing the list of cities.

Internal Error: When there is an internal error (ex. can't access database), the response is a 500 status code. The response body is a JSON object containing an error message.

Allergies

This returns a list of allergies that are present in the Data Lake.

{
	"allergies": [String]
}

Command

curl http://localhost:3000/api/v1/allergies -X GET

Response

Success: The response is a 200 status code. The response body is a JSON object containing the list of allergies.

Internal Error: When there is an internal error (ex. can't access database), the response is a 500 status code. The response body is a JSON object containing an error message.

License

Copyright 2019 IBM Corp. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.