complete editing medical history and add ga

master
Amir Hossein Khademi 2023-11-05 16:14:13 +03:30
parent 99648676b3
commit 52b3a9ec89
38 changed files with 871 additions and 321 deletions

View File

@ -1,4 +1,6 @@
namespace DocuMed.Core.CoreServices; using DocuMed.Domain.Entities.City;
namespace DocuMed.Core.CoreServices;
public class AccountService : IAccountService public class AccountService : IAccountService
@ -10,6 +12,7 @@ public class AccountService : IAccountService
private readonly ICurrentUserService _currentUserService; private readonly ICurrentUserService _currentUserService;
private readonly IUserService _userService; private readonly IUserService _userService;
private readonly ISmsService _smsService; private readonly ISmsService _smsService;
private readonly IRepositoryWrapper _repositoryWrapper;
public AccountService( public AccountService(
UserManager<ApplicationUser> userManager, UserManager<ApplicationUser> userManager,
@ -17,7 +20,8 @@ public class AccountService : IAccountService
IJwtService jwtService, IJwtService jwtService,
ICurrentUserService currentUserService, ICurrentUserService currentUserService,
IUserService userService, IUserService userService,
ISmsService smsService) ISmsService smsService,
IRepositoryWrapper repositoryWrapper)
{ {
_userManager = userManager; _userManager = userManager;
_userSignInManager = userSignInManager; _userSignInManager = userSignInManager;
@ -25,6 +29,7 @@ public class AccountService : IAccountService
_currentUserService = currentUserService; _currentUserService = currentUserService;
_userService = userService; _userService = userService;
_smsService = smsService; _smsService = smsService;
_repositoryWrapper = repositoryWrapper;
} }
@ -134,8 +139,22 @@ public class AccountService : IAccountService
} }
private async Task<AccessToken<ApplicationUserSDto>> CompleteLogin(ApplicationUser user, CancellationToken cancellationToken) private async Task<AccessToken<ApplicationUserSDto>> CompleteLogin(ApplicationUser user, CancellationToken cancellationToken)
=> await _jwtService.Generate<ApplicationUserSDto, ApplicationUser>(user); {
var token = await _jwtService.Generate<ApplicationUserSDto, ApplicationUser>(user);
if (token.User.SectionId != Guid.Empty)
{
var section = await _repositoryWrapper.SetRepository<Section>().TableNoTracking
.FirstOrDefaultAsync(s => s.Id == user.SectionId, cancellationToken);
if (section != null)
{
token.User.SectionName = section.Name;
}
}
return token;
}

View File

@ -21,14 +21,36 @@ public class MedicalHistoryService : IMedicalHistoryService
throw new AppException("شرح حال پیدا نشد", ApiResultStatusCode.NotFound); throw new AppException("شرح حال پیدا نشد", ApiResultStatusCode.NotFound);
var ent = MedicalHistory.Create(template.ChiefComplaint, template.SectionId, template.FirstName, var ent = MedicalHistory.Create(template.ChiefComplaint, template.SectionId, template.FirstName,
template.LastName, template.FatherName, template.NationalId, template.Temperature, template.BirthDate, template.LastName, template.FatherName, template.NationalId, template.Age, template.BirthDate,
template.PresentIllnessDetail, template.PastDiseasesHistoryDetail, template.PastSurgeryHistoryDetail, template.PresentIllnessDetail, template.PastDiseasesHistoryDetail, template.PastSurgeryHistoryDetail,
template.FamilyHistoryDetail, template.AllergyDetail, template.DrugHistoryDetail, template.FamilyHistoryDetail, template.AllergyDetail, template.DrugHistoryDetail,
template.AddictionHistoryDetail, template.SystemReviewDetail, template.VitalSignDetail, template.AddictionHistoryDetail, template.SystemReviewDetail, template.VitalSignDetail, template.GeneralAppearanceDetail,
template.SystolicBloodPressure, template.DiastolicBloodPressure, template.PulseRate, template.SPO2, template.SystolicBloodPressure, template.DiastolicBloodPressure, template.PulseRate, template.SPO2,
template.Temperature, template.ApplicationUserId); template.Temperature, template.ApplicationUserId, template.MedicalHistoryTemplateId);
ent.Id = template.Id; ent.Id = template.Id;
foreach (var answer in template.Answers.Where(a=>a.Id == Guid.Empty))
ent.AddAnswer(answer.Answer, answer.Question, answer.Part, answer.QuestionType);
foreach (var answer in template.Answers.Where(a => a.Id != Guid.Empty))
{
var dbAnswer = await _repositoryWrapper.SetRepository<MedicalHistoryAnswer>().TableNoTracking
.FirstOrDefaultAsync(a => a.Id == answer.Id, cancellationToken);
if (dbAnswer != null && dbAnswer.Answer != answer.Answer)
{
dbAnswer = MedicalHistoryAnswer.Create(answer.Answer, answer.Question, answer.Part, answer.QuestionType,
dbAnswer.MedicalHistoryId);
dbAnswer.Id = answer.Id;
_repositoryWrapper.SetRepository<MedicalHistoryAnswer>().Update(dbAnswer);
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
}
}
_medicalHistoryRepository.Update(ent);
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
return true; return true;
} }
@ -37,12 +59,12 @@ public class MedicalHistoryService : IMedicalHistoryService
if (!Guid.TryParse(_currentUserService.UserId, out Guid userId)) if (!Guid.TryParse(_currentUserService.UserId, out Guid userId))
throw new AppException("دسترسی غیرمجاز", ApiResultStatusCode.UnAuthorized); throw new AppException("دسترسی غیرمجاز", ApiResultStatusCode.UnAuthorized);
var ent = MedicalHistory.Create(template.ChiefComplaint, template.SectionId, template.FirstName, var ent = MedicalHistory.Create(template.ChiefComplaint, template.SectionId, template.FirstName,
template.LastName, template.FatherName, template.NationalId, template.Temperature, template.BirthDate, template.LastName, template.FatherName, template.NationalId, template.Age, template.BirthDate,
template.PresentIllnessDetail, template.PastDiseasesHistoryDetail, template.PastSurgeryHistoryDetail, template.PresentIllnessDetail, template.PastDiseasesHistoryDetail, template.PastSurgeryHistoryDetail,
template.FamilyHistoryDetail, template.AllergyDetail, template.DrugHistoryDetail, template.FamilyHistoryDetail, template.AllergyDetail, template.DrugHistoryDetail,
template.AddictionHistoryDetail, template.SystemReviewDetail, template.VitalSignDetail, template.AddictionHistoryDetail, template.SystemReviewDetail, template.VitalSignDetail, template.GeneralAppearanceDetail,
template.SystolicBloodPressure, template.DiastolicBloodPressure, template.PulseRate, template.SPO2, template.SystolicBloodPressure, template.DiastolicBloodPressure, template.PulseRate, template.SPO2,
template.Temperature, userId); template.Temperature, userId,template.MedicalHistoryTemplateId);
foreach (var answer in template.Answers) foreach (var answer in template.Answers)
ent.AddAnswer(answer.Answer, answer.Question, answer.Part, answer.QuestionType); ent.AddAnswer(answer.Answer, answer.Question, answer.Part, answer.QuestionType);

View File

@ -12,6 +12,8 @@ public class MedicalHistoryLDto : BaseDto<MedicalHistoryLDto,MedicalHistory>
public int Age { get; set; } public int Age { get; set; }
public DateTime BirthDate { get; set; } public DateTime BirthDate { get; set; }
public SectionSDto Section { get; set; } = new();
public string PresentIllnessDetail { get; set; } = string.Empty; public string PresentIllnessDetail { get; set; } = string.Empty;
public string PastDiseasesHistoryDetail { get; set; } = string.Empty; public string PastDiseasesHistoryDetail { get; set; } = string.Empty;
public string PastSurgeryHistoryDetail { get; set; } = string.Empty; public string PastSurgeryHistoryDetail { get; set; } = string.Empty;
@ -23,7 +25,7 @@ public class MedicalHistoryLDto : BaseDto<MedicalHistoryLDto,MedicalHistory>
public string VitalSignDetail { get; set; } = string.Empty; public string VitalSignDetail { get; set; } = string.Empty;
public string GeneralAppearanceDetail { get; set; } = string.Empty; public string GeneralAppearanceDetail { get; set; } = string.Empty;
public Guid MedicalHistoryTemplateId { get; set; }
public int SystolicBloodPressure { get; set; } public int SystolicBloodPressure { get; set; }
public int DiastolicBloodPressure { get; set; } public int DiastolicBloodPressure { get; set; }
public int PulseRate { get; set; } public int PulseRate { get; set; }

View File

@ -10,4 +10,6 @@ public class MedicalHistoryQuestionSDto : BaseDto<MedicalHistoryQuestionSDto,Med
public BodySystem BodySystem { get; set; } public BodySystem BodySystem { get; set; }
public bool IsSign { get; set; } public bool IsSign { get; set; }
public bool IsSymptom { get; set; } public bool IsSymptom { get; set; }
public MedicalHistoryAnswerSDto Answer { get; set; } = new();
} }

View File

@ -10,6 +10,7 @@ public class MedicalHistorySDto : BaseDto<MedicalHistorySDto,MedicalHistory>
public string LastName { get; set; } = string.Empty; public string LastName { get; set; } = string.Empty;
public string FatherName { get; set; } = string.Empty; public string FatherName { get; set; } = string.Empty;
public string NationalId { get; set; } = string.Empty; public string NationalId { get; set; } = string.Empty;
public Guid MedicalHistoryTemplateId { get; set; }
public int Age { get; set; } public int Age { get; set; }
public DateTime BirthDate { get; set; } public DateTime BirthDate { get; set; }
@ -22,6 +23,7 @@ public class MedicalHistorySDto : BaseDto<MedicalHistorySDto,MedicalHistory>
public string AddictionHistoryDetail { get; set; } = string.Empty; public string AddictionHistoryDetail { get; set; } = string.Empty;
public string SystemReviewDetail { get; set; } = string.Empty; public string SystemReviewDetail { get; set; } = string.Empty;
public string VitalSignDetail { get; set; } = string.Empty; public string VitalSignDetail { get; set; } = string.Empty;
public string GeneralAppearanceDetail { get; set; } = string.Empty;
public int SystolicBloodPressure { get; set; } public int SystolicBloodPressure { get; set; }

View File

@ -39,12 +39,14 @@ public partial class MedicalHistory
string addictionHistoryDetail, string addictionHistoryDetail,
string systemReviewDetail, string systemReviewDetail,
string vitalSignDetail, string vitalSignDetail,
string generalAppearanceDetail,
int systolicBloodPressure, int systolicBloodPressure,
int diastolicBloodPressure, int diastolicBloodPressure,
int pulseRate, int pulseRate,
int sPO2, int sPO2,
int temperature, int temperature,
Guid applicationUserId) Guid applicationUserId,
Guid medicalHistoryTemplateId)
{ {
return new MedicalHistory(presentIllnessDetail, return new MedicalHistory(presentIllnessDetail,
pastDiseasesHistoryDetail, pastDiseasesHistoryDetail,
@ -55,6 +57,7 @@ public partial class MedicalHistory
addictionHistoryDetail, addictionHistoryDetail,
systemReviewDetail, systemReviewDetail,
vitalSignDetail, vitalSignDetail,
generalAppearanceDetail,
chiefComplaint, chiefComplaint,
sectionId, sectionId,
firstName, firstName,
@ -68,7 +71,8 @@ public partial class MedicalHistory
pulseRate, pulseRate,
sPO2, sPO2,
temperature, temperature,
applicationUserId); applicationUserId,
medicalHistoryTemplateId);
} }
} }

View File

