Add project files.

master
Amir Hossein Khademi 2023-10-10 17:02:38 +03:30
parent 3bc1fc9ff6
commit be609347ed
181 changed files with 22221 additions and 0 deletions

25
.dockerignore 100644
View File

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

43
.vscode/launch.json vendored 100644
View File

@ -0,0 +1,43 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch and Debug Standalone Blazor WebAssembly App",
"type": "blazorwasm",
"request": "launch",
"cwd": "${workspaceFolder}",
"url": "http://localhost:5254;http://192.168.190.123:5254" // Tell launch where to find site
},
{
"name": "Watch",
"type": "coreclr",
"request": "launch",
"cwd": "${workspaceFolder}/DocuMed.PWA",
"program": "dotnet",
"args": [
"watch",
"--project",
".",
"--verbose" // Let's us confirm browser connects with hot reload capabilities
],
"preLaunchTask": "build" // Ensure we don't watch an unbuilt site
},
{
"name": "Attach",
"type": "blazorwasm",
"request": "attach",
"cwd": "${workspaceFolder}",
"url": "http://localhost:5254;http://192.168.190.123:5254", // Tell launch where to find site
"timeout": 120000, // Allows time for the site to launch
}
],
"compounds": [
{
"name": "Debug with Hot Reload",
"configurations": [ "Watch", "Attach" ]
}
]
}

41
.vscode/tasks.json vendored 100644
View File

@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/DocuMed.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/DocuMed.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/DocuMed.sln"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
namespace DocuMed.Api.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}

View File

@ -0,0 +1,21 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["DocuMed.Api/DocuMed.Api.csproj", "DocuMed.Api/"]
RUN dotnet restore "DocuMed.Api/DocuMed.Api.csproj"
COPY . .
WORKDIR "/src/DocuMed.Api"
RUN dotnet build "DocuMed.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "DocuMed.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DocuMed.Api.dll"]

View File

@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Asp.Versioning.Http" Version="7.0.1" />
<PackageReference Include="Ben.BlockingDetector" Version="0.0.4" />
<PackageReference Include="Carter" Version="7.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Elmah.Io.AspNetCore.Serilog" Version="4.1.16" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.8" />
<PackageReference Include="Sentry.Serilog" Version="3.34.0" />
<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.PostgreSQL" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="5.2.2" />
<PackageReference Include="Serilog.Sinks.ElmahIo" Version="4.3.29" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="9.1.0" />
<PackageReference Include="StackExchange.Redis.Extensions.Core" Version="9.1.0" />
<PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft" Version="9.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.8" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DocuMed.Infrastructure\DocuMed.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,23 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseAuthorization();
app.MapControllers();
app.Run();

View File

@ -0,0 +1,40 @@
{
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5288"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
"environmentVariables": {
"ASPNETCORE_URLS": "http://+:80"
},
"publishAllPorts": true
}
},
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:29584",
"sslPort": 0
}
}
}

View File

@ -0,0 +1,13 @@
namespace DocuMed.Api
{
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

View File

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.Common
{
public class CommonConfig
{
}
}

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<Using Include="MD.PersianDateTime.Standard" />
<Using Include="System.ComponentModel.DataAnnotations" />
<Using Include="System.ComponentModel.DataAnnotations.Schema" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,30 @@
using System.Collections;
namespace DocuMed.Common.Extensions
{
public static class AssertExtensions
{
public static void NotNull<T>(T obj, string name, string message = null)
where T : class
{
if (obj is null)
throw new ArgumentNullException($"{name} : {typeof(T)}", message);
}
public static void NotNull<T>(T? obj, string name, string message = null)
where T : struct
{
if (!obj.HasValue)
throw new ArgumentNullException($"{name} : {typeof(T)}", message);
}
public static void NotEmpty<T>(T obj, string name, string message = null, T defaultValue = null)
where T : class
{
if (obj == defaultValue
|| obj is string str && string.IsNullOrWhiteSpace(str)
|| obj is IEnumerable list && !list.Cast<object>().Any())
throw new ArgumentException("Argument is empty : " + message, $"{name} : {typeof(T)}");
}
}
}

View File

@ -0,0 +1,39 @@
using DocuMed.Common.Models.Entity;
namespace DocuMed.Common.Extensions
{
public static class ClassDisplayExtensions
{
public static string GetDisplayAttributeName<T>()
{
var attrs =
Attribute.GetCustomAttributes(typeof(T));
foreach (var attr in attrs)
{
var displayAttribute = attr as ClassDisplay;
if (displayAttribute == null)
continue;
return displayAttribute.GetName();
}
return null;
}
public static string GetDisplayAttributeDescription<T>()
{
var attrs =
Attribute.GetCustomAttributes(typeof(T));
foreach (var attr in attrs)
{
var displayAttribute = attr as ClassDisplay;
if (displayAttribute == null)
continue;
return displayAttribute.GetDescription();
}
return null;
}
}
}

View File

@ -0,0 +1,59 @@
namespace DocuMed.Common.Extensions
{
public static class DateTimeExtensions
{
public static string GetPersianDayOfWeek(this DayOfWeek dayOfWeek)
{
switch (dayOfWeek)
{
case DayOfWeek.Friday:
return "جمعه";
case DayOfWeek.Monday:
return "دوشنبه";
case DayOfWeek.Saturday:
return "شنبه";
case DayOfWeek.Sunday:
return "یکشنبه";
case DayOfWeek.Thursday:
return "پنج شنبه";
case DayOfWeek.Tuesday:
return "سه شنبه";
case DayOfWeek.Wednesday:
return "چهارشنبه";
}
return "";
}
public static DateTime UnixTimeStampToDateTime(double unixTimeStamp)
{
// Unix timestamp is seconds past epoch
var dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dtDateTime = dtDateTime.AddMilliseconds(unixTimeStamp).ToLocalTime();
return dtDateTime;
}
public static long DateTimeToUnixTimeStamp(DateTime dateTime)
{
return ((DateTimeOffset)dateTime).ToUnixTimeMilliseconds();
}
public static int DifferenceByDay(DateTime originDateTime, DateTime destDateTime)
{
return (int)(destDateTime - originDateTime).TotalDays;
}
public static int DifferenceByHoure(DateTime originDateTime, DateTime destDateTime)
{
return (int)(destDateTime - originDateTime).TotalHours;
}
public static TimeSpan Difference(DateTime originDateTime, DateTime destDateTime)
{
var durateion = (destDateTime - originDateTime).Duration();
return durateion;
}
public static PersianDateTime ToPersianDateTime(this DateTime dateTime)
=> new PersianDateTime(dateTime);
}
}

View File

@ -0,0 +1,54 @@
using System.Reflection;
namespace DocuMed.Common.Extensions
{
public enum DisplayProperty
{
Description,
GroupName,
Name,
Prompt,
ShortName,
Order
}
public static class EnumExtensions
{
public static IEnumerable<T> GetEnumValues<T>(this T input) where T : struct
{
if (!typeof(T).IsEnum)
throw new NotSupportedException();
return Enum.GetValues(input.GetType()).Cast<T>();
}
public static IEnumerable<T> GetEnumFlags<T>(this T input) where T : struct
{
if (!typeof(T).IsEnum)
throw new NotSupportedException();
foreach (var value in Enum.GetValues(input.GetType()))
if ((input as Enum).HasFlag(value as Enum))
yield return (T)value;
}
public static string ToDisplay(this Enum value, DisplayProperty property = DisplayProperty.Name)
{
AssertExtensions.NotNull(value, nameof(value));
var attribute = value.GetType().GetField(value.ToString())
.GetCustomAttributes<DisplayAttribute>(false).FirstOrDefault();
if (attribute == null)
return value.ToString();
var propValue = attribute.GetType().GetProperty(property.ToString()).GetValue(attribute, null);
return propValue.ToString();
}
public static Dictionary<int, string> ToDictionary(this Enum value)
{
return Enum.GetValues(value.GetType()).Cast<Enum>().ToDictionary(p => Convert.ToInt32(p), q => ToDisplay(q));
}
}
}

View File

@ -0,0 +1,18 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace DocuMed.Common.Extensions
{
public static class NewtonJsonExtensions
{
public static JsonSerializerSettings CamelCaseSerialize =>
new()
{
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy()
},
Formatting = Formatting.Indented
};
}
}

View File

@ -0,0 +1,41 @@
using System.Text.RegularExpressions;
namespace DocuMed.Common.Extensions;
public static class PhoneNumberExtensions
{
public static bool CheckPhoneNumber(string phoneNumber)
{
var regex = new Regex(@"(^(989|0989|\+989|09|9)[0-9]{9}$)");
return regex.IsMatch(phoneNumber);
}
public static string GetVerifyFromPhoneNumber(string phoneNumber)
{
var dateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute / 5, 0);
var timeStamp = ((DateTimeOffset)dateTime).ToUnixTimeMilliseconds() / 10000;
int FTD = int.Parse(string.Format("{0}{1}{2}",
GetSumDigit(int.Parse(string.Format("{0}{1}{2}", phoneNumber[5], phoneNumber[7], phoneNumber[9]))) % 10,
GetSumDigit(int.Parse(string.Format("{0}{1}{2}", phoneNumber[4], phoneNumber[6], phoneNumber[8]))) % 10,
GetSumDigit(int.Parse(string.Format("{0}{1}{2}", phoneNumber[10], phoneNumber[9], phoneNumber[8]))) % 10));
int ATD = GetSumDigit(((int)timeStamp % 1000) + FTD);
timeStamp = (int)timeStamp / 1000;
int BTD = GetSumDigit(((int)timeStamp % 1000) + ATD);
timeStamp = (int)timeStamp / 1000;
int CTD = GetSumDigit(((int)timeStamp % 1000) + ATD);
FTD = GetSumDigit(FTD);
if (ATD % 2 == 0)
return string.Format("{0}{1}{2}{3}", GetSumDigit(ATD) % 10, GetSumDigit(BTD) % 10, GetSumDigit(CTD) % 10, GetSumDigit(FTD) % 10);
else
return string.Format("{0}{1}{2}{3}", ATD % 10, BTD % 10, CTD % 10, FTD % 10);
}
private static int GetSumDigit(int number)
{
string sNumber = number.ToString();
int total = 0;
foreach (var s in sNumber)
total += int.Parse(s.ToString());
return total;
}
}

View File

@ -0,0 +1,16 @@
using System.Reflection;
namespace DocuMed.Common.Extensions
{
public static class PropertyExtensions
{
public static string GetPropertyDisplayName(this MemberInfo propertyExpression)
{
var memberInfo = propertyExpression;
var attr = memberInfo.GetCustomAttributes<DisplayAttribute>().FirstOrDefault();
if (attr == null) return memberInfo.Name;
return attr.Name;
}
}
}

View File

@ -0,0 +1,12 @@
namespace DocuMed.Common.Extensions
{
public static class RandomExtensions
{
public static T RandomItem<T>(List<T> originList)
{
var random = new Random(DateTime.Now.Millisecond);
var rand = random.Next(0, originList.Count - 1);
return originList[rand];
}
}
}

