CCA LifePod Member Exp API

(0 reviews)
This API posts CCA Caregiver and Member data to LifePod. This is a scheduled job to run on a daily basis once. Data is formatted to have caregivers and associated members in a parent/child hierarchical model to be posted to LifePod BulkInsert endpoint

home

Overview

This API is used to bulk load caregivers and associated members from CCA systems to LifePod systems through the LifePod InsertUpdate API endpoint. API will be scheduled to run once a day. The request will be a JSON structure with caregivers and members. The response will get a batch ID for that run from LifePod. After a predefined time interval, the Error API will get the response from another LifePod Error endpoint. Error response will be logged into the DB if there are errors.

Both APIs (Member Upload and Bulk Errors) are scheduled in the Anypoint platform.

Member Upload API will POST the JSON request(CareGiver with Recipients) generated after fetching the data from DB to LifePod API. Also, it will update the DB with the received response payload. Whereas, Bulk Errors will run after 4 hours of Member Upload API run to Get all the Errors for that batch and update the DB accordingly.

Use cases covered

  • Fetch Caregiver with Recipients data from the DB
  • Create a JSON payload
  • Post data to BulkInsert endpoint
  • Get a bacthID
  • Fetch error data from Error endpoint with the batchID
  • Update the DB

High-Level Architecture

Design Goals

As a consumer of LifePod API(s), the design was achieved through the LifePod API specifications. LifePod API was designed to consume caregiver and recipient bulk data. Recipients are grouped under a caregiver and are fed as JSON requests to the endpoint. LifePod API receives the request payload and process asynchronously. The response we get is a batch ID.

This batch ID is used in a subsequent call to another endpoint to get the results of the processing of that batch from the earlier request.

resources/Annotation%202020-10-07%20144649-2623acfa-b52a-449b-95f4-9a0da22d2a9f.jpg

resources/Annotation%202020-10-07%20144621-5457933a-9126-4e0f-8248-258329fc9a26.jpg

Primary WorkFlow

Both Member Upload and Bulk Errors API will request for a token from Azure AD with a respective Client ID and Client Secret
On successful authentication, these APIs will call to LifePod API(get-refresh-token) to get the API Key. Once a valid API key received, it will call the DB to get all the data for members, prepare the required JSON request out of the fetched DB data, Calls the LifePod API to post the JSON request and, updates the DB with the received response

15 minutes after the bulkInsert API is run, bulk errors API will run to get all the errors for the same batch and updates the DB with response
Workflow sequence for the two APIs are in the above diagrams

Access Requirements

  1. Client credentials are used to invoke the API from Postman
  2. For scheduled jobs listener is not exposed, thus there is no need for any authentication

EndPoints
https://api-dev.commonwealthcare.org/lifepod/member/v1/bulkUpload
https://api-dev.commonwealthcare.org/lifepod/member/v1/bulkErrors

https://api-stage.commonwealthcare.org/lifepod/member/v1/bulkUpload
https://api-stage.commonwealthcare.org/lifepod/member/v1/bulkErrors

https://prod.commonwealthcare.org/lifepod/member/v1/bulkUpload
https://prod.commonwealthcare.org/lifepod/member/v1/bulkErrors

Response

Sample Responses 200 (Member Upload)

{
"timestamp": "2020-06-16 15:40:06.610+0000",
"status": 200,
"error": null,
"message": "OK",
"path": "/api/v1/bulk-provisioning/insertUpdate",
"data": {
"batchId": "e1afe5ba-4f9c-4998-9a18-ca207e28e475",
"dateCreated": "2020-06-16 15:40:06.605+0000",
"loadingName": "JSON loading, size:1",
"totalAmount": 1,
"processedAmount": null,
"status": "PENDING"
}
}

Sample Responses 200 (Bulk Errors)

{
"timestamp": "2020-07-02 11:56:41.088+0000",
"status": 200,
"error": null,
"message": "OK",
"data": {
"status": "DONE",
"errorsCount": 0,
"errors": [],
"errorStatus": "SUCCESSFUL"
}
}

Success criteria

  1. The status value of the record is in our database
  2. No data validation errors

Failure criteria

  • FirstName, LastName, email or any mandatory field is empty or null
  • Member ID is not valid
  • isAdmin field is not Boolean
  • isInactive is not Boolean
  • care plans field is not an Array object
Sample JSON Payload

[
{
"caregiver": {
"firstName": "Alicia",
"lastName": "Beeman",
"email": "abeeman@elementcare.org",
"isAdmin": "false",
"isInactive": "false",
"timeZone": "US/Eastern",
"orgDept": "Element Care",
"orgLocation": null,
"orgOther": null,
"phoneNumber": "1(617)426-06-00",
"isPhoneSmsEnabled": null
},
"recipients": [
{
"memberId": "5365550620",
"firstName": "Nagat",
"lastName": "Yosif",
"role": "PRIMARY_CAREGIVER",
"customPartnerRelationship": "HOME_HEALTH_CARE",
"roleDeleted": null,
"timeZone": "US/Eastern",
"isInactive": "false",
"relationship": null,
"dob": "07/01/1943",
"zipCode": "01960",
"nickName": null,
"orgDepartment": "Element Care",
"orgLocation": null,
"orgOther": null,
"hearingAbility": null,
"carePlans": [
"CCA COVID-19",
"CCA STARTER"
],
"phoneNumber": "1(781)535-79-30",
"wifiType": null,
"persEnabled": null,
"persProvider": null,
"speakingProficiency": null,
"mobility": null,
"currentProduct": "SCO",
"gender": "Female",
"ethnicity": null,
"language": "Arabic",
"ratingCategory": "CNDNon",
"pcpFirstName": "Norin",
"pcpLastName": "Dashoush",
"pcpPhoneNumber": null,
"careModel": "Delegated Arrangement",
"address1": "18 Walnut St Apt 301",
"address2": null,
"city": "Peabody",
"state": "MA",
"totalInboundCalls": null,
"totalInPersonVisits": null,
"allTouches": null,
"inPatientClaims": null,
"emergencyClaims": null,
"pharmacyClaims": null,
"totalPaidHcs": null,
"allPaidClaims": null
}]
}
]


Reviews