Upsert Patient User

PUT {{auth_backend_server}}/patient/$upsert

[ALPHA RELEASE]

A single endpoint to upsert patient FHIR resources, upsert users, and link the two together.

This endpoint is intended for the following use cases:

  • Initial simultaneous creation of BOTH new patient FHIR resources and patient users in Auth Service
  • Simultaneous PUT updates to BOTH patient FHIR resources and patient users and ensuring patient FHIR resources and linked patient users stay in sync

To make changes to only the patient resource or only the patient user in Auth Service, use the appropriate PUT or PATCH endpoints (e.g., including updating the patient FHIR resource ID on the user):

Request Body

{"data"=>{"attributes"=>{"patientIdentifierSystem"=>"http://hospital.smarthealthit.org", "patient"=>{"resourceType"=>"Patient", "name"=>[{"family"=>"Upsert", "given"=>["David"]}], "telecom"=>[{"system"=>"email", "value"=>"david.upsert@gmail.com"}], "gender"=>"male", "birthDate"=>"1970-01-01", "identifier"=>[{"use"=>"official", "system"=>"http://hospital.smarthealthit.org", "value"=>"001"}]}, "user"=>{"data"=>{"type"=>"auth/users", "attributes"=>{"email"=>"david.upsert@gmail.com", "name"=>"David Upsert", "userType"=>"individual", "sendPasswordResetEmail"=>false, "sendVerificationEmail"=>false}, "relationships"=>{"auth/roles"=>{"data"=>{"type"=>"auth/roles", "id"=>"5e3e9e0e-a6ad-4113-9e9f-c28e59343ae9"}}}}}}}}