View File

@ -0,0 +1,165 @@
namespace DocuMed.Common.Extensions
{
public static class StringExtensions
{
public static string ToPriceWhitPriceType(this long price, string priceType)
{
return price.ToString("N0") + " " + priceType;
}
public static string ToPriceWhitPriceType(this decimal price, string priceType)
{
return price.ToString("N0") + " " + priceType;
}
public static string ToPriceWhitPriceType(this double price, string priceType)
{
return price.ToString("N0") + " " + priceType;
}
public static bool HasValue(this string value, bool ignoreWhiteSpace = true)
{
return ignoreWhiteSpace ? !string.IsNullOrWhiteSpace(value) : !string.IsNullOrEmpty(value);
}
public static int ToInt(this string value)
{
return Convert.ToInt32(value);
}
public static decimal ToDecimal(this string value)
{
return Convert.ToDecimal(value);
}
public static string ToNumeric(this int value)
{
return value.ToString("N0"); //"123,456"
}
public static string ToNumeric(this decimal value)
{
return value.ToString("N0");
}
public static string ToCurrency(this int value)
{
//fa-IR => current culture currency symbol => ریال
//123456 => "123,123ریال"
return value.ToString("C0");
}
public static string ToCurrency(this decimal value)
{
return value.ToString("C0");
}
public static string En2Fa(this string str)
{
return str.Replace("0", "۰")
.Replace("1", "۱")
.Replace("2", "۲")
.Replace("3", "۳")
.Replace("4", "۴")
.Replace("5", "۵")
.Replace("6", "۶")
.Replace("7", "۷")
.Replace("8", "۸")
.Replace("9", "۹");
}
public static string Fa2En(this string str)
{
return str.Replace("۰", "0")
.Replace("۱", "1")
.Replace("۲", "2")
.Replace("۳", "3")
.Replace("۴", "4")
.Replace("۵", "5")
.Replace("۶", "6")
.Replace("۷", "7")
.Replace("۸", "8")
.Replace("۹", "9")
//iphone numeric
.Replace("٠", "0")
.Replace("١", "1")
.Replace("٢", "2")
.Replace("٣", "3")
.Replace("٤", "4")
.Replace("٥", "5")
.Replace("٦", "6")
.Replace("٧", "7")
.Replace("٨", "8")
.Replace("٩", "9");
}
public static string FixPersianChars(this string str)
{
return str.Replace("ﮎ", "ک")
.Replace("ﮏ", "ک")
.Replace("ﮐ", "ک")
.Replace("ﮑ", "ک")
.Replace("ك", "ک")
.Replace("ي", "ی")
.Replace(" ", " ")
.Replace("", " ")
.Replace("ھ", "ه"); //.Replace("ئ", "ی");
}
public static string CleanString(this string str)
{
return str.Trim().FixPersianChars().Fa2En().NullIfEmpty();
}
public static string NullIfEmpty(this string str)
{
return str?.Length == 0 ? null : str;
}
public static string GetId(int length = 8)
{
return Guid.NewGuid().ToString("N").Substring(0, length);
}
public static string ConvertTo3Digit(this string str)
{
str = string.Concat(str.Split(','));
var array = str.ToCharArray();
Array.Reverse(array);
str = new string(array);
var newStr = "";
for (var i = 0; i < str.Length; i++)
{
newStr += str[i];
if ((i + 1) % 3 == 0)
newStr += ",";
}
var newarray = newStr.ToCharArray();
Array.Reverse(newarray);
newStr = new string(newarray);
if (newStr.Length > 0 && newStr[0] == ',')
newStr = newStr.Substring(1);
return newStr;
}
public static string ConvertToOrginal(this string str)
{
return string.Concat(str.Split(','));
}
public static string CheckPhoneNumber(string phoneNumber)
{
if (phoneNumber.Substring(0, 3).Contains("+98"))
phoneNumber = phoneNumber.Replace("+98", "0");
else if (phoneNumber.Substring(0, 2).Contains("98"))
phoneNumber = string.Concat("0", phoneNumber.Substring(2));
else if (phoneNumber[0] != '0')
phoneNumber = string.Concat("0", phoneNumber);
return phoneNumber;
}
}
}

View File

@ -0,0 +1,21 @@
namespace DocuMed.Common.Extensions
{
public static class ValidationExtensions
{
public static bool CheckDateIs(this DateTime dateTime, DateTime From, DateTime To)
{
if (dateTime.Date > To.Date && dateTime.Date < From.Date)
return true;
return false;
}
public static bool CheckDateFromToNow(this DateTime dateTime, int fromDays = 5)
{
var From = DateTime.Now.AddDays(-fromDays);
var To = DateTime.Now;
if (dateTime.Date > To.Date && dateTime.Date < From.Date)
return true;
return false;
}
}
}

View File

@ -0,0 +1,51 @@
using System.IdentityModel.Tokens.Jwt;
namespace DocuMed.Common.Models.Api
{
public class AccessToken
{
public AccessToken()
{
}
public AccessToken(JwtSecurityToken securityToken)
{
access_token = new JwtSecurityTokenHandler().WriteToken(securityToken);
token_type = "Bearer";
expire_in_datetime = securityToken.ValidTo;
expires_in = (int)(securityToken.ValidTo - DateTime.UtcNow).TotalSeconds;
}
public string access_token { get; set; } = string.Empty;
public string refresh_token { get; set; } = string.Empty;
public string token_type { get; set; } = string.Empty;
public int expires_in { get; set; }
public string token_id { get; set; } = string.Empty;
public DateTime expire_in_datetime { get; set; }
public string BearerToken => $"Bearer {access_token}";
}
public class AccessToken<TUser>
{
public AccessToken()
{
}
public AccessToken(JwtSecurityToken securityToken)
{
access_token = new JwtSecurityTokenHandler().WriteToken(securityToken);
token_type = "Bearer";
expires_in = (int)(securityToken.ValidTo - DateTime.UtcNow).TotalSeconds;
}
public string access_token { get; set; } = string.Empty;
public string ig_access_token { get; set; } = string.Empty;
public string refresh_token { get; set; } = string.Empty;
public string token_type { get; set; } = string.Empty;
public int expires_in { get; set; }
public TUser User { get; set; }
public string BearerToken => $"Bearer {access_token}";
public List<string> Permissions { get; set; }
}
}

View File

