57 lines
2.3 KiB
C#
57 lines
2.3 KiB
C#
using Rinta.Domain.Common;
|
|
|
|
namespace Rinta.Domain.Entities;
|
|
|
|
public enum PrescriptionStatus
|
|
{
|
|
Active,
|
|
Discontinued,
|
|
Completed
|
|
}
|
|
|
|
/// <summary>
|
|
/// En läkemedelsordination. Precis som ClinicalNote räknas detta som
|
|
/// journaldata enligt Patientdatalagen och följer samma append-only-princip:
|
|
/// en ordination ändras aldrig i efterhand. Att "ändra dos" innebär att
|
|
/// den gamla ordinationen sätts ut (Discontinue) och en ny skapas, länkad
|
|
/// via ReplacesPrescriptionId - precis som rättelseflödet för ClinicalNote.
|
|
/// </summary>
|
|
public class Prescription : TenantEntityBase
|
|
{
|
|
public Guid PatientId { get; set; }
|
|
public Patient? Patient { get; set; }
|
|
|
|
/// <summary>Fritextnamn på preparatet, t.ex. "Alvedon 500 mg tablett".</summary>
|
|
public string DrugName { get; set; } = string.Empty;
|
|
|
|
/// <summary>WHO ATC-kod (Anatomical Therapeutic Chemical), t.ex. "N02BE01" för paracetamol.
|
|
/// ATC är den internationella klassificeringsstandard som även svensk sjukvård använder.</summary>
|
|
public string? AtcCode { get; set; }
|
|
|
|
/// <summary>Om ordinationen härrör från en slagning mot extern läkemedelskälla.</summary>
|
|
public Guid? MedicationCatalogEntryId { get; set; }
|
|
|
|
public string Dosage { get; set; } = string.Empty; // t.ex. "1 tablett"
|
|
public string Frequency { get; set; } = string.Empty; // t.ex. "3 gånger dagligen vid behov"
|
|
public string? Route { get; set; } // t.ex. "Oralt", "Intravenöst"
|
|
|
|
/// <summary>ICD-10-kod för diagnosen ordinationen avser, t.ex. "R51" (huvudvärk).</summary>
|
|
public string? DiagnosisCode { get; set; }
|
|
public string? DiagnosisDescription { get; set; }
|
|
|
|
public DateOnly StartDate { get; set; }
|
|
public DateOnly? PlannedEndDate { get; set; }
|
|
|
|
public string PrescribingClinicianUserId { get; set; } = string.Empty;
|
|
|
|
public bool IsSigned { get; set; } = false;
|
|
public DateTimeOffset? SignedAtUtc { get; set; }
|
|
|
|
public PrescriptionStatus Status { get; set; } = PrescriptionStatus.Active;
|
|
public DateTimeOffset? DiscontinuedAtUtc { get; set; }
|
|
public string? DiscontinuationReason { get; set; }
|
|
|
|
/// <summary>Sätts när denna ordination ersätter en tidigare (t.ex. dosjustering).</summary>
|
|
public Guid? ReplacesPrescriptionId { get; set; }
|
|
}
|