SB 04-Jun-2019
This commit is contained in:
@@ -147,6 +147,29 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
// Determine which action types can occur more than once against an admission.
|
||||
public bool IsRestrictedToSingleOccurrence(Spm.AdmissionActionType type)
|
||||
{
|
||||
// 'Repeat admission' can only occur once.
|
||||
switch (type)
|
||||
{
|
||||
case Spm.AdmissionActionType.RepeatAdmission:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsRestrictedToSingleRequired(Spm.AdmissionActionType type)
|
||||
{
|
||||
// Everything apart from 'General'.
|
||||
switch (type)
|
||||
{
|
||||
case Spm.AdmissionActionType.General:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
public DateTime ApplicationFrom
|
||||
{
|
||||
get { return data.ApplicationFrom; }
|
||||
set { CheckChanged(data.ApplicationFrom, value); data.ApplicationFrom = value; }
|
||||
set { CheckChanged(data.ApplicationFrom, value); data.ApplicationFrom = value; }dd
|
||||
}
|
||||
public DateTime ApplicationTo
|
||||
{
|
||||
@@ -171,6 +171,9 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract int GetFacilityCount(Spm.FacilityType type);
|
||||
public abstract bool HasFacilities(Spm.FacilityType type);
|
||||
public abstract bool HasProcedures();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -186,6 +186,7 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract bool HasRoles();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -159,6 +159,7 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract bool HasAdmissionRoles();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -135,10 +135,24 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public Spm.WardAdmissionMode GetBookingMode()
|
||||
{
|
||||
// Based on 'Booking to Facility' flag etc.
|
||||
if (FacilityType == Spm.FacilityType.Ward && IsBookingToFacility)
|
||||
return Spm.WardAdmissionMode.ByWard;
|
||||
return Spm.WardAdmissionMode.ByResource;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public bool IsTemplateRequiredForBooking()
|
||||
{
|
||||
if (GetBookingMode() == Spm.WardAdmissionMode.ByWard)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
String fn = GetType().Name + ".SetData";
|
||||
@@ -208,7 +222,7 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags.
|
||||
public bool BookingToFacility
|
||||
public bool IsBookingToFacility
|
||||
{
|
||||
get { return GetFlag(Flag_BookingToFacility); }
|
||||
set { SetFlag(Flag_BookingToFacility, value); }
|
||||
@@ -217,6 +231,15 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract bool HasTemplates(); // eg. Slots.
|
||||
public abstract bool HasSessions();
|
||||
public abstract bool HasSessionsBefore(DateTime target, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasSessionsAfter(DateTime target, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasSessions(DateTime before, DateTime after, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasAdmissions(Spm.AdmissionCancelType admissionCancelType);
|
||||
public abstract bool HasAdmissionsBefore(DateTime target, Spm.AdmissionCancelType admissionCancelType, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasAdmissionsAfter(DateTime target, Spm.AdmissionCancelType admissionCancelType, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasAdmissions(DateTime before, DateTime after, Spm.AdmissionCancelType admissionCancelType, ref DateTime? earliest, ref DateTime? latest);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -341,14 +341,22 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
set { CheckChanged(data.ApplicationTo, value); data.ApplicationTo = value; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract bool HasDataItems(); // eg. Slots.
|
||||
public abstract bool HasSessions();
|
||||
public abstract bool HasSessionsBefore(DateTime target, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasSessionsAfter(DateTime target, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasSessions(DateTime before, DateTime after, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasAdmissions(Spm.AdmissionCancelType admissionCancelType);
|
||||
public abstract bool HasAdmissionsBefore(DateTime target, Spm.AdmissionCancelType admissionCancelType, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasAdmissionsAfter(DateTime target, Spm.AdmissionCancelType admissionCancelType, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract bool HasAdmissions(DateTime before, DateTime after, Spm.AdmissionCancelType admissionCancelType, ref DateTime? earliest, ref DateTime? latest);
|
||||
public abstract long GetSessionComplexityCount(DateTime admission, String complexity,SysId admissionExcludeId);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -138,6 +138,8 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract bool HasProcedures();
|
||||
public abstract long GetProcedureCount(String filter = null);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -215,6 +215,7 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
public abstract bool HasAdmission();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a E l e m e n t s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
public abstract bool HasAdmission();
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.Bus;
|
||||
using Sarand.PatientMgr.Core.App;
|
||||
|
||||
namespace Sarand.PatientMgr.Core.Bus
|
||||
{
|
||||
@@ -32,8 +33,18 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
{
|
||||
//Status = TemplateDataStatus;
|
||||
}
|
||||
public SysId FacilityTemplateId { get; set; }
|
||||
public Spm.TemplateDataType TemplateDataType { get; set; }
|
||||
public short Seq { get; set; }
|
||||
public String Identifier { get; set; }
|
||||
public String Value { get; set; }
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
FacilityTemplateId = FacilityTemplateId;
|
||||
TemplateDataType = TemplateDataType;
|
||||
Seq = Seq;
|
||||
Identifier = Identifier;
|
||||
Value = Value;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
@@ -47,7 +58,11 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
// ErrField.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
|
||||
public ValidValue FacilityTemplateId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue TemplateDataType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Seq { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Identifier { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Value { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -99,6 +114,31 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Attributes.
|
||||
public SysId FacilityTemplateId
|
||||
{
|
||||
get { return data.FacilityTemplateId; }
|
||||
set { CheckChanged(data.FacilityTemplateId, value); data.FacilityTemplateId = value; }
|
||||
}
|
||||
public Spm.TemplateDataType TemplateDataType
|
||||
{
|
||||
get { return data.TemplateDataType; }
|
||||
set { CheckChanged((int)data.TemplateDataType, (int)value); data.TemplateDataType = value; }
|
||||
}
|
||||
public short Seq
|
||||
{
|
||||
get { return data.Seq; }
|
||||
set { CheckChanged(data.Seq, value); data.Seq = value; }
|
||||
}
|
||||
public String Identifier
|
||||
{
|
||||
get { return data.Identifier; }
|
||||
set { CheckChanged(data.Identifier, value); data.Identifier = value; }
|
||||
}
|
||||
public String Value
|
||||
{
|
||||
get { return data.Value; }
|
||||
set { CheckChanged(data.Value, value); data.Value = value; }
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -123,7 +163,12 @@ namespace Sarand.PatientMgr.Core.Bus
|
||||
// List filtering.
|
||||
public List<SysId> IncludedIds { get; } = new List<SysId>();
|
||||
public List<SysId> ExcludedIds { get; } = new List<SysId>();
|
||||
// ###.
|
||||
// Template Data.
|
||||
public SysId FacilityTemplateId { get; set; }
|
||||
public Spm.TemplateDataType TemplateDataType { get; set; }
|
||||
public short Seq { get; set; }
|
||||
public String Identifier { get; set; }
|
||||
public String Value { get; set; }
|
||||
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.Any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user