Table of Contents

Class ClinicalDocument

Namespace
Core.CliniCore.Domain.ClinicalDocumentation
Assembly
Core.CliniCore.dll

Composite pattern implementation for complete medical encounter documentation Follows SOAP (Subjective, Objective, Assessment, Plan) format

public class ClinicalDocument : IIdentifiable
Inheritance
ClinicalDocument
Implements
Inherited Members
Extension Methods

Remarks

Creates a new clinical document with a specified ID (for client-server ID synchronization)

Constructors

ClinicalDocument(Guid, Guid, Guid)

Creates a new clinical document with an auto-generated ID

public ClinicalDocument(Guid patientId, Guid physicianId, Guid appointmentId)

Parameters

patientId Guid

The unique identifier of the patient.

physicianId Guid

The unique identifier of the physician.

appointmentId Guid

The unique identifier of the appointment.

ClinicalDocument(Guid, Guid, Guid, Guid)

Composite pattern implementation for complete medical encounter documentation Follows SOAP (Subjective, Objective, Assessment, Plan) format

public ClinicalDocument(Guid id, Guid patientId, Guid physicianId, Guid appointmentId)

Parameters

id Guid

The unique identifier for the document.

patientId Guid

The unique identifier of the patient.

physicianId Guid

The unique identifier of the physician.

appointmentId Guid

The unique identifier of the appointment.

Remarks

Creates a new clinical document with a specified ID (for client-server ID synchronization)

Properties

AppointmentId

Gets the unique identifier of the appointment related to this document.

public Guid AppointmentId { get; }

Property Value

Guid

ChiefComplaint

Chief complaint/reason for visit

public string? ChiefComplaint { get; set; }

Property Value

string

CompletedAt

Gets the date and time when the document was completed, or null if it is not yet completed.

public DateTime? CompletedAt { get; }

Property Value

DateTime?

CreatedAt

Gets the date and time when the document was created.

public DateTime CreatedAt { get; }

Property Value

DateTime

Entries

All entries in this document

public IReadOnlyList<AbstractClinicalEntry> Entries { get; }

Property Value

IReadOnlyList<AbstractClinicalEntry>

Id

Gets the unique identifier for the clinical document.

public Guid Id { get; }

Property Value

Guid

IsCompleted

Gets a value indicating whether the document has been completed.

public bool IsCompleted { get; }

Property Value

bool

PatientId

Gets the unique identifier of the patient associated with this document.

public Guid PatientId { get; }

Property Value

Guid

PhysicianId

Gets the unique identifier of the physician who authored this document.

public Guid PhysicianId { get; }

Property Value

Guid

Methods

AddEntry(AbstractClinicalEntry)

Adds an entry to the document

public void AddEntry(AbstractClinicalEntry entry)

Parameters

entry AbstractClinicalEntry

The clinical entry to add.

Exceptions

InvalidOperationException

Thrown when attempting to modify a completed document or add a prescription for a non-existent diagnosis.

Complete()

Completes the document, preventing further modifications

public void Complete()

Exceptions

InvalidOperationException

Thrown when the document is already completed or fails validation.

GenerateSOAPNote()

Generates a formatted SOAP note

public string GenerateSOAPNote()

Returns

string

A string containing the formatted SOAP note.

GetAssessments()

Gets all assessments

public IEnumerable<AssessmentEntry> GetAssessments()

Returns

IEnumerable<AssessmentEntry>

An enumerable collection of assessment entries.

GetDiagnoses()

Gets all diagnoses

public IEnumerable<DiagnosisEntry> GetDiagnoses()

Returns

IEnumerable<DiagnosisEntry>

An enumerable collection of diagnosis entries.

GetEntries<T>()

Gets all entries of a specific type

public IEnumerable<T> GetEntries<T>() where T : AbstractClinicalEntry

Returns

IEnumerable<T>

An enumerable collection of entries of the specified type.

Type Parameters

T

The type of clinical entry to retrieve.

GetObservations()

Gets all observations (can be Subjective or Objective depending on Type)

public IEnumerable<ObservationEntry> GetObservations()

Returns

IEnumerable<ObservationEntry>

An enumerable collection of observation entries.

GetPlans()

Gets all plan entries

public IEnumerable<PlanEntry> GetPlans()

Returns

IEnumerable<PlanEntry>

An enumerable collection of plan entries.

GetPrescriptions()

Gets all prescriptions

public IEnumerable<PrescriptionEntry> GetPrescriptions()

Returns

IEnumerable<PrescriptionEntry>

An enumerable collection of prescription entries.

GetPrescriptionsForDiagnosis(Guid)

Gets prescriptions for a specific diagnosis

public IEnumerable<PrescriptionEntry> GetPrescriptionsForDiagnosis(Guid diagnosisId)

Parameters

diagnosisId Guid

The unique identifier of the diagnosis.

Returns

IEnumerable<PrescriptionEntry>

An enumerable collection of prescription entries related to the specified diagnosis.

GetValidationErrors()

Gets validation errors

public List<string> GetValidationErrors()

Returns

List<string>

A list of strings describing any validation errors found in the document.

IsComplete()

Validates the document is complete

public bool IsComplete()

Returns

bool

True if the document meets the minimum requirements for completion; otherwise, false.

RemoveEntry(AbstractClinicalEntry)

Removes an entry from the document. If removing a diagnosis, all related prescriptions are also removed (cascade delete). If removing a prescription, the reference is removed from its parent diagnosis.

public bool RemoveEntry(AbstractClinicalEntry entry)

Parameters

entry AbstractClinicalEntry

The clinical entry to remove.

Returns

bool

True if the entry was removed; false if the entry was not found.

Exceptions

InvalidOperationException

Thrown when attempting to modify a completed document.