Thank you @jkuester
By the role field is empty i meant , we got <role/>
in the xml generated by window.CHTCore.debugFormModel()
.
So, the role is empty because the contact related to the current user is not loaded
Also,we are opening the form from the contact’s profile page.
No other field is loader, as said, the contact is not loaded to allow data hydration
We made this simple form (a new form) to reproduice the issue.
The result below. Same thing, it was not able to load the contact information:
Here is a sample a user contact:
{
"_id": "xxxxxxxxxxxxxxxxxxxxxx",
"_rev": "2-xxxxxxxxxxxxxxxxxxxxxx",
"person_id": "",
"place_language": "fr",
"is_active": "true",
"name_prefix": "STM-",
"name_regex": "^STM-.{2,}",
"parent": {
"_id": "xxxxxxxxxxxxxxxxxxxxxx",
"parent": {
"_id": "xxxxxxxxxxxxxxxxxxxxxx"
}
},
"name": "STM-Gestionnaire",
"language": "${place_language}",
"select_role": "stock_manager",
"role": "stock_manager",
"tb_focal_point_info": {
"s_site": "Site1",
"s_ha": "HA1",
"s_cscom_area": "CSCOM1"
},
"concession": "",
"menage": "",
"date_of_birth": "2005-08-14",
"date_of_birth_method": "approx",
"person_age_in_years": "19",
"person_age_in_months": "228",
"cscom_area": "CSCOM1_AREA",
"ephemeral_dob": {
"age_years": "19",
"age_months": "0",
"dob_method": "approx",
"ephemeral_months": "8",
"ephemeral_years": "2005",
"dob_approx": "2005-08-14T00:00:00.000-00:00",
"dob_raw": "2005-08-14T00:00:00.000-00:00",
"dob_iso": "2005-08-14"
},
"sex": "male",
"phone": "",
"alternate_phone": "",
"geolocation": "",
"type": "person",
"reported_date": 1723642882419,
"form_version": {
"time": 1723642782403,
"sha256": "97f9bc9d4aa223758a4f95ac38ea87b1a8bc13fc7fcbd3028ed0c3dcba1062a8"
},
"patient_id": "xxxxx"
}