Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

References/User & Skills: Difference between revisions

From OHC Network Wiki
More languages
Content deleted Content added
Automated edit (via update-page on MediaWiki MCP Server)
Fix unclosed wikilink in gender Field row (restores Cargo row) (via update-page on MediaWiki MCP Server)
 
(One intermediate revision by the same user not shown)
Line 12: Line 12:
A <code>User</code> is a Care account — authentication, profile, clinician credentials, and notification/MFA data. The Django model is the storage layer. The Pydantic resource specs in <code>care/emr/resources/user/</code> and <code>care/emr/resources/mfa/</code> are the API layer: they define enums, validation, the shape of the opaque <code>JSONField</code>s, and the separate request/response schemas you write to and read from.
A <code>User</code> is a Care account — authentication, profile, clinician credentials, and notification/MFA data. The Django model is the storage layer. The Pydantic resource specs in <code>care/emr/resources/user/</code> and <code>care/emr/resources/mfa/</code> are the API layer: they define enums, validation, the shape of the opaque <code>JSONField</code>s, and the separate request/response schemas you write to and read from.


'''Source:''' [<nowiki/>https://github.com/ohcnetwork/care/blob/develop/care/users/models.py <code>care/users/models.py</code>], [<nowiki/>https://github.com/ohcnetwork/care/blob/develop/care/facility/models/patient.py <code>care/facility/models/patient.py</code>], [<nowiki/>https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/user/spec.py <code>care/emr/resources/user/spec.py</code>], [<nowiki/>https://github.com/ohcnetwork/care/blob/develop/care/emr/resources/mfa/spec.py <code>care/emr/resources/mfa/spec.py</code>]


== Models ==
== Models ==
Line 63: Line 62:
{{Field|model=User&Skills|section=Identity &amp; profile|name=prefix|type=CharField(10)|notes=Name prefix (e.g. Dr.); spec caps length at 10. Optional in specs}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=prefix|type=CharField(10)|notes=Name prefix (e.g. Dr.); spec caps length at 10. Optional in specs}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=suffix|type=CharField(50)|notes=Name suffix; spec caps length at 50. Optional in specs}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=suffix|type=CharField(50)|notes=Name suffix; spec caps length at 50. Optional in specs}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=gender|type=CharField(100)|notes=Nullable in DB. Write specs constrain it to <code>GenderChoices</code> and require it; read specs return it as a plain string. See [[#genderchoices-values}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=gender|type=CharField(100)|notes=Nullable in DB. Write specs constrain it to <code>GenderChoices</code> and require it; read specs return it as a plain string. See [[#genderchoices-values|GenderChoices values]]}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=old_gender|type=IntegerField|notes=Legacy <code>GENDER_CHOICES</code> (<code>1</code> Male, <code>2</code> Female, <code>3</code> Non-binary); nullable. No user spec exposes it}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=old_gender|type=IntegerField|notes=Legacy <code>GENDER_CHOICES</code> (<code>1</code> Male, <code>2</code> Female, <code>3</code> Non-binary); nullable. No user spec exposes it}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=date_of_birth|type=DateField|notes=Nullable. Read-only (nullable string) in <code>CurrentUserRetrieveSpec</code>}}
{{Field|model=User&Skills|section=Identity &amp; profile|name=date_of_birth|type=DateField|notes=Nullable. Read-only (nullable string) in <code>CurrentUserRetrieveSpec</code>}}
Line 397: Line 396:
* Write through <code>UserCreateSpec</code> / <code>UserUpdateSpec</code>; read through <code>UserSpec</code> (list), <code>UserRetrieveSpec</code> (detail), <code>CurrentUserRetrieveSpec</code> (self), and <code>PublicUserReadSpec</code> (public). Picture URLs, MFA status, roles, flags, and nested org/creator objects are all computed server-side.
* Write through <code>UserCreateSpec</code> / <code>UserUpdateSpec</code>; read through <code>UserSpec</code> (list), <code>UserRetrieveSpec</code> (detail), <code>CurrentUserRetrieveSpec</code> (self), and <code>PublicUserReadSpec</code> (public). Picture URLs, MFA status, roles, flags, and nested org/creator objects are all computed server-side.



{{SourceCode
|model=care/users/models.py
|extra1_label=patient.py
|extra1_path=care/facility/models/patient.py
|spec=care/emr/resources/user/spec.py
|extra2_label=spec.py
|extra2_path=care/emr/resources/mfa/spec.py
}}
{{Navbox access governance}}
{{Navbox access governance}}