@ -20,6 +20,7 @@ public partial class MedicalHistory : ApiEntity
string addictionHistoryDetail, string addictionHistoryDetail,
string systemReviewDetail, string systemReviewDetail,
string vitalSignDetail, string vitalSignDetail,
string generalAppearanceDetail,
string chiefComplaint, string chiefComplaint,
Guid sectionId, Guid sectionId,
string firstName, string firstName,
@ -33,7 +34,8 @@ public partial class MedicalHistory : ApiEntity
int pulseRate, int pulseRate,
int spo2, int spo2,
int temperature, int temperature,
Guid applicationUserId) Guid applicationUserId,
Guid medicalHistoryTemplateId)
{ {
PresentIllnessDetail = presentIllnessDetail; PresentIllnessDetail = presentIllnessDetail;
PastDiseasesHistoryDetail = pastDiseasesHistoryDetail; PastDiseasesHistoryDetail = pastDiseasesHistoryDetail;
@ -44,6 +46,7 @@ public partial class MedicalHistory : ApiEntity
AddictionHistoryDetail = addictionHistoryDetail; AddictionHistoryDetail = addictionHistoryDetail;
SystemReviewDetail = systemReviewDetail; SystemReviewDetail = systemReviewDetail;
VitalSignDetail = vitalSignDetail; VitalSignDetail = vitalSignDetail;
GeneralAppearanceDetail = generalAppearanceDetail;
ChiefComplaint = chiefComplaint; ChiefComplaint = chiefComplaint;
SectionId = sectionId; SectionId = sectionId;
FirstName = firstName; FirstName = firstName;
@ -58,6 +61,7 @@ public partial class MedicalHistory : ApiEntity
SPO2 = spo2; SPO2 = spo2;
Temperature = temperature; Temperature = temperature;
ApplicationUserId = applicationUserId; ApplicationUserId = applicationUserId;
MedicalHistoryTemplateId = medicalHistoryTemplateId;
} }
public string ChiefComplaint { get; internal set; } = string.Empty; public string ChiefComplaint { get; internal set; } = string.Empty;
public Guid SectionId { get; internal set; } public Guid SectionId { get; internal set; }
@ -79,6 +83,7 @@ public partial class MedicalHistory : ApiEntity
public string AddictionHistoryDetail { get; internal set; } = string.Empty; public string AddictionHistoryDetail { get; internal set; } = string.Empty;
public string SystemReviewDetail { get; internal set; } = string.Empty; public string SystemReviewDetail { get; internal set; } = string.Empty;
public string VitalSignDetail { get; internal set; } = string.Empty; public string VitalSignDetail { get; internal set; } = string.Empty;
public string GeneralAppearanceDetail { get; internal set; } = string.Empty;
public int SystolicBloodPressure { get; internal set; } public int SystolicBloodPressure { get; internal set; }
@ -87,6 +92,7 @@ public partial class MedicalHistory : ApiEntity
public int SPO2 { get; internal set; } public int SPO2 { get; internal set; }
public int Temperature { get; internal set; } public int Temperature { get; internal set; }
public Guid MedicalHistoryTemplateId { get; internal set; }
public Guid ApplicationUserId { get; internal set; } public Guid ApplicationUserId { get; internal set; }
public ApplicationUser? ApplicationUser { get; internal set; } public ApplicationUser? ApplicationUser { get; internal set; }

View File

