java.lang.Object
edu.ntnu.idata1002.prosjekt2021.model.Patient

public class Patient
extends java.lang.Object
Represents a Patient. Uniquely identified by socialSecurityNumber.
  • Constructor Summary

    Constructors
    Constructor Description
    Patient​(java.lang.String fullName, java.lang.String address, java.lang.String phonenumber, java.lang.String socialSecurityNumber, java.lang.String city, int postalCode, javafx.scene.image.Image picture)
    Creates an instance of a patient.
  • Method Summary

    Modifier and Type Method Description
    void addCareplan​(Careplan careplan)
    Add careplan to the patients list of careplans.
    boolean doCpr()
    Returns whether the patient whishes to be saved or not.
    Careplan findCareplanByTypeOfCare​(java.lang.String typeOfCare)
    Finds the careplan mathching given the type of care.
    java.lang.String getAdditionalInformation()
    Returns additional information about the patient.
    java.lang.String getAddress()
    Returns the address of the patient.
    java.util.List<Careplan> getCareplans()
    Returns this patients list of careplans.
    java.lang.String getCity()
    Returns the city of where this patient lives.
    java.lang.String getDiagnosis()
    Returns this patients current diagnosis.
    Contact getEmergencyContact()
    Returns this patients emergency contact.
    java.lang.String getFullName()
    Returns the full name of the patient.
    Contact getGeneralPractitioner()
    Returns this patients general practitioner.
    java.lang.String getPhonenumber()
    Returns the telephone number of the patient.
    javafx.scene.image.Image getPicture()
    Returns picture of this patient.
    int getPostalCode()
    Returns the postalcode of where this patient lives.
    java.lang.String getSocialSecurityNumber()
    Returns the socialSecurityNumber of the patient.
    java.lang.String getSummary()
    Returns the short summary about the patient's condition and what extent of care is needed from them.
    void removeCareplan​(Careplan careplan)
    Removes the given careplan from the patients list of careplans.
    void setAdditionalInformation​(java.lang.String additionalInformation)
    Sets additional information about the patient.
    void setAddress​(java.lang.String address)
    Sets new address to the patient.
    void setDiagnosis​(java.lang.String diagnosis)
    Sets this patients current diagnosis.
    void setDoCpr​(boolean doCpr)
    Sets whether the patient wishes to be saved or not.
    void setEmergencyContact​(Contact emergencyContact)
    Sets this patients emergency contact.
    void setGeneralPractitioner​(Contact generalPractitioner)
    Sets this patients general practitioner.
    void setPhonenumber​(java.lang.String phonenumber)
    Sets new telephone number to the patient.
    void setPicture​(javafx.scene.image.Image picture)
    Sets the picture of this patient.
    void setSummary​(java.lang.String summary)
    Sets the short summary about the extent of care the patient needs.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Patient

      public Patient​(java.lang.String fullName, java.lang.String address, java.lang.String phonenumber, java.lang.String socialSecurityNumber, java.lang.String city, int postalCode, javafx.scene.image.Image picture)
      Creates an instance of a patient.
      Parameters:
      fullName - full name of the patient.
      address - address of the patient.
      phonenumber - telephone number of the patient.
      socialSecurityNumber - unique socialSecurityNumber of the patient.
      city - the city where this patient resides.
      postalCode - the postal code where this patient resides.
      picture - picture of the patient.
  • Method Details

    • getFullName

      public java.lang.String getFullName()
      Returns the full name of the patient.
      Returns:
      full name of the patient.
    • setAddress

      public void setAddress​(java.lang.String address)
      Sets new address to the patient.
      Parameters:
      address - new address of the patient
    • getAddress

      public java.lang.String getAddress()
      Returns the address of the patient.
      Returns:
      address of the patient.
    • getPhonenumber

      public java.lang.String getPhonenumber()
      Returns the telephone number of the patient.
      Returns:
      telephone number of the patient.
    • getSocialSecurityNumber

      public java.lang.String getSocialSecurityNumber()
      Returns the socialSecurityNumber of the patient.
      Returns:
      socialSecurityNumber of the patient.
    • setPhonenumber

      public void setPhonenumber​(java.lang.String phonenumber)
      Sets new telephone number to the patient.
      Parameters:
      phonenumber - new telephone number of the patient.
    • getCity

      public java.lang.String getCity()
      Returns the city of where this patient lives.
      Returns:
      city where this patient lives.
    • getPostalCode

      public int getPostalCode()
      Returns the postalcode of where this patient lives.
      Returns:
      postalcode of where this patient lives.
    • setPicture

      public void setPicture​(javafx.scene.image.Image picture)
      Sets the picture of this patient.
      Parameters:
      picture - picture of this patient.
    • getPicture

      public javafx.scene.image.Image getPicture()
      Returns picture of this patient.
      Returns:
      picture of this patient.
    • getEmergencyContact

      public Contact getEmergencyContact()
      Returns this patients emergency contact.
      Returns:
      this patients emergency contact.
    • setEmergencyContact

      public void setEmergencyContact​(Contact emergencyContact)
      Sets this patients emergency contact.
      Parameters:
      emergencyContact - emergency contact to be set.
    • getGeneralPractitioner

      public Contact getGeneralPractitioner()
      Returns this patients general practitioner.
      Returns:
      this patients general practitioner.
    • setGeneralPractitioner

      public void setGeneralPractitioner​(Contact generalPractitioner)
      Sets this patients general practitioner.
      Parameters:
      generalPractitioner - general practitioner to be set.
    • getSummary

      public java.lang.String getSummary()
      Returns the short summary about the patient's condition and what extent of care is needed from them.
      Returns:
      summary about the extent of care needed.
    • setSummary

      public void setSummary​(java.lang.String summary)
      Sets the short summary about the extent of care the patient needs.
      Parameters:
      summary - summary of the extent of care the patient needs to be set.
    • getAdditionalInformation

      public java.lang.String getAdditionalInformation()
      Returns additional information about the patient.
      Returns:
      additional information about the patient.
    • setAdditionalInformation

      public void setAdditionalInformation​(java.lang.String additionalInformation)
      Sets additional information about the patient.
      Parameters:
      additionalInformation - additional information about the patient to be set.
    • getDiagnosis

      public java.lang.String getDiagnosis()
      Returns this patients current diagnosis.
      Returns:
      this patients current diagnosis.
    • setDiagnosis

      public void setDiagnosis​(java.lang.String diagnosis)
      Sets this patients current diagnosis.
      Parameters:
      diagnosis - this patients current diagnosis to be set.
    • addCareplan

      public void addCareplan​(Careplan careplan)
      Add careplan to the patients list of careplans.
      Parameters:
      careplan - the careplan to be added.
    • removeCareplan

      public void removeCareplan​(Careplan careplan)
      Removes the given careplan from the patients list of careplans.
      Parameters:
      careplan - the careplan to be removed.
    • findCareplanByTypeOfCare

      public Careplan findCareplanByTypeOfCare​(java.lang.String typeOfCare)
      Finds the careplan mathching given the type of care.
      Parameters:
      typeOfCare - the type of care in the careplan to look for.
      Returns:
      careplan the careplan with the specified type of care. Returns null if no matching careplan is found.
    • getCareplans

      public java.util.List<Careplan> getCareplans()
      Returns this patients list of careplans.
      Returns:
      list of this patients careplans.
    • setDoCpr

      public void setDoCpr​(boolean doCpr)
      Sets whether the patient wishes to be saved or not.
      Parameters:
      doCpr - true if the patient wishes to be saved. false if the patient do not want to be saved.
    • doCpr

      public boolean doCpr()
      Returns whether the patient whishes to be saved or not.
      Returns:
      true if the patient wishes to be saved. false if the patient do not want to be saved.