Fill Medical forms
curl --request POST \
--url https://production.yasmina.ai/api/v1/medical/medical-forms/fill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"all_employees": {
"allergies": "No",
"current_medications": "No",
"hospitalizations": "No",
"pre_existing_conditions": "No",
"past_surgeries": "No",
"surgery_complications": "No",
"chest_pain_or_breathlessness": "No",
"heart_procedures": "No",
"smoking": "No",
"alcohol_consumption": "No",
"physical_activity": "No",
"family_history": "No",
"chronic_disease": [
"None of the above"
]
}
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/medical-forms/fill"
payload = { "all_employees": {
"allergies": "No",
"current_medications": "No",
"hospitalizations": "No",
"pre_existing_conditions": "No",
"past_surgeries": "No",
"surgery_complications": "No",
"chest_pain_or_breathlessness": "No",
"heart_procedures": "No",
"smoking": "No",
"alcohol_consumption": "No",
"physical_activity": "No",
"family_history": "No",
"chronic_disease": ["None of the above"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
all_employees: {
allergies: 'No',
current_medications: 'No',
hospitalizations: 'No',
pre_existing_conditions: 'No',
past_surgeries: 'No',
surgery_complications: 'No',
chest_pain_or_breathlessness: 'No',
heart_procedures: 'No',
smoking: 'No',
alcohol_consumption: 'No',
physical_activity: 'No',
family_history: 'No',
chronic_disease: ['None of the above']
}
})
};
fetch('https://production.yasmina.ai/api/v1/medical/medical-forms/fill', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://production.yasmina.ai/api/v1/medical/medical-forms/fill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'all_employees' => [
'allergies' => 'No',
'current_medications' => 'No',
'hospitalizations' => 'No',
'pre_existing_conditions' => 'No',
'past_surgeries' => 'No',
'surgery_complications' => 'No',
'chest_pain_or_breathlessness' => 'No',
'heart_procedures' => 'No',
'smoking' => 'No',
'alcohol_consumption' => 'No',
'physical_activity' => 'No',
'family_history' => 'No',
'chronic_disease' => [
'None of the above'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://production.yasmina.ai/api/v1/medical/medical-forms/fill"
payload := strings.NewReader("{\n \"all_employees\": {\n \"allergies\": \"No\",\n \"current_medications\": \"No\",\n \"hospitalizations\": \"No\",\n \"pre_existing_conditions\": \"No\",\n \"past_surgeries\": \"No\",\n \"surgery_complications\": \"No\",\n \"chest_pain_or_breathlessness\": \"No\",\n \"heart_procedures\": \"No\",\n \"smoking\": \"No\",\n \"alcohol_consumption\": \"No\",\n \"physical_activity\": \"No\",\n \"family_history\": \"No\",\n \"chronic_disease\": [\n \"None of the above\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://production.yasmina.ai/api/v1/medical/medical-forms/fill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"all_employees\": {\n \"allergies\": \"No\",\n \"current_medications\": \"No\",\n \"hospitalizations\": \"No\",\n \"pre_existing_conditions\": \"No\",\n \"past_surgeries\": \"No\",\n \"surgery_complications\": \"No\",\n \"chest_pain_or_breathlessness\": \"No\",\n \"heart_procedures\": \"No\",\n \"smoking\": \"No\",\n \"alcohol_consumption\": \"No\",\n \"physical_activity\": \"No\",\n \"family_history\": \"No\",\n \"chronic_disease\": [\n \"None of the above\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.yasmina.ai/api/v1/medical/medical-forms/fill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"all_employees\": {\n \"allergies\": \"No\",\n \"current_medications\": \"No\",\n \"hospitalizations\": \"No\",\n \"pre_existing_conditions\": \"No\",\n \"past_surgeries\": \"No\",\n \"surgery_complications\": \"No\",\n \"chest_pain_or_breathlessness\": \"No\",\n \"heart_procedures\": \"No\",\n \"smoking\": \"No\",\n \"alcohol_consumption\": \"No\",\n \"physical_activity\": \"No\",\n \"family_history\": \"No\",\n \"chronic_disease\": [\n \"None of the above\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"declared": 2,
"remaining": 0
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "<string>",
"message": "<string>"
}Fill Medical forms
This is if the HR wants to fill the Medical forms on behalf of the employees. The answers in all_employees apply to every employee; use ids_or_emails to override the answers for specific employees. Use the Get the Medical form questions API to see the question text for each key.
POST
/
medical-forms
/
fill
Fill Medical forms
curl --request POST \
--url https://production.yasmina.ai/api/v1/medical/medical-forms/fill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"all_employees": {
"allergies": "No",
"current_medications": "No",
"hospitalizations": "No",
"pre_existing_conditions": "No",
"past_surgeries": "No",
"surgery_complications": "No",
"chest_pain_or_breathlessness": "No",
"heart_procedures": "No",
"smoking": "No",
"alcohol_consumption": "No",
"physical_activity": "No",
"family_history": "No",
"chronic_disease": [
"None of the above"
]
}
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/medical-forms/fill"
payload = { "all_employees": {
"allergies": "No",
"current_medications": "No",
"hospitalizations": "No",
"pre_existing_conditions": "No",
"past_surgeries": "No",
"surgery_complications": "No",
"chest_pain_or_breathlessness": "No",
"heart_procedures": "No",
"smoking": "No",
"alcohol_consumption": "No",
"physical_activity": "No",
"family_history": "No",
"chronic_disease": ["None of the above"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
all_employees: {
allergies: 'No',
current_medications: 'No',
hospitalizations: 'No',
pre_existing_conditions: 'No',
past_surgeries: 'No',
surgery_complications: 'No',
chest_pain_or_breathlessness: 'No',
heart_procedures: 'No',
smoking: 'No',
alcohol_consumption: 'No',
physical_activity: 'No',
family_history: 'No',
chronic_disease: ['None of the above']
}
})
};
fetch('https://production.yasmina.ai/api/v1/medical/medical-forms/fill', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://production.yasmina.ai/api/v1/medical/medical-forms/fill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'all_employees' => [
'allergies' => 'No',
'current_medications' => 'No',
'hospitalizations' => 'No',
'pre_existing_conditions' => 'No',
'past_surgeries' => 'No',
'surgery_complications' => 'No',
'chest_pain_or_breathlessness' => 'No',
'heart_procedures' => 'No',
'smoking' => 'No',
'alcohol_consumption' => 'No',
'physical_activity' => 'No',
'family_history' => 'No',
'chronic_disease' => [
'None of the above'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://production.yasmina.ai/api/v1/medical/medical-forms/fill"
payload := strings.NewReader("{\n \"all_employees\": {\n \"allergies\": \"No\",\n \"current_medications\": \"No\",\n \"hospitalizations\": \"No\",\n \"pre_existing_conditions\": \"No\",\n \"past_surgeries\": \"No\",\n \"surgery_complications\": \"No\",\n \"chest_pain_or_breathlessness\": \"No\",\n \"heart_procedures\": \"No\",\n \"smoking\": \"No\",\n \"alcohol_consumption\": \"No\",\n \"physical_activity\": \"No\",\n \"family_history\": \"No\",\n \"chronic_disease\": [\n \"None of the above\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://production.yasmina.ai/api/v1/medical/medical-forms/fill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"all_employees\": {\n \"allergies\": \"No\",\n \"current_medications\": \"No\",\n \"hospitalizations\": \"No\",\n \"pre_existing_conditions\": \"No\",\n \"past_surgeries\": \"No\",\n \"surgery_complications\": \"No\",\n \"chest_pain_or_breathlessness\": \"No\",\n \"heart_procedures\": \"No\",\n \"smoking\": \"No\",\n \"alcohol_consumption\": \"No\",\n \"physical_activity\": \"No\",\n \"family_history\": \"No\",\n \"chronic_disease\": [\n \"None of the above\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.yasmina.ai/api/v1/medical/medical-forms/fill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"all_employees\": {\n \"allergies\": \"No\",\n \"current_medications\": \"No\",\n \"hospitalizations\": \"No\",\n \"pre_existing_conditions\": \"No\",\n \"past_surgeries\": \"No\",\n \"surgery_complications\": \"No\",\n \"chest_pain_or_breathlessness\": \"No\",\n \"heart_procedures\": \"No\",\n \"smoking\": \"No\",\n \"alcohol_consumption\": \"No\",\n \"physical_activity\": \"No\",\n \"family_history\": \"No\",\n \"chronic_disease\": [\n \"None of the above\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"declared": 2,
"remaining": 0
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The company whose employees are being declared for.
Default answers applied to all employees of the company
Hide child attributes
Hide child attributes
Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Optional. Chronic conditions the employee has.
Available options:
Diabetes, Asthma, Chronic Kidney Disease, Liver Disease, Cancer, None of the above Per-employee overrides. Identify the employee by email, nationality id, or Iqama id.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Available options:
Yes, No Optional. Chronic conditions the employee has.
Available options:
Diabetes, Asthma, Chronic Kidney Disease, Liver Disease, Cancer, None of the above ⌘I