ahmedsakri
04/12/2023, 11:33 AMCaregiver Family Member and Legal Guardian. I am attaching these policies to user while Inviting.
Question:
Is there a way after a user logs in (invited user) check what category does he belongs to? Like(Caregiver Family Member or the Legal Guardian?
Is there a way i can get assigned access-policy name?
Thanks in Advance for the help!rahul1
04/12/2023, 8:19 PMPatient resource by using the useMedplumProfile() hookahmedsakri
04/13/2023, 5:55 AMProjectMemmbership in my access-policies and tried hitting the API. It still gave me forbidden error.
Tried with all the 3 objects below:
{
"resourceType": "ProjectMembership",
"compartment": {
"reference": "%patient"
}
},
{
"resourceType": "ProjectMembership",
"compartment": {
"reference": "%patient"
},
"readonly": true
},
{
"resourceType": "ProjectMembership",
"readonly": true
},ahmedsakri
04/13/2023, 6:12 AMcurl 'https://api.foodemo.xyz/fhir/R4/ProjectMembership?profile=Patient%2Ffa0850c7-2e6e-40cd-8aff-21fb92170e9c' \
-H 'Accept: */*' \
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjAzYzBiOWIyLWY3YTMtNGEyYi04MjlhLTMwYjg1MDYxOTkxZSIsInR5cCI6IkpXVCJ9.eyJsb2dpbl9pZCI6IjNkMGFjY2ViLTY0OGItNGUxNy1hMTUwLWU4NzU1NmIwMzI3YSIsInN1YiI6ImM3OGFkNzRiLTJjYTMtNDhjNC04OTczLTVlMzA0ZGYxZjk4NCIsInVzZXJuYW1lIjoiYzc4YWQ3NGItMmNhMy00OGM0LTg5NzMtNWUzMDRkZjFmOTg0Iiwic2NvcGUiOiJvcGVuaWQiLCJwcm9maWxlIjoiUGF0aWVudC9mYTA4NTBjNy0yZTZlLTQwY2QtOGFmZi0yMWZiOTIxNzBlOWMiLCJpYXQiOjE2ODEzNjUxMTMsImlzcyI6Imh0dHBzOi8vYXBpLmZvb2RlbW8ueHl6LyIsImV4cCI6MTY4MTM2ODcxM30.aKNWr4Ciet4W9PWtFQpiKWdW2KHa7lF_eSnvlr-EjomlYnIm_dZ0A8iJzH5Pj1sD1ii_A-vaFEF-8yqi3JXqioBiduBmRqBj67rM2TAC6IV5PWfeg4V9TC8ofA9vgKV_x3an3LpAU6mM3NwbT5SCD6c7AZyKGRpmDomcnDiRycXcFpQ6EOUxxsao8CWgyJQZVvH-ZlYrwp-zku-BjVv2_uwZJzkGrJYB5GouRZHoIcQr5gbNcPRJ0k02NGnhvPQ1a6m_2_S_27ScMaOibX_mwxVjD2yJ9PnacXv3i_7NZB4P-Foru0nQ6_yfPuvi0oOtSeg0PvavLWSr7p2X3Pz7QQ' \
-H 'Cache-Control: max-age=0' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/fhir+json' \
-H 'Origin: http://localhost:3001' \
-H 'Referer: http://localhost:3001/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' \
-H 'X-Medplum: extended' \
-H 'sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--compressedahmedsakri
04/13/2023, 7:51 AMahmedsakri
04/14/2023, 4:16 AMrahul1
04/14/2023, 5:04 PMProjectMembership are only accessible by project administrators, so the patient login won't be able to access themrahul1
04/14/2023, 5:04 PMrahul1
04/14/2023, 5:08 PMRelatedPerson.relationship field is an array, precisely for this reason. I would suggest that for every RelatedPerson, in addition to storing their family relationship (e.g. "mother", "father", etc.), you also store a second element that indicates whether they are a "Caregiver Family Member or the Legal Guardian".
This field will then also be a Search parameter, making it easier to perform searches such as "find all legal guardians for Patient X"rahul1
04/14/2023, 5:08 PM