backend.entities
- This module defines the two entities:
Patient
Session
backend.entities.patient
- class backend.entities.patient.Patient(id: str, name: str, **kwargs)[source]
Bases:
object
- Class:
Patient defines a patient.
- Parameters:
id (str) – the patient’s ID
name (str) – the patient’s name
More attributes can be added if necessary.
- Example:
- A test run that creates and displays two patients:
Patient with only ID and Name
Patient with ID, Name, and Place.
if __name__ == '__main__': patient = Patient('AX314', 'ABC') print(repr(patient)) patient = Patient('GF342', 'POW', place='X-122') print(repr(patient))
backend.entities.session
- class backend.entities.session.Session(patient: Patient, **kwargs)[source]
Bases:
object
- Class:
Session defines a session.
- Parameters:
patient – a Patient
The date of the session is automatically created.
More attributes can be added if necessary.
- Example:
A test run that first creates a Patient (using ID and Name) and then a Session using today’s date.
if __name__ == '__main__': patient = Patient('AX314', 'ABC') session = Session(patient) print(repr(session))