@ -39,11 +39,13 @@ namespace DocuMed.Domain.Mappers
AddictionHistoryDetail = p1.AddictionHistoryDetail, AddictionHistoryDetail = p1.AddictionHistoryDetail,
SystemReviewDetail = p1.SystemReviewDetail, SystemReviewDetail = p1.SystemReviewDetail,
VitalSignDetail = p1.VitalSignDetail, VitalSignDetail = p1.VitalSignDetail,
GeneralAppearanceDetail = p1.GeneralAppearanceDetail,
SystolicBloodPressure = p1.SystolicBloodPressure, SystolicBloodPressure = p1.SystolicBloodPressure,
DiastolicBloodPressure = p1.DiastolicBloodPressure, DiastolicBloodPressure = p1.DiastolicBloodPressure,
PulseRate = p1.PulseRate, PulseRate = p1.PulseRate,
SPO2 = p1.SPO2, SPO2 = p1.SPO2,
Temperature = p1.Temperature, Temperature = p1.Temperature,
MedicalHistoryTemplateId = p1.MedicalHistoryTemplateId,
ApplicationUserId = p1.ApplicationUserId, ApplicationUserId = p1.ApplicationUserId,
ApplicationUser = new ApplicationUser() {Id = p1.ApplicationUserId}, ApplicationUser = new ApplicationUser() {Id = p1.ApplicationUserId},
Id = p1.Id Id = p1.Id
@ -75,11 +77,13 @@ namespace DocuMed.Domain.Mappers
result.AddictionHistoryDetail = p2.AddictionHistoryDetail; result.AddictionHistoryDetail = p2.AddictionHistoryDetail;
result.SystemReviewDetail = p2.SystemReviewDetail; result.SystemReviewDetail = p2.SystemReviewDetail;
result.VitalSignDetail = p2.VitalSignDetail; result.VitalSignDetail = p2.VitalSignDetail;
result.GeneralAppearanceDetail = p2.GeneralAppearanceDetail;
result.SystolicBloodPressure = p2.SystolicBloodPressure; result.SystolicBloodPressure = p2.SystolicBloodPressure;
result.DiastolicBloodPressure = p2.DiastolicBloodPressure; result.DiastolicBloodPressure = p2.DiastolicBloodPressure;
result.PulseRate = p2.PulseRate; result.PulseRate = p2.PulseRate;
result.SPO2 = p2.SPO2; result.SPO2 = p2.SPO2;
result.Temperature = p2.Temperature; result.Temperature = p2.Temperature;
result.MedicalHistoryTemplateId = p2.MedicalHistoryTemplateId;
result.ApplicationUserId = p2.ApplicationUserId; result.ApplicationUserId = p2.ApplicationUserId;
result.ApplicationUser = funcMain2(new Never(), result.ApplicationUser, p2); result.ApplicationUser = funcMain2(new Never(), result.ApplicationUser, p2);
result.Id = p2.Id; result.Id = p2.Id;
@ -110,11 +114,13 @@ namespace DocuMed.Domain.Mappers
AddictionHistoryDetail = p8.AddictionHistoryDetail, AddictionHistoryDetail = p8.AddictionHistoryDetail,
SystemReviewDetail = p8.SystemReviewDetail, SystemReviewDetail = p8.SystemReviewDetail,
VitalSignDetail = p8.VitalSignDetail, VitalSignDetail = p8.VitalSignDetail,
GeneralAppearanceDetail = p8.GeneralAppearanceDetail,
SystolicBloodPressure = p8.SystolicBloodPressure, SystolicBloodPressure = p8.SystolicBloodPressure,
DiastolicBloodPressure = p8.DiastolicBloodPressure, DiastolicBloodPressure = p8.DiastolicBloodPressure,
PulseRate = p8.PulseRate, PulseRate = p8.PulseRate,
SPO2 = p8.SPO2, SPO2 = p8.SPO2,
Temperature = p8.Temperature, Temperature = p8.Temperature,
MedicalHistoryTemplateId = p8.MedicalHistoryTemplateId,
ApplicationUserId = p8.ApplicationUserId, ApplicationUserId = p8.ApplicationUserId,
ApplicationUser = new ApplicationUser() {Id = p8.ApplicationUserId}, ApplicationUser = new ApplicationUser() {Id = p8.ApplicationUserId},
Id = p8.Id Id = p8.Id
@ -130,6 +136,7 @@ namespace DocuMed.Domain.Mappers
LastName = p9.LastName, LastName = p9.LastName,
FatherName = p9.FatherName, FatherName = p9.FatherName,
NationalId = p9.NationalId, NationalId = p9.NationalId,
MedicalHistoryTemplateId = p9.MedicalHistoryTemplateId,
Age = p9.Age, Age = p9.Age,
BirthDate = p9.BirthDate, BirthDate = p9.BirthDate,
PresentIllnessDetail = p9.PresentIllnessDetail, PresentIllnessDetail = p9.PresentIllnessDetail,
@ -141,6 +148,7 @@ namespace DocuMed.Domain.Mappers
AddictionHistoryDetail = p9.AddictionHistoryDetail, AddictionHistoryDetail = p9.AddictionHistoryDetail,
SystemReviewDetail = p9.SystemReviewDetail, SystemReviewDetail = p9.SystemReviewDetail,
VitalSignDetail = p9.VitalSignDetail, VitalSignDetail = p9.VitalSignDetail,
GeneralAppearanceDetail = p9.GeneralAppearanceDetail,
SystolicBloodPressure = p9.SystolicBloodPressure, SystolicBloodPressure = p9.SystolicBloodPressure,
DiastolicBloodPressure = p9.DiastolicBloodPressure, DiastolicBloodPressure = p9.DiastolicBloodPressure,
PulseRate = p9.PulseRate, PulseRate = p9.PulseRate,
@ -165,6 +173,7 @@ namespace DocuMed.Domain.Mappers
result.LastName = p10.LastName; result.LastName = p10.LastName;
result.FatherName = p10.FatherName; result.FatherName = p10.FatherName;
result.NationalId = p10.NationalId; result.NationalId = p10.NationalId;
result.MedicalHistoryTemplateId = p10.MedicalHistoryTemplateId;
result.Age = p10.Age; result.Age = p10.Age;
result.BirthDate = p10.BirthDate; result.BirthDate = p10.BirthDate;
result.PresentIllnessDetail = p10.PresentIllnessDetail; result.PresentIllnessDetail = p10.PresentIllnessDetail;
@ -176,6 +185,7 @@ namespace DocuMed.Domain.Mappers
result.AddictionHistoryDetail = p10.AddictionHistoryDetail; result.AddictionHistoryDetail = p10.AddictionHistoryDetail;
result.SystemReviewDetail = p10.SystemReviewDetail; result.SystemReviewDetail = p10.SystemReviewDetail;
result.VitalSignDetail = p10.VitalSignDetail; result.VitalSignDetail = p10.VitalSignDetail;
result.GeneralAppearanceDetail = p10.GeneralAppearanceDetail;
result.SystolicBloodPressure = p10.SystolicBloodPressure; result.SystolicBloodPressure = p10.SystolicBloodPressure;
result.DiastolicBloodPressure = p10.DiastolicBloodPressure; result.DiastolicBloodPressure = p10.DiastolicBloodPressure;
result.PulseRate = p10.PulseRate; result.PulseRate = p10.PulseRate;
@ -195,6 +205,7 @@ namespace DocuMed.Domain.Mappers
LastName = p12.LastName, LastName = p12.LastName,
FatherName = p12.FatherName, FatherName = p12.FatherName,
NationalId = p12.NationalId, NationalId = p12.NationalId,
MedicalHistoryTemplateId = p12.MedicalHistoryTemplateId,
Age = p12.Age, Age = p12.Age,
BirthDate = p12.BirthDate, BirthDate = p12.BirthDate,
PresentIllnessDetail = p12.PresentIllnessDetail, PresentIllnessDetail = p12.PresentIllnessDetail,
@ -206,6 +217,7 @@ namespace DocuMed.Domain.Mappers
AddictionHistoryDetail = p12.AddictionHistoryDetail, AddictionHistoryDetail = p12.AddictionHistoryDetail,
SystemReviewDetail = p12.SystemReviewDetail, SystemReviewDetail = p12.SystemReviewDetail,
VitalSignDetail = p12.VitalSignDetail, VitalSignDetail = p12.VitalSignDetail,
GeneralAppearanceDetail = p12.GeneralAppearanceDetail,
SystolicBloodPressure = p12.SystolicBloodPressure, SystolicBloodPressure = p12.SystolicBloodPressure,
DiastolicBloodPressure = p12.DiastolicBloodPressure, DiastolicBloodPressure = p12.DiastolicBloodPressure,
PulseRate = p12.PulseRate, PulseRate = p12.PulseRate,
@ -220,6 +232,13 @@ namespace DocuMed.Domain.Mappers
{ {
ChiefComplaint = p13.ChiefComplaint, ChiefComplaint = p13.ChiefComplaint,
SectionId = p13.SectionId, SectionId = p13.SectionId,
Section = p13.Section == null ? null : new Section()
{
Name = p13.Section.Name,
Detail = p13.Section.Detail,
UniversityId = p13.Section.UniversityId,
Id = p13.Section.Id
},
FirstName = p13.FirstName, FirstName = p13.FirstName,
LastName = p13.LastName, LastName = p13.LastName,
FatherName = p13.FatherName, FatherName = p13.FatherName,
@ -235,11 +254,13 @@ namespace DocuMed.Domain.Mappers
AddictionHistoryDetail = p13.AddictionHistoryDetail, AddictionHistoryDetail = p13.AddictionHistoryDetail,
SystemReviewDetail = p13.SystemReviewDetail, SystemReviewDetail = p13.SystemReviewDetail,
VitalSignDetail = p13.VitalSignDetail, VitalSignDetail = p13.VitalSignDetail,
GeneralAppearanceDetail = p13.GeneralAppearanceDetail,
SystolicBloodPressure = p13.SystolicBloodPressure, SystolicBloodPressure = p13.SystolicBloodPressure,
DiastolicBloodPressure = p13.DiastolicBloodPressure, DiastolicBloodPressure = p13.DiastolicBloodPressure,
PulseRate = p13.PulseRate, PulseRate = p13.PulseRate,
SPO2 = p13.SPO2, SPO2 = p13.SPO2,
Temperature = p13.Temperature, Temperature = p13.Temperature,
MedicalHistoryTemplateId = p13.MedicalHistoryTemplateId,
ApplicationUserId = p13.ApplicationUserId, ApplicationUserId = p13.ApplicationUserId,
Answers = funcMain3(p13.Answers), Answers = funcMain3(p13.Answers),
Id = p13.Id Id = p13.Id
@ -255,6 +276,7 @@ namespace DocuMed.Domain.Mappers
result.ChiefComplaint = p15.ChiefComplaint; result.ChiefComplaint = p15.ChiefComplaint;
result.SectionId = p15.SectionId; result.SectionId = p15.SectionId;
result.Section = funcMain4(p15.Section, result.Section);
result.FirstName = p15.FirstName; result.FirstName = p15.FirstName;
result.LastName = p15.LastName; result.LastName = p15.LastName;
result.FatherName = p15.FatherName; result.FatherName = p15.FatherName;
@ -270,155 +292,187 @@ namespace DocuMed.Domain.Mappers
result.AddictionHistoryDetail = p15.AddictionHistoryDetail; result.AddictionHistoryDetail = p15.AddictionHistoryDetail;
result.SystemReviewDetail = p15.SystemReviewDetail; result.SystemReviewDetail = p15.SystemReviewDetail;
result.VitalSignDetail = p15.VitalSignDetail; result.VitalSignDetail = p15.VitalSignDetail;
result.GeneralAppearanceDetail = p15.GeneralAppearanceDetail;
result.SystolicBloodPressure = p15.SystolicBloodPressure; result.SystolicBloodPressure = p15.SystolicBloodPressure;
result.DiastolicBloodPressure = p15.DiastolicBloodPressure; result.DiastolicBloodPressure = p15.DiastolicBloodPressure;
result.PulseRate = p15.PulseRate; result.PulseRate = p15.PulseRate;
result.SPO2 = p15.SPO2; result.SPO2 = p15.SPO2;
result.Temperature = p15.Temperature; result.Temperature = p15.Temperature;
result.MedicalHistoryTemplateId = p15.MedicalHistoryTemplateId;
result.ApplicationUserId = p15.ApplicationUserId; result.ApplicationUserId = p15.ApplicationUserId;
result.Answers = funcMain4(p15.Answers, result.Answers); result.Answers = funcMain5(p15.Answers, result.Answers);
result.Id = p15.Id; result.Id = p15.Id;
return result; return result;
} }
public static Expression<Func<MedicalHistoryLDto, MedicalHistory>> ProjectLDtoToMedicalHistory => p19 => new MedicalHistory() public static Expression<Func<MedicalHistoryLDto, MedicalHistory>> ProjectLDtoToMedicalHistory => p21 => new MedicalHistory()
{ {
ChiefComplaint = p19.ChiefComplaint, ChiefComplaint = p21.ChiefComplaint,
SectionId = p19.SectionId, SectionId = p21.SectionId,
FirstName = p19.FirstName, Section = p21.Section == null ? null : new Section()
LastName = p19.LastName,
FatherName = p19.FatherName,
NationalId = p19.NationalId,
Age = p19.Age,
BirthDate = p19.BirthDate,
PresentIllnessDetail = p19.PresentIllnessDetail,
PastDiseasesHistoryDetail = p19.PastDiseasesHistoryDetail,
PastSurgeryHistoryDetail = p19.PastSurgeryHistoryDetail,
FamilyHistoryDetail = p19.FamilyHistoryDetail,
AllergyDetail = p19.AllergyDetail,
DrugHistoryDetail = p19.DrugHistoryDetail,
AddictionHistoryDetail = p19.AddictionHistoryDetail,
SystemReviewDetail = p19.SystemReviewDetail,
VitalSignDetail = p19.VitalSignDetail,
SystolicBloodPressure = p19.SystolicBloodPressure,
DiastolicBloodPressure = p19.DiastolicBloodPressure,
PulseRate = p19.PulseRate,
SPO2 = p19.SPO2,
Temperature = p19.Temperature,
ApplicationUserId = p19.ApplicationUserId,
Answers = p19.Answers.Select<MedicalHistoryAnswerSDto, MedicalHistoryAnswer>(p20 => new MedicalHistoryAnswer()
{ {
Answer = p20.Answer, Name = p21.Section.Name,
Question = p20.Question, Detail = p21.Section.Detail,
Part = p20.Part, UniversityId = p21.Section.UniversityId,
QuestionType = p20.QuestionType, Id = p21.Section.Id
MedicalHistoryId = p20.MedicalHistoryId, },
Id = p20.Id FirstName = p21.FirstName,
LastName = p21.LastName,
FatherName = p21.FatherName,
NationalId = p21.NationalId,
Age = p21.Age,
BirthDate = p21.BirthDate,
PresentIllnessDetail = p21.PresentIllnessDetail,
PastDiseasesHistoryDetail = p21.PastDiseasesHistoryDetail,
PastSurgeryHistoryDetail = p21.PastSurgeryHistoryDetail,
FamilyHistoryDetail = p21.FamilyHistoryDetail,
AllergyDetail = p21.AllergyDetail,
DrugHistoryDetail = p21.DrugHistoryDetail,
AddictionHistoryDetail = p21.AddictionHistoryDetail,
SystemReviewDetail = p21.SystemReviewDetail,
VitalSignDetail = p21.VitalSignDetail,
GeneralAppearanceDetail = p21.GeneralAppearanceDetail,
SystolicBloodPressure = p21.SystolicBloodPressure,
DiastolicBloodPressure = p21.DiastolicBloodPressure,
PulseRate = p21.PulseRate,
SPO2 = p21.SPO2,
Temperature = p21.Temperature,
MedicalHistoryTemplateId = p21.MedicalHistoryTemplateId,
ApplicationUserId = p21.ApplicationUserId,
Answers = p21.Answers.Select<MedicalHistoryAnswerSDto, MedicalHistoryAnswer>(p22 => new MedicalHistoryAnswer()
{
Answer = p22.Answer,
Question = p22.Question,
Part = p22.Part,
QuestionType = p22.QuestionType,
MedicalHistoryId = p22.MedicalHistoryId,
Id = p22.Id
}).ToList<MedicalHistoryAnswer>(), }).ToList<MedicalHistoryAnswer>(),
Id = p19.Id Id = p21.Id
}; };
public static MedicalHistoryLDto AdaptToLDto(this MedicalHistory p21) public static MedicalHistoryLDto AdaptToLDto(this MedicalHistory p23)
{ {
return p21 == null ? null : new MedicalHistoryLDto() return p23 == null ? null : new MedicalHistoryLDto()
{ {
ChiefComplaint = p21.ChiefComplaint, ChiefComplaint = p23.ChiefComplaint,
SectionId = p21.SectionId, SectionId = p23.SectionId,
FirstName = p21.FirstName, FirstName = p23.FirstName,
LastName = p21.LastName, LastName = p23.LastName,
FatherName = p21.FatherName, FatherName = p23.FatherName,
NationalId = p21.NationalId, NationalId = p23.NationalId,
Age = p21.Age, Age = p23.Age,
BirthDate = p21.BirthDate, BirthDate = p23.BirthDate,
PresentIllnessDetail = p21.PresentIllnessDetail, Section = p23.Section == null ? null : new SectionSDto()
PastDiseasesHistoryDetail = p21.PastDiseasesHistoryDetail, {
PastSurgeryHistoryDetail = p21.PastSurgeryHistoryDetail, Name = p23.Section.Name,
FamilyHistoryDetail = p21.FamilyHistoryDetail, Detail = p23.Section.Detail,
AllergyDetail = p21.AllergyDetail, UniversityId = p23.Section.UniversityId,
DrugHistoryDetail = p21.DrugHistoryDetail, Id = p23.Section.Id
AddictionHistoryDetail = p21.AddictionHistoryDetail, },
SystemReviewDetail = p21.SystemReviewDetail, PresentIllnessDetail = p23.PresentIllnessDetail,
VitalSignDetail = p21.VitalSignDetail, PastDiseasesHistoryDetail = p23.PastDiseasesHistoryDetail,
SystolicBloodPressure = p21.SystolicBloodPressure, PastSurgeryHistoryDetail = p23.PastSurgeryHistoryDetail,
DiastolicBloodPressure = p21.DiastolicBloodPressure, FamilyHistoryDetail = p23.FamilyHistoryDetail,
PulseRate = p21.PulseRate, AllergyDetail = p23.AllergyDetail,
SPO2 = p21.SPO2, DrugHistoryDetail = p23.DrugHistoryDetail,
Temperature = p21.Temperature, AddictionHistoryDetail = p23.AddictionHistoryDetail,
ApplicationUserId = p21.ApplicationUserId, SystemReviewDetail = p23.SystemReviewDetail,
Answers = funcMain5(p21.Answers), VitalSignDetail = p23.VitalSignDetail,
Id = p21.Id GeneralAppearanceDetail = p23.GeneralAppearanceDetail,
MedicalHistoryTemplateId = p23.MedicalHistoryTemplateId,
SystolicBloodPressure = p23.SystolicBloodPressure,
DiastolicBloodPressure = p23.DiastolicBloodPressure,
PulseRate = p23.PulseRate,
SPO2 = p23.SPO2,
Temperature = p23.Temperature,
ApplicationUserId = p23.ApplicationUserId,
Answers = funcMain6(p23.Answers),
Id = p23.Id
}; };
} }
public static MedicalHistoryLDto AdaptTo(this MedicalHistory p23, MedicalHistoryLDto p24) public static MedicalHistoryLDto AdaptTo(this MedicalHistory p25, MedicalHistoryLDto p26)
{ {
if (p23 == null) if (p25 == null)
{ {
return null; return null;
} }
MedicalHistoryLDto result = p24 ?? new MedicalHistoryLDto(); MedicalHistoryLDto result = p26 ?? new MedicalHistoryLDto();
result.ChiefComplaint = p23.ChiefComplaint; result.ChiefComplaint = p25.ChiefComplaint;
result.SectionId = p23.SectionId; result.SectionId = p25.SectionId;
result.FirstName = p23.FirstName; result.FirstName = p25.FirstName;
result.LastName = p23.LastName; result.LastName = p25.LastName;
result.FatherName = p23.FatherName; result.FatherName = p25.FatherName;
result.NationalId = p23.NationalId; result.NationalId = p25.NationalId;
result.Age = p23.Age; result.Age = p25.Age;
result.BirthDate = p23.BirthDate; result.BirthDate = p25.BirthDate;
result.PresentIllnessDetail = p23.PresentIllnessDetail; result.Section = funcMain7(p25.Section, result.Section);
result.PastDiseasesHistoryDetail = p23.PastDiseasesHistoryDetail; result.PresentIllnessDetail = p25.PresentIllnessDetail;
result.PastSurgeryHistoryDetail = p23.PastSurgeryHistoryDetail; result.PastDiseasesHistoryDetail = p25.PastDiseasesHistoryDetail;
result.FamilyHistoryDetail = p23.FamilyHistoryDetail; result.PastSurgeryHistoryDetail = p25.PastSurgeryHistoryDetail;
result.AllergyDetail = p23.AllergyDetail; result.FamilyHistoryDetail = p25.FamilyHistoryDetail;
result.DrugHistoryDetail = p23.DrugHistoryDetail; result.AllergyDetail = p25.AllergyDetail;
result.AddictionHistoryDetail = p23.AddictionHistoryDetail; result.DrugHistoryDetail = p25.DrugHistoryDetail;
result.SystemReviewDetail = p23.SystemReviewDetail; result.AddictionHistoryDetail = p25.AddictionHistoryDetail;
result.VitalSignDetail = p23.VitalSignDetail; result.SystemReviewDetail = p25.SystemReviewDetail;
result.SystolicBloodPressure = p23.SystolicBloodPressure; result.VitalSignDetail = p25.VitalSignDetail;
result.DiastolicBloodPressure = p23.DiastolicBloodPressure; result.GeneralAppearanceDetail = p25.GeneralAppearanceDetail;
result.PulseRate = p23.PulseRate; result.MedicalHistoryTemplateId = p25.MedicalHistoryTemplateId;
result.SPO2 = p23.SPO2; result.SystolicBloodPressure = p25.SystolicBloodPressure;
result.Temperature = p23.Temperature; result.DiastolicBloodPressure = p25.DiastolicBloodPressure;
result.ApplicationUserId = p23.ApplicationUserId; result.PulseRate = p25.PulseRate;
result.Answers = funcMain6(p23.Answers, result.Answers); result.SPO2 = p25.SPO2;
result.Id = p23.Id; result.Temperature = p25.Temperature;
result.ApplicationUserId = p25.ApplicationUserId;
result.Answers = funcMain8(p25.Answers, result.Answers);
result.Id = p25.Id;
return result; return result;
} }
public static Expression<Func<MedicalHistory, MedicalHistoryLDto>> ProjectToLDto => p27 => new MedicalHistoryLDto() public static Expression<Func<MedicalHistory, MedicalHistoryLDto>> ProjectToLDto => p31 => new MedicalHistoryLDto()
{ {
ChiefComplaint = p27.ChiefComplaint, ChiefComplaint = p31.ChiefComplaint,
SectionId = p27.SectionId, SectionId = p31.SectionId,
FirstName = p27.FirstName, FirstName = p31.FirstName,
LastName = p27.LastName, LastName = p31.LastName,
FatherName = p27.FatherName, FatherName = p31.FatherName,
NationalId = p27.NationalId, NationalId = p31.NationalId,
Age = p27.Age, Age = p31.Age,
BirthDate = p27.BirthDate, BirthDate = p31.BirthDate,
PresentIllnessDetail = p27.PresentIllnessDetail, Section = p31.Section == null ? null : new SectionSDto()
PastDiseasesHistoryDetail = p27.PastDiseasesHistoryDetail,
PastSurgeryHistoryDetail = p27.PastSurgeryHistoryDetail,
FamilyHistoryDetail = p27.FamilyHistoryDetail,
AllergyDetail = p27.AllergyDetail,
DrugHistoryDetail = p27.DrugHistoryDetail,
AddictionHistoryDetail = p27.AddictionHistoryDetail,
SystemReviewDetail = p27.SystemReviewDetail,
VitalSignDetail = p27.VitalSignDetail,
SystolicBloodPressure = p27.SystolicBloodPressure,
DiastolicBloodPressure = p27.DiastolicBloodPressure,
PulseRate = p27.PulseRate,
SPO2 = p27.SPO2,
Temperature = p27.Temperature,
ApplicationUserId = p27.ApplicationUserId,
Answers = p27.Answers.Select<MedicalHistoryAnswer, MedicalHistoryAnswerSDto>(p28 => new MedicalHistoryAnswerSDto()
{ {
Answer = p28.Answer, Name = p31.Section.Name,
Question = p28.Question, Detail = p31.Section.Detail,
Part = p28.Part, UniversityId = p31.Section.UniversityId,
QuestionType = p28.QuestionType, Id = p31.Section.Id
MedicalHistoryId = p28.MedicalHistoryId, },
Id = p28.Id PresentIllnessDetail = p31.PresentIllnessDetail,
PastDiseasesHistoryDetail = p31.PastDiseasesHistoryDetail,
PastSurgeryHistoryDetail = p31.PastSurgeryHistoryDetail,
FamilyHistoryDetail = p31.FamilyHistoryDetail,
AllergyDetail = p31.AllergyDetail,
DrugHistoryDetail = p31.DrugHistoryDetail,
AddictionHistoryDetail = p31.AddictionHistoryDetail,
SystemReviewDetail = p31.SystemReviewDetail,
VitalSignDetail = p31.VitalSignDetail,
GeneralAppearanceDetail = p31.GeneralAppearanceDetail,
MedicalHistoryTemplateId = p31.MedicalHistoryTemplateId,
SystolicBloodPressure = p31.SystolicBloodPressure,
DiastolicBloodPressure = p31.DiastolicBloodPressure,
PulseRate = p31.PulseRate,
SPO2 = p31.SPO2,
Temperature = p31.Temperature,
ApplicationUserId = p31.ApplicationUserId,
Answers = p31.Answers.Select<MedicalHistoryAnswer, MedicalHistoryAnswerSDto>(p32 => new MedicalHistoryAnswerSDto()
{
Answer = p32.Answer,
Question = p32.Question,
Part = p32.Part,
QuestionType = p32.QuestionType,
MedicalHistoryId = p32.MedicalHistoryId,
Id = p32.Id
}).ToList<MedicalHistoryAnswerSDto>(), }).ToList<MedicalHistoryAnswerSDto>(),
Id = p27.Id Id = p31.Id
}; };
private static Section funcMain1(Never p4, Section p5, MedicalHistorySDto p2) private static Section funcMain1(Never p4, Section p5, MedicalHistorySDto p2)
@ -469,20 +523,36 @@ namespace DocuMed.Domain.Mappers
} }
private static List<MedicalHistoryAnswer> funcMain4(List<MedicalHistoryAnswerSDto> p17, List<MedicalHistoryAnswer> p18) private static Section funcMain4(SectionSDto p17, Section p18)
{ {
if (p17 == null) if (p17 == null)
{ {
return null; return null;
} }
List<MedicalHistoryAnswer> result = new List<MedicalHistoryAnswer>(p17.Count); Section result = p18 ?? new Section();
result.Name = p17.Name;
result.Detail = p17.Detail;
result.UniversityId = p17.UniversityId;
result.Id = p17.Id;
return result;
}
private static List<MedicalHistoryAnswer> funcMain5(List<MedicalHistoryAnswerSDto> p19, List<MedicalHistoryAnswer> p20)
{
if (p19 == null)
{
return null;
}
List<MedicalHistoryAnswer> result = new List<MedicalHistoryAnswer>(p19.Count);
int i = 0; int i = 0;
int len = p17.Count; int len = p19.Count;
while (i < len) while (i < len)
{ {
MedicalHistoryAnswerSDto item = p17[i]; MedicalHistoryAnswerSDto item = p19[i];
result.Add(item == null ? null : new MedicalHistoryAnswer() result.Add(item == null ? null : new MedicalHistoryAnswer()
{ {
Answer = item.Answer, Answer = item.Answer,
@ -498,20 +568,20 @@ namespace DocuMed.Domain.Mappers
} }
private static List<MedicalHistoryAnswerSDto> funcMain5(List<MedicalHistoryAnswer> p22) private static List<MedicalHistoryAnswerSDto> funcMain6(List<MedicalHistoryAnswer> p24)
{ {
if (p22 == null) if (p24 == null)
{ {
return null; return null;
} }
List<MedicalHistoryAnswerSDto> result = new List<MedicalHistoryAnswerSDto>(p22.Count); List<MedicalHistoryAnswerSDto> result = new List<MedicalHistoryAnswerSDto>(p24.Count);
int i = 0; int i = 0;
int len = p22.Count; int len = p24.Count;
while (i < len) while (i < len)
{ {
MedicalHistoryAnswer item = p22[i]; MedicalHistoryAnswer item = p24[i];
result.Add(item == null ? null : new MedicalHistoryAnswerSDto() result.Add(item == null ? null : new MedicalHistoryAnswerSDto()
{ {
Answer = item.Answer, Answer = item.Answer,
@ -527,20 +597,36 @@ namespace DocuMed.Domain.Mappers
} }
private static List<MedicalHistoryAnswerSDto> funcMain6(List<MedicalHistoryAnswer> p25, List<MedicalHistoryAnswerSDto> p26) private static SectionSDto funcMain7(Section p27, SectionSDto p28)
{ {
if (p25 == null) if (p27 == null)
{ {
return null; return null;
} }
List<MedicalHistoryAnswerSDto> result = new List<MedicalHistoryAnswerSDto>(p25.Count); SectionSDto result = p28 ?? new SectionSDto();
result.Name = p27.Name;
result.Detail = p27.Detail;
result.UniversityId = p27.UniversityId;
result.Id = p27.Id;
return result;
}
private static List<MedicalHistoryAnswerSDto> funcMain8(List<MedicalHistoryAnswer> p29, List<MedicalHistoryAnswerSDto> p30)
{
if (p29 == null)
{
return null;
}
List<MedicalHistoryAnswerSDto> result = new List<MedicalHistoryAnswerSDto>(p29.Count);
int i = 0; int i = 0;
int len = p25.Count; int len = p29.Count;
while (i < len) while (i < len)
{ {
MedicalHistoryAnswer item = p25[i]; MedicalHistoryAnswer item = p29[i];
result.Add(item == null ? null : new MedicalHistoryAnswerSDto() result.Add(item == null ? null : new MedicalHistoryAnswerSDto()
{ {
Answer = item.Answer, Answer = item.Answer,

View File

@ -2,12 +2,16 @@
public static class Address public static class Address
{ {
#if DEBUG
public static string BaseAddress = "http://localhost:32770/api"; public static string BaseAddress = "http://localhost:32770/api";
public static readonly string AuthController = $"{BaseAddress}/auth"; #else
public static readonly string CityController = $"{BaseAddress}/city"; public static string BaseAddress = "https://api.documed.ir/api";
public static readonly string UniversityController = $"{BaseAddress}/university"; #endif
public static readonly string SectionController = $"{BaseAddress}/section"; public static string AuthController = $"{BaseAddress}/auth";
public static readonly string UserController = $"{BaseAddress}/user"; public static string CityController = $"{BaseAddress}/city";
public static readonly string MedicalHistoryTemplateController = $"{BaseAddress}/medicalhistory/template"; public static string UniversityController = $"{BaseAddress}/university";
public static readonly string MedicalHistoryController = $"{BaseAddress}/medicalhistory"; public static string SectionController = $"{BaseAddress}/section";
public static string UserController = $"{BaseAddress}/user";
public static string MedicalHistoryTemplateController = $"{BaseAddress}/medicalhistory/template";
public static string MedicalHistoryController = $"{BaseAddress}/medicalhistory";
} }

View File

@ -18,7 +18,7 @@
<p class="-mt-3 text-white font-light font-iranyekan">@ViewModel?.User.PhoneNumber</p> <p class="-mt-3 text-white font-light font-iranyekan">@ViewModel?.User.PhoneNumber</p>
</MudStack> </MudStack>
</MudStack> </MudStack>
<MudButton class="my-auto ml-5 mr-auto font-extrabold bg-white rounded-lg">@ViewModel?.User.SectionName</MudButton> <MudButton @onclick="ProfileClicked" class="my-auto ml-5 mr-auto font-extrabold bg-white rounded-lg">@ViewModel?.User.SectionName</MudButton>
</div> </div>
<div class="bg-[#EEEEEE] w-full h-full flex flex-col rounded-t-xl"> <div class="bg-[#EEEEEE] w-full h-full flex flex-col rounded-t-xl">
<MudStack class="pb-20 bg-[#EEEEEE] rounded-t-xl"> <MudStack class="pb-20 bg-[#EEEEEE] rounded-t-xl">
@ -31,32 +31,34 @@
</div> </div>
@if (@ViewModel.IsProcessing) @if (@ViewModel.IsProcessing)
{ {
@for (int i = 0; i < 4; i++) <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2">
{ @for (int i = 0; i < 4; i++)
<MudCard class="bg-transparent p-4 rounded-lg" Elevation="0"> {
<div class="flex flex-row"> <MudCard class="bg-transparent p-4 rounded-lg" Elevation="0">
<div class="mx-4 mb-3 basis-1/3"> <div class="flex flex-row">
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" /> <div class="mx-4 mb-3 basis-1/3">
<MudSkeleton class="mt-3 h-2" SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" /> <MudSkeleton SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" />
</div> <MudSkeleton class="mt-3 h-2" SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" />
</div>
<MudSkeleton class="mx-4 mb-3 h-10 basis-1/4 mr-auto" SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" /> <MudSkeleton class="mx-4 mb-3 h-10 basis-1/4 mr-auto" SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" />
</div> </div>
<div class="grid grid-cols-3"> <div class="grid grid-cols-3">
<MudSkeleton class="mx-4" Animation="Animation.Wave" SkeletonType="SkeletonType.Text" /> <MudSkeleton class="mx-4" Animation="Animation.Wave" SkeletonType="SkeletonType.Text" />
<MudSkeleton class="mx-4" Animation="Animation.Wave" /> <MudSkeleton class="mx-4" Animation="Animation.Wave" />
<MudSkeleton class="mx-4" Animation="Animation.Wave" /> <MudSkeleton class="mx-4" Animation="Animation.Wave" />
</div> </div>
</MudCard> </MudCard>
} }
</div>
} }
else else
{ {
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 "> <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2">
@foreach (var item in @ViewModel.PageDto) @foreach (var item in @ViewModel.PageDto)
{ {
<MedicalHistoryItemTemplate MedicalHistory="@item" /> <MedicalHistoryItemTemplate Clicked="MedicalHistoryClicked" MedicalHistory="@item" />
} }
</div> </div>
} }
@ -108,6 +110,8 @@
public void CreateMedicalHistoryClicked() => NavigationManager.NavigateTo("MedicalHistoryActionPage"); public void CreateMedicalHistoryClicked() => NavigationManager.NavigateTo("MedicalHistoryActionPage");
public void MedicalHistoryClicked(MedicalHistorySDto medicalHistory) => NavigationManager.NavigateTo($"MedicalHistoryActionPage/{medicalHistory.Id}");
public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage"); public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage");
public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage"); public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage");

View File

@ -17,6 +17,8 @@ public class HomePageViewModel : BaseViewModel<List<MedicalHistorySDto>>
public ApplicationUserSDto User { get; private set; } = new ApplicationUserSDto(); public ApplicationUserSDto User { get; private set; } = new ApplicationUserSDto();
public override async Task InitializeAsync() public override async Task InitializeAsync()
{ {
@ -24,7 +26,6 @@ public class HomePageViewModel : BaseViewModel<List<MedicalHistorySDto>>
{ {
IsProcessing = true; IsProcessing = true;
User = await _userUtility.GetUserAsync(); User = await _userUtility.GetUserAsync();
await Task.Delay(500);
var token = await _userUtility.GetBearerTokenAsync(); var token = await _userUtility.GetBearerTokenAsync();
var list = await _restWrapper var list = await _restWrapper
.CrudDtoApiRest<MedicalHistoryLDto, MedicalHistorySDto, Guid>(Address.MedicalHistoryController) .CrudDtoApiRest<MedicalHistoryLDto, MedicalHistorySDto, Guid>(Address.MedicalHistoryController)

View File

@ -1,4 +1,5 @@
@page "/MedicalHistoryActionPage" @page "/MedicalHistoryActionPage"
@page "/MedicalHistoryActionPage/{MedicalHistoryId}"
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@ -6,32 +7,30 @@
<BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید"> <BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید">
<div class="flex flex-col w-full h-full rounded-t-xl"> <div class="flex flex-col w-full h-full rounded-t-xl p-1">
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="@ViewModel.Carousel" ShowArrows="false" <MudCarousel class="flex-grow w-full h-full overflow-x-hidden overflow-y-scroll" @ref="@ViewModel.Carousel" ShowArrows="false"
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object"> ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
<MudCarouselItem> <MudCarouselItem>
<div class="flex flex-col w-full h-full"> <div class="flex flex-col w-full h-full p-4">
<MedicalHistoryActionStep1 <MedicalHistoryActionStep1 @bind-ChiefComplaint="@ViewModel.PageDto.ChiefComplaint"
@bind-ChiefComplaint="@ViewModel.PageDto.ChiefComplaint"
@bind-SelectedTemplate="@ViewModel.SelectedTemplate" @bind-SelectedTemplate="@ViewModel.SelectedTemplate"
@bind-SelectedSection="@ViewModel.SelectedSelection" @bind-SelectedSection="@ViewModel.SelectedSelection"
@bind-PatientAge="@ViewModel.PageDto.Age" @bind-PatientAge="@ViewModel.PageDto.Age"
@bind-PatientFirstName="@ViewModel.PageDto.FirstName" @bind-PatientFirstName="@ViewModel.PageDto.FirstName"
@bind-PatientLastName="@ViewModel.PageDto.LastName" @bind-PatientLastName="@ViewModel.PageDto.LastName" />
/>
</div> </div>
</MudCarouselItem> </MudCarouselItem>
<MudCarouselItem> <MudCarouselItem>
<div class="flex flex-col h-full"> <div class="flex flex-col h-full p-4">
<MedicalHistoryActionStep2 PiQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.PresentIllness).ToList()" <MedicalHistoryActionStep2 PiQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.PresentIllness).ToList()"
@bind-PiDetail="@ViewModel.PageDto.PresentIllnessDetail" @bind-PiDetail="@ViewModel.PageDto.PresentIllnessDetail"
PiAnswers="@ViewModel.PiAnswers" /> PiAnswers="@ViewModel.PiAnswers" />
</div> </div>
</MudCarouselItem> </MudCarouselItem>
<MudCarouselItem> <MudCarouselItem>
<div class="flex flex-col h-full"> <div class="flex flex-col h-full p-4">
<MedicalHistoryActionStep3 PdhQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.PastDiseasesHistory).ToList()" <MedicalHistoryActionStep3 PdhQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.PastDiseasesHistory).ToList()"
PdhAnswers="@ViewModel.PdhAnswers" PdhAnswers="@ViewModel.PdhAnswers"
@bind-PdhDetail="@ViewModel.PageDto.PastDiseasesHistoryDetail" @bind-PdhDetail="@ViewModel.PageDto.PastDiseasesHistoryDetail"
@ -41,7 +40,7 @@
</div> </div>
</MudCarouselItem> </MudCarouselItem>
<MudCarouselItem> <MudCarouselItem>
<div class="flex flex-col h-full"> <div class="flex flex-col h-full p-4">
<MedicalHistoryActionStep4 DhQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.DrugHistory).ToList()" <MedicalHistoryActionStep4 DhQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.DrugHistory).ToList()"
DhAnswers="@ViewModel.DhAnswers" DhAnswers="@ViewModel.DhAnswers"
@bind-DhDetail="@ViewModel.PageDto.DrugHistoryDetail" @bind-DhDetail="@ViewModel.PageDto.DrugHistoryDetail"
@ -54,15 +53,18 @@
</div> </div>
</MudCarouselItem> </MudCarouselItem>
<MudCarouselItem> <MudCarouselItem>
<div class="flex flex-col h-full"> <div class="flex flex-col h-full p-4">
<MedicalHistoryActionStep5 GaQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.GeneralAppearance).ToList()" <MedicalHistoryActionStep5 GaQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.GeneralAppearance).ToList()"
GaAnswers="@ViewModel.GaAnswers"
RosQuestions="@ViewModel.SelectedTemplateLDto.Questions.Where(q=>q.Part==MedicalHistoryPart.ReviewOfSystem).ToList()"
RosAnswers="@ViewModel.RosAnswers"
@bind-DiastolicBloodPressure="@ViewModel.PageDto.DiastolicBloodPressure" @bind-DiastolicBloodPressure="@ViewModel.PageDto.DiastolicBloodPressure"
@bind-PulseRate="@ViewModel.PageDto.PulseRate" @bind-PulseRate="@ViewModel.PageDto.PulseRate"
@bind-SPO2="@ViewModel.PageDto.SPO2" @bind-SPO2="@ViewModel.PageDto.SPO2"
@bind-SystolicBloodPressure="@ViewModel.PageDto.SystolicBloodPressure" @bind-SystolicBloodPressure="@ViewModel.PageDto.SystolicBloodPressure"
@bind-Temperature="@ViewModel.PageDto.Temperature" @bind-Temperature="@ViewModel.PageDto.Temperature"
@bind-GaDetail="@ViewModel.PageDto.GeneralAppearanceDetail" @bind-GaDetail="@ViewModel.PageDto.GeneralAppearanceDetail"
@bind-RosDetail="@ViewModel.PageDto.SystemReviewDetail"/> @bind-RosDetail="@ViewModel.PageDto.SystemReviewDetail" />
</div> </div>
</MudCarouselItem> </MudCarouselItem>
<MudCarouselItem> <MudCarouselItem>
@ -74,11 +76,22 @@
@if (!@ViewModel.MedicalHistorySubmitted) @if (!@ViewModel.MedicalHistorySubmitted)
{ {
<MudPaper class="bottom-0 left-0 fixed w-full bg-[--color-medicalhistory] px-3 pt-4 pb-3 rounded-t-xl flex flex-row"> <MudPaper class="basis-auto bottom-0 left-0 fixed w-full bg-[--color-medicalhistory] px-3 pt-4 pb-3 rounded-t-xl flex flex-row">
@if (@ViewModel.CurrentStep == 4) @if (@ViewModel.CurrentStep == 4)
{ {
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled" Color="Color.Primary" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full">تکمیل</MudButton> @if (@ViewModel.IsEditing)
{
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled"
IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight"
class="font-extrabold rounded-full bg-[--color-primary]">ویرایش</MudButton>
}
else
{
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled"
IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight"
class="font-extrabold rounded-full bg-[--color-primary]">تـــکمیل</MudButton>
}
} }
else else
{ {
@ -97,10 +110,16 @@
</BasePageUi> </BasePageUi>
@code { @code {
[Parameter]
public string MedicalHistoryId { get; set; } = string.Empty;
public MedicalHistoryActionPageViewModel ViewModel { get; set; } public MedicalHistoryActionPageViewModel ViewModel { get; set; }
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
ViewModel = new MedicalHistoryActionPageViewModel(RestWrapper, NavigationManager, Snackbar, UserUtility); ViewModel = Guid.TryParse(MedicalHistoryId, out Guid medicalHistoryId) ?
new MedicalHistoryActionPageViewModel(RestWrapper, NavigationManager, Snackbar, UserUtility, medicalHistoryId)
: new MedicalHistoryActionPageViewModel(RestWrapper, NavigationManager, Snackbar, UserUtility);
await ViewModel.InitializeAsync(); await ViewModel.InitializeAsync();
await base.OnInitializedAsync(); await base.OnInitializedAsync();
} }

View File

@ -1,4 +1,6 @@
namespace DocuMed.PWA.Pages; using Mapster;
namespace DocuMed.PWA.Pages;
public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDto> public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDto>
{ {
@ -6,6 +8,7 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDt
private readonly NavigationManager _navigationManager; private readonly NavigationManager _navigationManager;
private readonly ISnackbar _snackbar; private readonly ISnackbar _snackbar;
private readonly IUserUtility _userUtility; private readonly IUserUtility _userUtility;
private readonly Guid _medicalHistoryId;
public MedicalHistoryActionPageViewModel(IRestWrapper restWrapper, public MedicalHistoryActionPageViewModel(IRestWrapper restWrapper,
NavigationManager navigationManager, NavigationManager navigationManager,
@ -18,6 +21,21 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDt
_userUtility = userUtility; _userUtility = userUtility;
} }
public MedicalHistoryActionPageViewModel(IRestWrapper restWrapper,
NavigationManager navigationManager,
ISnackbar snackbar,
IUserUtility userUtility,
Guid medicalHistoryId)
{
_restWrapper = restWrapper;
_navigationManager = navigationManager;
_snackbar = snackbar;
_userUtility = userUtility;
_medicalHistoryId = medicalHistoryId;
IsEditing = true;
}
public MedicalHistoryTemplateSDto SelectedTemplate { get; set; } = new(); public MedicalHistoryTemplateSDto SelectedTemplate { get; set; } = new();
public MedicalHistoryTemplateLDto SelectedTemplateLDto { get; set; } = new(); public MedicalHistoryTemplateLDto SelectedTemplateLDto { get; set; } = new();
@ -37,24 +55,69 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDt
public int CurrentStep { get; set; } = 0; public int CurrentStep { get; set; } = 0;
public string StepCounter { get; set; } = "1 / 5"; public string StepCounter { get; set; } = "1 / 5";
public bool MedicalHistorySubmitted { get; set; } = false; public bool MedicalHistorySubmitted { get; set; } = false;
public override async Task InitializeAsync()
{
if (_medicalHistoryId != Guid.Empty && IsEditing)
{
try
{
IsProcessing = true;
var token = await _userUtility.GetBearerTokenAsync();
var dto = await _restWrapper.CrudDtoApiRest<MedicalHistorySDto, MedicalHistoryLDto, Guid>(Address.MedicalHistoryController)
.ReadOne(_medicalHistoryId, token);
PageDto = dto;
SelectedSelection = dto.Section;
PiAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.PresentIllness));
PdhAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.PastDiseasesHistory));
PshAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.PastSurgeryHistory));
FhAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.FamilyHistory));
DhAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.DrugHistory));
HhAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.AddictionHistory));
GaAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.GeneralAppearance));
RosAnswers.AddRange(dto.Answers.Where(q => q.Part == MedicalHistoryPart.ReviewOfSystem));
if (dto.MedicalHistoryTemplateId != Guid.Empty)
{
SelectedTemplate = new MedicalHistoryTemplateSDto { Id = dto.MedicalHistoryTemplateId };
await SelectTemplateAsync();
}
}
catch (ApiException ex)
{
var exe = await ex.GetContentAsAsync<ApiResult>();
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
}
catch (Exception e)
{
_snackbar.Add(e.Message, Severity.Error);
}
finally
{
IsProcessing = false;
}
}
await base.InitializeAsync();
}
public async Task CompleteStepClicked() public async Task CompleteStepClicked()
{ {
CurrentStep++; CurrentStep++;
StepCounter = $"{CurrentStep + 1} / 5"; StepCounter = $"{CurrentStep + 1} / 5";
if (CurrentStep == 1) if (CurrentStep == 1)
await CheckMedicalHistoryAsync(); await SelectTemplateAsync();
if (CurrentStep == 5) if (CurrentStep == 5)
{ {
//if (IsEditing) if (IsEditing)
// await EditTemplateAsync(); await EditMedicalHistoryAsync();
//else else
await SubmitMedicalHistoryAsync(); await SubmitMedicalHistoryAsync();
MedicalHistorySubmitted = true; MedicalHistorySubmitted = true;
} }
Carousel?.MoveTo(CurrentStep); Carousel?.MoveTo(CurrentStep);
} }
private async Task CheckMedicalHistoryAsync() private async Task SelectTemplateAsync()
{ {
try try
{ {
@ -65,9 +128,9 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDt
var token = await _userUtility.GetBearerTokenAsync(); var token = await _userUtility.GetBearerTokenAsync();
var dto = await _restWrapper.CrudDtoApiRest<MedicalHistoryTemplateSDto, MedicalHistoryTemplateLDto, Guid>(Address.MedicalHistoryTemplateController) var dto = await _restWrapper.CrudDtoApiRest<MedicalHistoryTemplateSDto, MedicalHistoryTemplateLDto, Guid>(Address.MedicalHistoryTemplateController)
.ReadOne(SelectedTemplate.Id, token); .ReadOne(SelectedTemplate.Id, token);
PageDto.Id = dto.Id;
SelectedTemplateLDto = dto; SelectedTemplateLDto = dto;
SelectedTemplate = dto.Adapt<MedicalHistoryTemplateSDto>();
} }
catch (ApiException ex) catch (ApiException ex)
{ {
@ -83,7 +146,6 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDt
IsProcessing = false; IsProcessing = false;
} }
} }
@ -124,6 +186,44 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel<MedicalHistoryLDt
} }
} }
public async Task EditMedicalHistoryAsync()
{
try
{
IsProcessing = true;
if (SelectedSelection == null)
throw new Exception("لطفا بخش مورد نظر را انتخاب نمایید");
PageDto.SectionId = SelectedSelection.Id;
var token = await _userUtility.GetBearerTokenAsync();
PageDto.SectionId = SelectedSelection.Id;
PageDto.Answers.AddRange(PiAnswers);
PageDto.Answers.AddRange(PdhAnswers);
PageDto.Answers.AddRange(PshAnswers);
PageDto.Answers.AddRange(FhAnswers);
PageDto.Answers.AddRange(DhAnswers);
PageDto.Answers.AddRange(HhAnswers);
PageDto.Answers.AddRange(GaAnswers);
PageDto.Answers.AddRange(RosAnswers);
await _restWrapper.CrudDtoApiRest<MedicalHistoryLDto, MedicalHistorySDto, Guid>(Address.MedicalHistoryController)
.Update(PageDto, token);
}
catch (ApiException ex)
{
var exe = await ex.GetContentAsAsync<ApiResult>();
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
}
catch (Exception e)
{
_snackbar.Add(e.Message, Severity.Error);
}
finally
{
IsProcessing = false;
}
}
public void RollBackStepClicked() public void RollBackStepClicked()
{ {
Carousel?.MoveTo(--CurrentStep); Carousel?.MoveTo(--CurrentStep);

View File

@ -18,7 +18,6 @@
<MudAutocomplete Value="@SelectedTemplate" <MudAutocomplete Value="@SelectedTemplate"
ToStringFunc="dto => dto.ChiefComplaint" ToStringFunc="dto => dto.ChiefComplaint"
SearchFunc="@SearchTemplates" SearchFunc="@SearchTemplates"
TextChanged="async str => { ChiefComplaint = str;await ChiefComplaintChanged.InvokeAsync(str); }"
ValueChanged="async dto => { SelectedTemplate = dto; await SelectedTemplateChanged.InvokeAsync(SelectedTemplate); }" ValueChanged="async dto => { SelectedTemplate = dto; await SelectedTemplateChanged.InvokeAsync(SelectedTemplate); }"
T="MedicalHistoryTemplateSDto" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined"> T="MedicalHistoryTemplateSDto" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined">
<ProgressIndicatorInPopoverTemplate> <ProgressIndicatorInPopoverTemplate>

View File

@ -1,10 +1,11 @@
@using System.Collections.ObjectModel
<MudStack class="font-iranyekan"> <MudStack class="font-iranyekan">
<BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" /> <BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" />
@foreach (var question in PiQuestions) @foreach (var question in PiQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="AnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="AnswerChanged" />
} }
@ -15,6 +16,20 @@
@code @code
{ {
protected override void OnParametersSet()
{
if (PiAnswers.Count > 0)
{
foreach (var question in PiQuestions)
{
var answer = PiAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
base.OnParametersSet();
}
[Parameter] [Parameter]
public List<MedicalHistoryAnswerSDto> PiAnswers { get; set; } = new(); public List<MedicalHistoryAnswerSDto> PiAnswers { get; set; } = new();
@ -34,6 +49,6 @@
findAnswer.Answer = dto.Answer; findAnswer.Answer = dto.Answer;
else else
PiAnswers.Add(dto); PiAnswers.Add(dto);
} }
} }

View File

@ -4,7 +4,7 @@
@foreach (var question in PdhQuestions) @foreach (var question in PdhQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="PdhAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="PdhAnswerChanged" />
} }
@ -17,7 +17,7 @@
@foreach (var question in PshQuestions) @foreach (var question in PshQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="PshAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="PshAnswerChanged" />
} }
<MudTextField Margin="Margin.Dense" <MudTextField Margin="Margin.Dense"
@ -28,6 +28,28 @@
@code @code
{ {
protected override void OnParametersSet()
{
if (PdhAnswers.Count > 0)
{
foreach (var question in PdhQuestions)
{
var answer = PdhAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
if (PshAnswers.Count > 0)
{
foreach (var question in PshQuestions)
{
var answer = PshAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
base.OnParametersSet();
}
[Parameter] [Parameter]
public List<MedicalHistoryAnswerSDto> PdhAnswers { get; set; } = new(); public List<MedicalHistoryAnswerSDto> PdhAnswers { get; set; } = new();

View File

@ -2,7 +2,7 @@
<BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" /> <BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" />
@foreach (var question in FhQuestions) @foreach (var question in FhQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="FhAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="FhAnswerChanged" />
} }
<MudTextField T="string" <MudTextField T="string"
Value="@FhDetail" ValueChanged="async detail => { FhDetail = detail; await FhDetailChanged.InvokeAsync(detail); }" Value="@FhDetail" ValueChanged="async detail => { FhDetail = detail; await FhDetailChanged.InvokeAsync(detail); }"
@ -13,7 +13,7 @@
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2"> <div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
@foreach (var question in DhQuestions) @foreach (var question in DhQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="DhAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="DhAnswerChanged" />
} }
</div> </div>
@ -25,7 +25,7 @@
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2"> <div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
@foreach (var question in HhQuestions) @foreach (var question in HhQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="HhAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="HhAnswerChanged" />
} }
</div> </div>
@ -45,7 +45,37 @@
</MudStack> </MudStack>
@code { @code {
protected override void OnParametersSet()
{
if (FhAnswers.Count > 0)
{
foreach (var question in FhQuestions)
{
var answer = FhAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
if (DhAnswers.Count > 0)
{
foreach (var question in DhQuestions)
{
var answer = DhAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
if (HhAnswers.Count > 0)
{
foreach (var question in HhQuestions)
{
var answer = HhAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
base.OnParametersSet();
}
[Parameter] [Parameter]
public string AhDetail { get; set; } = string.Empty; public string AhDetail { get; set; } = string.Empty;
@ -108,10 +138,10 @@
private void HhAnswerChanged(MedicalHistoryAnswerSDto dto) private void HhAnswerChanged(MedicalHistoryAnswerSDto dto)
{ {
var findAnswer = DhAnswers.FirstOrDefault(pi => pi.Question == dto.Question && pi.Part == dto.Part); var findAnswer = HhAnswers.FirstOrDefault(pi => pi.Question == dto.Question && pi.Part == dto.Part);
if (findAnswer != null) if (findAnswer != null)
findAnswer.Answer = dto.Answer; findAnswer.Answer = dto.Answer;
else else
DhAnswers.Add(dto); HhAnswers.Add(dto);
} }
} }

View File

@ -4,7 +4,7 @@
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2"> <div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
@foreach (var question in GaQuestions) @foreach (var question in GaQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="GaAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="GaAnswerChanged" />
} }
</div> </div>
@ -16,26 +16,38 @@
<BasePartDivider Index="10" Title="علائم حیاتی ( VS )" /> <BasePartDivider Index="10" Title="علائم حیاتی ( VS )" />
<div class="flex flex-row"> <div class="flex flex-row">
<p class="my-auto mr-5 font-extrabold text-md grow">فشــــار خون</p> <p class="my-auto mr-5 font-extrabold text-md grow">فشــــار خون</p>
<MudTextField InputType="InputType.Number" Label="سیستولیک" Margin="Margin.Dense" class="mx-3 my-auto basis-1/12" T="string" Variant="Variant.Outlined" /> <MudTextField InputType="InputType.Number"
<MudTextField InputType="InputType.Number" Label="دیاستولیک" Margin="Margin.Dense" class="my-auto basis-1/12" T="string" Variant="Variant.Outlined" /> Value="@SystolicBloodPressure" ValueChanged="async detail => { SystolicBloodPressure = detail; await SystolicBloodPressureChanged.InvokeAsync(detail); }"
Label="سیستولیک"
Margin="Margin.Dense"
class="mx-3 my-auto basis-1/12" T="int" Variant="Variant.Outlined" />
<MudTextField InputType="InputType.Number"
Value="@DiastolicBloodPressure" ValueChanged="async detail => { DiastolicBloodPressure = detail; await DiastolicBloodPressureChanged.InvokeAsync(detail); }"
Label="دیاستولیک"
Margin="Margin.Dense"
class="my-auto basis-1/12" T="int" Variant="Variant.Outlined" />
</div> </div>
<div class="grid grid-cols-3"> <div class="grid grid-cols-3">
<MudTextField InputType="InputType.Number" Margin="Margin.Dense" Label="نبض" T="string" Variant="Variant.Outlined" />
<MudTextField Value="@PulseRate" ValueChanged="async detail => { PulseRate = detail; await PulseRateChanged.InvokeAsync(detail); }"
InputType="InputType.Number" Margin="Margin.Dense" Label="نبض" T="int" Variant="Variant.Outlined" />
<MudTextField InputType="InputType.Number" class="mx-2" Margin="Margin.Dense" Label="اکسیژن" T="string" Variant="Variant.Outlined" /> <MudTextField Value="@SPO2" ValueChanged="async detail => { SPO2 = detail; await SPO2Changed.InvokeAsync(detail); }"
InputType="InputType.Number" class="mx-2" Margin="Margin.Dense" Label="اکسیژن" T="int" Variant="Variant.Outlined" />
<MudTextField InputType="InputType.Number" Margin="Margin.Dense" Label="دمای بدن" T="string" Variant="Variant.Outlined" /> <MudTextField Value="@Temperature" ValueChanged="async detail => { Temperature = detail; await TemperatureChanged.InvokeAsync(detail); }"
InputType="InputType.Number" Margin="Margin.Dense" Label="دمای بدن" T="int" Variant="Variant.Outlined" />
</div> </div>
<BasePartDivider Index="11" Title="بررسی سیستماتیک ( ROS )" /> <BasePartDivider Index="11" Title="بررسی سیستماتیک ( ROS )" />
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2"> <div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
@foreach (var question in GaQuestions) @foreach (var question in RosQuestions)
{ {
<BaseMedicalQuestionTemplate Question="@question" AnswerChanged="GaAnswerChanged" /> <BaseMedicalQuestionTemplate Question="@question" Answer="@question.Answer" AnswerChanged="RosAnswerChanged" />
} }
</div> </div>
@ -47,7 +59,28 @@
</MudStack> </MudStack>
@code { @code {
protected override void OnParametersSet()
{
if (GaAnswers.Count > 0)
{
foreach (var question in GaQuestions)
{
var answer = GaAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
if (RosAnswers.Count > 0)
{
foreach (var question in RosQuestions)
{
var answer = RosAnswers.FirstOrDefault(a => a.Question == question.Question && a.Part == question.Part);
if (answer != null)
question.Answer = answer;
}
}
base.OnParametersSet();
}
[Parameter] [Parameter]
public string RosDetail { get; set; } = string.Empty; public string RosDetail { get; set; } = string.Empty;
@ -59,13 +92,6 @@
[Parameter] [Parameter]
public List<MedicalHistoryQuestionSDto> GaQuestions { get; set; } = new(); public List<MedicalHistoryQuestionSDto> GaQuestions { get; set; } = new();
[Parameter]
public string GaDetail { get; set; } = string.Empty;
[Parameter]
public EventCallback<string> GaDetailChanged { get; set; }
private void GaAnswerChanged(MedicalHistoryAnswerSDto dto) private void GaAnswerChanged(MedicalHistoryAnswerSDto dto)
{ {
var findAnswer = GaAnswers.FirstOrDefault(pi => pi.Question == dto.Question && pi.Part == dto.Part); var findAnswer = GaAnswers.FirstOrDefault(pi => pi.Question == dto.Question && pi.Part == dto.Part);
@ -75,6 +101,27 @@
GaAnswers.Add(dto); GaAnswers.Add(dto);
} }
[Parameter]
public List<MedicalHistoryAnswerSDto> RosAnswers { get; set; } = new();
[Parameter]
public List<MedicalHistoryQuestionSDto> RosQuestions { get; set; } = new();
[Parameter]
public string GaDetail { get; set; } = string.Empty;
[Parameter]
public EventCallback<string> GaDetailChanged { get; set; }
private void RosAnswerChanged(MedicalHistoryAnswerSDto dto)
{
var findAnswer = RosAnswers.FirstOrDefault(pi => pi.Question == dto.Question && pi.Part == dto.Part);
if (findAnswer != null)
findAnswer.Answer = dto.Answer;
else
RosAnswers.Add(dto);
}
[Parameter] [Parameter]
public int SystolicBloodPressure { get; set; } public int SystolicBloodPressure { get; set; }

View File

@ -67,14 +67,14 @@
@if (@ViewModel.IsEditing) @if (@ViewModel.IsEditing)
{ {
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled" <MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled"
IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight"
class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton> class="font-extrabold rounded-full bg-[--color-medicalhistory]">ویرایش</MudButton>
} }
else else
{ {
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled" <MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled"
IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight"
class="font-extrabold rounded-full bg-[--color-medicalhistory]">ویرایش</MudButton> class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton>
} }
} }
else else

View File

@ -160,7 +160,6 @@ public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel<MedicalHi
PageDto.SectionId = SelectedSelection.Id; PageDto.SectionId = SelectedSelection.Id;
PageDto.Questions.AddRange(PiQuestions); PageDto.Questions.AddRange(PiQuestions);
PageDto.Questions.AddRange(PdhQuestions); PageDto.Questions.AddRange(PdhQuestions);
PageDto.Questions.AddRange(PiQuestions);
PageDto.Questions.AddRange(PshQuestions); PageDto.Questions.AddRange(PshQuestions);
PageDto.Questions.AddRange(FhQuestions); PageDto.Questions.AddRange(FhQuestions);
PageDto.Questions.AddRange(DhQuestions); PageDto.Questions.AddRange(DhQuestions);

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="flex flex-row"> <div class="flex flex-row">
<MudTextField @bind-Value="@_vitalSign" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" /> <MudTextField @bind-Value="@_generalAppearance" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
<MudButton Variant="Variant.Outlined" @onclick="AddGeneralAppearance" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md"> <MudButton Variant="Variant.Outlined" @onclick="AddGeneralAppearance" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
+ +
@ -96,9 +96,10 @@
</MudStack> </MudStack>
@code { @code {
private string _vitalSign = string.Empty; private string _generalAppearance = string.Empty;
[Parameter] [Parameter]
public List<MedicalHistoryQuestionSDto> GeneralAppearance { get; set; } = new(); public List<MedicalHistoryQuestionSDto> GeneralAppearance { get; set; } = new();
private void RemoveGeneralAppearance(MedicalHistoryQuestionSDto generalAppearance) private void RemoveGeneralAppearance(MedicalHistoryQuestionSDto generalAppearance)
{ {
GeneralAppearance.Remove(generalAppearance); GeneralAppearance.Remove(generalAppearance);
@ -107,11 +108,11 @@
{ {
GeneralAppearance.Add(new MedicalHistoryQuestionSDto GeneralAppearance.Add(new MedicalHistoryQuestionSDto
{ {
Question = _vitalSign, Question = _generalAppearance,
QuestionType = MedicalHistoryQuestionType.Selective, QuestionType = MedicalHistoryQuestionType.Selective,
Part = MedicalHistoryPart.VitalSign Part = MedicalHistoryPart.GeneralAppearance
}); });
_vitalSign = string.Empty; _generalAppearance = string.Empty;
} }

View File

@ -9,14 +9,6 @@ builder.Services.AddMudServices(config =>
config.SnackbarConfiguration.SnackbarVariant = Variant.Filled; config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight; config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight;
}); });
if (builder.HostEnvironment.IsDevelopment())
{
Address.BaseAddress = "http://localhost:32770/api";
}
else if (builder.HostEnvironment.IsProduction())
{
Address.BaseAddress = "https://documed.ir/api";
}
builder.Services.AddScoped<IRestWrapper, RestWrapper>(); builder.Services.AddScoped<IRestWrapper, RestWrapper>();
builder.Services.AddScoped<IUserUtility, UserUtility>(); builder.Services.AddScoped<IUserUtility, UserUtility>();
builder.Services.AddBlazoredLocalStorage(); builder.Services.AddBlazoredLocalStorage();

View File

@ -1,5 +1,5 @@
@using DocuMed.Domain.Dtos.SmallDtos @using DocuMed.Domain.Dtos.SmallDtos
<MudCard Class="mx-3 my-1 rounded-md" Elevation="2"> <MudCard @onclick="async ()=> await Clicked.InvokeAsync(MedicalHistory)" Class="mx-3 my-1 rounded-md" Elevation="2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="bg-[--color-primary] rounded-r-lg w-2"></div> <div class="bg-[--color-primary] rounded-r-lg w-2"></div>
<MudStack class="grow mx-3.5 my-4"> <MudStack class="grow mx-3.5 my-4">
@ -35,4 +35,7 @@
[Parameter] [Parameter]
public MedicalHistorySDto MedicalHistory { get; set; } = new(); public MedicalHistorySDto MedicalHistory { get; set; } = new();
[Parameter]
public EventCallback<MedicalHistorySDto> Clicked { get; set; }
} }

View File

@ -1,24 +1,26 @@
@switch (Question.QuestionType) @switch (Question.QuestionType)
{ {
case MedicalHistoryQuestionType.Selective: case MedicalHistoryQuestionType.Selective:
<SelectiveMedicalQuestionTemplate Question="@Question.Question" AnswerChanged="async answer => await AnswerChanging(answer) " /> <SelectiveMedicalQuestionTemplate Question="@Question.Question" Answer="@Answer.Answer" AnswerChanged="async answer => await AnswerChanging(answer) " />
break; break;
case MedicalHistoryQuestionType.Hourly: case MedicalHistoryQuestionType.Hourly:
<HourMedicalQuestionTemplate Question="@Question.Question" AnswerChanged="async answer => await AnswerChanging(answer) " /> <HourMedicalQuestionTemplate Question="@Question.Question" Answer="@Answer.Answer" AnswerChanged="async answer => await AnswerChanging(answer) " />
break; break;
case MedicalHistoryQuestionType.Interrogatively: case MedicalHistoryQuestionType.Interrogatively:
<InterrogativelyMedicalQuestionTemplate Question="@Question.Question" AnswerChanged="async answer => await AnswerChanging(answer) " /> <InterrogativelyMedicalQuestionTemplate Question="@Question.Question" Answer="@Answer.Answer" AnswerChanged="async answer => await AnswerChanging(answer) " />
break; break;
case MedicalHistoryQuestionType.YesOrNo: case MedicalHistoryQuestionType.YesOrNo:
<YesOrNoMedicalQuestionTemplate Question="@Question.Question" AnswerChanged="async answer => await AnswerChanging(answer) " /> <YesOrNoMedicalQuestionTemplate Question="@Question.Question" Answer="@Answer.Answer" AnswerChanged="async answer => await AnswerChanging(answer) " />
break;
case MedicalHistoryQuestionType.RosSelective:
<RosSelectiveMedicalQuestionTemplate IsSymptom="@Question.IsSymptom" IsSign="@Question.IsSign" BodySystem="@Question.BodySystem" Question="@Question.Question" Answer="@Answer.Answer" AnswerChanged="async answer => await AnswerChanging(answer) " />
break; break;
default: default:
<InterrogativelyMedicalQuestionTemplate Question="@Question.Question" AnswerChanged="async answer => await AnswerChanging(answer) " /> <InterrogativelyMedicalQuestionTemplate Question="@Question.Question" Answer="@Answer.Answer" AnswerChanged="async answer => await AnswerChanging(answer) " />
break; break;
} }
@code { @code {
[Parameter] [Parameter]
public MedicalHistoryQuestionSDto Question { get; set; } = new(); public MedicalHistoryQuestionSDto Question { get; set; } = new();
@ -31,12 +33,12 @@
private async Task AnswerChanging(string answer) private async Task AnswerChanging(string answer)
{ {
Answer = new MedicalHistoryAnswerSDto Answer = new MedicalHistoryAnswerSDto
{ {
Question = Question.Question, Question = Question.Question,
QuestionType = Question.QuestionType, QuestionType = Question.QuestionType,
Answer = answer, Answer = answer,
Part = Question.Part Part = Question.Part
}; };
await AnswerChanged.InvokeAsync(Answer); await AnswerChanged.InvokeAsync(Answer);
} }

View File

@ -13,6 +13,16 @@
@code @code
{ {
protected override void OnParametersSet()
{
base.OnParametersSet();
if (!Answer.IsNullOrEmpty() && int.TryParse(Answer, out int hCounter))
{
_hourCounter = hCounter;
}
}
private int _hourCounter; private int _hourCounter;
[Parameter] [Parameter]

View File

@ -7,7 +7,6 @@
Variant="Variant.Outlined" /> Variant="Variant.Outlined" />
@code { @code {
[Parameter] [Parameter]
public string Answer { get; set; } = string.Empty; public string Answer { get; set; } = string.Empty;

View File

@ -0,0 +1,91 @@
@if (_isSelected)
{
<MudCard @onclick="SelectChanged" class="text-center bg-[--color-medicalhistory]">
<MudCardContent>
<div class="flex flex-row">
<p class="flex-grow font-extrabold text-gray-600 text-md">@Question</p>
<MudPaper Elevation="0" Class="mx-1 mt-1 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
@BodySystem.ToDisplay()
</MudPaper>
@if (IsSign)
{
<MudPaper Elevation="0" Class="mx-1 mt-1 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
Sign
</MudPaper>
}
@if (IsSymptom)
{
<MudPaper Elevation="0" Class="mx-1 mt-1 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
Symptom
</MudPaper>
}
</div>
</MudCardContent>
</MudCard>
}
else
{
<MudCard @onclick="SelectChanged" class="text-center">
<MudCardContent>
<div class="flex flex-row">
<p class="flex-grow font-extrabold text-gray-600 text-md">@Question</p>
<MudPaper Elevation="0" Class="mx-1 mt-1 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
@BodySystem.ToDisplay()
</MudPaper>
@if (IsSign)
{
<MudPaper Elevation="0" Class="mx-1 mt-1 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
Sign
</MudPaper>
}
@if (IsSymptom)
{
<MudPaper Elevation="0" Class="mx-1 mt-1 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
Symptom
</MudPaper>
}
</div>
</MudCardContent>
</MudCard>
}
@code
{
protected override void OnParametersSet()
{
base.OnParametersSet();
if (!Answer.IsNullOrEmpty())
{
_isSelected = Answer == Question;
}
}
[Parameter]
public string Answer { get; set; } = string.Empty;
[Parameter]
public EventCallback<string> AnswerChanged { get; set; }
[Parameter]
public string Question { get; set; } = string.Empty;
[Parameter]
public BodySystem BodySystem { get; set; }
[Parameter]
public bool IsSign { get; set; }
[Parameter]
public bool IsSymptom { get; set; }
private bool _isSelected = false;
private async Task SelectChanged()
{
_isSelected = !_isSelected;
Answer = _isSelected ? Question : string.Empty;
await AnswerChanged.InvokeAsync(Answer);
}
}

View File

@ -1,6 +1,6 @@
@if (_isSelected) @if (_isSelected)
{ {
<MudCard @onclick="SelectChanged" class="text-center bg-[--color-medicalhistory] border-2"> <MudCard @onclick="SelectChanged" class="text-center bg-[--color-medicalhistory]">
<MudCardContent> <MudCardContent>
<p class="font-extrabold text-gray-600 text-md">@Question</p> <p class="font-extrabold text-gray-600 text-md">@Question</p>
</MudCardContent> </MudCardContent>
@ -17,6 +17,15 @@ else
@code @code
{ {
protected override void OnParametersSet()
{
base.OnParametersSet();
if (!Answer.IsNullOrEmpty())
{
_isSelected = Answer == Question;
}
}
[Parameter] [Parameter]
public string Answer { get; set; } = string.Empty; public string Answer { get; set; } = string.Empty;
@ -28,10 +37,12 @@ else
private bool _isSelected = false; private bool _isSelected = false;
private void SelectChanged() private async Task SelectChanged()
{ {
_isSelected = !_isSelected;
Answer = _isSelected ? Question : string.Empty; Answer = _isSelected ? Question : string.Empty;
_isSelected = !_isSelected; await AnswerChanged.InvokeAsync(Answer);
} }
} }

View File

@ -42,7 +42,23 @@
@code @code
{ {
protected override void OnParametersSet()
{
base.OnParametersSet();
if (!Answer.IsNullOrEmpty())
{
if (Answer == "بله")
{
_isNoSelected = false;
_isYesSelected = true;
}
else if (Answer == "خیر")
{
_isNoSelected = true;
_isYesSelected = false;
}
}
}
[Parameter] [Parameter]
public string Answer { get; set; } = string.Empty; public string Answer { get; set; } = string.Empty;

View File

@ -22,7 +22,7 @@
<MudIconButton @onclick="BackClicked" Icon="@Icons.Material.TwoTone.ChevronLeft" class="w-10 h-10 my-auto ml-4 mr-auto font-extrabold bg-white rounded-full" /> <MudIconButton @onclick="BackClicked" Icon="@Icons.Material.TwoTone.ChevronLeft" class="w-10 h-10 my-auto ml-4 mr-auto font-extrabold bg-white rounded-full" />
} }
</div> </div>
<div class="bg-[#EEEEEE] w-full h-full flex flex-col rounded-t-xl p-5"> <div class="bg-[#EEEEEE] w-full h-full flex flex-col rounded-t-xl">
@ChildContent @ChildContent
</div> </div>
</MudStack> </MudStack>

View File

@ -769,6 +769,9 @@ video {
.flex-none { .flex-none {
flex: none; flex: none;
} }
.flex-grow {
flex-grow: 1;
}
.grow { .grow {
flex-grow: 1; flex-grow: 1;
} }
@ -784,6 +787,9 @@ video {
.basis-2\/4 { .basis-2\/4 {
flex-basis: 50%; flex-basis: 50%;
} }
.basis-auto {
flex-basis: auto;
}
.grid-cols-1 { .grid-cols-1 {
grid-template-columns: repeat(1, minmax(0, 1fr)); grid-template-columns: repeat(1, minmax(0, 1fr));
} }
@ -850,9 +856,6 @@ video {
border-top-left-radius: 0.75rem; border-top-left-radius: 0.75rem;
border-top-right-radius: 0.75rem; border-top-right-radius: 0.75rem;
} }
.border-2 {
border-width: 2px;
}
.border-\[--color-medicalhistory\] { .border-\[--color-medicalhistory\] {
border-color: var(--color-medicalhistory); border-color: var(--color-medicalhistory);
} }
@ -908,6 +911,9 @@ video {
.bg-opacity-20 { .bg-opacity-20 {
--tw-bg-opacity: 0.2; --tw-bg-opacity: 0.2;
} }
.p-1 {
padding: 0.25rem;
}
.p-4 { .p-4 {
padding: 1rem; padding: 1rem;
} }

View File

@ -905,6 +905,10 @@ video {
flex: none; flex: none;
} }
.flex-grow {
flex-grow: 1;
}
.grow { .grow {
flex-grow: 1; flex-grow: 1;
} }
@ -925,6 +929,10 @@ video {
flex-basis: 50%; flex-basis: 50%;
} }
.basis-auto {
flex-basis: auto;
}
.grid-cols-1 { .grid-cols-1 {
grid-template-columns: repeat(1, minmax(0, 1fr)); grid-template-columns: repeat(1, minmax(0, 1fr));
} }
@ -1012,10 +1020,6 @@ video {
border-top-right-radius: 0.75rem; border-top-right-radius: 0.75rem;
} }
.border-2 {
border-width: 2px;
}
.border-\[--color-medicalhistory\] { .border-\[--color-medicalhistory\] {
border-color: var(--color-medicalhistory); border-color: var(--color-medicalhistory);
} }
@ -1086,6 +1090,10 @@ video {
--tw-bg-opacity: 0.2; --tw-bg-opacity: 0.2;
} }
.p-1 {
padding: 0.25rem;
}
.p-4 { .p-4 {
padding: 1rem; padding: 1rem;
} }

View File

@ -1,44 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DocuMed.Repository.Migrations
{
/// <inheritdoc />
public partial class editMH : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_MedicalHistories_SectionId",
schema: "public",
table: "MedicalHistories",
column: "SectionId");
migrationBuilder.AddForeignKey(
name: "FK_MedicalHistories_Sections_SectionId",
schema: "public",
table: "MedicalHistories",
column: "SectionId",
principalSchema: "public",
principalTable: "Sections",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_MedicalHistories_Sections_SectionId",
schema: "public",
table: "MedicalHistories");
migrationBuilder.DropIndex(
name: "IX_MedicalHistories_SectionId",
schema: "public",
table: "MedicalHistories");
}
}
}

View File

@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DocuMed.Repository.Migrations namespace DocuMed.Repository.Migrations
{ {
[DbContext(typeof(ApplicationContext))] [DbContext(typeof(ApplicationContext))]
[Migration("20231028181623_editMH")] [Migration("20231031084330_init")]
partial class editMH partial class init
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -221,6 +221,9 @@ namespace DocuMed.Repository.Migrations
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<Guid>("MedicalHistoryTemplateId")
.HasColumnType("uuid");
b.Property<DateTime>("ModifiedAt") b.Property<DateTime>("ModifiedAt")
.HasColumnType("timestamp without time zone"); .HasColumnType("timestamp without time zone");

View File

@ -254,6 +254,7 @@ namespace DocuMed.Repository.Migrations
PulseRate = table.Column<int>(type: "integer", nullable: false), PulseRate = table.Column<int>(type: "integer", nullable: false),
SPO2 = table.Column<int>(type: "integer", nullable: false), SPO2 = table.Column<int>(type: "integer", nullable: false),
Temperature = table.Column<int>(type: "integer", nullable: false), Temperature = table.Column<int>(type: "integer", nullable: false),
MedicalHistoryTemplateId = table.Column<Guid>(type: "uuid", nullable: false),
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false), ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
@ -266,6 +267,13 @@ namespace DocuMed.Repository.Migrations
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_MedicalHistories", x => x.Id); table.PrimaryKey("PK_MedicalHistories", x => x.Id);
table.ForeignKey(
name: "FK_MedicalHistories_Sections_SectionId",
column: x => x.SectionId,
principalSchema: "public",
principalTable: "Sections",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey( table.ForeignKey(
name: "FK_MedicalHistories_Users_ApplicationUserId", name: "FK_MedicalHistories_Users_ApplicationUserId",
column: x => x.ApplicationUserId, column: x => x.ApplicationUserId,
@ -442,6 +450,12 @@ namespace DocuMed.Repository.Migrations
table: "MedicalHistories", table: "MedicalHistories",
column: "ApplicationUserId"); column: "ApplicationUserId");
migrationBuilder.CreateIndex(
name: "IX_MedicalHistories_SectionId",
schema: "public",
table: "MedicalHistories",
column: "SectionId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_MedicalHistoryAnswers_MedicalHistoryId", name: "IX_MedicalHistoryAnswers_MedicalHistoryId",
schema: "public", schema: "public",

View File

@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DocuMed.Repository.Migrations namespace DocuMed.Repository.Migrations
{ {
[DbContext(typeof(ApplicationContext))] [DbContext(typeof(ApplicationContext))]
[Migration("20231028152226_init")] [Migration("20231105123131_editMhAddGa")]
partial class init partial class editMhAddGa
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -214,6 +214,10 @@ namespace DocuMed.Repository.Migrations
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("GeneralAppearanceDetail")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsRemoved") b.Property<bool>("IsRemoved")
.HasColumnType("boolean"); .HasColumnType("boolean");
@ -221,6 +225,9 @@ namespace DocuMed.Repository.Migrations
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<Guid>("MedicalHistoryTemplateId")
.HasColumnType("uuid");
b.Property<DateTime>("ModifiedAt") b.Property<DateTime>("ModifiedAt")
.HasColumnType("timestamp without time zone"); .HasColumnType("timestamp without time zone");
@ -278,6 +285,8 @@ namespace DocuMed.Repository.Migrations
b.HasIndex("ApplicationUserId"); b.HasIndex("ApplicationUserId");
b.HasIndex("SectionId");
b.ToTable("MedicalHistories", "public"); b.ToTable("MedicalHistories", "public");
}); });
@ -715,7 +724,15 @@ namespace DocuMed.Repository.Migrations
.OnDelete(DeleteBehavior.Restrict) .OnDelete(DeleteBehavior.Restrict)
.IsRequired(); .IsRequired();
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
.WithMany()
.HasForeignKey("SectionId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("ApplicationUser"); b.Navigation("ApplicationUser");
b.Navigation("Section");
}); });
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b => modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>

View File

@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DocuMed.Repository.Migrations
{
/// <inheritdoc />
public partial class editMhAddGa : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "GeneralAppearanceDetail",
schema: "public",
table: "MedicalHistories",
type: "text",
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GeneralAppearanceDetail",
schema: "public",
table: "MedicalHistories");
}
}
}

View File

@ -211,6 +211,10 @@ namespace DocuMed.Repository.Migrations
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("GeneralAppearanceDetail")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsRemoved") b.Property<bool>("IsRemoved")
.HasColumnType("boolean"); .HasColumnType("boolean");
@ -218,6 +222,9 @@ namespace DocuMed.Repository.Migrations
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<Guid>("MedicalHistoryTemplateId")
.HasColumnType("uuid");
b.Property<DateTime>("ModifiedAt") b.Property<DateTime>("ModifiedAt")
.HasColumnType("timestamp without time zone"); .HasColumnType("timestamp without time zone");