123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- using MongoDB.Bson.Serialization.Attributes;
- using SharpCompress.Common;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Flyinsono.DBCopy.Tool.Entities
- {
- internal class TerminalDatas
- {
- public string Id { get; private set; }
- public DateTime CreateTime { get; private set; }
- public DateTime UpdateTime { get; set; }
- public VidType DataType { get; set; }
- public string Application { get; set; }
- public string PreviewImageFileToken { get; set; }
- public string PatientInfoId { get; set; }
- public IList<TerminalDataFile> Files { get; set; }
- public IList<TerminalDataComment> Comments { get; set; }
- public string TerminalRecordId { get; set; }
- /// <summary>
- /// Gets the image location.
- /// </summary>
- public ImageLocation ImageLocation { get; set; }
- /// <summary>
- /// 图像质控内容
- /// </summary>
- [BsonIgnoreIfNull]
- public ICollection<QualityControlData> QualityControlDatas { get; set; }
- /// <summary>
- /// 器官识别结果
- /// </summary>
- public List<EnumOrgans> OrganDiagnosisResult { get; set; }
- }
- internal class TerminalData
- {
- public string Id { get; set; }
- public string PreviewImageFileToken { get; set; }
- public IList<TerminalDataFile> Files { get; set; }
- }
- /// <summary>
- /// The base class for image location, different application has different implementation.
- /// </summary>
- [BsonKnownTypes(typeof(BreastImageLocation), typeof(LiverImageLocation), typeof(PositionImageLocation))]
- class ImageLocation
- {
- }
- /// <summary>
- /// Define the BreastImageLocation stored in database
- /// </summary>
- class BreastImageLocation : ImageLocation
- {
- public Position Position { get; set; }
- public QuadrantEnum Quadrant { get; set; }
- public bool Equals(BreastImageLocation other)
- {
- if (other == null)
- {
- return false;
- }
- return Position == other.Position && Quadrant == other.Quadrant;
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- return obj is BreastImageLocation && Equals((BreastImageLocation)obj);
- }
- public override int GetHashCode()
- {
- unchecked
- {
- var hashCode = Position.GetHashCode();
- hashCode = (hashCode * 397) ^ Quadrant.GetHashCode();
- return hashCode;
- }
- }
- }
- class LiverImageLocation : ImageLocation
- {
- public LiverPosition Position { get; set; }
- public bool Equals(LiverImageLocation other)
- {
- if (other == null)
- {
- return false;
- }
- return Position == other.Position;
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- return obj is LiverImageLocation && Equals((LiverImageLocation)obj);
- }
- public override int GetHashCode()
- {
- unchecked
- {
- var hashCode = Position.GetHashCode();
- return hashCode;
- }
- }
- }
- class PositionImageLocation : ImageLocation
- {
- public string Group { get; set; }
- public string Position { get; set; }
- public bool Equals(PositionImageLocation other)
- {
- if (other == null)
- {
- return false;
- }
- return Position == other.Position && Group == other.Group;
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- return obj is PositionImageLocation && Equals((PositionImageLocation)obj);
- }
- public override int GetHashCode()
- {
- unchecked
- {
- var hashCode = Position.GetHashCode();
- hashCode = (hashCode * 397) ^ Group.GetHashCode();
- return hashCode;
- }
- }
- }
- public enum QuadrantEnum
- {
- OuterUpper,
- InnerUpper,
- OuterLower,
- InnerLower
- }
- /// <summary>
- /// left or right position
- /// </summary>
- public enum Position
- {
- None,
- Left,
- Right
- }
- public enum LiverPosition
- {
- LeftLobe,
- RightLobeOfUnder,
- RightLobeOfInter
- }
- internal class TerminalDataComment
- {
- public string Id { get; set; }
- public DateTime CreateTime { get; set; }
- public DateTime UpdateTime { get; set; }
- public AdminInfo User { get; set; }
- public double Score { get; set; }
- public string Description { get; set; }
- }
- internal class TerminalDataFile
- {
- public string Id { get; set; }
- public DateTime CreateTime { get; set; }
- public DateTime UpdateTime { get; set; }
- /// <summary>
- /// Indicate report file name
- /// </summary>
- public string FileName { get; set; }
- public ImageQuality ImageQuality { get; set; }
- }
- public enum ImageQuality
- {
- High,
- Low
- }
- public enum VidType
- {
- VinnoVidSingle,
- ThirdVidSingle,
- VinnoVidMovie,
- ThirdVidMovie,
- Image
- }
- }
|