placecare / backend

0 stars 0 forks source link

Defining product architecture #1

Open NathaelB opened 2 months ago

NathaelB commented 2 months ago

Defining Product Architecture

Components

Admission

Admission to an EHPAD or MAS is a key moment for both the person concerned and their family. It marks a major change in daily life and requires careful preparation.

How is admission organised?

  1. The application file: This generally consists of an administrative section (identity, family situation, etc.) and a medical section (state of health, treatment, etc.).
  2. Examination of the application : The establishment assesses whether the person meets the admission criteria and whether their needs can be met.
  3. Visit to the establishment: An interview is organised with the person and/or their family to present the establishment and its services and answer any questions.
  4. The admission decision: If the application is accepted, a residence contract is drawn up, setting out the terms and conditions of admission and the rights and duties of each party.

Data structure

interface Identity {
  firstname: string
  lastname: string
  gender: string | null
  birthDate: DateTime | null
}
interface Contact {
  landlinePhone: string | null
  mobilePhone: string | null
  email: string | null
}
interface Address {
  address: string
  addressDetails: string | null
  zipCode: string
  city: string
  country: string
}
interface House {
  name: string
  description?: string
  referredProfessional: Professional

  professionnals: ManyToMany<Professional >
}
Professionel

The professional represents a person belonging to the medical world. They may be in-house doctors, GPs, care assistants or ash.

type ProfessionalType = 'nurse' | 'externalDoctor' | 'careAssistant' | 'ash'

interface Professional {
  oidcId: string(uuid)
  type: ProfessionalType
  identity: Identity
  contact: Contact
  address: Address
}
Résident

A resident of an EHPAD or MAS is a person who lives in this establishment. They are elderly people (in the case of EHPADs) or disabled adults (in the case of MASs) who need regular, personalised help to carry out everyday tasks.

interface Resident {
  identity: Identity
  refferingDoctor: Professional | null
  refferingDoctorAccesses: jsonb
  admittedAt: DateTime | null
  house: House
  createdAt: DateTime
  updatedAt: DateTime | null

  family: ManyToMany<FamilyMember>
  allergies: ManyToMany<Allergy>
  allergens: ManyToMany<Allergen>
  pathologies: ManyToMany<Pathology>
}
Membre de la famille

This person represents a close member of the family, who may be the emergency contact in the event of a problem and may have access to monitor the state of health of their relative, depending on the authorisations granted by the facilities.

type Position = 'parent' | 'grandParent' | 'browser' | 'sister'

interface FamilyMember {
  identity: Identity
  contact: Contact
  address: Address
  position: Position
  isUrgencyContact: boolean

  residents: ManyToMany<Resident>
}
interface Allergen {
  name: string
}
interface Allergy {
  name: string

  allergens: ManyToMany<Allergen>
}
type PathologyType = ''

interface Pathology {
  name: string
  type: PathologyType
}
NathaelB commented 2 months ago

A house represented a structure for example, I'd like to set up a company to bring together all the healthcare professionals where they work.

I can say : Company = House ? @LeadcodeDev

LeadcodeDev commented 2 months ago

No, a house represents a place in the physical sense.

For example, in an ephad it is customary to name the different departments by geographical locations:

NathaelB commented 2 months ago

Okay nice, so I can create a company resource to identify an establishment ?

NathaelB commented 2 months ago

@LeadcodeDev in terms of relationships, do you mean that a healthcare professional can be on several sites (site= EHPAD de Montpellier Lapeyronie for example) or is the professional linked to a single company?

I'm more of a fan of a ManyToMany relationship personally.