672 lines
18 KiB
C#
672 lines
18 KiB
C#
using Sarand.Core.Base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Sarand.PatientMgr.Core.App
|
|
{
|
|
//=======================================================================
|
|
public static class Spm
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Version.
|
|
public static String Version { get; } = "0.0.1";
|
|
// History.
|
|
// 0.0.1 Apr-2019 Initial.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Constants.
|
|
public static readonly String ApplicationCaption = "Sarand PatientMgr";
|
|
// System defaults.
|
|
public static int Default_UpdateLimitDaysInPast { get; } = 7;
|
|
public static int Default_UpdateLimitDaysInPast_Min { get; } = 1;
|
|
public static int Default_UpdateLimitDaysInPast_Max { get; } = 60;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Site. NB Only code should be used on database.
|
|
public enum Site
|
|
{
|
|
Unknown = 0,
|
|
ANT = 10, /* Addenbrookes */
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// System codes - predefined lists of codes that cannot be changed.
|
|
public enum SystemCode
|
|
{
|
|
Unknown = 0,
|
|
// General.
|
|
Site = 1,
|
|
DataItemType,
|
|
// Item options.
|
|
ItemOption,
|
|
ItemOptionContext_Flag,
|
|
ItemOptionContext_Value,
|
|
ItemOptionContext_CodeList,
|
|
ItemOptionContext_ScheduleColour,
|
|
ItemOptionContext_FieldLabel,
|
|
ItemOptionContext_ShowField,
|
|
ItemOptionContext_ExportField,
|
|
ItemOptionContext_AdmissionTiming,
|
|
ItemOptionContext_AdmValueList,
|
|
ItemOptionContext_CombineAdmNotes,
|
|
ItemOptionContext_CombinePatDetails,
|
|
ItemOptionContext_SessionUtilMeasure,
|
|
ItemOptionContext_SessionUtilisation,
|
|
ItemOptionContext_SessionUtilThreshold,
|
|
ItemOptionContext_ScheduleHighlight,
|
|
// Employees
|
|
EmployeeRole,
|
|
// Patient.
|
|
Gender,
|
|
PatientDataSource,
|
|
// Facilities.
|
|
FacilityType,
|
|
ScheduleType,
|
|
TemplateMapType,
|
|
SessionModel,
|
|
ScheduleFreezeType,
|
|
ResourceCategory,
|
|
//TemplateType, Not used directly.
|
|
TheatreSessionType, // Subset of TemplateType values.
|
|
ClinicSessionType, // Subset of TemplateType values.
|
|
WardResourceType, // Subset of TemplateType values.
|
|
ResourceCapacityType,
|
|
ResourceLoadingType,
|
|
TemplateDataType,
|
|
ProcedureComplexity,
|
|
// Admissions.
|
|
AdmissionOccupancy,
|
|
AdmissionActionType,
|
|
AdmissionCancelType,
|
|
AttendanceType,
|
|
AttendanceStatus,
|
|
WardPeriodLength,
|
|
WardResourceDisplay,
|
|
WardHighlighting,
|
|
// Reports.
|
|
ReportSpacing,
|
|
}
|
|
|
|
//-----------------------------------------------------------------------
|
|
// Code types - defined by the user.
|
|
public enum SystemCodeType
|
|
{
|
|
Unknown = 0,
|
|
Ward,
|
|
// Anaesthetic,
|
|
// OperationPosition,
|
|
ComfortScore,
|
|
};
|
|
public enum CodeType
|
|
{
|
|
Unknown = 0,
|
|
Anaesthetic,
|
|
OperationPosition,
|
|
OperatingSpeciality,
|
|
Allergy,
|
|
RiskFactor,
|
|
};
|
|
|
|
//-----------------------------------------------------------------------
|
|
// Data Item Types - identifiers the types of data items.
|
|
// NB Do not change the value associated with each item - these are tied to the database.
|
|
public enum DataItemType
|
|
{
|
|
Unknown = -1,
|
|
// Values are tied to the database - do not change.
|
|
Institution = 10,
|
|
Department = 11,
|
|
Facility = 20,
|
|
Employee = 21,
|
|
Patient = 22,
|
|
Operation = 23,
|
|
FacilityTemplate = 30,
|
|
TemplateSlot = 31,
|
|
FacilitySession = 32,
|
|
EmployeeRole = 33,
|
|
Procedure = 34,
|
|
Admission = 40,
|
|
AdmissionRole = 41,
|
|
// 'Virtual' item types - subsets of main item type.
|
|
/* Employee Roles of type 'Consultant'. */
|
|
RoleConsultant = 100,
|
|
/* Codes of type 'Speciality'. */
|
|
CodeSpeciality = 101,
|
|
// System data types.
|
|
SecItem = SaDataItemType.SecItem,
|
|
CodeType = SaDataItemType.CodeType,
|
|
Code = SaDataItemType.Code,
|
|
Interface = SaDataItemType.Interface,
|
|
ItemOption = SaDataItemType.ItemOption,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Item Configuration Options.
|
|
public enum ItemOptionType
|
|
{
|
|
Flag, // Discrete Yes/No values (tailored context list by item type).
|
|
Value, // Discrete values (tailored context list by item type).
|
|
CodeList, // Comma separated list of codes - tailored context list by item type.
|
|
SessionModel, // See defined list, eg. Maternity
|
|
ScheduleColour, // Schedule colour options.
|
|
FieldLabel, // Used to change default field label (eg. admission system ref)
|
|
Admission_DefaultProcedure, // Free text eg. 'Caesarian Section'
|
|
Admission_DefaultSpeciality, // Speciality code
|
|
Admission_DefaultComplexity, // Complexity code
|
|
Admission_DefaultWard, // Ward code
|
|
Admission_ValueList, // Comma separated list, eg. Procedure indications.
|
|
Admission_ShowField, // Used to identify optional fields to be shown in dialogs, views and reports.
|
|
Admission_ExportField, // Used to identify additional fields to export with schedule details.
|
|
Admission_AdmissionTiming, // Flag timing events that are to be recorded.
|
|
FilterAttrTypes, // To store user's filter sequence (system maintained).
|
|
Schedule_MinWeeks,
|
|
Schedule_CombineAdmNotes,
|
|
Schedule_CombinePatDetails,
|
|
Schedule_ReportAdmissionSpacing,
|
|
UpdateLimitDaysInPast,
|
|
SpecialityBackgroundColour,
|
|
SessionUtilMeasure,
|
|
SessionUtilisation,
|
|
SessionUtilThreshold,
|
|
ScheduleHighlight,
|
|
TheatreListTypeDisplay, // Associated types from SystemCodeTheatreSessionType codes.
|
|
ClinicListTypeDisplay, // Associated types from SystemCodeClinicSessionType codes.
|
|
AttendanceBorderColour,
|
|
};
|
|
// Discrete Flags - NB Default should always be 'No'.
|
|
public enum ItemOptionContext_Flag
|
|
{
|
|
// Configuration flag options.
|
|
Admission_AllowOverlappingTemplates, // Otherwise, Templates in each facility must have different times.
|
|
Admission_AllowMultiplePatientSessionBookings, // Otherwise, patient can only be booked once in a session.
|
|
Admission_GenerateChangeSessionMovement, // Auto store 'Moved' type cancellation for session change.
|
|
Admission_RecordTimings, // Show timimgs page on admission on and after day of admission.
|
|
Admission_AllowAdmissionDuplication, // Allow unassigned admissions to be duplicated against future sessions.
|
|
Template_AllowUnits, // Allow Units to be defined against Templates and entered against admissions.
|
|
};
|
|
// Discrete values.
|
|
public enum ItemOptionContext_Value
|
|
{
|
|
// Configuration value options.
|
|
ScheduleDisplayWeeks_Theatre,
|
|
ScheduleDisplayWeeks_Clinic,
|
|
ScheduleDisplayWeeks_Ward,
|
|
FacilityCapacity,
|
|
FacilityCapacity_Male,
|
|
FacilityCapacity_Female,
|
|
};
|
|
// Comma separated lists of codes.
|
|
public enum ItemOptionContext_CodeList
|
|
{
|
|
// Department configuration code lists.
|
|
WaitingListSpeciality_Include,
|
|
WaitingListSpeciality_Exclude,
|
|
};
|
|
// Fields whose labels can be specified
|
|
public enum ItemOptionContext_FieldLabel
|
|
{
|
|
Admission_SystemRef,
|
|
Admission_AttendingSurgeon,
|
|
};
|
|
// Admission fields that are optionally shown.
|
|
public enum ItemOptionContext_ShowField
|
|
{
|
|
Tci,
|
|
Gender,
|
|
PatientHistory,
|
|
BreechOn,
|
|
DecisionToAdmitOn,
|
|
SystemRef,
|
|
ReferringConsultant,
|
|
AttendingSurgeon,
|
|
ProcedureIndication,
|
|
Operation,
|
|
Position,
|
|
SpecialEquipment,
|
|
ComfortScore,
|
|
AttendanceType,
|
|
AttendanceStatus,
|
|
CancelTimeLimit,
|
|
CancelReason,
|
|
CancelNotes,
|
|
};
|
|
// Admission fields that are optionally Exported.
|
|
public enum ItemOptionContext_ExportField
|
|
{
|
|
OperatingConsultantCode,
|
|
OperatingSurgeonCode,
|
|
PatientNo,
|
|
PatientName,
|
|
PatientForename,
|
|
PatientSurname,
|
|
ProcedureIndication,
|
|
BreechOn,
|
|
DecisionToAdmitOn,
|
|
};
|
|
// Admission timings.
|
|
public enum ItemOptionContext_AdmissionTiming
|
|
{
|
|
Called,
|
|
Arrived,
|
|
AnaesStart,
|
|
ProcStart,
|
|
ProcEnd,
|
|
InRecovery,
|
|
InformDest,
|
|
Leave,
|
|
};
|
|
// Admission fields with default lists.
|
|
public enum ItemOptionContext_AdmValueList
|
|
{
|
|
ProcedureDesc,
|
|
ProcedureIndication,
|
|
Ward,
|
|
ComfortScore,
|
|
CancelReason,
|
|
ProcedureKit,
|
|
};
|
|
// Admission fields to combine with notes.
|
|
public enum ItemOptionContext_CombineAdmNotes
|
|
{
|
|
PatientHistory,
|
|
GestationPeriod,
|
|
BreechOn,
|
|
DecisionToAdmitOn,
|
|
ProcedureIndication,
|
|
};
|
|
// Admission fields to combine with patient details.
|
|
public enum ItemOptionContext_CombinePatDetails
|
|
{
|
|
SystemRef,
|
|
};
|
|
// Session utilisation options.
|
|
public enum ItemOptionContext_SessionUtilMeasure
|
|
{
|
|
Duration = 10,
|
|
Units = 20,
|
|
Default = Duration,
|
|
};
|
|
public enum ItemOptionContext_SessionUtilisation
|
|
{
|
|
BlankPatientNoIsReservedAdmission,
|
|
ExcludeReservedAdmissions,
|
|
IncludeSessionBreakDuration,
|
|
};
|
|
public enum ItemOptionContext_SessionUtilThreshold
|
|
{
|
|
SessionUtilThreshold_Low,
|
|
SessionUtilThreshold_High,
|
|
};
|
|
public enum ItemOptionContext_ScheduleHighlight
|
|
{
|
|
FacilityName,
|
|
SessionName,
|
|
};
|
|
public enum ItemOptionContext_ScheduleColour
|
|
{
|
|
SessionBackground,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Employee roles.
|
|
public enum EmployeeRole
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Consultant = 10,
|
|
Surgeon = 11,
|
|
Anaesthetist = 12,
|
|
};
|
|
// Employee role categories.
|
|
public enum EmployeeRoleCategory
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Operating = 10, // Surgeon/Consultant designated for operation.
|
|
Referring = 11, // Surgeon/Consultant referring the patient for procedure.
|
|
Attending = 12, // Surgeon/Consultant actually carrying out the procedure.
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Patient definitions.
|
|
public enum Gender
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Female = 1,
|
|
Male = 2,
|
|
Unspecified = 9,
|
|
};
|
|
public enum PatientDataSource
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Patient = 10, // Internal tables.
|
|
Admission,
|
|
Demographics, // Interfaces.
|
|
WaitingList,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Facility type.
|
|
public enum FacilityType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Theatre = 10,
|
|
Clinic = 20,
|
|
Ward = 30,
|
|
Apparatus = 40,
|
|
};
|
|
// Schedule type.
|
|
public enum ScheduleType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Theatre = 10,
|
|
Clinic = 20,
|
|
Ward = 30,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Ward admission mode.
|
|
public enum WardAdmissionMode
|
|
{
|
|
Unknown = 0,
|
|
ByResource, // Booking against bed, chair etc.
|
|
ByWard, // Booking direct to ward (not specific resource).
|
|
};
|
|
// Ward Period length.
|
|
public enum WardPeriodLength
|
|
{
|
|
Unknown,
|
|
Week,
|
|
Weeks_2,
|
|
Weeks_4,
|
|
Weeks_6,
|
|
Weeks_8,
|
|
};
|
|
// Ward Resource display.
|
|
public enum WardResourceDisplay
|
|
{
|
|
Unknown,
|
|
Summary,
|
|
Narrow,
|
|
Standard,
|
|
Wide,
|
|
};
|
|
// Ward Highlighting.
|
|
public enum WardHighlighting
|
|
{
|
|
Unknown,
|
|
None,
|
|
Duration,
|
|
Gender,
|
|
ReferringCons,
|
|
Speciality,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Facility template map type.
|
|
public enum FacilityTemplateMapType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
None = 1,
|
|
RollingWeek = 10,
|
|
WeekdayInstanceInMonth = 11,
|
|
WorkingWeekInMonth = 12,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Template Session format.
|
|
public enum SessionModel
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Default = 1,
|
|
Standard = 10,
|
|
Maternity = 20,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Schedule Freeze type.
|
|
public enum ScheduleFreezeType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
None = 1,
|
|
FixedTimePreviousDay = 10,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
public enum ResourceCategory
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
TheatreList = 10,
|
|
ClinicList = 20,
|
|
WardResource = 30,
|
|
WardAdmissionList = 31,
|
|
WardDischargeList = 32,
|
|
};
|
|
public enum TemplateType
|
|
{
|
|
Unknown = -1,
|
|
// Values are tied to the database - do not change.
|
|
None = 0,
|
|
// Theatre template types.
|
|
TheatreSession_Service = 10,
|
|
TheatreSession_Training = 20,
|
|
// Clinic template types.
|
|
ClinicSession_Service = 10,
|
|
ClinicSession_Training = 20,
|
|
// Ward resource types.
|
|
WardResource_Bed = 10,
|
|
WardResource_Chair = 11,
|
|
WardResource_Bay = 20,
|
|
WardResource_Room = 21,
|
|
};
|
|
// Ward resource capacity types.
|
|
public enum ResourceCapacityTypeContext
|
|
{
|
|
WardResource,
|
|
ClinicSession,
|
|
};
|
|
public enum ResourceCapacityType
|
|
{
|
|
Unknown = -1,
|
|
// Values are tied to the database - do not change.
|
|
None = 0,
|
|
Single = 10,
|
|
Double = 20,
|
|
DoubleExclusive = 21, // Exclusive booking takes all slots.
|
|
Triple = 30,
|
|
TripleExclusive = 31,
|
|
Quadruple = 40,
|
|
QuadrupleExclusive = 41,
|
|
};
|
|
public enum ResourceLoadingType
|
|
{
|
|
Unknown = -1,
|
|
// Values are tied to the database - do not change.
|
|
None = 0,
|
|
Units = 10,
|
|
};
|
|
// Template associated Data Type.
|
|
public enum TemplateDataType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
ComplexityCapacity = 10,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Procedure complexity.
|
|
public enum ProcedureComplexity
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Minor = 10,
|
|
Intermediate = 20,
|
|
Major = 30,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Admission type.
|
|
public enum AdmissionType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
TheatreDayCase = 10,
|
|
TheatreInPatientElective = 12,
|
|
TheatreEmergency = 13,
|
|
ClinicBooking = 20,
|
|
WardAdmission = 30,
|
|
WardReservation = 39,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Admission Occupancy.
|
|
public enum AdmissionOccupancy
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Single = 10,
|
|
Exclusive = 11,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Admission Data type.
|
|
public enum AdmissionDataType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Allergy = 10,
|
|
RiskFactor = 11,
|
|
ProcedureKit = 20, // Added Apr2014. Add code & Caption to AdmissionData table.
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Admission Action type.
|
|
public enum AdmissionActionType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
SendLetter = 10,
|
|
RepeatAdmission = 20,
|
|
ArrangeTransport = 30,
|
|
Filing = 40,
|
|
Prescription = 50,
|
|
General = 990,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Attendance Type.
|
|
public enum AttendanceType
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
OutPatient = 10,
|
|
InPatient = 20,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Attendance status.
|
|
public enum AttendanceStatus
|
|
{
|
|
Unknown = 0,
|
|
// Values are tied to the database - do not change.
|
|
Arrived = 10,
|
|
Discharged = 15,
|
|
Cancelled = 20,
|
|
Dna = 30,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Admission cancellation type.
|
|
public enum AdmissionCancelType
|
|
{
|
|
// Anything other than 'None' ('0').
|
|
Cancelled = -2,
|
|
Unknown = -1,
|
|
// Values are tied to the database - do not change.
|
|
None = 0,
|
|
CancelTimeLimit = 10,
|
|
CancelOther = 11,
|
|
Deletion = 12,
|
|
ChangeSession = 20,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Security Rights.
|
|
public enum SecurityRight
|
|
{
|
|
ManageSecurity,
|
|
ManageConfig,
|
|
ManageDb,
|
|
// Security rights associated with specific department.
|
|
DepartmentView,
|
|
DepartmentReserve,
|
|
DepartmentUpdate,
|
|
DepartmentConfig,
|
|
// Security rights associated with specific consultant.
|
|
ConsultantView,
|
|
ConsultantUpdate,
|
|
// Security rights associated with specific speciality.
|
|
SpecialityView,
|
|
SpecialityUpdate,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// List controls.
|
|
public enum ListCtrl
|
|
{
|
|
Cancellations = 140,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Spacing for reports.
|
|
public enum ReportSpacing
|
|
{
|
|
Narrow,
|
|
Standard,
|
|
Wide,
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
// Schedule display.
|
|
// Text justification.
|
|
public enum Justification
|
|
{
|
|
Left,
|
|
Center,
|
|
Right
|
|
};
|
|
// Display columns.
|
|
public enum DisplayColumn
|
|
{
|
|
Ref,
|
|
Period,
|
|
Facility,
|
|
Patient, // Summary - number and name.
|
|
PatientNo,
|
|
PatientName,
|
|
PatientDob,
|
|
PatientAge,
|
|
PatientHistory,
|
|
GestationPeriod,
|
|
Ward,
|
|
Consultant,
|
|
Surgeon,
|
|
Procedure,
|
|
SpecialEquipment,
|
|
Time,
|
|
Anaesthetic,
|
|
Position,
|
|
Kit,
|
|
HasRisk,
|
|
Notes,
|
|
LastUpdate
|
|
};
|
|
// Display font sizes.
|
|
public enum DisplayFont
|
|
{
|
|
Standard,
|
|
Medium,
|
|
Large
|
|
};
|
|
// Display boundaries.
|
|
public enum DisplayBoundary
|
|
{
|
|
Period,
|
|
Session,
|
|
Admission
|
|
};
|
|
//-----------------------------------------------------------------------
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|