After having received generic information about the health reports as discussed in Fetching Health Reports' Metadata and being aware of the different types of reports discussed under Report Classification, to get personalized results for a particular profile, of health reports of your choice, you would have to generate those reports.
Report Jobs
Each report job is an entity that represents the pipeline, from start to finish, to generate a particular health report for a particular profile. Creating a report job would automatically initiate the pipeline to generate the health report of your choice for your profile. You can track the report job for any updates or errors as it moves across the pipeline.
Report jobs are genome file based jobs, meaning that they require a genome file to be processed. For more details regarding the report jobs and their creation, please refer to Genome File Based Jobs
Creating a Report Job for the First Time
If you don't have the genome file processed for your profile and are creating a report job for the first time, please refer to Creating a Job for the First Time - Uploading + Processing Genome File.
Examples to Create a Report Job
POST https://selfdecode.com/service/b2b-integrations/report-job/
Payload to generate only report sans PDF
{
"profile_id": "1ca85f64-5717-4562-b3fc-2c963f66afa6",
"report_id": "fc852116-1338-42f4-a538-26a98d9a44be",
"file_id": "162357df-e111-4792-8c42-6369d43d52fd", // only for first job
"desired_status": "report_generated"
}
Payload to generate report + PDF
{
"profile_id": "1ca85f64-5717-4562-b3fc-2c963f66afa6",
"report_id": "fc852116-1338-42f4-a538-26a98d9a44be",
"file_id": "162357df-e111-4792-8c42-6369d43d52fd", // only for first job
"desired_status": "pdf_generated",
"pdf_config": {
"recommendation_type": "simple",
"lab_results_type": "out_of_optimal"
},
"pdf_file_name": "John Doe - Dehydration"
}
Fetching Report Jobs
List
/report-job/ endpoint supports listing by parameters: report_id, profile_id, status
Retrieve
Individual report jobs can be retrieved by their ID via the report-job/:pk endpoint.
Retrieve by profile_id, report_id combination
The latest matching report job can be retrieved via the report-job/profile/:profile-id/report/:report-id endpoint.
Report Job PDFs
Please refer to PDFs section in Genome File Based Jobs.
Composing Report
If you're interested in composing a web page comprising of the health report details, refer to the Composing Health Reports section.
Bulk Creating
For mass report / PDF generation for a single profile we have a bulk-create endpoint. It accepts a payload identical to the standard /report-job payload, except instead of a report_id field, a report_ids field is used. This field expects a list of report_ids which must be non-empty and contain a maximum of 250 report IDs.
Example:
POST https://selfdecode.com/service/b2b-integrations/report-job/bulk-create/
{
"profile_id": "1ca85f64-5717-4562-b3fc-2c963f66afa6",
"report_ids": ["3fa85f64-5717-4562-b3fc-2c963f66afa6","9ca85f64-5717-4562-b3fc-2c963f66afa6"],
"desired_status": "pdf_generated"
}
Generate All
To generate all reports for an existing profile, use the [/report-job/generate-all/](https://selfdecode.readme.io/v3.0.0/reference/report_job_generate_all_create) endpoint.
Example:
POST https://selfdecode.com/service/b2b-integrations/report-job/generate-all/
{
"profile_id": "1ca85f64-5717-4562-b3fc-2c963f66afa6",
"desired_status": "pdf_generated"
}
Regenerate Reports
To ensure the accuracy and up-to-date status of reports, we have implemented a regeneration process. If a report fails to generate or becomes outdated (due to a newer version being published), it can be regenerated using the following endpoints:
- Regenerate a certain report: /report-job/regenerate/
- Regenerate multiple reports: /report-job/regenerate/bulk-create/
- Regenerate all failed/out of date reports: /report-job/regenerate/regenerate-all/
Webhooks
Please check our webhooks guide for detailed instructions on using webhooks.
