Skip to content

Client Profile

1. What does this feature do? (High-Level Overview)

Section titled “1. What does this feature do? (High-Level Overview)”

This feature provides the About me section for a client profile, combining read-only detail cards and an edit workflow in a single tab. It centralizes client identity, plan data, parent linkage, referring provider data, diagnosis details, notes, documentation link, and location assignment.

  • Users with update_clients can enter edit mode in the About me section and persist changes.
  • Users without update_clients can see read-only cards but cannot switch to editable form via the edit wrapper.
  • In read mode, some inline pencil buttons are hidden when update_clients is missing (Parent, Referring Provider, Diagnosis cards).

Required permissions used by this feature path:

  • update_clients: enables edit mode and save/cancel flow for About me updates.
  • Rule 1: About me appears under the profile tab option_selected === 1.
  • Rule 2: Entering edit mode is controlled by EditWrapper directive and blocked when permission is missing.
  • Rule 3: Edit form initializes from current client data and re-initializes on input changes.
  • Rule 4: Secondary diagnosis values are handled as an array in UI and serialized to comma-separated string on save.
  • Rule 5: Birthdate is normalized before save: date string values are converted to Date objects to match backend expectations.
  • Rule 6: Diagnosis-dependent fields are conditional:
  • Level is shown when diagnosis_code is F84.0.
  • Other Diagnosis is shown when diagnosis_code is ICD-10.
  • Other Secondary Diagnosis is shown when secondary diagnosis selection includes ICD-10.
  • Rule 7: Parent selector supports existing parent assignment via lazy-select (/v2/parents) and manual creation through modal.
  • Rule 8: New parent creation can be deferred as pending; parent is created first during save, then client payload is emitted with real parents_id.
  • Rule 9: Canceling edit clears pending parent draft data and exits edit mode.
  • Rule 10: Save from child emits partial profile data; parent container merges payload with current profile and calls updatePatientProfile.
  • Rule 11: If location_id changed, container fetches fresh location details and updates local location display data.
  • Rule 12: If insurer fields are involved (benefits flow), full profile reload is triggered; About me direct updates otherwise patch local profile state from backend response.
  • Rule 13: Save success/failure feedback is shown through modal alerts.
  • Main navigation path:
  1. Medical > Clients list.
  2. Open client profile.
  3. About me tab (option 1).
  • About me read-mode cards:
  1. Client Information.
  2. Plan Information.
  3. Parent Information.
  4. Referring Provider Information.
  5. Diagnosis Information.
  6. Special Notes.
  7. Location Information.
  • About me edit-mode blocks:
  1. Personal Information.
  2. Plan Information.
  3. Parent Information (existing or pending parent).
  4. Referring Provider Information.
  5. Diagnosis Information.
  6. Special Notes.
  7. Documentation link.
  8. Location Information.
  1. Open a client profile and stay on About me.
  2. Enter edit mode.
  3. Update desired fields (identity, address, language, school, notes, etc.).
  4. Click Save Changes.
  5. System persists updates and shows success feedback.

Scenario B: Assign an existing parent to the client

Section titled “Scenario B: Assign an existing parent to the client”
  1. Enter edit mode in About me.
  2. In Parent section, use Parent email lazy-select.
  3. Choose an existing parent record.
  4. Verify Parent Name auto-loads.
  5. Save Changes.

Scenario C: Create a new parent during About me edit

Section titled “Scenario C: Create a new parent during About me edit”
  1. Enter edit mode.
  2. In Parent section, click the plus button.
  3. Fill Parent modal and submit.
  4. Parent stays as pending in form state.
  5. Click Save Changes; parent is created first, then client profile update is emitted with the new parent id.
  1. Enter edit mode.
  2. Select Diagnosis Code.
  3. If needed, set Level (F84.0) or Other Diagnosis fields (ICD-10).
  4. Select Secondary Diagnosis Codes (multi-select).
  5. Save Changes.
  • Q: What if a user does not have update_clients?

  • A: The edit wrapper blocks edit mode; read-only information remains visible.

  • Q: What if secondary diagnosis selection is empty?

  • A: secondary_diagnosis_codes is saved as empty string.

  • Q: What if birthdate in form is a string?

  • A: It is parsed back to Date before save emission.

  • Q: What if parent creation from modal fails?

  • A: Save process is interrupted for that flow and an error alert is shown.

  • Q: What if save fails in parent container?

  • A: Error feedback is shown; local error message is built from backend message/errors object.

  • Q: What if location changes while saving?

  • A: Container requests updated location data and refreshes local location fields accordingly.