@ -0,0 +1,41 @@
using System.Net;
namespace DocuMed.Common.Models.Api
{
public enum ApiResultStatusCode
{
[Display(Name = "عملیات با موفقیت انجام شد")]
Success = HttpStatusCode.OK,
[Display(Name = "خطایی در سرور رخ داده است")]
ServerError = HttpStatusCode.InternalServerError,
[Display(Name = "پارامتر های ارسالی معتبر نیستند")]
BadRequest = HttpStatusCode.BadRequest,
[Display(Name = "یافت نشد")]
NotFound = HttpStatusCode.NotFound,
[Display(Name = "لیست خالی است")]
ListEmpty = 4,
[Display(Name = "خطایی در پردازش رخ داد")]
LogicError = 5,
[Display(Name = "موجودی کیف پول کافی نمی باشد")]
WalletBalanceNoEnough = 6,
[Display(Name = "خطای احراز هویت")]
UnAuthorized = HttpStatusCode.Unauthorized,
[Display(Name = "سرور خاموش شده است لطفا منتظر بمانید")]
ServerDown = HttpStatusCode.ServiceUnavailable,
[Display(Name = "در ارسال پیامک مورد نظر مشکلی رخ داده است")]
SendSmsError = 7,
[Display(Name = "در ارسال درخواست به سرورهای دیگر مشکلی رخ داده است")]
RefitError = 8
}
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.Common.Models.Api
{
public class AppSettings
{
public bool Seeded { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace DocuMed.Common.Models.Api
{
public enum FileUploadType
{
Handout,
Video,
Image
}
public class FileUploadRequest
{
public string StringBaseFile { get; set; }
public string FileName { get; set; }
public FileUploadType FileUploadType { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace DocuMed.Common.Models.Api
{
public class HealthCheck
{
public bool Health { get; set; }
public string Version { get; set; }
public string TotalMemory { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace DocuMed.Common.Models.Api
{
public class ResponseFile
{
public string Url { get; set; }
public string Location { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,18 @@
namespace DocuMed.Common.Models.Api
{
public class TokenRequest
{
public string grant_type { get; set; }
public string username { get; set; }
public string password { get; set; }
public string refresh_token { get; set; }
public string scope { get; set; }
public string client_id { get; set; }
public string client_secret { get; set; }
public string login_hash { get; set; }
public string device_id { get; set; }
public string license_id { get; set; }
}
}

View File

@ -0,0 +1,90 @@
using System.Security.Claims;
namespace DocuMed.Common.Models.Claims;
public static class ApplicationClaims
{
public static ClaimDto ManageComplexes { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ManageComplexes,
Title = "دسترسی کامل به مجموعه ها",
Detail = "دسترسی به افزودن و مدیریت مجموعه های سیستم"
};
public static ClaimDto ViewComplexes { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ViewComplexes,
Title = "مشاهده مجموعه ها",
Detail = "دسترسی به مشاهده مجموعه ها"
};
public static ClaimDto ManageShifts { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ManageShifts,
Title = "دسترسی کامل به شیفت ها",
Detail = "دسترسی به افزودن و مدیریت شیفت ها فروشگاه شما"
};
public static ClaimDto ViewShifts { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ViewShifts,
Title = "دسترسی مشاهده به شیفت ها",
Detail = "قابلیت مشاهده شیفت های مجموعه"
};
public static ClaimDto ManageShiftPlans { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ManageShiftPlans,
Title = "دسترسی کامل به شیفت بندی ها",
Detail = "دسترسی به افزودن و مدیریت شیفت بندی فروشگاه شما"
};
public static ClaimDto ManageTasks { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ManageTasks,
Title = "دسترسی کامل به وظایف",
Detail = "دسترسی به افزودن و مدیریت وظایف فروشگاه شما"
};
public static ClaimDto ViewTasks { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ViewTasks,
Title = "دسترسی مشاهده وظایف",
Detail = "دسترسی مشاهده وظایف مجموعه شما"
};
public static ClaimDto ManageActivities { get; } = new ClaimDto
{
Type = CustomClaimType.Permission,
Value = ApplicationPermission.ManageActivities,
Title = "دسترسی کامل به فعالیت ها",
Detail = "دسترسی به افزودن و مدیریت فعالیت ها فروشگاه شما"
};
public static List<Claim> AllClaims = new List<Claim>
{
ManageActivities.GetClaim,
ViewTasks.GetClaim,
ManageTasks.GetClaim,
ManageShiftPlans.GetClaim,
ViewShifts.GetClaim,
ManageShifts.GetClaim,
ViewComplexes.GetClaim,
ManageComplexes.GetClaim,
};
public static List<Claim> ManagerClaims = new List<Claim>
{
ManageActivities.GetClaim,
ViewTasks.GetClaim,
ManageTasks.GetClaim,
ManageShiftPlans.GetClaim,
ViewShifts.GetClaim,
ManageShifts.GetClaim,
};
}

View File

@ -0,0 +1,14 @@
namespace DocuMed.Common.Models.Claims;
public static class ApplicationPermission
{
public const string ManageComplexes = nameof(ManageComplexes);
public const string ViewComplexes = nameof(ViewComplexes);
public const string ManageShifts = nameof(ManageShifts);
public const string ViewShifts = nameof(ViewShifts);
public const string ManageShiftPlans = nameof(ManageShiftPlans);
public const string ManageTasks = nameof(ManageTasks);
public const string ViewTasks = nameof(ViewTasks);
public const string ManageActivities = nameof(ManageActivities);
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Security.Claims;
namespace DocuMed.Common.Models.Claims;
public class ClaimDto : INotifyPropertyChanged
{
public string Value { get; set; } = string.Empty;
public string Type { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Detail { get; set; } = string.Empty;
public bool IsSelected { get; set; } = false;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public Claim GetClaim => new Claim(Type, Value);
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.Common.Models.Claims
{
public static class CustomClaimType
{
public static string Permission { get; } = "Permission";
}
}

View File

@ -0,0 +1,48 @@
namespace DocuMed.Common.Models.Entity;
public abstract class ApiEntity : IApiEntity , IEquatable<ApiEntity>
{
[Key]
public Guid Id { get; set; }
[Display(Name = "تاریخ حذف")]
public DateTime RemovedAt { get; set; }
[Display(Name = "تاریخ ساخت")]
public DateTime CreatedAt { get; set; }
[Display(Name = "ساخته شده توسط")]
public string CreatedBy { get; set; } = string.Empty;
[Display(Name = "حذف شده")]
public bool IsRemoved { get; set; }
[Display(Name = "حذف شده توسط")]
public string RemovedBy { get; set; } = string.Empty;
[Display(Name = "اخرین تغییر در")]
public DateTime ModifiedAt { get; set; }
[Display(Name = "اخرین تغییر توسط")]
public string ModifiedBy { get; set; } = string.Empty;
public bool Equals(ApiEntity? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Id.Equals(other.Id);
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((ApiEntity)obj);
}
public override int GetHashCode()
{
return Id.GetHashCode();
}
}

View File

@ -0,0 +1,25 @@
namespace DocuMed.Common.Models.Entity
{
[AttributeUsage(AttributeTargets.Class)]
public class ClassDisplay : Attribute
{
private readonly string _description;
private readonly string _name;
public ClassDisplay(string name, string description)
{
_name = name;
_description = description;
}
public string GetName()
{
return _name;
}
public string GetDescription()
{
return _description;
}
}
}

View File

@ -0,0 +1,13 @@
namespace DocuMed.Common.Models.Entity
{
public interface IApiEntity
{
string CreatedBy { get; }
string ModifiedBy { get; }
string RemovedBy { get; }
bool IsRemoved { get; }
DateTime CreatedAt { get; }
DateTime RemovedAt { get; }
DateTime ModifiedAt { get; }
}
}

View File

@ -0,0 +1,26 @@
using System.Runtime.Serialization;
using DocuMed.Common.Models.Api;
namespace DocuMed.Common.Models.Exception
{
[Serializable()]
public class AppException : System.Exception
{
protected AppException(SerializationInfo info, StreamingContext context) : base(info, context) { }
public ApiResultStatusCode StatusCode { get; set; }
public AppException()
{
StatusCode = ApiResultStatusCode.ServerError;
}
public AppException(string message) : base(message)
{
StatusCode = ApiResultStatusCode.ServerError;
}
public AppException(string message, ApiResultStatusCode statusCode) : base(message)
{
StatusCode = statusCode;
}
}
}

View File

@ -0,0 +1,91 @@
using System.Net;
using System.Runtime.Serialization;
using DocuMed.Common.Models.Api;
namespace DocuMed.Common.Models.Exception
{
[Serializable()]
public class BaseApiException : System.Exception
{
protected BaseApiException(SerializationInfo info, StreamingContext context) : base(info, context) { }
public BaseApiException()
: this(ApiResultStatusCode.ServerError)
{
}
public BaseApiException(ApiResultStatusCode statusCode)
: this(statusCode, null)
{
}
public BaseApiException(string message)
: this(ApiResultStatusCode.ServerError, message)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message)
: this(statusCode, message, HttpStatusCode.InternalServerError)
{
}
public BaseApiException(string message, object additionalData) : this(ApiResultStatusCode.ServerError, message, additionalData)
{
}
public BaseApiException(ApiResultStatusCode statusCode, object additionalData) : this(statusCode, null, additionalData)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, object additionalData)
: this(statusCode, message, HttpStatusCode.InternalServerError, additionalData)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, HttpStatusCode httpStatusCode)
: this(statusCode, message, httpStatusCode, null)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, HttpStatusCode httpStatusCode, object additionalData)
: this(statusCode, message, httpStatusCode, null, additionalData)
{
}
public BaseApiException(string message, System.Exception exception)
: this(ApiResultStatusCode.ServerError, message, exception)
{
}
public BaseApiException(string message, System.Exception exception, object additionalData)
: this(ApiResultStatusCode.ServerError, message, exception, additionalData)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, System.Exception exception)
: this(statusCode, message, HttpStatusCode.InternalServerError, exception)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, System.Exception exception, object additionalData)
: this(statusCode, message, HttpStatusCode.InternalServerError, exception, additionalData)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, HttpStatusCode httpStatusCode, System.Exception exception)
: this(statusCode, message, httpStatusCode, exception, null)
{
}
public BaseApiException(ApiResultStatusCode statusCode, string message, HttpStatusCode httpStatusCode, System.Exception exception, object additionalData)
: base(message, exception)
{
ApiStatusCode = statusCode;
HttpStatusCode = httpStatusCode;
AdditionalData = additionalData;
}
public HttpStatusCode HttpStatusCode { get; set; }
public ApiResultStatusCode ApiStatusCode { get; set; }
public object AdditionalData { get; set; }
}
}

View File

@ -0,0 +1,6 @@
namespace DocuMed.Common.Models
{
public interface IScopedDependency
{
}
}

View File

@ -0,0 +1,97 @@
using System.ComponentModel;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using DocuMed.Common.Models.Exception;
namespace DocuMed.Common.Models.Mapper
{
/// <summary>
/// Base Dto Class initial map config between entity and dto
/// </summary>
/// <typeparam name="TDto">Type of Dto Class</typeparam>
/// <typeparam name="TEntity">Type of Entity Class</typeparam>
public abstract class BaseDto<TDto, TEntity> : INotifyPropertyChanged, IBaseDto<TDto,TEntity> where TEntity : class where TDto : class
{
public Guid Id { get; set; }
public static Expression<Func<TEntity, TDto>> ProjectToDto
{
get => GetProjectToDto();
}
private static Expression<Func<TEntity, TDto>> GetProjectToDto()
{
var assembly = typeof(TEntity).Assembly;
var mapperName = $"{typeof(TEntity).Name}Mapper";
var mapperType = assembly.GetTypes()?.FirstOrDefault(t => t.Name.Contains(mapperName));
if (mapperType == null)
throw new AppException($"{typeof(TEntity).Name}Mapper Not Found!");
if (typeof(TDto).Name.Contains("SDto"))
{
var projectProperty = mapperType.GetProperty("ProjectToSDto");
if (projectProperty == null)
throw new AppException($"{typeof(TEntity).Name}Mapper Dont Have ProjectTo");
return projectProperty.GetValue(null, null) as Expression<Func<TEntity, TDto>>;
}
else if (typeof(TDto).Name.Contains("LDto"))
{
var projectProperty = mapperType.GetProperty("ProjectToLDto");
if (projectProperty == null)
throw new AppException($"{typeof(TEntity).Name}Mapper Dont Have ProjectTo");
return projectProperty.GetValue(null, null) as Expression<Func<TEntity, TDto>>;
}
else
throw new AppException($"{typeof(TDto).Name} Projection Not Implemented");
}
public virtual bool Compare(object obj)
{
if(obj is BaseDto<TDto,TEntity> objDto)
return objDto.Id == this.Id;
return Equals(obj);
}
public TDto Clone()
{
return (TDto)MemberwiseClone();
}
public TEntity ToEntity()
{
var assembly = typeof(TEntity).Assembly;
var mapperName = $"{typeof(TEntity).Name}Mapper";
var mapperType = assembly.GetTypes()?.FirstOrDefault(t => t.Name.Contains(mapperName));
var toEntityMethodInfo = mapperType.GetMethod($"AdaptTo{typeof(TEntity).Name}");
var parms = new[] { this };
var entity = toEntityMethodInfo.Invoke(null, parms);
if (entity is TEntity o)
return o;
return null;
}
public static TDto FromEntity(TEntity model)
{
var assembly = typeof(TEntity).Assembly;
var mapperName = $"{typeof(TEntity).Name}Mapper";
var mapperType = assembly.GetTypes()?.FirstOrDefault(t => t.Name.Contains(mapperName));
var toDtoMethodInfo = mapperType.GetMethod("AdaptToDto");
var parms = new[] { model };
var dto = toDtoMethodInfo.Invoke(null, parms);
if (dto is TDto o)
return o;
return null;
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
OnPropertyChanged(propertyName);
return true;
}
}
}

View File

@ -0,0 +1,11 @@
using System.Linq.Expressions;
namespace DocuMed.Common.Models.Mapper
{
public interface IBaseDto<TDto,TEntity>
{
Guid Id { get; set; }
bool Compare(object obj);
static Expression<Func<TEntity, TDto>> ProjectToDto;
}
}

View File

@ -0,0 +1,38 @@
namespace DocuMed.Common.Models.Report
{
public class ChartUnit
{
public List<long> Values { get; set; } = new();
public List<string> ValuesStr
{
get { return Values.Select(v => v.ToString()).ToList(); }
}
public List<string> Labels { get; set; } = new();
}
public class ChartUnitIQuery
{
public IQueryable<long> Values { get; set; }
public List<string> ValuesStr
{
get { return Values.Select(v => v.ToString()).ToList(); }
}
public IQueryable<string> Labels { get; set; }
}
public class ChartUnit<TValue>
{
public List<TValue> Values { get; set; } = new();
public List<string> ValuesStr
{
get { return Values.Select(v => v.ToString()).ToList(); }
}
public List<string> Labels { get; set; } = new();
}
}

View File

@ -0,0 +1,24 @@
namespace DocuMed.Common.Models.Report
{
public enum ReportType
{
ByDate,
ByValue,
BySelected
}
public class ReportRequestProp
{
public string PropertyName { get; set; }
public string PropertyValue { get; set; }
}
public class ReportRequest
{
public string TableType { get; set; }
public ReportType ReportType { get; set; }
public DateTime FromDateTime { get; set; }
public DateTime ToDateTime { get; set; }
public List<ReportRequestProp> ReportRequestProps { get; set; } = new();
}
}

View File

@ -0,0 +1,34 @@
namespace DocuMed.Common.Models.Report
{
public class ReportResult
{
private List<ReportRow> _rows;
public List<ReportRow> Rows
{
get
{
if (_rows == null)
_rows = new List<ReportRow>();
return _rows;
}
set => _rows = value;
}
}
public class ReportRow
{
private List<string> _cells;
public List<string> Cells
{
get
{
if (_cells == null)
_cells = new List<string>();
return _cells;
}
set => _cells = value;
}
}
}

View File

@ -0,0 +1,89 @@
using System.Collections;
using System.Reflection;
namespace DocuMed.Common.Models.Report
{
public interface IReportableItem
{
string Name { get; set; }
string PropertyName { get; set; }
object DefaultValue { get; set; }
object SelectedValue { get; set; }
string ItemType { get; }
object Element { get; set; }
}
public class BoolReportable : IReportableItem
{
public BoolReportable()
{
ItemType = GetType().Name;
}
public string Name { get; set; }
public string PropertyName { get; set; }
public object DefaultValue { get; set; }
public object SelectedValue { get; set; }
public string ItemType { get; }
public object Element { get; set; }
}
public class ListReportable : IReportableItem
{
public ListReportable()
{
ItemType = GetType().Name;
}
public IList List { get; set; }
public IList ConvertedList { get; set; }
public string DisplayMemberPath { get; set; }
public string SelectedMemberPath { get; set; }
public string ListItemType { get; set; }
public string Name { get; set; }
public string PropertyName { get; set; }
public object DefaultValue { get; set; }
public object SelectedValue { get; set; }
public string ItemType { get; }
public object Element { get; set; }
}
public class EnumReportable : IReportableItem
{
public EnumReportable()
{
ItemType = GetType().Name;
}
public string EnumTypeName { get; set; }
public string Name { get; set; }
public string PropertyName { get; set; }
public object DefaultValue { get; set; }
public object SelectedValue { get; set; }
public string ItemType { get; }
public object Element { get; set; }
public Type EnumType(Assembly domainAssembly)
{
var types = domainAssembly.GetTypes();
var type = types.FirstOrDefault(t => t.Name == EnumTypeName);
return type;
}
}
public class NumericReportable : IReportableItem
{
public NumericReportable()
{
ItemType = GetType().Name;
}
public string Name { get; set; }
public string PropertyName { get; set; }
public object DefaultValue { get; set; }
public object SelectedValue { get; set; }
public string ItemType { get; }
public object Element { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.Core
{
public class Class1
{
}
}

View File

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="AspNetCoreRateLimit.Redis" Version="2.0.0" />
<PackageReference Include="Autofac.Extras.Quartz" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageReference Include="Quartz" Version="3.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DocuMed.Repository\DocuMed.Repository.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Mapster" Version="7.3.0" />
<PackageReference Include="Mapster.Core" Version="1.2.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.11" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
</ItemGroup>
<!--<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Mapster" Version="7.3.0" />
<PackageReference Include="Mapster.Core" Version="1.2.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
</ItemGroup>-->
<Target Name="Mapster">
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet build" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster extension -a &quot;$(TargetDir)$(ProjectName).dll&quot; -n Brizco.Domain.Mappers -o Mappers" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster mapper -a &quot;$(TargetDir)$(ProjectName).dll&quot; -n Brizco.Domain.Mappers -o Mappers" />
</Target>
<ItemGroup>
<ProjectReference Include="..\DocuMed.Common\DocuMed.Common.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Entities\User\" />
</ItemGroup>
<ItemGroup>
<Using Include="DocuMed.Domain.Enums" />
<Using Include="Mapster" />
<Using Include="Microsoft.AspNetCore.Identity" />
<Using Include="System.ComponentModel.DataAnnotations" />
<Using Include="System.Numerics" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,5 @@
namespace DocuMed.Domain;
public class DomainConfig
{
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.Domain.Entities.User;
public class ApplicationRole : IdentityRole<Guid>
{
public string Description { get; set; } = string.Empty;
public string EnglishName { get; set; } = string.Empty;
public string PersianName { get; set; } = string.Empty;
}

View File

@ -0,0 +1,13 @@
namespace DocuMed.Domain.Entities.User;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[GenerateMapper]
public class ApplicationUser : IdentityUser<Guid>
{
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string InternationalId { get; set; } = string.Empty;
public DateTime BirthDate { get; set; }
public Gender Gender { get; set; }
public SignUpStatus SignUpStatus { get; set; }
}

View File

@ -0,0 +1,9 @@
namespace DocuMed.Domain.Enums;
public enum Gender
{
[Display(Name = "مرد")]
Male,
[Display(Name = "زن")]
Female
}

View File

@ -0,0 +1,11 @@
namespace DocuMed.Domain.Enums;
public enum SignUpStatus
{
[Display(Name = "شروع ثبت نام")]
StartSignUp = 0,
[Display(Name = "شماره تلفن تایید شد")]
PhoneNumberVerified = 1,
[Display(Name = "ثبت نام تکمیل شد")]
SignUpCompleted = 5,
}

View File

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
</Weavers>

View File

@ -0,0 +1,37 @@
namespace DocuMed.Domain.Models.Settings;
public class SiteSettings
{
public JwtSettings JwtSettings { get; set; } = new JwtSettings();
public string BaseUrl { get; set; } = string.Empty;
public RedisSettings MasterRedisConfiguration { get; set; } = new RedisSettings();
public UserSetting UserSetting { get; set; } = new UserSetting();
public string KaveNegarApiKey { get; set; } = string.Empty;
}
public class RedisSettings
{
public string Password { get; set; } = string.Empty;
public string ServiceName { get; set; } = string.Empty;
public string Host { get; set; } = string.Empty;
public int Port { get; set; }
}
public class JwtSettings
{
public string SecretKey { get; set; } = string.Empty;
public string Issuer { get; set; } = string.Empty;
public string Audience { get; set; } = string.Empty;
public int ExpireAddDay { get; set; }
}
public class UserSetting
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string RoleName { get; set; } = string.Empty;
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string Phone { get; set; } = string.Empty;
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.Infrastructure
{
public class Class1
{
}
}

View File

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Refit" Version="6.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DocuMed.Core\DocuMed.Core.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>

View File

@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="npm run buildcss" />
</Target>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<AssemblyVersion>1.0.0.2</AssemblyVersion>
<FileVersion>1.0.0.2</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.LottieAnimation" Version="1.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.10" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.10.0" />
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="2.1.0.1" />
</ItemGroup>
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\ItemModels\" />
<Folder Include="wwwroot\assets\lotties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DocuMed.Domain\DocuMed.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="DocuMed.PWA.Models" />
<Using Include="DocuMed.PWA.Models.Entities" />
<Using Include="DocuMed.PWA.Models.Enums" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocuMed.PWA", "DocuMed.PWA.csproj", "{520F6D6A-2EFD-499F-972F-EF9E1EBD2452}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{520F6D6A-2EFD-499F-972F-EF9E1EBD2452}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{520F6D6A-2EFD-499F-972F-EF9E1EBD2452}.Debug|Any CPU.Build.0 = Debug|Any CPU
{520F6D6A-2EFD-499F-972F-EF9E1EBD2452}.Release|Any CPU.ActiveCfg = Release|Any CPU
{520F6D6A-2EFD-499F-972F-EF9E1EBD2452}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6B860D71-D558-47DE-ACCC-6C25282D547D}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,11 @@
namespace DocuMed.PWA.Models.Entities;
public class MedicalHistory
{
public string Name { get; set; } = string.Empty;
public string Section { get; set; } = string.Empty;
public int Aag { get; set; }
public string CC { get; set; } = string.Empty;
public Gender Gender { get; set; }
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.PWA.Models.Entities;
public class MedicalHistoryQuestion
{
public string Title { get; set; } = string.Empty;
public MedicalHistoryQuestionType Type { get; set; }
}

View File

@ -0,0 +1,10 @@
namespace DocuMed.PWA.Models.Entities
{
public class MedicalHistorySystemReview
{
public string Title { get; set; } = string.Empty;
public string System { get; set; } = string.Empty;
public bool IsSign { get; set; }
public bool IsSymptom { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace DocuMed.PWA.Models.Entities;
public class MedicalHistoryTemplate
{
public string CC { get; set; } = string.Empty;
public string Section { get; set; } = string.Empty;
}

View File

@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace DocuMed.PWA.Models.Enums;
public enum Gender
{
[Display(Name = "مرد")]
Male,
[Display(Name = "زن")]
Female
}

View File

@ -0,0 +1,8 @@
namespace DocuMed.PWA.Models.Enums;
public enum MedicalHistoryQuestionType
{
Hourly,
Interrogatively,
YesOrNo
}

View File

@ -0,0 +1,138 @@
@page "/HomePage"
@inject NavigationManager NavigationManager
<MudStack class="w-screen h-screen bg-[#356859]">
<div class="flex flex-row mt-4 mb-3">
<MudStack Row="true" @onclick="ProfileClicked">
<MudAvatar Size="Size.Large" Class="mr-5">
<MudImage
Src="https://qph.cf2.quoracdn.net/main-thumb-161841968-200-xtisrhulnnwiuyeojsvojtoqjrqsglrj.jpeg">
</MudImage>
</MudAvatar>
<MudStack class="justify-center ">
<p class="font-bold text-lg text-white font-iranyekan">امیرحسین خادمی</p>
<p class="-mt-3 text-white font-light font-iranyekan">09214802813</p>
</MudStack>
</MudStack>
<MudButton class="my-auto ml-5 mr-auto font-extrabold bg-white rounded-lg">اطفال</MudButton>
</div>
<div class="bg-[#EEEEEE] w-full h-full flex flex-col rounded-t-xl">
<MudStack class="pb-20 bg-[#EEEEEE] rounded-t-xl">
<div class="flex flex-row mx-5 mt-5">
<div>
<p class="font-extrabold text-[#356859]">شرح حال های امروز شما</p>
<p class="text-xs font-light ">لیست شرح حال های انجام شده در امروز</p>
</div>
<MudButton DisableElevation="false" @onclick="CreateMedicalHistoryClicked" class="text-[#356859] my-auto mr-auto font-extrabold bg-white rounded-lg drop-shadow-md">+ افزودن</MudButton>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 ">
@foreach(var item in _medicalHistories)
{
<MedicalHistoryItemTemplate MedicalHistory="@item" />
}
</div>
</MudStack>
<MudPaper class="fixed bottom-0 py-1 left-0 z-50 w-full bg-white rounded-t-xl">
<div class="grid h-full max-w-lg grid-cols-4 mx-auto font-medium">
<button type="button" class="inline-flex flex-col items-center justify-center px-1 group">
<MudIcon Icon="@Icons.Material.Outlined.MedicalInformation"
class="w-8 h-8 mb-2 text-[--color-primary]" />
<span class="-mt-1 text-sm text-[--color-primary]">شرح حال</span>
</button>
<button @onclick="MedicalHistoryTemplatesClicked" type="button" class="inline-flex flex-col items-center justify-center px-1 group">
<MudIcon Icon="@Icons.Material.Outlined.Difference"
Class="w-8 h-8 mb-2 text-gray-400 group-hover:text-[--color-primary]" />
<span class="-mt-1 text-sm text-gray-400 group-hover:text-[--color-primary]">پیش نویس</span>
</button>
<button @onclick="MedicalOrdersClicked" type="button" class="inline-flex flex-col items-center justify-center px-1 py-1 group">
<MudIcon Icon="@Icons.Material.Outlined.PostAdd"
Class="w-8 h-8 mb-2 text-gray-400 group-hover:text-[--color-primary]" />
<span class="-mt-1 text-sm text-gray-400 group-hover:text-[--color-primary]">اوردر ها</span>
</button>
<button @onclick="ProfileClicked" type="button"
class="inline-flex flex-col items-center justify-center px-1 group">
<MudIcon Icon="@Icons.Material.Filled.PersonOutline"
Class="w-8 h-8 mb-2 text-gray-400 group-hover:text-[--color-primary]" />
<span class="-mt-1 text-sm text-gray-400 group-hover:text-[--color-primary]">پروفایل</span>
</button>
</div>
</MudPaper>
</div>
</MudStack>
@code {
public void ProfileClicked() => NavigationManager.NavigateTo("ProfilePage");
public void CreateMedicalHistoryClicked() => NavigationManager.NavigateTo("MedicalHistoryActionPage");
public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage");
public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage");
private List<MedicalHistory> _medicalHistories = new List<MedicalHistory>();
protected override void OnInitialized()
{
_medicalHistories.Add(new MedicalHistory
{
Name = "امیرحسین معتمدی",
Aag = 35,
CC = "سردرد",
Section = "داخلی",
Gender = Gender.Male
});
_medicalHistories.Add(new MedicalHistory
{
Name = "محمد امینی",
Aag = 40,
CC = "معده درد",
Section = "داخلی",
Gender = Gender.Male
});
_medicalHistories.Add(new MedicalHistory
{
Name = "زیبا بروفه",
Aag = 20,
CC = "سوختگی",
Section = "سوختگی",
Gender = Gender.Female
});
_medicalHistories.Add(new MedicalHistory
{
Name = "روشنک فدایی",
Aag = 18,
CC = "دردسینه",
Section = "داخلی",
Gender = Gender.Female
});
_medicalHistories.Add(new MedicalHistory
{
Name = "سطلان محمدی",
Aag = 28,
CC = "روانی",
Section = "روان",
Gender = Gender.Male
});
_medicalHistories.Add(new MedicalHistory
{
Name = "سعید سعیدی",
Aag = 60,
CC = "بی هوشی",
Section = "داخلی",
Gender = Gender.Male
});
base.OnInitialized();
}
}

View File

@ -0,0 +1,182 @@
@page "/"
@inject NavigationManager NavigationManager
<style>
.mud-input-label {
background-color: #FFFBE6;
}
/* .secondary-border>.mud-input-control-input-container>.mud-input.mud-input-outlined>input:focus~.mud-input-outlined-border {
border-color: #FD5523;
color: white;
} */
</style>
<div class="flex flex-col w-screen h-screen">
<div class="w-full overflow-hidden basis-2/4">
<MudCarousel class="w-full h-full" ShowArrows="false" ShowBullets="false" EnableSwipeGesture="true"
AutoCycle="true" TData="object">
<MudCarouselItem>
<div class="flex flex-col h-full mx-5">
<div class="my-auto">
<div class="-mt-8">
<dotlottie-player
src="https://lottie.host/752358b3-21b0-4448-b8f4-0f2a2acc998b/DZAZuyYyol.json"
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
</div>
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">شرح حال نویسی بیمار راحت تر
از
همیشه</p>
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
خود
مثل شرح حال نویسی همراه و همیار همیشگی پزشکان محترم</p>
</div>
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full mx-5">
<div class="my-auto">
<div class="-mt-8 -mb-3">
<dotlottie-player
src="https://lottie.host/9ca6089d-388f-4eef-8050-8181c1d945a1/B7oM9NN9O4.json"
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
</div>
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">اوردر های شما همه در یک
اپلیکیشن</p>
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
خود
مثل شرح حال نویسی همیار همیشگی پزشکان محترم</p>
</div>
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full mx-5">
<div class="my-auto">
<div class="-mt-8 -mb-10">
<dotlottie-player
src="https://lottie.host/87dfb50f-e91f-45c6-b8dc-d3a2436c533c/5DPvXG0W1t.json"
background="transparent" speed="1" class="m-auto w-72 h-72" loop autoplay />
</div>
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">نرم افزار جامع داکیـــــومد
</p>
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
خود
مثل تهیه پیشنویس شرح حال همراه همیشگی پزشکان محترم</p>
</div>
</div>
</MudCarouselItem>
</MudCarousel>
</div>
<MudPaper Elevation="10" class="w-full rounded-t-2xl bg-[#FFFBE6] basis-2/4">
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="_carousel" ShowArrows="false"
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
<MudCarouselItem>
<div class="flex flex-col h-full p-5 font-iranyekan">
<MudStack class="my-auto">
<p class="text-lg font-extrabold font-iranyekan">ورود | ثبت نام</p>
<p class="text-xs text-justify">
برای ورود یا ثبت نام به اپلیکیشن داکیومد باید شماره تلفن همراه خود را
وارد کنید
</p>
<MudForm @ref="confirmPhoneNumberForm">
<MudTextField Required="true" RequiredError="لطفا شماره تلفن را وارد کنید"
@bind-Value="@phoneNumber" InputType="InputType.Telephone" T="string" Label="شماره تلفن همراه"
Variant="Variant.Outlined" />
</MudForm>
<BaseButtonUi OnClickCallback="ConfirmPhoneNumber" Content="ثبت شماره تلفن"
Icon="@Icons.Material.TwoTone.Phone" Color="Color.Secondary" Variant="Variant.Filled">
</BaseButtonUi>
<p class="mx-3 text-justify">
با تایید شماره تلفن همراه با همه شرایط <a class="text-blue-500">
حریم
خصوصی
</a> اپلیکیشن داکیومد موافقت می کنم
</p>
</MudStack>
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MudStack class="p-5 my-auto font-iranyekan">
<p class="text-lg font-extrabold font-iranyekan">ورود | ثبت نام</p>
<p class="text-xs text-justify">
برای ورود یا ثبت نام به اپلیکیشن داکیومد باید شماره تلفن همراه خود را
وارد کنید
</p>
<MudTextField class="text-sm" T="string" Label="کد ارسال شده را وارد کنید"
Variant="Variant.Outlined" />
<BaseButtonUi OnClickCallback="ConfirmVerifyCode" Content="تایید کد"
Icon="@Icons.Material.TwoTone.Verified" Color="Color.Secondary" Variant="Variant.Filled">
</BaseButtonUi>
<div class="flex flex-row mr-5">
<MudStack class="my-auto">
<p class="text-lg font-extrabold">02:00</p>
<a class="-mt-5 font-bold text-blue-600">ارسال مجدد پیامک</a>
</MudStack>
<MudButton class="mr-auto rounded-full" EndIcon="@Icons.Material.Filled.ChevronLeft"
Variant="Variant.Outlined" @onclick="PhoneNumberRollBack" Color="Color.Primary"
Size="Size.Medium">
بازگشت
</MudButton>
</div>
</MudStack>
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MudStack class="w-screen p-5 my-auto font-iranyekan">
<p class="text-lg font-extrabold font-iranyekan">ثبت نام</p>
<p class="text-xs text-justify">برای ثبت نام به اپلیکیشن داکیومد باید اطلاعات کامل خود را وارد
کنید
</p>
<MudTextField class="text-sm" T="string" Label="نام" Variant="Variant.Outlined" />
<MudTextField class="text-sm" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
<MudTextField class="text-sm" T="string" @bind-Value="@phoneNumber" Label="شماره تلفن همراه"
Variant="Variant.Outlined" />
<MudAutocomplete T="string" Label="شهر شما" Variant="Variant.Outlined" />
<MudAutocomplete T="string" Label="دانشگاه" Variant="Variant.Outlined" />
<BaseButtonUi OnClickCallback="ConfirmSignUp" Content="تکمیل ثبت نام"
Icon="@Icons.Material.TwoTone.Login" Color="Color.Primary" Variant="Variant.Filled">
</BaseButtonUi>
</MudStack>
</div>
</MudCarouselItem>
</MudCarousel>
</MudPaper>
</div>
@code
{
private MudCarousel<object>? _carousel;
private int _currentSignOnStep = 0;
MudForm? confirmPhoneNumberForm;
private string phoneNumber = string.Empty;
private void ConfirmPhoneNumber()
{
confirmPhoneNumberForm?.Validate();
if (confirmPhoneNumberForm != null && confirmPhoneNumberForm.IsValid)
_carousel?.MoveTo(++_currentSignOnStep);
}
private void ConfirmVerifyCode()
{
_carousel?.MoveTo(++_currentSignOnStep);
}
private void PhoneNumberRollBack()
{
_carousel?.MoveTo(--_currentSignOnStep);
}
private void ConfirmSignUp()
{
NavigationManager.NavigateTo("HomePage");
}
}

View File

@ -0,0 +1,86 @@
@page "/MedicalHistoryActionPage"
@inject NavigationManager NavigationManager
<BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید">
<div class="flex flex-col w-full h-full rounded-t-xl">
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="_carousel" ShowArrows="false"
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
<MudCarouselItem>
<div class="flex flex-col w-full h-full">
<MedicalHistoryActionStep1 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryActionStep2 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryActionStep3 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryActionStep4 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryActionStep5 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryActionStep6 SubmittedOnClick="CompleteCreateMedicalHistory" />
</div>
</MudCarouselItem>
</MudCarousel>
@if(!medicalHistorySubmited){
<MudPaper class="bottom-0 left-0 fixed w-full bg-[--color-medicalhistory] px-3 pt-4 pb-3 rounded-t-xl flex flex-row">
@if (_currentStep == 4)
{
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Filled" Color="Color.Primary" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full">تکمیل</MudButton>
}
else
{
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Outlined" IconSize="Size.Large"
StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full">مرحله بعد
</MudButton>
}
<p class="my-auto text-lg font-extrabold text-center grow">@_stepCounter</p>
<MudButton @onclick="RollBackStepClicked" IconSize="Size.Large" EndIcon="@Icons.Material.Filled.ChevronLeft"
class="font-extrabold rounded-full">مرحله قبل</MudButton>
</MudPaper>
}
</div>
</BasePageUi>
@code {
private MudCarousel<object>? _carousel;
private int _currentStep = 0;
private string _stepCounter = "1 / 5";
private bool medicalHistorySubmited = false;
private void CompleteStepClicked()
{
_carousel?.MoveTo(++_currentStep);
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
if (_currentStep == 5)
medicalHistorySubmited = true;
}
private void RollBackStepClicked()
{
_carousel?.MoveTo(--_currentStep);
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
}
private void CompleteCreateMedicalHistory()
{
NavigationManager.NavigateTo("HomePage");
}
}

View File

@ -0,0 +1,13 @@
<MudStack class="my-auto text-center font-iranyekan">
<p class="text-lg font-extrabold">افزودن شرح حال جدید</p>
<p class="text-center text-md">لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
مورد ده</p>
<BasePartDivider Index="1" Title="شکایت اصلی بیمار" />
<MudAutocomplete T="string" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined" Margin="Margin.Normal" />
<MudAutocomplete T="string" Label="بخش بیمار" Variant="Variant.Outlined" />
</MudStack>
@code {
}

View File

@ -0,0 +1,17 @@
<MudStack class="font-iranyekan">
<BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" />
<HourQuestionTemplate/>
<div class="h-[1px] w-full bg-gray-400 bg-opacity-70 mt-2 mb-1"></div>
<MudTextField T="string" Label="چه علائمی همراه با سردرد دارید ؟" Variant="Variant.Outlined"/>
<MudTextField T="string" Label="توضیحاتـــ تکمیلی" Lines="5" Variant="Variant.Outlined"/>
</MudStack>
@code {
}

View File

@ -0,0 +1,22 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="3" Title="تاریخچه بیماری های قبلی ( PMH )" />
<HourQuestionTemplate/>
<div class="h-[1px] w-full bg-gray-400 bg-opacity-70 mt-2 mb-1"></div>
<MudTextField T="string" Label="چه علائمی همراه با سردرد دارید ؟" Variant="Variant.Outlined"/>
<MudTextField Margin="Margin.Dense" T="string" Label="توضیحاتـــ تکمیلی" Lines="5" Variant="Variant.Outlined"/>
<BasePartDivider Index="4" Title="تاریخچه جراحی های قبلی ( PSH )" />
<MudTextField Margin="Margin.Dense" T="string" Label="توضیحاتـــ تکمیلی" Lines="5" Variant="Variant.Outlined"/>
</MudStack>
@code {
}

View File

@ -0,0 +1,36 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" />
<MudTextField Margin="Margin.Dense" T="string" Label="توضیحاتـــ تکمیلی" Lines="5" Variant="Variant.Outlined" />
<BasePartDivider Index="6" Title="داروهای مصرفی ( FH )" />
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
@for (int i = 0; i < 5; i++)
{
<MudCard class="text-center">
<MudCardContent>
<p class="font-extrabold text-gray-600 text-md">ادالت کولد 500</p>
</MudCardContent>
</MudCard>
}
</div>
<BasePartDivider Index="7" Title="مواد مصرفی ( HH )" />
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
@for (int i = 0; i < 4; i++)
{
<MudCard class="text-center">
<MudCardContent>
<p class="font-extrabold text-gray-600 text-md">ادالت کولد 500</p>
</MudCardContent>
</MudCard>
}
</div>
</MudStack>
@code {
}

View File

@ -0,0 +1,42 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="8" Title="ظاهر کلی بیمار ( FH )" />
<MudTextField Margin="Margin.Dense" T="string" Label="توضیحاتـــ تکمیلی" Lines="2" Variant="Variant.Outlined" />
<div class="grid grid-cols-2 gap-1 md:grid-cols-4 sm:grid-cols-2">
<MudCard class="text-center">
<MudCardContent>
<p class="font-bold text-gray-600 text-md">بیمار هوشیار است</p>
</MudCardContent>
</MudCard>
<MudCard class="text-center">
<MudCardContent>
<p class="font-bold text-gray-600 text-md">بیمار ILL است</p>
</MudCardContent>
</MudCard>
</div>
<BasePartDivider Index="9" Title="علائم حیاتی ( FH )" />
<div class="flex flex-row">
<p class="my-auto mr-5 font-extrabold text-md grow">فشــــار خون</p>
<MudTextField InputType="InputType.Number" Margin="Margin.Dense" class="mx-3 my-auto basis-1/12" T="string" Variant="Variant.Outlined" />
<MudTextField InputType="InputType.Number" Margin="Margin.Dense" class="my-auto basis-1/12" T="string" Variant="Variant.Outlined" />
</div>
<div class="grid grid-cols-3">
<MudTextField InputType="InputType.Number" Margin="Margin.Dense" Label="نبض" T="string" Variant="Variant.Outlined" />
<MudTextField InputType="InputType.Number" class="mx-2" Margin="Margin.Dense" Label="اکسیژن" T="string" Variant="Variant.Outlined" />
<MudTextField InputType="InputType.Number" Margin="Margin.Dense" Label="دمای بدن" T="string" Variant="Variant.Outlined" />
</div>
</MudStack>
@code {
}

View File

@ -0,0 +1,14 @@
<MudStack class="pb-20 font-iranyekan my-auto">
<p class="text-lg text-center font-extrabold">شرح حال تکمیل شد</p>
<p class="text-center text-md">
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
مورد ده
</p>
<BaseButtonUi @onclick="() => { SubmittedOnClick.InvokeAsync(); }" class="my-auto" Content="ثبت شرح حال بیمار" Variant="Variant.Filled" Color="Color.Primary" Icon="@Icons.Material.TwoTone.Check"></BaseButtonUi>
</MudStack>
@code {
[Parameter]
public EventCallback SubmittedOnClick { get; set; }
}

View File

@ -0,0 +1,88 @@
@page "/MedicalHistoryTemplateActionPage"
@inject NavigationManager NavigationManager
<BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید">
<div class="flex flex-col w-full h-full rounded-t-xl">
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="_carousel" ShowArrows="false"
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
<MudCarouselItem>
<div class="flex flex-col w-full h-full">
<MedicalHistoryTemplateActionStep1 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryTemplateActionStep2 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryTemplateActionStep3 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryTemplateActionStep4 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryTemplateActionStep5 />
</div>
</MudCarouselItem>
<MudCarouselItem>
<div class="flex flex-col h-full">
<MedicalHistoryTemplateActionStep6 SubmittedOnClick="CompleteCreateMedicalHistory" />
</div>
</MudCarouselItem>
</MudCarousel>
@if(!medicalHistorySubmited){
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rounded-t-xl flex flex-row">
@if (_currentStep == 4)
{
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Filled" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton>
}
else
{
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Outlined" IconSize="Size.Large"
StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full border-[--color-medicalhistory] text-[--color-medicalhistory]">
مرحله بعد
</MudButton>
}
<p class="my-auto text-lg text-[--color-medicalhistory] font-extrabold text-center grow">@_stepCounter</p>
<MudButton @onclick="RollBackStepClicked" IconSize="Size.Large" EndIcon="@Icons.Material.Filled.ChevronLeft"
class="font-extrabold text-[--color-medicalhistory] rounded-full">مرحله قبل</MudButton>
</MudPaper>
}
</div>
</BasePageUi>
@code {
private MudCarousel<object>? _carousel;
private int _currentStep = 0;
private string _stepCounter = "1 / 5";
private bool medicalHistorySubmited = false;
private void CompleteStepClicked()
{
_carousel?.MoveTo(++_currentStep);
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
if (_currentStep == 5)
medicalHistorySubmited = true;
}
private void RollBackStepClicked()
{
_carousel?.MoveTo(--_currentStep);
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
}
private void CompleteCreateMedicalHistory()
{
NavigationManager.NavigateTo("HomePage");
}
}

View File

@ -0,0 +1,13 @@
<MudStack class="my-auto text-center font-iranyekan">
<p class="text-lg font-extrabold">افزودن پیش نویس شرح حال جدید</p>
<p class="text-center text-md">لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
مورد ده</p>
<BasePartDivider Index="1" Title="شکایت اصلی بیمار" />
<MudAutocomplete T="string" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined" Margin="Margin.Normal" />
<MudAutocomplete T="string" Label="بخش بیمار" Variant="Variant.Outlined" />
</MudStack>
@code {
}

View File

@ -0,0 +1,50 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" />
<MudAlert Severity="Severity.Info">شما میتوانید سوال های هر بخش ها را به صورت کامل تنظیم نمایید</MudAlert>
@foreach (var item in Questions)
{
<MedicalHistoryQuestionTemplateItemTemplate QuestionRemoved="RemoveQuestion" />
}
<MudSelect @bind-Value="@_questionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
</MudSelect>
<MudTextField @bind-Value="@_questionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
Variant="Variant.Outlined" />
<MudAutocomplete T="string" Label="وابستگی به سوال قبلی" Variant="Variant.Outlined" />
<MudButton @onclick="AddQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
+ افزودن
</MudButton>
</MudStack>
@code
{
private MedicalHistoryQuestionType _questionType;
private string EnumConvertFunc() => string.Empty;
private string _questionTitle = string.Empty;
public List<MedicalHistoryQuestion> Questions { get; set; } = new();
private void RemoveQuestion(MedicalHistoryQuestion question)
{
Questions.Remove(question);
}
private void AddQuestion()
{
Questions.Add(new MedicalHistoryQuestion
{
Title = _questionTitle,
Type = _questionType
});
}
}

View File

@ -0,0 +1,89 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="3" Title="تاریخچه بیماری قبلی ( PI )" />
@foreach (var item in PIQuestions)
{
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePIQuestion" />
}
<MudSelect @bind-Value="@_piQuestionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
</MudSelect>
<MudTextField @bind-Value="@_piQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
Variant="Variant.Outlined" />
<MudButton @onclick="AddPIQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
+ افزودن
</MudButton>
<BasePartDivider Index="4" class="mt-9" Title="تاریخچه جراحی های قبلی ( PSH )" />
@foreach (var item in PIQuestions)
{
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePSHQuestion" />
}
<MudSelect @bind-Value="@_pshQuestionType"
T="MedicalHistoryQuestionType"
Label="نوع سوال"
Variant="Variant.Outlined">
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
</MudSelect>
<MudTextField @bind-Value="@_pshQuestionTitle"
Margin="Margin.None"
T="string"
Label="عنوان سوال" Lines="1"
Variant="Variant.Outlined" />
<MudButton @onclick="AddPSHQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
+ افزودن
</MudButton>
</MudStack>
@code
{
private string _piQuestionTitle = string.Empty;
private MedicalHistoryQuestionType _piQuestionType;
private string _pshQuestionTitle = string.Empty;
private MedicalHistoryQuestionType _pshQuestionType;
public List<MedicalHistoryQuestion> PIQuestions { get; set; } = new();
public List<MedicalHistoryQuestion> PSHQuestions { get; set; } = new();
private void RemovePIQuestion(MedicalHistoryQuestion question)
{
PIQuestions.Remove(question);
}
private void AddPIQuestion()
{
PIQuestions.Add(new MedicalHistoryQuestion
{
Title = _piQuestionTitle,
Type = _piQuestionType
});
}
private void RemovePSHQuestion(MedicalHistoryQuestion question)
{
PSHQuestions.Remove(question);
}
private void AddPSHQuestion()
{
PSHQuestions.Add(new MedicalHistoryQuestion
{
Title = _pshQuestionTitle,
Type = _pshQuestionType
});
}
}

View File

@ -0,0 +1,113 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" />
@foreach (var item in FamilyHistories)
{
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemoveFamilyHistory" />
}
<MudSelect @bind-Value="@_familyHistoryQuestionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
</MudSelect>
<MudTextField @bind-Value="@_familyHistoryQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
Variant="Variant.Outlined" />
<MudButton @onclick="AddFamilyHistory" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
+ افزودن
</MudButton>
<BasePartDivider Index="6" class="mt-9" Title="داروهای مصرفی ( DH )" />
<div class="grid mx-1 gap-2 grid-cols-2 md:grid-cols-4">
@foreach (var item in DrugHistories)
{
<MudCard @onclick="()=>RemoveDrugHistory(item)" class="text-center">
<MudCardContent>
<p class="font-extrabold text-gray-600 text-md">@item</p>
</MudCardContent>
</MudCard>
}
</div>
<div class="flex flex-row">
<MudTextField @bind-Value="@_drugHistoryName" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
<MudButton Variant="Variant.Outlined" @onclick="AddDrugHistory" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
+
</MudButton>
</div>
<BasePartDivider Index="7" class="mt-9" Title="مواد مصرفی ( HH )" />
<div class="grid mx-1 gap-2 grid-cols-2 md:grid-cols-4">
@foreach (var item in HHMedicines)
{
<MudCard @onclick="()=>RemoveHHMedicine(item)" class="text-center">
<MudCardContent>
<p class="font-extrabold text-gray-600 text-md">@item</p>
</MudCardContent>
</MudCard>
}
</div>
<div class="flex flex-row">
<MudTextField @bind-Value="@_hhName" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
<MudButton Variant="Variant.Outlined" @onclick="AddHHMedicine" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
+
</MudButton>
</div>
</MudStack>
@code {
private string _familyHistoryQuestionTitle = string.Empty;
private MedicalHistoryQuestionType _familyHistoryQuestionType;
public List<MedicalHistoryQuestion> FamilyHistories { get; set; } = new();
private void RemoveFamilyHistory(MedicalHistoryQuestion question)
{
FamilyHistories.Remove(question);
}
private void AddFamilyHistory()
{
FamilyHistories.Add(new MedicalHistoryQuestion
{
Title = _familyHistoryQuestionTitle,
Type = _familyHistoryQuestionType
});
}
private string _drugHistoryName = string.Empty;
public List<string> DrugHistories { get; set; } = new();
private void RemoveDrugHistory(string medicine)
{
DrugHistories.Remove(medicine);
}
private void AddDrugHistory()
{
DrugHistories.Add(_drugHistoryName);
_drugHistoryName = string.Empty;
}
private string _hhName = string.Empty;
public List<string> HHMedicines { get; set; } = new();
private void RemoveHHMedicine(string medicine)
{
HHMedicines.Remove(medicine);
}
private void AddHHMedicine()
{
HHMedicines.Add(_hhName);
_hhName = string.Empty;
}
}

View File

@ -0,0 +1,106 @@
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="8" Title="ظاهر کلی بیمار ( GA )" />
<div class="grid mx-1 gap-2 grid-cols-1 md:grid-cols-2">
@foreach (var item in GeneralAppearances)
{
<MudCard @onclick="()=>RemoveGeneralAppearance(item)" class="text-center">
<MudCardContent>
<p class="font-extrabold text-gray-600 text-md">@item</p>
</MudCardContent>
</MudCard>
}
</div>
<div class="flex flex-row">
<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>
</div>
<BasePartDivider class="mt-9" Index="9" Title="مرور سیستماتیک ( ROS )" />
@foreach (var item in ReviewOfSystems)
{
<MudPaper class="px-3 py-2 mx-1">
<div class="flex flex-row">
<div>
<p>@item.Title</p>
<div class="flex flex-row">
<MudPaper Elevation="0" Class="mx-1 mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
@item.System
</MudPaper>
@if(@item.IsSign)
{
<MudPaper Elevation="0" Class="mx-1 mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
Sign
</MudPaper>
}
@if (@item.IsSymptom)
{
<MudPaper Elevation="0" Class="mx-1 mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
Symptom
</MudPaper>
}
</div>
</div>
<MudIconButton @onclick="()=>RemoveReviewOfSystems(item)" class="mr-auto" Color="Color.Error" Icon="@Icons.Material.Filled.Close" />
</div>
</MudPaper>
}
<MudTextField @bind-Value="@_reviewOfSystemTitle" class="grow" T="string" Label="علامت مورد نظر" Variant="Variant.Outlined" />
<MudTextField @bind-Value="@_reviewOfSystemSystem" class="grow" T="string" Label="سیستم مورد نظر" Variant="Variant.Outlined" />
<div class="flex flex-row">
<MudCheckBox @bind-Checked="@_reviewOfSystemIsSign" Color="Color.Primary" UnCheckedColor="Color.Default" Size="Size.Large" T="bool"
class="my-auto" Label="Sign"></MudCheckBox>
<MudCheckBox @bind-Checked="@_reviewOfSystemIsSymptom" Color="Color.Primary" UnCheckedColor="Color.Default" Size="Size.Large" T="bool"
class="my-auto" Label="Symptom"></MudCheckBox>
<MudButton @onclick="AddReviewOfSystems" Variant="Variant.Outlined" Color="Color.Info" IconSize="Size.Large" DisableElevation="false"
class="mr-auto mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
+
</MudButton>
</div>
</MudStack>
@code {
private string _generalAppearance = string.Empty;
public List<string> GeneralAppearances { get; set; } = new();
private void RemoveGeneralAppearance(string medicine)
{
GeneralAppearances.Remove(medicine);
}
private void AddGeneralAppearance()
{
GeneralAppearances.Add(_generalAppearance);
_generalAppearance = string.Empty;
}
private string _reviewOfSystemTitle = string.Empty;
private string _reviewOfSystemSystem = string.Empty;
private bool _reviewOfSystemIsSign;
private bool _reviewOfSystemIsSymptom;
public List<MedicalHistorySystemReview> ReviewOfSystems { get; set; } = new();
private void RemoveReviewOfSystems(MedicalHistorySystemReview review)
{
ReviewOfSystems.Remove(review);
}
private void AddReviewOfSystems()
{
ReviewOfSystems.Add(new MedicalHistorySystemReview
{
Title = _reviewOfSystemTitle,
IsSign = _reviewOfSystemIsSign,
IsSymptom = _reviewOfSystemIsSymptom,
System = _reviewOfSystemSystem
});
_reviewOfSystemTitle = string.Empty;
}
}

View File

@ -0,0 +1,19 @@
<MudStack class="pb-20 font-iranyekan my-auto">
<div class="-mt-8">
<dotlottie-player src="https://lottie.host/a1062be3-f832-4939-8bf9-841c047ff2b3/lpqB7zE3kv.json"
background="transparent" speed="0.8" class="m-auto w-72 h-72" loop autoplay />
</div>
<p class="text-xl text-center font-extrabold">تبریک تمپلیت شما تکمیل شد</p>
<p class="text-center -mt-2 mb-8 text-md">
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
مورد ده
</p>
<BaseButtonUi @onclick="() => { SubmittedOnClick.InvokeAsync(); }" class="my-auto" Content="تبریک تمپلیت شما تکمیل شد" Variant="Variant.Filled" Color="Color.Success" Icon="@Icons.Material.TwoTone.Check"></BaseButtonUi>
</MudStack>
@code {
[Parameter]
public EventCallback SubmittedOnClick { get; set; }
}

View File

@ -0,0 +1,63 @@
@page "/MedicalHistoryTemplatesPage"
@inject NavigationManager NavigationManager
<BasePageUi Title="پیش نویس های شرح حال نویسی" Description="پیش نویس های شرح های سرعت و دقت شما را افزایش میدهد">
<MudStack>
<div class="flex flex-row mr-1 mt-5">
<div>
<p class="font-extrabold text-[#356859]">تمامی پیش نویس های شما</p>
<p class="text-xs font-light ">شما میتوانید پیش نویس جدید اضافه کنید</p>
</div>
<MudButton @onclick="CreateMedicalHistoryTemplateClicked" DisableElevation="false" class="text-[#356859] my-auto mr-auto font-extrabold bg-white rounded-lg drop-shadow-md">+ افزودن</MudButton>
</div>
<MudTextField class="text-sm" InputType="InputType.Search" T="string" Label="جست جو پیش نویس" Variant="Variant.Outlined"/>
<div class="grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4">
@foreach(var item in _medicalHistoryTemplates)
{
<MedicalHistoryTemplateItemTemplate Clicked="MedicalHistoryTemplateClicked" MedicalHistoryTemplate="@item" />
}
</div>
</MudStack>
</BasePageUi>
@code
{
private void CreateMedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
private void MedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
private List<MedicalHistoryTemplate> _medicalHistoryTemplates = new();
protected override void OnInitialized()
{
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
{
CC = "سردرد",
Section = "داخلی"
});
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
{
CC = "بدن درد",
Section = "فیزیو"
});
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
{
CC = "بی خوابی",
Section = "داخلی"
});
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
{
CC = "دردپهلو",
Section = "داخلی"
});
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
{
CC = "سوختگی",
Section = "سوختگی"
});
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
{
CC = "شکستگی",
Section = "فیزیو"
});
base.OnInitialized();
}
}

View File

@ -0,0 +1,28 @@
@page "/MedicalOrdersPage"
@inject NavigationManager NavigationManager
@inject IJSRuntime JSRuntime
<BasePageUi Description="شما میتوانید اوردرهای روزانه را وارد کنید" Title="اوردرها">
<MudStack class="pb-20 font-iranyekan my-auto">
<div class="-mt-8 -mb-8">
<dotlottie-player src="https://lottie.host/5131235d-98fe-4d79-9149-f51d349612ef/UMuv72r1Cp.json"
background="transparent" speed="0.8" class="m-auto w-[23rem] h-[23rem]" loop autoplay />
</div>
<p class="text-xl text-center font-extrabold">بخش اوردرها به زودی اضافه میشود</p>
<p class="text-center -mt-2 mb-8 text-md">
بخش اوردرها در حال توسعه و پیاده سازی می باشد و به زودی در اختیار شما کاربران عزیز قرار میگیرد
</p>
<BaseButtonUi @onclick="BackClicked" class="my-auto" Content="بازگشت" Variant="Variant.Filled" Color="Color.Secondary" Icon="@Icons.Material.TwoTone.ChevronLeft"></BaseButtonUi>
</MudStack>
</BasePageUi>
@code {
private async Task BackClicked()
{
await JSRuntime.InvokeVoidAsync("history.back");
}
}

View File

@ -0,0 +1,30 @@
@page "/ProfilePage"
@using System.Reflection
<BasePageUi Title="پروفایل شما" Description="اطلاعات پروفایل شما باید دقیق و کامل باشد">
<MudStack class="pb-10">
<MudTextField T="string" Label="نـــــــام" Variant="Variant.Outlined" />
<MudTextField T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
<MudTextField T="string" Label="شماره تماس" Variant="Variant.Outlined" />
<MudTextField T="string" Label="شماره دانشجویی" Variant="Variant.Outlined" />
<MudAutocomplete T="string" Label="شهر شما" Variant="Variant.Outlined" />
<MudAutocomplete T="string" Label="دانشگاه" Variant="Variant.Outlined" />
<MudAutocomplete T="string" Label="بخش فعلی" Variant="Variant.Outlined" />
<BaseButtonUi Icon="@Icons.Material.TwoTone.Check" Content="ویرایش پروفایل" Variant="Variant.Filled" Color="Color.Primary"/>
<BaseButtonUi Icon="@Icons.Material.TwoTone.Close" Content="خروج از حساب کاربری" Variant="Variant.Outlined" Color="Color.Error" />
</MudStack>
<div class="bg-gray-300 rounded-md mt-auto py-4 px-6 flex flex-row">
<p class="my-auto">نسخه برنامه </p>
<p class="font-extrabold text-lg mr-auto">@_version</p>
</div>
</BasePageUi>
@code {
private readonly string _version = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString() ?? string.Empty;
}

View File

@ -0,0 +1,14 @@
using DocuMed.PWA;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using Toolbelt.Blazor.Extensions.DependencyInjection;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddMudServices();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddPWAUpdater();
await builder.Build().RunAsync();

View File

@ -0,0 +1,30 @@
{
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5254"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://192.168.222.123:56464",
"sslPort": 0
}
}
}

View File

@ -0,0 +1,43 @@
<MudCard Class="mx-3 my-1 rounded-md" Elevation="2">
<div class="flex flex-row">
<div class="bg-[--color-primary] rounded-r-lg w-2"></div>
<MudStack class="grow mx-3.5 my-4">
<div class="flex flex-row">
<p class="font-extrabold font-iranyekan text-base my-auto text-[#37966F]">@MedicalHistory.Name</p>
<MudPaper Elevation="0"
class="bg-[#FFDACF] text-[#D03405] rounded-full py-0.5 px-3 my-auto mr-auto text-xs font-iranyekan">
<p>@MedicalHistory.CC در بخش @MedicalHistory.Section</p>
</MudPaper>
</div>
<MudGrid Row="true" Class="items-center justify-stretch">
<MudItem xs="4">
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
@MedicalHistory.Aag ساله
</MudPaper>
</MudItem>
<MudItem xs="4">
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
@MedicalHistory.Gender.ToString()
</MudPaper>
</MudItem>
<MudItem xs="4">
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
@MedicalHistory.Section
</MudPaper>
</MudItem>
</MudGrid>
</MudStack>
</div>
</MudCard>
@code {
[Parameter]
public MedicalHistory MedicalHistory { get; set; } = new();
}

View File

@ -0,0 +1,23 @@
<MudPaper class="px-3 py-2 mx-1">
<div class="flex flex-row">
<div>
<p>@Question.Title</p>
<MudPaper Elevation="0"
Class="mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
@Question.Type.ToString();
</MudPaper>
</div>
<MudIconButton @onclick="async ()=> await QuestionRemoved.InvokeAsync(Question)" class="mr-auto" Color="Color.Error" Icon="@Icons.Material.Filled.Close" />
</div>
</MudPaper>
@code {
[Parameter]
public MedicalHistoryQuestion Question { get; set; } = new MedicalHistoryQuestion();
[Parameter]
public EventCallback<MedicalHistoryQuestion> QuestionRemoved { get; set; }
}

View File

@ -0,0 +1,19 @@
<MudCard @onclick="(async () => { await Clicked.InvokeAsync(MedicalHistoryTemplate); })" Elevation="2" class="rounded-lg">
<MudCardContent>
<p class="text-center font-extrabold mt-1 text-gray-600 text-lg">@MedicalHistoryTemplate.CC</p>
<MudPaper Elevation="0"
class="bg-[#FFDACF] text-center text-[#D03405] rounded-full py-0.5 mt-3 mr-auto text-xs font-iranyekan">
<p>بخش @MedicalHistoryTemplate.Section</p>
</MudPaper>
</MudCardContent>
</MudCard>
@code {
[Parameter]
public MedicalHistoryTemplate MedicalHistoryTemplate { get; set; } = new();
[Parameter]
public EventCallback<MedicalHistoryTemplate> Clicked { get; set; }
}

View File

@ -0,0 +1,35 @@
@inherits LayoutComponentBase
<MudRTLProvider RightToLeft="true">
<MudThemeProvider Theme="MyCustomTheme" />
<MudDialogProvider />
<MudSnackbarProvider />
<MudLayout>
<div>
@Body
<PWAUpdater />
</div>
</MudLayout>
</MudRTLProvider>
@code
{
MudTheme MyCustomTheme = new MudTheme()
{
Palette = new PaletteLight()
{
Primary = "#356859",
Secondary = "#FD5523",
},
PaletteDark = new PaletteDark()
{
Primary = "#356859",
Secondary = "#FD5523",
}
};
protected override void OnInitialized()
{
base.OnInitialized();
}
}

View File

@ -0,0 +1,81 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}
.top-row.auth {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}

View File

@ -0,0 +1,18 @@
<div class="flex flex-row mt-2">
<p class="ml-3 font-bold text-justify grow">علائم از چند ساعت پیش شروع شده است ؟</p>
<div class="flex flex-row">
<MudIconButton @onclick="IncreaseHour" DisableElevation="true" Class="bg-white rounded-full"
Icon="@Icons.Material.Filled.KeyboardArrowUp" Variant="Variant.Filled" />
<p class="my-auto ml-1 mr-2 text-xl font-extrabold">@HourCounter</p>
<p class="my-auto ml-2 font-extrabold">ساعت</p>
<MudIconButton @onclick="DecreaseHour" DisableElevation="true" Class="bg-white rounded-full"
Icon="@Icons.Material.Filled.KeyboardArrowDown" Variant="Variant.Filled" />
</div>
</div>
@code {
public int HourCounter { get; set; }
private void IncreaseHour() => HourCounter++;
private void DecreaseHour() => HourCounter--;
}

View File

@ -0,0 +1,41 @@
<MudButton Variant="@Variant"
Color="@Color"
@onclick="OnClickCallback"
@attributes="CapturedAttributes"
DisableElevation="true"
class="rounded-md">
<div class="flex flex-row w-full">
@if (Variant == Variant.Filled)
{
<div class="-mr-2 -ml-6 w-10 h-10 items-center bg-[#000000] bg-opacity-20 rounded-md">
<MudIcon Icon="@Icon" class="w-5 h-5 mt-2.5"></MudIcon>
</div>
}
else
{
<div class="-mr-2 -ml-6 w-12 h-12 items-center rounded-md">
<MudIcon Icon="@Icon" class="w-7 h-7 mt-2"></MudIcon>
</div>
}
<p class="my-auto mx-auto font-extrabold">@Content</p>
</div>
</MudButton>
@code
{
[Parameter]
public Variant Variant { get; set; }
[Parameter]
public Color Color { get; set; }
[Parameter]
public string Content { get; set; } = string.Empty;
[Parameter]
public string Icon { get; set; } = string.Empty;
[Parameter]
public EventCallback OnClickCallback { get; set; }
[Parameter(CaptureUnmatchedValues = true)]
public Dictionary<string, object> CapturedAttributes { get; set; } = new();
}

View File

@ -0,0 +1,49 @@
@inject IJSRuntime JSRuntime
<style>
.mud-input-label {
background-color: #eee;
}
</style>
<MudStack class="w-screen h-screen bg-[#356859]">
<div class="flex flex-row mt-4 mb-3">
@if (Header != null)
{
@Header
}
else
{
<MudStack Row="true" Class="mx-7 my-2">
<MudStack class="justify-center ">
<p class="text-lg font-extrabold text-white font-iranyekan">@Title</p>
<p class="-mt-3 text-xs text-white font-iranyekan">@Description</p>
</MudStack>
</MudStack>
<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 class="bg-[#EEEEEE] w-full h-full flex flex-col rounded-t-xl p-5">
@ChildContent
</div>
</MudStack>
@code
{
[Parameter]
public RenderFragment? ChildContent { get; set; }
[Parameter]
public RenderFragment? Header { get; set; }
[Parameter]
public string Title { get; set; } = string.Empty;
[Parameter]
public string Description { get; set; } = string.Empty;
private async Task BackClicked()
{
await JSRuntime.InvokeVoidAsync("history.back");
}
}

View File

@ -0,0 +1,19 @@
<div @attributes="CapturedAttributes">
<div class="flex flex-row">
<div class="flex-none w-8 h-8 pt-1 text-lg font-extrabold text-center bg-white rounded-full">@Index</div>
<p class="flex-none mx-2 my-auto font-extrabold text-gray-700">@Title</p>
<div class="h-[1px] my-auto bg-gray-400 grow w-fit"></div>
</div>
</div>
@code {
[Parameter]
public string Title {get;set;} = string.Empty;
[Parameter]
public int Index {get;set;}
[Parameter(CaptureUnmatchedValues = true)]
public Dictionary<string, object> CapturedAttributes { get; set; } = new();
}

View File

@ -0,0 +1,18 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using DocuMed.PWA
@using DocuMed.PWA.Shared
@using MudBlazor
@using DocuMed.PWA.Shared.Originals
@using DocuMed.PWA.Shared.ItemTemplates
@using Microsoft.AspNetCore.Authorization
@using Blazorise.LottieAnimation
@using DocuMed.PWA.Shared.MedicalTemplates
@using DocuMed.PWA.Pages.MedicalHistoryTemplateActionParts
@using DocuMed.PWA.Pages.MedicalHistoryActionParts

1395
DocuMed.PWA/package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
{
"dependencies": {
"autoprefixer": "^10.4.16",
"postcss": "^8.4.30",
"postcss-cli": "^10.1.0",
"tailwindcss": "^3.3.3"
},
"name": "documed.pwa",
"version": "1.0.0",
"main": "tailwind.config.js",
"scripts": {
"buildcss": "postcss wwwroot/css/app.css -o wwwroot/css/app.min.css"
},
"author": "",
"license": "ISC",
"description": ""
}

Some files were not shown because too many files have changed in this diff Show More