From 8a791e564421399edd94f79558eacbe118a64780 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Wed, 28 Aug 2019 22:45:53 -0300 Subject: [PATCH 1/8] Se agrega el CUIT al Usuario --- Msn.InteropDemo.Common/Utils/Helpers/Cuit.cs | 108 ++++ .../Identity/SystemUserConfiguration.cs | 3 + ...0829004457_add_CUIT_SystemUser.Designer.cs | 609 ++++++++++++++++++ .../20190829004457_add_CUIT_SystemUser.cs | 22 + .../Migrations/DataContextModelSnapshot.cs | 2 + .../Identity/SystemUser.cs | 2 + .../Pages/Account/Manage/Index.cshtml | 16 +- .../Pages/Account/Manage/Index.cshtml.cs | 11 +- .../Identity/Pages/Account/Register.cshtml | 24 +- .../Identity/Pages/Account/Register.cshtml.cs | 9 +- .../CustomValidators/CuitValidator.cs | 31 + 11 files changed, 827 insertions(+), 10 deletions(-) create mode 100644 Msn.InteropDemo.Common/Utils/Helpers/Cuit.cs create mode 100644 Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.Designer.cs create mode 100644 Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.cs create mode 100644 Msn.InteropDemo.Web/CustomValidators/CuitValidator.cs diff --git a/Msn.InteropDemo.Common/Utils/Helpers/Cuit.cs b/Msn.InteropDemo.Common/Utils/Helpers/Cuit.cs new file mode 100644 index 0000000..f30a63e --- /dev/null +++ b/Msn.InteropDemo.Common/Utils/Helpers/Cuit.cs @@ -0,0 +1,108 @@ +using System; +using System.Text.RegularExpressions; + +namespace Msn.InteropDemo.Common.Utils.Helpers +{ + public static class Cuit + { + public static bool Validate(string cuit) + { + if (string.IsNullOrWhiteSpace(cuit)) + { + return false; + } + + cuit = cuit.Trim(); + if (cuit.Length > 13) //no puede ser mayor que 13 con los guiones incluidos. + { + return false; + } + + cuit = cuit.Replace("-", ""); // Le quito el guión + if (cuit.Length != 11) + { + return false; + } + + var rg = new Regex("[A-Z_a-z]"); // Expresión regular para caracteres no válidos + if (rg.IsMatch(cuit)) + { + // Tiene caracteres no válidos + return false; + } + + var calculado = GetCuitVerificationDigit(cuit); + var digito = int.Parse(cuit.Substring(10)); + return calculado == digito; + } + + public static int GetCuitVerificationDigit(string cuit) + { + var mult = new[] { 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 }; + var nums = cuit.ToCharArray(); + var total = 0; + for (var i = 0; i < mult.Length; i++) + { + total += int.Parse(nums[i].ToString()) * mult[i]; + } + var resto = total % 11; + return resto == 0 ? 0 : resto == 1 ? 9 : 11 - resto; + } + + public static string ToCleanFormat(string cuit) + { + if (cuit != null) + { + cuit = cuit.Trim(); //quito espacios + cuit = cuit.Replace("-", ""); // Le quito el guión + } + return cuit; + } + + public static string ToUIFormat(long? cuit, bool mustValidate = false) + { + if(!cuit.HasValue) + { + return string.Empty; + } + if(cuit.Value == 0) + { + return string.Empty; + } + + return ToUIFormat(cuit.ToString(), mustValidate); + } + + public static string ToUIFormat(string cuit, bool mustValidate = false) + { + if (mustValidate && !Validate(cuit)) + { + throw new ArgumentException("Número de CUIT incorrecto"); + } + + cuit = cuit.Trim(); //quito espacios + cuit = cuit.Replace("-", ""); // Le quito el guión si lo hubiera, posiblemente tenga solo uno. + + //cuit = 20172874127 + + if (cuit.Length != 11) + { + return cuit; + } + + var preCuit = cuit.Substring(0, 2) + "-"; + //preCuit = 20- + + preCuit += cuit.Substring(2, cuit.Length - 3) + "-"; + //preCuit = 20-17287412- + + preCuit += cuit.Substring(cuit.Length - 1); + //preCuit = 20-17287412-7 + + cuit = preCuit; + + return cuit; + } + + } +} diff --git a/Msn.InteropDemo.Data/EntitiesConfiguration/Identity/SystemUserConfiguration.cs b/Msn.InteropDemo.Data/EntitiesConfiguration/Identity/SystemUserConfiguration.cs index aa29457..fe8b767 100644 --- a/Msn.InteropDemo.Data/EntitiesConfiguration/Identity/SystemUserConfiguration.cs +++ b/Msn.InteropDemo.Data/EntitiesConfiguration/Identity/SystemUserConfiguration.cs @@ -20,6 +20,9 @@ public void Configure(EntityTypeBuilder builder) .HasMaxLength(100) .IsUnicode() .IsRequired(); + + builder.Property(p => p.CUIT) + .IsRequired(false); } } } diff --git a/Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.Designer.cs b/Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.Designer.cs new file mode 100644 index 0000000..5d91cc1 --- /dev/null +++ b/Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.Designer.cs @@ -0,0 +1,609 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Msn.InteropDemo.Data.Context; + +namespace Msn.InteropDemo.Data.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20190829004457_add_CUIT_SystemUser")] + partial class add_CUIT_SystemUser + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079"); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ActivityRequest") + .HasMaxLength(1000) + .IsUnicode(false); + + b.Property("ActivityRequestBody"); + + b.Property("ActivityRequestUI"); + + b.Property("ActivityResponse") + .HasMaxLength(1000) + .IsUnicode(false); + + b.Property("ActivityResponseBody"); + + b.Property("ActivityTypeDescriptorId"); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("Enabled"); + + b.Property("RequestIsJson"); + + b.Property("RequestIsURL"); + + b.Property("ResponseIsJson"); + + b.Property("ResponseIsURL"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SessionUserId") + .IsRequired() + .HasMaxLength(200) + .IsUnicode(false); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeDescriptorId"); + + b.HasIndex("CreatedDateTime"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("SessionUserId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("ActivityLog"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityTypeDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Enabled"); + + b.Property("Nombre") + .IsRequired() + .HasColumnType("varchar(50)") + .HasMaxLength(200) + .IsUnicode(false); + + b.Property("Orden"); + + b.HasKey("Id"); + + b.ToTable("ActivityTypeDescriptor"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("Enabled"); + + b.Property("Observacion") + .HasMaxLength(500) + .IsUnicode(true); + + b.Property("PacienteId"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDateTime"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("PacienteId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("Evolucion"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionDiagnostico", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionDiagnostico"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionMedicamento", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionMedicamento"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionVacunaAplicacion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionVacunaAplicacion"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Identity.SystemUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("Apellido") + .IsRequired() + .HasMaxLength(100) + .IsUnicode(true); + + b.Property("CUIT"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("Nombre") + .IsRequired() + .HasMaxLength(100) + .IsUnicode(true); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.Paciente", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("DomicilioCalle"); + + b.Property("DomicilioCalleAltura"); + + b.Property("DomicilioCodPostal"); + + b.Property("DomicilioDepto"); + + b.Property("DomicilioPiso"); + + b.Property("Email") + .HasMaxLength(100) + .IsUnicode(false); + + b.Property("Enabled"); + + b.Property("FechaNacimiento") + .HasColumnType("Date"); + + b.Property("FederadoDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("FederadorId"); + + b.Property("NroDocumento"); + + b.Property("OtrosApellidos") + .HasMaxLength(50); + + b.Property("OtrosNombres") + .HasMaxLength(50); + + b.Property("PrimerApellido") + .IsRequired() + .HasMaxLength(50); + + b.Property("PrimerNombre") + .IsRequired() + .HasMaxLength(50); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Sexo") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("TipoDocumentoId"); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("TipoDocumentoId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("Paciente"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.TipoDocumento", b => + { + b.Property("Id"); + + b.Property("Enabled"); + + b.Property("Nombre") + .IsRequired() + .HasColumnType("varchar(50)") + .HasMaxLength(50); + + b.Property("Orden"); + + b.HasKey("Id"); + + b.ToTable("TipoDocumento"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityLog", b => + { + b.HasOne("Msn.InteropDemo.Entities.Activity.ActivityTypeDescriptor", "ActivityTypeDescriptor") + .WithMany() + .HasForeignKey("ActivityTypeDescriptorId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Pacientes.Paciente", "Paciente") + .WithMany() + .HasForeignKey("PacienteId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionDiagnostico", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Diagnosticos") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionMedicamento", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Medicamentos") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionVacunaAplicacion", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Vacunas") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.Paciente", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Pacientes.TipoDocumento", "TipoDocumento") + .WithMany() + .HasForeignKey("TipoDocumentoId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.cs b/Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.cs new file mode 100644 index 0000000..fdef562 --- /dev/null +++ b/Msn.InteropDemo.Data/Migrations/20190829004457_add_CUIT_SystemUser.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Msn.InteropDemo.Data.Migrations +{ + public partial class add_CUIT_SystemUser : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "CUIT", + table: "AspNetUsers", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "CUIT", + table: "AspNetUsers"); + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs b/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs index 84c5ec1..be5789a 100644 --- a/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs +++ b/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs @@ -337,6 +337,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(100) .IsUnicode(true); + b.Property("CUIT"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken(); diff --git a/Msn.InteropDemo.Entities/Identity/SystemUser.cs b/Msn.InteropDemo.Entities/Identity/SystemUser.cs index 4934828..b912bd0 100644 --- a/Msn.InteropDemo.Entities/Identity/SystemUser.cs +++ b/Msn.InteropDemo.Entities/Identity/SystemUser.cs @@ -12,5 +12,7 @@ public SystemUser() : base() public string Apellido { get; set; } + public long? CUIT { get; set; } + } } diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml index 8b5197f..64c6ab9 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml @@ -15,7 +15,7 @@ -
+
@if (Model.IsEmailConfirmed) { @@ -31,11 +31,16 @@ }
-
+
+
+ + + +
@@ -43,4 +48,11 @@ @section Scripts { + + } \ No newline at end of file diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs index da671a8..e3a96ae 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using Msn.InteropDemo.Web.CustomValidators; namespace Msn.InteropDemo.Web.Areas.Identity.Pages.Account.Manage { @@ -47,6 +48,11 @@ public class InputModel [Phone] [Display(Name = "Teléfono")] public string PhoneNumber { get; set; } + + [Display(Name = "CUIT")] + [Required(ErrorMessage = "El CUIT es requerido")] + [CuitValidator(ErrorMessage = "El CUIT ingresado es inválido")] + public string CUIT { get; set; } } public async Task OnGetAsync() @@ -66,7 +72,8 @@ public async Task OnGetAsync() Input = new InputModel { Email = email, - PhoneNumber = phoneNumber + PhoneNumber = phoneNumber, + CUIT = Common.Utils.Helpers.Cuit.ToUIFormat(user.CUIT) }; IsEmailConfirmed = await _userManager.IsEmailConfirmedAsync(user); @@ -109,6 +116,8 @@ public async Task OnPostAsync() } } + user.CUIT = long.Parse(Common.Utils.Helpers.Cuit.ToCleanFormat(Input.CUIT)); + await _userManager.UpdateAsync(user); await _signInManager.RefreshSignInAsync(user); StatusMessage = "Su cuenta ha sido actualizada."; return RedirectToPage(); diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml index b2d1b27..c569af5 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml @@ -19,19 +19,26 @@
-
+
-
+
+
+
+ + + +
+
@@ -57,7 +64,7 @@
-
+
@@ -77,9 +84,14 @@ - - - @section Scripts { + + + } diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml.cs b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml.cs index 4b96f5e..9fefba6 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml.cs +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; +using Msn.InteropDemo.Web.CustomValidators; namespace Msn.InteropDemo.Web.Areas.Identity.Pages.Account { @@ -67,6 +68,11 @@ public class InputModel [Display(Name = "Confirmar contraseña")] [Compare("Password", ErrorMessage = "Las contraseñas inegresasas no coinciden.")] public string ConfirmPassword { get; set; } + + [Display(Name = "CUIT")] + [Required(ErrorMessage = "El CUIT es requerido")] + [CuitValidator(ErrorMessage = "El CUIT ingresado es inválido")] + public string CUIT { get; set; } } public void OnGet(string returnUrl = null) @@ -84,7 +90,8 @@ public async Task OnPostAsync(string returnUrl = null) UserName = Input.UserName, Nombre = Input.Nombre, Apellido = Input.Apellido, - Email = Input.Email + Email = Input.Email, + CUIT = long.Parse(Common.Utils.Helpers.Cuit.ToCleanFormat(Input.CUIT)) }; var result = await _userManager.CreateAsync(user, Input.Password); diff --git a/Msn.InteropDemo.Web/CustomValidators/CuitValidator.cs b/Msn.InteropDemo.Web/CustomValidators/CuitValidator.cs new file mode 100644 index 0000000..5aa7546 --- /dev/null +++ b/Msn.InteropDemo.Web/CustomValidators/CuitValidator.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; + +namespace Msn.InteropDemo.Web.CustomValidators +{ + public class CuitValidator : ValidationAttribute + { + protected override ValidationResult IsValid(object value, ValidationContext validationContext) + { + //Se retorna Success si es null porque probablemente podría ser opcional + //Para que sea obligatororio la Property deberá ser combinada con [Required] + if (value == null) + { + return ValidationResult.Success; + } + + if (Common.Utils.Helpers.Cuit.Validate(value.ToString())) + { + return ValidationResult.Success; + } + else + { + if (!string.IsNullOrWhiteSpace(ErrorMessage)) + { + return new ValidationResult(ErrorMessage); + } + + return new ValidationResult("El CUIT ingresado es incorrecto."); + } + } + } +} From b80d7bb9c5c9e6a694e682b375aa98e674c4a715 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Fri, 30 Aug 2019 10:33:10 -0300 Subject: [PATCH 2/8] =?UTF-8?q?Se=20agrega=20par=C3=A1metro=20de=20configu?= =?UTF-8?q?raci=C3=B3n=20de=20DomainName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Msn.InteropDemo.Common/Constants/DomainName.cs | 7 ++++++- Msn.InteropDemo.Web/Startup.cs | 5 +++++ Msn.InteropDemo.Web/rename.appsettings.json | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Msn.InteropDemo.Common/Constants/DomainName.cs b/Msn.InteropDemo.Common/Constants/DomainName.cs index 568e0dc..09cafbb 100644 --- a/Msn.InteropDemo.Common/Constants/DomainName.cs +++ b/Msn.InteropDemo.Common/Constants/DomainName.cs @@ -6,11 +6,16 @@ namespace Msn.InteropDemo.Common.Constants { public sealed class DomainName { - public static readonly DomainName LocalDomain = new DomainName { Value = "http://www.msal.gov.ar" }; + public static readonly DomainName LocalDomain = new DomainName(); public static readonly DomainName FederadorPatientDomain = new DomainName { Value = "https://federador.msal.gob.ar/patient-id" }; public static readonly DomainName RenaperDniDomain = new DomainName { Value = "http://www.renaper.gob.ar/dni" }; public static readonly DomainName MinInteriorPassportDomain = new DomainName { Value = "http://www.mininterior.gob.ar/pas" }; + public void SetValue(string domainName) + { + Value = domainName; + } + public string Value { get; private set; } } diff --git a/Msn.InteropDemo.Web/Startup.cs b/Msn.InteropDemo.Web/Startup.cs index 5fe8bb1..4bcaf54 100644 --- a/Msn.InteropDemo.Web/Startup.cs +++ b/Msn.InteropDemo.Web/Startup.cs @@ -59,6 +59,11 @@ public void ConfigureServices(IServiceCollection services) .AddDefaultUI(UIFramework.Bootstrap4); + //*** Set Local DomainName ********************************************** + var domainName = Configuration.GetValue("DomainName"); + Common.Constants.DomainName.LocalDomain.SetValue(domainName); + //*********************************************************************** + //*** DEPENDENCY INJECTIONS FOR OBJECTS ************************************************ services.AddHttpContextAccessor(); diff --git a/Msn.InteropDemo.Web/rename.appsettings.json b/Msn.InteropDemo.Web/rename.appsettings.json index 0649c5f..f3776d8 100644 --- a/Msn.InteropDemo.Web/rename.appsettings.json +++ b/Msn.InteropDemo.Web/rename.appsettings.json @@ -36,6 +36,8 @@ "AllowedHosts": "*", + "DomainName": "{URL_DEL_DOMINIO}", + "IntegrationServices": { "Services": [ From bd1ebe8de5bbcd914b96c1edefdc0bf177d632b6 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Sat, 31 Aug 2019 01:44:02 -0300 Subject: [PATCH 3/8] Mapeo a CIE10 --- .../AppServices/Cie10AppService.cs | 63 ++ .../Mapping/Profiles/EvolucionProfile.cs | 12 - .../Mapping/Profiles/SnowstormProfile.cs | 34 + .../ICie10AppService.cs | 7 + Msn.InteropDemo.Data/Context/DataContext.cs | 10 +- .../Codificacion/Cie10Configuration.cs | 31 + .../20190830161736_add_Cie10.Designer.cs | 631 ++++++++++++++++++ .../Migrations/20190830161736_add_Cie10.cs | 29 + .../Migrations/DataContextModelSnapshot.cs | 22 + .../Codificacion/CIE10.cs | 16 + .../Mock/CurrentContext.cs | 2 +- .../Msn.InteropDemo.Fhir.ConsoleTest.csproj | 2 +- Msn.InteropDemo.Fhir.ConsoleTest/Program.cs | 28 +- .../appsettings.json | 9 +- .../PatientManager.cs | 89 ++- .../SnowstormManager.cs | 50 +- .../ISnowstormManager.cs | 4 +- .../Cie10MappingAdditionalFields.cs | 17 + .../Model/Components/RefsetCie10MapItem.cs | 7 + .../Response/RefsetQueryCie10MapResponse.cs | 16 + .../Model/Response/RefsetQueryResponse.cs | 9 +- .../Snomed/Cie10MapResultViewModel.cs | 22 + .../Controllers/EvolucionarController.cs | 25 + Msn.InteropDemo.Web/Startup.cs | 1 + .../Evolucionar/EvolucionarPaciente.js | 21 +- .../Evolucionar/SearchSnowstormModal.js | 49 +- 26 files changed, 1110 insertions(+), 96 deletions(-) create mode 100644 Msn.InteropDemo.AppServices.Implementation/AppServices/Cie10AppService.cs create mode 100644 Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/SnowstormProfile.cs create mode 100644 Msn.InteropDemo.AppServices/ICie10AppService.cs create mode 100644 Msn.InteropDemo.Data/EntitiesConfiguration/Codificacion/Cie10Configuration.cs create mode 100644 Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs create mode 100644 Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs create mode 100644 Msn.InteropDemo.Entities/Codificacion/CIE10.cs create mode 100644 Msn.InteropDemo.Snowstorm/Model/Components/Cie10MappingAdditionalFields.cs create mode 100644 Msn.InteropDemo.Snowstorm/Model/Components/RefsetCie10MapItem.cs create mode 100644 Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryCie10MapResponse.cs create mode 100644 Msn.InteropDemo.ViewModel/Snomed/Cie10MapResultViewModel.cs diff --git a/Msn.InteropDemo.AppServices.Implementation/AppServices/Cie10AppService.cs b/Msn.InteropDemo.AppServices.Implementation/AppServices/Cie10AppService.cs new file mode 100644 index 0000000..9e2874e --- /dev/null +++ b/Msn.InteropDemo.AppServices.Implementation/AppServices/Cie10AppService.cs @@ -0,0 +1,63 @@ +using Microsoft.Extensions.Logging; +using Msn.InteropDemo.AppServices.Core; +using Msn.InteropDemo.Snowstorm; +using Msn.InteropDemo.ViewModel.Snomed; +using System.Collections.Generic; +using System.Linq; + +namespace Msn.InteropDemo.AppServices.Implementation.AppServices +{ + public class Cie10AppService : Core.GenericServiceReadOnly, ICie10AppService + { + private readonly ISnowstormManager _snowstormManager; + + public Cie10AppService(ICurrentContext currentContext, + ILogger logger, + Snowstorm.ISnowstormManager snowstormManager) : + base(currentContext, logger) + { + _snowstormManager = snowstormManager; + } + + public IEnumerable GetCie10MappedItems(string conceptId) + { + var lst = new List(); + + var cie10lst = _snowstormManager.RunQueryCie10MapRefset(conceptId); + + //se seleccionan solo aquellos que tienen un MapTarget, es decir, un Mapeo Esistente. + cie10lst.Items = cie10lst.Items.Where(x => !string.IsNullOrWhiteSpace(x.additionalFields.mapTarget)).ToList(); + + //Customization para el formato de la codificacion de la DEIS + foreach (var item in cie10lst.Items) + { + if(item.additionalFields.mapTarget.Length == 3) + { + item.additionalFields.mapTarget += "X"; + } + } + + //Mapeo a nuestros ViewModels + var cie10Maplst = Mapper.Map>(cie10lst.Items); + + //Se seleccionadn los distintos MApTargue para is a buscar en la DB + var cie102search = cie10Maplst.Select(x => x.MapTarget).Distinct(); + + //obtenidos de la DB + var cie10FromDbItems = CurrentContext.DataContext.Cie10.Where(x => cie102search.Contains(x.SubcategoriaId)); + + //por cada uno encontrado se le setea el texto de la SubcategoriaNombre y CategoriaNombre de la CIE10 esn Español + foreach (var item in cie10Maplst) + { + var dbitem = cie10FromDbItems.FirstOrDefault(x => x.SubcategoriaId == item.MapTarget); + if(dbitem != null) + { + item.SubcategoriaNombre = dbitem.SubcategoriaNombre; + item.CategoriaNombre = dbitem.CategoriaNombre; + } + } + + return cie10Maplst; + } + } +} diff --git a/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/EvolucionProfile.cs b/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/EvolucionProfile.cs index eb7b40e..cef25ba 100644 --- a/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/EvolucionProfile.cs +++ b/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/EvolucionProfile.cs @@ -26,18 +26,6 @@ public EvolucionProfile() .ForMember(dest => dest.ProfesionalApellido, orig => orig.MapFrom(x => $"Dr. {x.CreatedUser.Apellido}")) .ForMember(dest => dest.FechaEvolucion, orig => orig.MapFrom(x => x.CreatedDateTime.ToString("dd/MM/yyyy"))); - CreateMap() - .ForMember(dest => dest.ConceptId, orig => orig.MapFrom(x => x.ConceptId)) - .ForMember(dest => dest.Description, orig => orig.MapFrom(x => x.pt.Term)) - .ForMember(dest => dest.FSN, orig => orig.MapFrom(x => x.fsn.Term)) - .ForMember(dest => dest.Language, orig => orig.MapFrom(x => x.pt.Lang)); - - CreateMap() - .ForMember(dest => dest.ConceptId, orig => orig.MapFrom(x => x.referencedComponent.conceptId)) - .ForMember(dest => dest.Description, orig => orig.MapFrom(x => x.referencedComponent.pt.Term)) - .ForMember(dest => dest.FSN, orig => orig.MapFrom(x => x.referencedComponent.fsn.Term)) - .ForMember(dest => dest.Language, orig => orig.MapFrom(x => x.referencedComponent.pt.Lang)); - CreateMap(); CreateMap(); CreateMap(); diff --git a/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/SnowstormProfile.cs b/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/SnowstormProfile.cs new file mode 100644 index 0000000..2639aaf --- /dev/null +++ b/Msn.InteropDemo.AppServices.Implementation/Mapping/Profiles/SnowstormProfile.cs @@ -0,0 +1,34 @@ +using Msn.InteropDemo.ViewModel.Snomed; + +namespace Msn.InteropDemo.AppServices.Implementation.Mapping.Profiles +{ + public class SnowstormProfile : AutoMapper.Profile + { + public SnowstormProfile() + { + CreateMap() + .ForMember(dest => dest.ConceptId, orig => orig.MapFrom(x => x.ConceptId)) + .ForMember(dest => dest.Description, orig => orig.MapFrom(x => x.pt.Term)) + .ForMember(dest => dest.FSN, orig => orig.MapFrom(x => x.fsn.Term)) + .ForMember(dest => dest.Language, orig => orig.MapFrom(x => x.pt.Lang)); + + CreateMap() + .ForMember(dest => dest.ConceptId, orig => orig.MapFrom(x => x.referencedComponent.conceptId)) + .ForMember(dest => dest.Description, orig => orig.MapFrom(x => x.referencedComponent.pt.Term)) + .ForMember(dest => dest.FSN, orig => orig.MapFrom(x => x.referencedComponent.fsn.Term)) + .ForMember(dest => dest.Language, orig => orig.MapFrom(x => x.referencedComponent.pt.Lang)); + + CreateMap() + .ForMember(dest => dest.ConceptId, orig => orig.MapFrom(x => x.referencedComponent.conceptId)) + .ForMember(dest => dest.Description, orig => orig.MapFrom(x => x.referencedComponent.pt.Term)) + .ForMember(dest => dest.FSN, orig => orig.MapFrom(x => x.referencedComponent.fsn.Term)) + .ForMember(dest => dest.Language, orig => orig.MapFrom(x => x.referencedComponent.pt.Lang)) + .ForMember(dest => dest.MapGroup, orig => orig.MapFrom(x => x.additionalFields.mapGroup)) + .ForMember(dest => dest.MapPriority, orig => orig.MapFrom(x => x.additionalFields.mapPriority)) + .ForMember(dest => dest.MapRule, orig => orig.MapFrom(x => x.additionalFields.mapRule)) + .ForMember(dest => dest.MapAdvice, orig => orig.MapFrom(x => x.additionalFields.mapAdvice)) + .ForMember(dest => dest.MapTarget, orig => orig.MapFrom(x => x.additionalFields.mapTarget.Replace(".", ""))) + .ForMember(dest => dest.SubcategoriaId, orig => orig.MapFrom(x => x.additionalFields.mapTarget.Replace(".", ""))); + } + } +} diff --git a/Msn.InteropDemo.AppServices/ICie10AppService.cs b/Msn.InteropDemo.AppServices/ICie10AppService.cs new file mode 100644 index 0000000..89715c0 --- /dev/null +++ b/Msn.InteropDemo.AppServices/ICie10AppService.cs @@ -0,0 +1,7 @@ +namespace Msn.InteropDemo.AppServices +{ + public interface ICie10AppService : Core.IGenericServiceReadOnly + { + System.Collections.Generic.IEnumerable GetCie10MappedItems(string conceptId); + } +} diff --git a/Msn.InteropDemo.Data/Context/DataContext.cs b/Msn.InteropDemo.Data/Context/DataContext.cs index 4a523cf..e70da99 100644 --- a/Msn.InteropDemo.Data/Context/DataContext.cs +++ b/Msn.InteropDemo.Data/Context/DataContext.cs @@ -70,14 +70,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) public DbSet EvolucionVacunaAplicaciones { get; set; } - - - - - - - - - + public DbSet Cie10 { get; set; } } } diff --git a/Msn.InteropDemo.Data/EntitiesConfiguration/Codificacion/Cie10Configuration.cs b/Msn.InteropDemo.Data/EntitiesConfiguration/Codificacion/Cie10Configuration.cs new file mode 100644 index 0000000..02e680e --- /dev/null +++ b/Msn.InteropDemo.Data/EntitiesConfiguration/Codificacion/Cie10Configuration.cs @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Msn.InteropDemo.Entities.Codificacion; + +namespace Msn.InteropDemo.Data.EntitiesConfiguration.Codificacion +{ + public class Cie10Configuration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.SubcategoriaId); + + builder.Property(x => x.SubcategoriaId) + .ValueGeneratedNever() + .HasMaxLength(4) + .HasColumnType("char(4)") + .IsRequired(true) + .IsUnicode(false); + + builder.Property(x => x.SubcategoriaNombre) + .HasMaxLength(300) + .IsRequired() + .IsUnicode(); + + builder.Property(x => x.CategoriaNombre) + .HasMaxLength(300) + .IsRequired() + .IsUnicode(); + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs b/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs new file mode 100644 index 0000000..2221f41 --- /dev/null +++ b/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs @@ -0,0 +1,631 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Msn.InteropDemo.Data.Context; + +namespace Msn.InteropDemo.Data.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20190830161736_add_Cie10")] + partial class add_Cie10 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079"); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ActivityRequest") + .HasMaxLength(1000) + .IsUnicode(false); + + b.Property("ActivityRequestBody"); + + b.Property("ActivityRequestUI"); + + b.Property("ActivityResponse") + .HasMaxLength(1000) + .IsUnicode(false); + + b.Property("ActivityResponseBody"); + + b.Property("ActivityTypeDescriptorId"); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("Enabled"); + + b.Property("RequestIsJson"); + + b.Property("RequestIsURL"); + + b.Property("ResponseIsJson"); + + b.Property("ResponseIsURL"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SessionUserId") + .IsRequired() + .HasMaxLength(200) + .IsUnicode(false); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeDescriptorId"); + + b.HasIndex("CreatedDateTime"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("SessionUserId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("ActivityLog"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityTypeDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Enabled"); + + b.Property("Nombre") + .IsRequired() + .HasColumnType("varchar(50)") + .HasMaxLength(200) + .IsUnicode(false); + + b.Property("Orden"); + + b.HasKey("Id"); + + b.ToTable("ActivityTypeDescriptor"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Codificacion.Cie10", b => + { + b.Property("SubcategoriaId") + .HasColumnType("char(4)") + .HasMaxLength(4) + .IsUnicode(false); + + b.Property("CategoriaNombre") + .IsRequired() + .HasMaxLength(300) + .IsUnicode(true); + + b.Property("SubcategoriaNombre") + .IsRequired() + .HasMaxLength(300) + .IsUnicode(true); + + b.HasKey("SubcategoriaId"); + + b.ToTable("Cie10"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("Enabled"); + + b.Property("Observacion") + .HasMaxLength(500) + .IsUnicode(true); + + b.Property("PacienteId"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDateTime"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("PacienteId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("Evolucion"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionDiagnostico", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionDiagnostico"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionMedicamento", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionMedicamento"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionVacunaAplicacion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionVacunaAplicacion"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Identity.SystemUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("Apellido") + .IsRequired() + .HasMaxLength(100) + .IsUnicode(true); + + b.Property("CUIT"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("Nombre") + .IsRequired() + .HasMaxLength(100) + .IsUnicode(true); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.Paciente", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("DomicilioCalle"); + + b.Property("DomicilioCalleAltura"); + + b.Property("DomicilioCodPostal"); + + b.Property("DomicilioDepto"); + + b.Property("DomicilioPiso"); + + b.Property("Email") + .HasMaxLength(100) + .IsUnicode(false); + + b.Property("Enabled"); + + b.Property("FechaNacimiento") + .HasColumnType("Date"); + + b.Property("FederadoDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("FederadorId"); + + b.Property("NroDocumento"); + + b.Property("OtrosApellidos") + .HasMaxLength(50); + + b.Property("OtrosNombres") + .HasMaxLength(50); + + b.Property("PrimerApellido") + .IsRequired() + .HasMaxLength(50); + + b.Property("PrimerNombre") + .IsRequired() + .HasMaxLength(50); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Sexo") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("TipoDocumentoId"); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("TipoDocumentoId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("Paciente"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.TipoDocumento", b => + { + b.Property("Id"); + + b.Property("Enabled"); + + b.Property("Nombre") + .IsRequired() + .HasColumnType("varchar(50)") + .HasMaxLength(50); + + b.Property("Orden"); + + b.HasKey("Id"); + + b.ToTable("TipoDocumento"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityLog", b => + { + b.HasOne("Msn.InteropDemo.Entities.Activity.ActivityTypeDescriptor", "ActivityTypeDescriptor") + .WithMany() + .HasForeignKey("ActivityTypeDescriptorId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Pacientes.Paciente", "Paciente") + .WithMany() + .HasForeignKey("PacienteId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionDiagnostico", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Diagnosticos") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionMedicamento", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Medicamentos") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionVacunaAplicacion", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Vacunas") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.Paciente", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Pacientes.TipoDocumento", "TipoDocumento") + .WithMany() + .HasForeignKey("TipoDocumentoId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs b/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs new file mode 100644 index 0000000..e77720c --- /dev/null +++ b/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Msn.InteropDemo.Data.Migrations +{ + public partial class add_Cie10 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Cie10", + columns: table => new + { + SubcategoriaId = table.Column(type: "char(4)", unicode: false, maxLength: 4, nullable: false), + SubcategoriaNombre = table.Column(maxLength: 300, nullable: false), + CategoriaNombre = table.Column(maxLength: 300, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Cie10", x => x.SubcategoriaId); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Cie10"); + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs b/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs index be5789a..382c264 100644 --- a/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs +++ b/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs @@ -209,6 +209,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ActivityTypeDescriptor"); }); + modelBuilder.Entity("Msn.InteropDemo.Entities.Codificacion.Cie10", b => + { + b.Property("SubcategoriaId") + .HasColumnType("char(4)") + .HasMaxLength(4) + .IsUnicode(false); + + b.Property("CategoriaNombre") + .IsRequired() + .HasMaxLength(300) + .IsUnicode(true); + + b.Property("SubcategoriaNombre") + .IsRequired() + .HasMaxLength(300) + .IsUnicode(true); + + b.HasKey("SubcategoriaId"); + + b.ToTable("Cie10"); + }); + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => { b.Property("Id") diff --git a/Msn.InteropDemo.Entities/Codificacion/CIE10.cs b/Msn.InteropDemo.Entities/Codificacion/CIE10.cs new file mode 100644 index 0000000..30fee97 --- /dev/null +++ b/Msn.InteropDemo.Entities/Codificacion/CIE10.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Msn.InteropDemo.Entities.Codificacion +{ + public class Cie10 + { + public string SubcategoriaId { get; set; } + + public string SubcategoriaNombre { get; set; } + + public string CategoriaNombre { get; set; } + + } +} diff --git a/Msn.InteropDemo.Fhir.ConsoleTest/Mock/CurrentContext.cs b/Msn.InteropDemo.Fhir.ConsoleTest/Mock/CurrentContext.cs index 96f430c..9a4288a 100644 --- a/Msn.InteropDemo.Fhir.ConsoleTest/Mock/CurrentContext.cs +++ b/Msn.InteropDemo.Fhir.ConsoleTest/Mock/CurrentContext.cs @@ -22,7 +22,7 @@ public CurrentContext(Data.Context.DataContext dataContext) public void RegisterActivityLog(ActivityLog activityLog) { activityLog.SessionUserId = SessionUserId; - activityLog.ContextUserId = GetCurrentUserId; + activityLog.CreatedUserId = GetCurrentUserId; DataContext.ActivityLogs.Add(activityLog); DataContext.SaveChanges(); diff --git a/Msn.InteropDemo.Fhir.ConsoleTest/Msn.InteropDemo.Fhir.ConsoleTest.csproj b/Msn.InteropDemo.Fhir.ConsoleTest/Msn.InteropDemo.Fhir.ConsoleTest.csproj index 65c1a29..6c3e622 100644 --- a/Msn.InteropDemo.Fhir.ConsoleTest/Msn.InteropDemo.Fhir.ConsoleTest.csproj +++ b/Msn.InteropDemo.Fhir.ConsoleTest/Msn.InteropDemo.Fhir.ConsoleTest.csproj @@ -14,7 +14,7 @@ - + diff --git a/Msn.InteropDemo.Fhir.ConsoleTest/Program.cs b/Msn.InteropDemo.Fhir.ConsoleTest/Program.cs index 025c790..a0dd98d 100644 --- a/Msn.InteropDemo.Fhir.ConsoleTest/Program.cs +++ b/Msn.InteropDemo.Fhir.ConsoleTest/Program.cs @@ -16,12 +16,7 @@ class Program static void Main(string[] args) { - //CreatePatient(); - //ConfigureLogger(); - //var bunble = GetPatient(); - //ShowPatients(); - //ShowPatient("1982708"); - //Log.CloseAndFlush(); + try { RegisteServices(); @@ -31,6 +26,7 @@ static void Main(string[] args) { Console.WriteLine($"Error al registrar servicios:\n{ex.ToString()}"); Console.ReadKey(); + return; } try @@ -45,8 +41,14 @@ static void Main(string[] args) // new DateTime(1964, 6, 30)); //TestExpression(); + //CreatePatient(); + //ConfigureLogger(); + //var bunble = GetPatient(); + //ShowPatients(); + //ShowPatient("1982708"); + //TestExpressionAppService(); - TestExpressionAppService(); + TestCie10Mapping(); } catch (Exception ex) @@ -58,6 +60,14 @@ static void Main(string[] args) DisposeServices(); } + + private static void TestCie10Mapping() + { + var service = _serviceProvider.GetService(); + var resp = service.GetCie10MappedItems("94599006"); + + } + private static void RegisteServices() { var configuration = new ConfigurationBuilder() @@ -70,8 +80,7 @@ private static void RegisteServices() IServiceCollection services = new ServiceCollection(); - services.AddDbContext(options => - options.UseSqlite(configuration.GetConnectionString("DefaultConnection"))); + services.AddDbContext(); services.AddLogging(config => config.AddSerilog()); @@ -82,6 +91,7 @@ private static void RegisteServices() services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); _serviceProvider = services.BuildServiceProvider(); diff --git a/Msn.InteropDemo.Fhir.ConsoleTest/appsettings.json b/Msn.InteropDemo.Fhir.ConsoleTest/appsettings.json index d812a75..7592083 100644 --- a/Msn.InteropDemo.Fhir.ConsoleTest/appsettings.json +++ b/Msn.InteropDemo.Fhir.ConsoleTest/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "DataSource=C:\\Desarrollo\\Ministerio\\DNSIS\\MSN-InteropDemo\\MnsInteropDemo\\DB\\InteropDemoDB.db" + "DefaultConnection": "DataSource=C:\\Desarrollo\\Ministerio\\DNSIS\\MSN-Open-RSD-LocalDB\\InteropDemoDB.db" }, "Logging": { "LogLevel": { @@ -22,7 +22,7 @@ ], "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ], "Properties": { - "Application": "Datascan.AC.Site" + "Application": "InteropDemo.Test" }, "Filter": [ { @@ -64,6 +64,11 @@ { "Name": "SNOWSTORM_FIND_CONCEPTS", "Url": "https://snowstorm.msal.gov.ar/MAIN/concepts" + }, + { + "Name": "SNOWSTORM_REFSET_MEMBERS", + "FriendlyURL": "https://snowstorm.msal.gov.ar/MAIN/members", + "Url": "https://snowstorm.msal.gov.ar/MAIN/members" } ] } diff --git a/Msn.InteropDemo.Fhir.Implementacion/PatientManager.cs b/Msn.InteropDemo.Fhir.Implementacion/PatientManager.cs index b34b34d..d831b25 100644 --- a/Msn.InteropDemo.Fhir.Implementacion/PatientManager.cs +++ b/Msn.InteropDemo.Fhir.Implementacion/PatientManager.cs @@ -1,15 +1,14 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text; -using Hl7.Fhir.Rest; +using Hl7.Fhir.Rest; using Microsoft.Extensions.Logging; -using Msn.InteropDemo.Integration.Configuration; -using Newtonsoft.Json.Linq; -using Msn.InteropDemo.Fhir.Model.Response; using Msn.InteropDemo.AppServices.Core; -using Msn.InteropDemo.ViewModel.Activity; using Msn.InteropDemo.Entities.Activity; +using Msn.InteropDemo.Fhir.Model.Response; +using Msn.InteropDemo.Integration.Configuration; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; namespace Msn.InteropDemo.Fhir.Implementacion { @@ -70,9 +69,9 @@ public FederarPacienteResponse FederarPaciente(Model.Request.FederarPacienteRequ }; var serviceUrl = _integrationServicesConfiguration.GetConfigurationService(IntegrationServicesConfiguration.ConfigurationServicesName.BUS); - var patientCreateUrl = serviceUrl.GetEndPoint(IntegrationService.ConfigurationEndPointName.PATIENT_POST_CREATE); + //var patientCreateUrl = serviceUrl.GetEndPoint(IntegrationService.ConfigurationEndPointName.PATIENT_POST_CREATE); - var client = new FhirClient(patientCreateUrl.URL) + var client = new FhirClient(serviceUrl.BaseURL) { PreferredFormat = ResourceFormat.Json }; @@ -147,6 +146,12 @@ public bool ExistsPatient(Model.Request.ExistPatientRequest request) return bundle.Total > 0; } + public bool ExistsPatient(Common.Constants.DomainName system, string value) + { + var bundle = GetPatientByIdentifier(system.Value, value); + return bundle.Total.HasValue && (bundle.Total > 0); + } + public Hl7.Fhir.Model.Bundle GetPatientsByMatch(int dni, string primerApellido, string primerNombre, @@ -258,41 +263,6 @@ public Hl7.Fhir.Model.Bundle GetPatientsByMatch(int dni, return ret; } - private void OnAfterResponseFhirServer(object sender, AfterResponseEventArgs e) - { - if (e.Body != null) - { - var responseBody = Encoding.UTF8.GetString(e.Body, 0, e.Body.Length); - - //Prettify !!! - responseBody = JToken.Parse(responseBody).ToString(); - - _logger.LogInformation($"Received response with s {e.RawResponse.StatusCode}"); - _logger.LogInformation($"Received response with body: {responseBody }"); - } - } - - private void OnBeforeRequestFhirServer(object sender, BeforeRequestEventArgs e) - { - if (e.Body != null) - { - var requestAdderss = e.RawRequest.Address.ToString(); - var requestBody = Encoding.UTF8.GetString(e.Body, 0, e.Body.Length); - - //Prettify !!! - requestBody = JToken.Parse(requestBody).ToString(); - - _logger.LogInformation($"Send Request Address:{requestAdderss}"); - _logger.LogInformation($"Send Request Body:{requestBody}"); - } - } - - public bool ExistsPatient(Common.Constants.DomainName system, string value) - { - var bundle = GetPatientByIdentifier(system.Value, value); - return bundle.Total.HasValue && (bundle.Total > 0); - } - public Hl7.Fhir.Model.Bundle GetPatientByIdentifier(Common.Constants.DomainName system, string value) { return GetPatientByIdentifier(system.Value, value); @@ -386,6 +356,33 @@ public Hl7.Fhir.Model.Patient GetPatientByBusId(string patientId) return ret; } + private void OnAfterResponseFhirServer(object sender, AfterResponseEventArgs e) + { + if (e.Body != null) + { + var responseBody = Encoding.UTF8.GetString(e.Body, 0, e.Body.Length); + + //Prettify !!! + responseBody = JToken.Parse(responseBody).ToString(); + + _logger.LogInformation($"Received response with s {e.RawResponse.StatusCode}"); + _logger.LogInformation($"Received response with body: {responseBody }"); + } + } + + private void OnBeforeRequestFhirServer(object sender, BeforeRequestEventArgs e) + { + if (e.Body != null) + { + var requestAdderss = e.RawRequest.Address.ToString(); + var requestBody = Encoding.UTF8.GetString(e.Body, 0, e.Body.Length); + + //Prettify !!! + requestBody = JToken.Parse(requestBody).ToString(); + _logger.LogInformation($"Send Request Address:{requestAdderss}"); + _logger.LogInformation($"Send Request Body:{requestBody}"); + } + } } } diff --git a/Msn.InteropDemo.Snowstorm.Implementation/SnowstormManager.cs b/Msn.InteropDemo.Snowstorm.Implementation/SnowstormManager.cs index f9751a0..de0f4a1 100644 --- a/Msn.InteropDemo.Snowstorm.Implementation/SnowstormManager.cs +++ b/Msn.InteropDemo.Snowstorm.Implementation/SnowstormManager.cs @@ -120,23 +120,24 @@ public QueryResponse RunQuery(string expression, string term) /// /// Realiza un Query de un determinado Refset /// - /// El ConcepId del Refset en el cual se busca + /// El ConcepId del Refset en el cual se busca /// Termino por el cual se filtran los datos obtenidos /// - public RefsetQueryResponse RunQueryRefset(string conceptId, string term) + public RefsetQueryResponse RunQueryRefset(string refsetId, string term) { - if (string.IsNullOrWhiteSpace(conceptId)) + if (string.IsNullOrWhiteSpace(refsetId)) { - throw new ArgumentException("message", nameof(conceptId)); + throw new ArgumentException("message", nameof(refsetId)); } if (string.IsNullOrWhiteSpace(term)) { throw new ArgumentException("message", nameof(term)); } - var query = $"referenceSet={conceptId}&activeFilter=true&offset={0}&limit={50}"; + var query = $"referenceSet={refsetId}&activeFilter=true&offset={0}&limit={50}"; var serviceConfig = _integrationServicesConfiguration.GetConfigurationService(IntegrationServicesConfiguration.ConfigurationServicesName.SNOWSTORM); var endpoint = serviceConfig.GetEndPoint(IntegrationService.ConfigurationEndPointName.SNOWSTORM_REFSET_MEMBERS); + var urlFriendly = $"{endpoint.FriendlyURL}?{query}"; var url = $"{endpoint.URL}?{query}"; var client = new HttpConsumer.SnowstormRequest(Expressions.Constants.HeaderDefault.Headers); @@ -146,7 +147,9 @@ public RefsetQueryResponse RunQueryRefset(string conceptId, string term) var activityLog = new ActivityLog { - ActivityRequest = $"{url}", + RequestIsURL = true, + ActivityRequest = url, + ActivityRequestUI = urlFriendly, ActivityTypeDescriptorId = (int)Entities.Activity.ActivityType.SNOWSTORM_FIND_CONCEPTS, ActivityResponse = $"Conceptos obtenidos Limite:{ret.Limit} sobre un Total de:{ret.Total}" }; @@ -155,5 +158,40 @@ public RefsetQueryResponse RunQueryRefset(string conceptId, string term) return ret; } + + + public RefsetQueryCie10MapResponse RunQueryCie10MapRefset(string sctConceptId) + { + if (string.IsNullOrWhiteSpace(sctConceptId)) + { + throw new ArgumentException("message", nameof(sctConceptId)); + } + + var referenceSetId = "447562003"; //CIE10 Mapeo de Snowmed a CIE10. + + var query = $"referenceSet={referenceSetId}&referencedComponentId={sctConceptId}&active=true&offset={0}&limit={50}"; + var serviceConfig = _integrationServicesConfiguration.GetConfigurationService(IntegrationServicesConfiguration.ConfigurationServicesName.SNOWSTORM); + var endpoint = serviceConfig.GetEndPoint(IntegrationService.ConfigurationEndPointName.SNOWSTORM_REFSET_MEMBERS); + + var urlFriendly = $"{endpoint.FriendlyURL}?{query}"; + var url = $"{endpoint.URL}?{query}"; + + var client = new HttpConsumer.SnowstormRequest(Expressions.Constants.HeaderDefault.Headers); + var ret = client.Get(url); + + var activityLog = new ActivityLog + { + RequestIsURL = true, + ActivityRequest = url, + ActivityRequestUI = urlFriendly, + ActivityTypeDescriptorId = (int)Entities.Activity.ActivityType.SNOWSTORM_FIND_CONCEPTS, + ActivityResponse = $"Buesqueda Mapeo CIE10. Conceptos obtenidos Limite:{ret.Limit} sobre un Total de:{ret.Total}" + }; + + _currentContext.RegisterActivityLog(activityLog); + + return ret; + } + } } diff --git a/Msn.InteropDemo.Snowstorm/ISnowstormManager.cs b/Msn.InteropDemo.Snowstorm/ISnowstormManager.cs index 28ffc9d..9f83575 100644 --- a/Msn.InteropDemo.Snowstorm/ISnowstormManager.cs +++ b/Msn.InteropDemo.Snowstorm/ISnowstormManager.cs @@ -7,7 +7,7 @@ public interface ISnowstormManager { QueryResponse RunQuery(Expressions.ExpresionBuilders.Base.BaseExpBuilder builder); QueryResponse RunQuery(string expression, string term); - - RefsetQueryResponse RunQueryRefset(string conceptId, string term); + RefsetQueryCie10MapResponse RunQueryCie10MapRefset(string sctConceptId); + RefsetQueryResponse RunQueryRefset(string refsetId, string term); } } diff --git a/Msn.InteropDemo.Snowstorm/Model/Components/Cie10MappingAdditionalFields.cs b/Msn.InteropDemo.Snowstorm/Model/Components/Cie10MappingAdditionalFields.cs new file mode 100644 index 0000000..29704fe --- /dev/null +++ b/Msn.InteropDemo.Snowstorm/Model/Components/Cie10MappingAdditionalFields.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Msn.InteropDemo.Snowstorm.Model.Components +{ + public class Cie10MappingAdditionalFields + { + public string mapCategoryId { get; set; } + public string mapRule { get; set; } + public string mapAdvice { get; set; } + public string mapPriority { get; set; } + public string mapGroup { get; set; } + public string correlationId { get; set; } + public string mapTarget { get; set; } + } +} diff --git a/Msn.InteropDemo.Snowstorm/Model/Components/RefsetCie10MapItem.cs b/Msn.InteropDemo.Snowstorm/Model/Components/RefsetCie10MapItem.cs new file mode 100644 index 0000000..4a1ae6a --- /dev/null +++ b/Msn.InteropDemo.Snowstorm/Model/Components/RefsetCie10MapItem.cs @@ -0,0 +1,7 @@ +namespace Msn.InteropDemo.Snowstorm.Model.Components +{ + public class RefsetCie10MapItem : RefsetItem + { + public Cie10MappingAdditionalFields additionalFields { get; set; } + } +} diff --git a/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryCie10MapResponse.cs b/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryCie10MapResponse.cs new file mode 100644 index 0000000..3aaaa71 --- /dev/null +++ b/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryCie10MapResponse.cs @@ -0,0 +1,16 @@ +using Msn.InteropDemo.Snowstorm.Model.Components; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Msn.InteropDemo.Snowstorm.Model.Response +{ + public class RefsetQueryResponse + { + public List Items { get; set; } + public int Total { get; set; } + public int Limit { get; set; } + public int Offset { get; set; } + public string SearchAfter { get; set; } + } +} diff --git a/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryResponse.cs b/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryResponse.cs index 3aaaa71..e066afc 100644 --- a/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryResponse.cs +++ b/Msn.InteropDemo.Snowstorm/Model/Response/RefsetQueryResponse.cs @@ -1,13 +1,10 @@ -using Msn.InteropDemo.Snowstorm.Model.Components; -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; namespace Msn.InteropDemo.Snowstorm.Model.Response { - public class RefsetQueryResponse + public class RefsetQueryCie10MapResponse { - public List Items { get; set; } + public List Items { get; set; } public int Total { get; set; } public int Limit { get; set; } public int Offset { get; set; } diff --git a/Msn.InteropDemo.ViewModel/Snomed/Cie10MapResultViewModel.cs b/Msn.InteropDemo.ViewModel/Snomed/Cie10MapResultViewModel.cs new file mode 100644 index 0000000..8a28636 --- /dev/null +++ b/Msn.InteropDemo.ViewModel/Snomed/Cie10MapResultViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Msn.InteropDemo.ViewModel.Snomed +{ + public class Cie10MapResultViewModel + { + public string ConceptId { get; set; } + public string Description { get; set; } + public string FSN { get; set; } + public string Language { get; set; } + public string SubcategoriaId { get; set; } + public string SubcategoriaNombre { get; set; } + public string CategoriaNombre { get; set; } + public string MapAdvice { get; set; } + public int MapGroup { get; set; } + public int MapPriority { get; set; } + public string MapRule { get; set; } + public string MapTarget { get; set; } + } +} diff --git a/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs b/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs index 27396ec..8997a02 100644 --- a/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs +++ b/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs @@ -15,17 +15,20 @@ public class EvolucionarController : Web.Controllers.Base.ControllerBase { private readonly IPacienteAppService _pacienteAppService; private readonly IEvolucionAppService _evolucionAppService; + private readonly ICie10AppService _cie10AppService; private readonly ISelectListHelper _selectListHelper; private readonly ILogger _logger; public EvolucionarController(IPacienteAppService pacienteAppService, IEvolucionAppService evolucionAppService, + ICie10AppService cie10AppService, ISelectListHelper selectListHelper, ILogger logger ) { _pacienteAppService = pacienteAppService; _evolucionAppService = evolucionAppService; + _cie10AppService = cie10AppService; _selectListHelper = selectListHelper; _logger = logger; } @@ -126,6 +129,28 @@ public JsonResult SearchHallazgos(string term) } } + public JsonResult GetMapeoCie10(string conceptId) + { + try + { + var lstitems = _cie10AppService.GetCie10MappedItems(conceptId); + + //TODO: Modificar con la implementacion del modal para seleccion multiple + if(lstitems.Any()) + { + var item = lstitems.ToList()[0]; + return new JsonResult(new { success = true, item }) { StatusCode = 200 }; + } + + return new JsonResult(new { success = false }) { StatusCode = 200 }; + } + catch (Exception ex) + { + _logger.LogError(ex, "Error obteniendo datos"); + return new JsonResult(new { message = ex.Message }) { StatusCode = 500 }; + } + } + [HttpPost] public JsonResult SaveEvolucion(ViewModel.Evoluciones.EvolucionViewModel model) { diff --git a/Msn.InteropDemo.Web/Startup.cs b/Msn.InteropDemo.Web/Startup.cs index 4bcaf54..7931f56 100644 --- a/Msn.InteropDemo.Web/Startup.cs +++ b/Msn.InteropDemo.Web/Startup.cs @@ -83,6 +83,7 @@ public void ConfigureServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); //************************************************************************************** diff --git a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js index 24b5837..9ff2cf3 100644 --- a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js +++ b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js @@ -161,14 +161,33 @@ function saveEvolucion() { //Table Hallazgos $('#tableHallazgos > tbody > tr').each(function () { + + var strTerm = $(this).find('div.sctTerm').text(); + var cie10MappedId = $(this).find('span.cie10MappedId'); + var cie10MappedText = $(this).find('span.cie10MappedText'); + var cie10Id = null; + var cie10Text = null; + + if (cie10MappedId.length) { + cie10Id = cie10MappedId.attr('id'); + cie10Text = cie10MappedText.text(); + } + var item = { SctConceptId: this.id, - SctDescriptionTerm: this.cells[0].innerHTML + SctDescriptionTerm: strTerm, + Cie10SubcategoriId: cie10Id, + Cie10SubcategoriText: cie10Text }; + console.log(item); + dataToPost.Diagnosticos.push(item); }); + //PARA TEST + return; + //Table Vacunas $('#tableVacunas > tbody > tr').each(function () { var item = { diff --git a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js index a0813a6..de5c860 100644 --- a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js +++ b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js @@ -124,7 +124,18 @@ function snowstomResultItemSelected(obj) { trHTML += ''; - trHTML += '' + obj.dataset.term + ''; + + if (searchTypeSelected == SearchType.HALLAZGOS) { + trHTML += '' + + '
' + obj.dataset.term + '
' + + '
SctId: ' + obj.dataset.conceptid + ' --> ' + + 'Maperar a CIE10' + + '
' + + ''; + } + else { + trHTML += '' + obj.dataset.term + ''; + } trHTML += ''; trHTML += '
'; @@ -137,6 +148,42 @@ function snowstomResultItemSelected(obj) { } +function mapToCie10(id) { + + var loc = window.rootUrl + "Seguimiento/Evolucionar/GetMapeoCie10?conceptId=" + id; + + $.ajax({ + url: loc, + type: 'GET', + dataType: 'json', + cache: false, + success: function (data) { + + var container = $('#mapContainer' + id); + + if (data.success) { + var nexElement = '' + data.item.subcategoriaNombre + ''; + var str = 'CIE10: ' + data.item.subcategoriaId + ' - '; + container.hide('slow', function () { + container.attr('id', data.item.subcategoriaId); + container.text(str); + container.addClass('cie10MappedId text-success'); + $(nexElement).insertAfter(container); + container.show('slow'); + }); + } else { + container.text('CIE10: No Encontrado'); + container.addClass('text-danger'); + } + }, + error: function (request, status, error) { + console.log(request.responseText); + alert(request.responseText); + } + }); +} + + function deleteItem(rowId) { var tr = $('#' + rowId); tr.fadeOut(300, function () { From a53390dc8c5b3f28b4ea765bc01b61ce99bc3c39 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Sat, 31 Aug 2019 17:24:01 -0300 Subject: [PATCH 4/8] Persistencia de Mapeo de Cie10 en DB --- .../EvolucionDiagnosticoConfiguration.cs | 13 + ...s => 20190831195010_add_Cie10.Designer.cs} | 9 +- ...d_Cie10.cs => 20190831195010_add_Cie10.cs} | 21 + ...n_Diagnostico_add_SubCatNombre.Designer.cs | 642 ++++++++++++++++++ ..._Evolucion_Diagnostico_add_SubCatNombre.cs | 23 + .../Migrations/DataContextModelSnapshot.cs | 11 + .../Msn.InteropDemo.Data.csproj | 46 ++ .../Evoluciones/EvolucionDiagnostico.cs | 4 + .../EvolucionDiagnosticoViewModel.cs | 4 + .../Controllers/EvolucionarController.cs | 1 + .../Evolucionar/EvolucionarPaciente.js | 11 +- .../Evolucionar/SearchSnowstormModal.js | 4 +- 12 files changed, 779 insertions(+), 10 deletions(-) rename Msn.InteropDemo.Data/Migrations/{20190830161736_add_Cie10.Designer.cs => 20190831195010_add_Cie10.Designer.cs} (98%) rename Msn.InteropDemo.Data/Migrations/{20190830161736_add_Cie10.cs => 20190831195010_add_Cie10.cs} (57%) create mode 100644 Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.Designer.cs create mode 100644 Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.cs diff --git a/Msn.InteropDemo.Data/EntitiesConfiguration/Evoluciones/EvolucionDiagnosticoConfiguration.cs b/Msn.InteropDemo.Data/EntitiesConfiguration/Evoluciones/EvolucionDiagnosticoConfiguration.cs index 66fd617..bef31c0 100644 --- a/Msn.InteropDemo.Data/EntitiesConfiguration/Evoluciones/EvolucionDiagnosticoConfiguration.cs +++ b/Msn.InteropDemo.Data/EntitiesConfiguration/Evoluciones/EvolucionDiagnosticoConfiguration.cs @@ -16,7 +16,20 @@ public void Configure(EntityTypeBuilder x.Cie10SubcategoriaId) + .HasMaxLength(4) + .HasColumnType("char(4)") + .IsRequired(false) + .IsUnicode(false); + + builder.Property(x => x.Cie10SubcategoriaNombre) + .HasMaxLength(300) + .IsRequired(false) + .IsUnicode(); + builder.HasIndex(x => x.SctConceptId); + + builder.HasIndex(x => x.Cie10SubcategoriaId); } } } diff --git a/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs b/Msn.InteropDemo.Data/Migrations/20190831195010_add_Cie10.Designer.cs similarity index 98% rename from Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs rename to Msn.InteropDemo.Data/Migrations/20190831195010_add_Cie10.Designer.cs index 2221f41..092a259 100644 --- a/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.Designer.cs +++ b/Msn.InteropDemo.Data/Migrations/20190831195010_add_Cie10.Designer.cs @@ -9,7 +9,7 @@ namespace Msn.InteropDemo.Data.Migrations { [DbContext(typeof(DataContext))] - [Migration("20190830161736_add_Cie10")] + [Migration("20190831195010_add_Cie10")] partial class add_Cie10 { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -279,6 +279,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Id") .ValueGeneratedOnAdd(); + b.Property("Cie10SubcategoriaId") + .HasColumnType("char(4)") + .HasMaxLength(4) + .IsUnicode(false); + b.Property("EvolucionId"); b.Property("SctConceptId") @@ -292,6 +297,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("Cie10SubcategoriaId"); + b.HasIndex("EvolucionId"); b.HasIndex("SctConceptId"); diff --git a/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs b/Msn.InteropDemo.Data/Migrations/20190831195010_add_Cie10.cs similarity index 57% rename from Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs rename to Msn.InteropDemo.Data/Migrations/20190831195010_add_Cie10.cs index e77720c..6f6b036 100644 --- a/Msn.InteropDemo.Data/Migrations/20190830161736_add_Cie10.cs +++ b/Msn.InteropDemo.Data/Migrations/20190831195010_add_Cie10.cs @@ -6,6 +6,14 @@ public partial class add_Cie10 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.AddColumn( + name: "Cie10SubcategoriaId", + table: "EvolucionDiagnostico", + type: "char(4)", + unicode: false, + maxLength: 4, + nullable: true); + migrationBuilder.CreateTable( name: "Cie10", columns: table => new @@ -18,12 +26,25 @@ protected override void Up(MigrationBuilder migrationBuilder) { table.PrimaryKey("PK_Cie10", x => x.SubcategoriaId); }); + + migrationBuilder.CreateIndex( + name: "IX_EvolucionDiagnostico_Cie10SubcategoriaId", + table: "EvolucionDiagnostico", + column: "Cie10SubcategoriaId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Cie10"); + + migrationBuilder.DropIndex( + name: "IX_EvolucionDiagnostico_Cie10SubcategoriaId", + table: "EvolucionDiagnostico"); + + migrationBuilder.DropColumn( + name: "Cie10SubcategoriaId", + table: "EvolucionDiagnostico"); } } } diff --git a/Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.Designer.cs b/Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.Designer.cs new file mode 100644 index 0000000..042fde7 --- /dev/null +++ b/Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.Designer.cs @@ -0,0 +1,642 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Msn.InteropDemo.Data.Context; + +namespace Msn.InteropDemo.Data.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20190831200942_Evolucion_Diagnostico_add_SubCatNombre")] + partial class Evolucion_Diagnostico_add_SubCatNombre + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079"); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ActivityRequest") + .HasMaxLength(1000) + .IsUnicode(false); + + b.Property("ActivityRequestBody"); + + b.Property("ActivityRequestUI"); + + b.Property("ActivityResponse") + .HasMaxLength(1000) + .IsUnicode(false); + + b.Property("ActivityResponseBody"); + + b.Property("ActivityTypeDescriptorId"); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("Enabled"); + + b.Property("RequestIsJson"); + + b.Property("RequestIsURL"); + + b.Property("ResponseIsJson"); + + b.Property("ResponseIsURL"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("SessionUserId") + .IsRequired() + .HasMaxLength(200) + .IsUnicode(false); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeDescriptorId"); + + b.HasIndex("CreatedDateTime"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("SessionUserId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("ActivityLog"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityTypeDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Enabled"); + + b.Property("Nombre") + .IsRequired() + .HasColumnType("varchar(50)") + .HasMaxLength(200) + .IsUnicode(false); + + b.Property("Orden"); + + b.HasKey("Id"); + + b.ToTable("ActivityTypeDescriptor"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Codificacion.Cie10", b => + { + b.Property("SubcategoriaId") + .HasColumnType("char(4)") + .HasMaxLength(4) + .IsUnicode(false); + + b.Property("CategoriaNombre") + .IsRequired() + .HasMaxLength(300) + .IsUnicode(true); + + b.Property("SubcategoriaNombre") + .IsRequired() + .HasMaxLength(300) + .IsUnicode(true); + + b.HasKey("SubcategoriaId"); + + b.ToTable("Cie10"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("Enabled"); + + b.Property("Observacion") + .HasMaxLength(500) + .IsUnicode(true); + + b.Property("PacienteId"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("CreatedDateTime"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("PacienteId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("Evolucion"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionDiagnostico", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cie10SubcategoriaId") + .HasColumnType("char(4)") + .HasMaxLength(4) + .IsUnicode(false); + + b.Property("Cie10SubcategoriaNombre") + .HasMaxLength(300) + .IsUnicode(true); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("Cie10SubcategoriaId"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionDiagnostico"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionMedicamento", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionMedicamento"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionVacunaAplicacion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EvolucionId"); + + b.Property("SctConceptId") + .IsRequired() + .HasColumnType("numeric(18,0)"); + + b.Property("SctDescriptionTerm") + .IsRequired() + .HasMaxLength(500) + .IsUnicode(true); + + b.HasKey("Id"); + + b.HasIndex("EvolucionId"); + + b.HasIndex("SctConceptId"); + + b.ToTable("EvolucionVacunaAplicacion"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Identity.SystemUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("Apellido") + .IsRequired() + .HasMaxLength(100) + .IsUnicode(true); + + b.Property("CUIT"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("Nombre") + .IsRequired() + .HasMaxLength(100) + .IsUnicode(true); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.Paciente", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("CreatedUserId") + .IsRequired(); + + b.Property("DomicilioCalle"); + + b.Property("DomicilioCalleAltura"); + + b.Property("DomicilioCodPostal"); + + b.Property("DomicilioDepto"); + + b.Property("DomicilioPiso"); + + b.Property("Email") + .HasMaxLength(100) + .IsUnicode(false); + + b.Property("Enabled"); + + b.Property("FechaNacimiento") + .HasColumnType("Date"); + + b.Property("FederadoDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("FederadorId"); + + b.Property("NroDocumento"); + + b.Property("OtrosApellidos") + .HasMaxLength(50); + + b.Property("OtrosNombres") + .HasMaxLength(50); + + b.Property("PrimerApellido") + .IsRequired() + .HasMaxLength(50); + + b.Property("PrimerNombre") + .IsRequired() + .HasMaxLength(50); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate(); + + b.Property("Sexo") + .IsRequired() + .HasColumnType("char(1)"); + + b.Property("TipoDocumentoId"); + + b.Property("UpdatedDateTime") + .HasColumnType("SmallDateTime"); + + b.Property("UpdatedUserId"); + + b.HasKey("Id"); + + b.HasIndex("CreatedUserId"); + + b.HasIndex("TipoDocumentoId"); + + b.HasIndex("UpdatedUserId"); + + b.ToTable("Paciente"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.TipoDocumento", b => + { + b.Property("Id"); + + b.Property("Enabled"); + + b.Property("Nombre") + .IsRequired() + .HasColumnType("varchar(50)") + .HasMaxLength(50); + + b.Property("Orden"); + + b.HasKey("Id"); + + b.ToTable("TipoDocumento"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Activity.ActivityLog", b => + { + b.HasOne("Msn.InteropDemo.Entities.Activity.ActivityTypeDescriptor", "ActivityTypeDescriptor") + .WithMany() + .HasForeignKey("ActivityTypeDescriptorId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.Evolucion", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Pacientes.Paciente", "Paciente") + .WithMany() + .HasForeignKey("PacienteId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionDiagnostico", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Diagnosticos") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionMedicamento", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Medicamentos") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Evoluciones.EvolucionVacunaAplicacion", b => + { + b.HasOne("Msn.InteropDemo.Entities.Evoluciones.Evolucion", "Evolucion") + .WithMany("Vacunas") + .HasForeignKey("EvolucionId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Msn.InteropDemo.Entities.Pacientes.Paciente", b => + { + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "CreatedUser") + .WithMany() + .HasForeignKey("CreatedUserId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Pacientes.TipoDocumento", "TipoDocumento") + .WithMany() + .HasForeignKey("TipoDocumentoId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("Msn.InteropDemo.Entities.Identity.SystemUser", "UpdatedUser") + .WithMany() + .HasForeignKey("UpdatedUserId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.cs b/Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.cs new file mode 100644 index 0000000..4309296 --- /dev/null +++ b/Msn.InteropDemo.Data/Migrations/20190831200942_Evolucion_Diagnostico_add_SubCatNombre.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Msn.InteropDemo.Data.Migrations +{ + public partial class Evolucion_Diagnostico_add_SubCatNombre : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Cie10SubcategoriaNombre", + table: "EvolucionDiagnostico", + maxLength: 300, + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Cie10SubcategoriaNombre", + table: "EvolucionDiagnostico"); + } + } +} diff --git a/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs b/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs index 382c264..1c1b127 100644 --- a/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs +++ b/Msn.InteropDemo.Data/Migrations/DataContextModelSnapshot.cs @@ -277,6 +277,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Id") .ValueGeneratedOnAdd(); + b.Property("Cie10SubcategoriaId") + .HasColumnType("char(4)") + .HasMaxLength(4) + .IsUnicode(false); + + b.Property("Cie10SubcategoriaNombre") + .HasMaxLength(300) + .IsUnicode(true); + b.Property("EvolucionId"); b.Property("SctConceptId") @@ -290,6 +299,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("Cie10SubcategoriaId"); + b.HasIndex("EvolucionId"); b.HasIndex("SctConceptId"); diff --git a/Msn.InteropDemo.Data/Msn.InteropDemo.Data.csproj b/Msn.InteropDemo.Data/Msn.InteropDemo.Data.csproj index 2d00501..7885de2 100644 --- a/Msn.InteropDemo.Data/Msn.InteropDemo.Data.csproj +++ b/Msn.InteropDemo.Data/Msn.InteropDemo.Data.csproj @@ -17,6 +17,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Msn.InteropDemo.Entities/Evoluciones/EvolucionDiagnostico.cs b/Msn.InteropDemo.Entities/Evoluciones/EvolucionDiagnostico.cs index 5560976..0096036 100644 --- a/Msn.InteropDemo.Entities/Evoluciones/EvolucionDiagnostico.cs +++ b/Msn.InteropDemo.Entities/Evoluciones/EvolucionDiagnostico.cs @@ -11,5 +11,9 @@ public class EvolucionDiagnostico public decimal? SctConceptId { get; set; } public string SctDescriptionTerm { get; set; } + + public string Cie10SubcategoriaId { get; set; } + + public string Cie10SubcategoriaNombre { get; set; } } } diff --git a/Msn.InteropDemo.ViewModel/Evoluciones/EvolucionDiagnosticoViewModel.cs b/Msn.InteropDemo.ViewModel/Evoluciones/EvolucionDiagnosticoViewModel.cs index 9050d17..9eaf8ea 100644 --- a/Msn.InteropDemo.ViewModel/Evoluciones/EvolucionDiagnosticoViewModel.cs +++ b/Msn.InteropDemo.ViewModel/Evoluciones/EvolucionDiagnosticoViewModel.cs @@ -12,5 +12,9 @@ public class EvolucionDiagnosticoViewModel public decimal? SctConceptId { get; set; } public string SctDescriptionTerm { get; set; } + + public string Cie10SubcategoriaId { get; set; } + + public string Cie10SubcategoriaNombre { get; set; } } } diff --git a/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs b/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs index 8997a02..b0e89bb 100644 --- a/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs +++ b/Msn.InteropDemo.Web/Areas/Seguimiento/Controllers/EvolucionarController.cs @@ -152,6 +152,7 @@ public JsonResult GetMapeoCie10(string conceptId) } [HttpPost] + [ValidateAntiForgeryToken] public JsonResult SaveEvolucion(ViewModel.Evoluciones.EvolucionViewModel model) { try diff --git a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js index 9ff2cf3..96f76c6 100644 --- a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js +++ b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js @@ -176,18 +176,13 @@ function saveEvolucion() { var item = { SctConceptId: this.id, SctDescriptionTerm: strTerm, - Cie10SubcategoriId: cie10Id, - Cie10SubcategoriText: cie10Text + Cie10SubcategoriaId: cie10Id, + Cie10SubcategoriaNombre: cie10Text }; - console.log(item); - dataToPost.Diagnosticos.push(item); }); - - //PARA TEST - return; - + //Table Vacunas $('#tableVacunas > tbody > tr').each(function () { var item = { diff --git a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js index de5c860..58cef66 100644 --- a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js +++ b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/SearchSnowstormModal.js @@ -163,14 +163,16 @@ function mapToCie10(id) { if (data.success) { var nexElement = '' + data.item.subcategoriaNombre + ''; + var str = 'CIE10: ' + data.item.subcategoriaId + ' - '; container.hide('slow', function () { container.attr('id', data.item.subcategoriaId); container.text(str); container.addClass('cie10MappedId text-success'); - $(nexElement).insertAfter(container); container.show('slow'); + $(nexElement).insertAfter(container).hide().show('slow'); }); + } else { container.text('CIE10: No Encontrado'); container.addClass('text-danger'); From 6cac23a79abe1aeba87d41366a9e61a76c1830e5 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Sat, 31 Aug 2019 18:15:35 -0300 Subject: [PATCH 5/8] Vista de Mapeo Obtenido de CIe10 --- .../Evolucionar/EvolucionarPaciente.js | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js index 96f76c6..797c1c5 100644 --- a/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js +++ b/Msn.InteropDemo.Web/wwwroot/js/Views/Seguimiento/Evolucionar/EvolucionarPaciente.js @@ -42,6 +42,7 @@ function loadEvolucion(id) { var btnMenuFecha = $('#btnMenuFecha' + id); var currentFechaConsultaText = $('#currentFechaConsultaText'); var currentConsultaProfesionalFullname = $('#currentConsultaProfesionalFullname'); + var textAreaObservacion = $('#textAreaObservacion'); $('.btn-menu-fechas').each(function () { $(this).removeClass('active'); @@ -53,6 +54,7 @@ function loadEvolucion(id) { btnSearchMedicamentos.css('display', 'none'); btnSaveEvolucion.css('display', 'none'); nuevaConsultaTitulo.hide('slow'); + textAreaObservacion.prop('readonly', true); var loc = window.rootUrl + "Seguimiento/Evolucionar/GetEvolucion/" + id; @@ -77,9 +79,31 @@ function loadEvolucion(id) { $("#tableHallazgos > tbody > tr").remove(); $.each(data.evolucion.diagnosticos, function (i, item) { + trHTML += ''; - trHTML += '' + item.sctDescriptionTerm + ''; - trHTML += ''; + + if (!item.cie10SubcategoriaId) { + //trHTML += '' + item.sctDescriptionTerm + ''; + //trHTML += ''; + trHTML += '' + + '
' + item.sctDescriptionTerm + '
' + + '
SctId: ' + item.sctConceptId + ' --> ' + + '(No mapeado)' + + '
' + + ''; + } + else { + trHTML += '' + + '
' + item.sctDescriptionTerm + '
' + + '
SctId: ' + item.sctConceptId + + ' --> CIE10: ' + item.cie10SubcategoriaId + ' - ' + + '' + item.cie10SubcategoriaNombre + '' + + '
' + + ''; + } + + //trHTML += '' + item.sctDescriptionTerm + ''; + //trHTML += ''; }); $('#tableHallazgos').append(trHTML); @@ -121,23 +145,25 @@ function setupNuevaEvolucion() { var btnSearchVacunas = $('#btnSearchVacunas'); var btnSearchMedicamentos = $('#btnSearchMedicamentos'); var btnSaveEvolucion = $('#btnSaveEvolucion'); - var currentConsultaFecha = $('#currentConsultaFecha'); var nuevaConsultaTitulo = $('#nuevaConsultaTitulo'); + var textAreaObservacion = $('#textAreaObservacion'); currentConsultaFecha.hide('slow'); nuevaConsultaTitulo.show('slow'); - btnSerachHallazgos.show('slow'); btnSearchVacunas.show('slow'); btnSearchMedicamentos.show('slow'); btnSaveEvolucion.show('slow'); + textAreaObservacion.prop('readonly', false); + + + textAreaObservacion.val(''); $('#evolucionId').val(''); $("#tableHallazgos > tbody > tr").remove(); $("#tableMedicamentos > tbody > tr").remove(); $("#tableVacunas > tbody > tr").remove(); - $('#textAreaObservacion').val(''); $('.btn-menu-fechas').each(function () { $(this).removeClass('active'); From c62cf0afb928bab885ce87db497379cc9f22a001 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Sat, 31 Aug 2019 18:36:23 -0300 Subject: [PATCH 6/8] Se agregar link a GitHub y favicon --- Msn.InteropDemo.Web/Views/Home/Index.cshtml | 3 ++- Msn.InteropDemo.Web/wwwroot/favicon.ico | Bin 32038 -> 1150 bytes 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Msn.InteropDemo.Web/Views/Home/Index.cshtml b/Msn.InteropDemo.Web/Views/Home/Index.cshtml index 375e323..d86f2e4 100644 --- a/Msn.InteropDemo.Web/Views/Home/Index.cshtml +++ b/Msn.InteropDemo.Web/Views/Home/Index.cshtml @@ -7,7 +7,8 @@

Open-RSD

Este es un proyecto educativo, que demuestra cómo un sistema se conecta con la Red de Salud Digital, parte de la Estrategia de Salud Digital de la República Argentina.

-

Open-RSD contiene las funcionalidades básicas de un Índice Maestro de Pacientes y una Historia clínica electrónica.

+

Open-RSD contiene las funcionalidades básicas de un Índice Maestro de Pacientes y un +

Puede descargar el código fuente del GitHub de la DNSIS Open-RSD

Ingresar »

diff --git a/Msn.InteropDemo.Web/wwwroot/favicon.ico b/Msn.InteropDemo.Web/wwwroot/favicon.ico index a3a799985c43bc7309d701b2cad129023377dc71..3e00cbd6dbab62cf5a5a99b0eda30829ef52c30e 100644 GIT binary patch literal 1150 zcmaizTS!xJ9LIlRBPBBFA*hgg>?tr`40?*_f<*LKNE8@(qtwjAu(YVu%v3ZYtb8c1 z7*^mwB%HdbTkc}HxvjW>)WmCU+Z&7f9*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&4!QDgBndn?3sNKYKCQFU4LGKJ$n@Je$&w9@E$X z^p@iJ(v&`1(tq~1zc>0Vow-KR&vm!GUzT?Eqgnc)leZ9p)-Z*C!zqb=-$XG0 z^!8RfuQs5s>Q~qcz92(a_Q+KH?C*vCTr~UdTiR`JGuNH8v(J|FTiSEcPrBpmHRtmd zI2Jng0J=bXK);YY^rM?jzn?~X-Pe`GbAy{D)Y6D&1GY-EBcy%Bq?bKh?A>DD9DD!p z?{q02wno2sraGUkZv5dx+J8)&K$)No43Zr(*S`FEdL!4C)}WE}vJd%{S6-3VUw>Wp z?Aasv`T0^%P$2vE?L+Qhj~qB~K%eW)xH(=b_jU}TLD&BP*Pc9hz@Z=e0nkpLkWl}> z_5J^i(9Z7$(XG9~I3sY)`OGZ#_L06+Dy4E>UstcP-rU@xJ$&rxvo!n1Ao`P~KLU-8 z{zDgN4-&A6N!kPSYbQ&7sLufi`YtE2uN$S?e&5n>Y4(q#|KP!cc1j)T^QrUXMPFaP z_SoYO8S8G}Z$?AL4`;pE?7J5K8yWqy23>cCT2{=-)+A$X^-I9=e!@J@A&-;Ufc)`H}c(VI&;0x zrrGv()5mjP%jXzS{^|29?bLNXS0bC%p!YXI!;O457rjCEEzMkGf~B3$T}dXBO23tP z+Ci>;5UoM?C@bU@f9G1^X3=ly&ZeFH<@|RnOG--A&)fd)AUgjw?%izq{p(KJ`EP0v z2mU)P!+3t@X14DA=E2RR-|p${GZ9ETX=d+kJRZL$nSa0daI@&oUUxnZg0xd_xu>Vz lzF#z5%kSKX?YLH3ll^(hI(_`L*t#Iva2Ede*Z;>H_ Date: Sun, 1 Sep 2019 20:46:39 -0300 Subject: [PATCH 7/8] =?UTF-8?q?Fix=20en=20Home.=20Configuraci=C3=B3n=20com?= =?UTF-8?q?pleta=20del=20usuario.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Identity/Pages/Account/Login.cshtml.cs | 19 ++++++++++++++++++- .../Pages/Account/Manage/Index.cshtml | 7 +++++++ .../Pages/Account/Manage/Index.cshtml.cs | 6 ++++-- .../Account/Manage/_MustConfigAccount.cshtml | 5 +++++ Msn.InteropDemo.Web/Views/Home/Index.cshtml | 3 +-- 5 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs index dacd7a5..0de1702 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -15,11 +15,15 @@ namespace Msn.InteropDemo.Web.Areas.Identity.Pages.Account [AllowAnonymous] public class LoginModel : PageModel { + private readonly UserManager _userManager; private readonly SignInManager _signInManager; private readonly ILogger _logger; - public LoginModel(SignInManager signInManager, ILogger logger) + public LoginModel(UserManager userManager, + SignInManager signInManager, + ILogger logger) { + _userManager = userManager; _signInManager = signInManager; _logger = logger; } @@ -77,9 +81,22 @@ public async Task OnPostAsync(string returnUrl = null) var result = await _signInManager.PasswordSignInAsync(Input.UserName, Input.Password, Input.RememberMe, lockoutOnFailure: false); if (result.Succeeded) { + var sysUser = _userManager.FindByNameAsync(Input.UserName).Result; + if (sysUser != null) + { + if (string.IsNullOrWhiteSpace(sysUser.Email) || !sysUser.CUIT.HasValue) + { + return RedirectToPage("Manage/Index", new { mustCongifAccount = true }); + } + } + _logger.LogInformation("User logged in."); return LocalRedirect(returnUrl); } + + + + //if (result.RequiresTwoFactor) //{ // return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe }); diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml index 64c6ab9..f697626 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml @@ -6,7 +6,14 @@ }

@ViewData["Title"]

+ +@if ((bool)ViewData["MustCongifAccount"]) +{ + +} + +
diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs index e3a96ae..a8f2270 100644 --- a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs @@ -55,8 +55,10 @@ public class InputModel public string CUIT { get; set; } } - public async Task OnGetAsync() + public async Task OnGetAsync(bool mustCongifAccount = false) { + ViewData.Add("MustCongifAccount", mustCongifAccount); + var user = await _userManager.GetUserAsync(User); if (user == null) { @@ -120,7 +122,7 @@ public async Task OnPostAsync() await _userManager.UpdateAsync(user); await _signInManager.RefreshSignInAsync(user); StatusMessage = "Su cuenta ha sido actualizada."; - return RedirectToPage(); + return RedirectToPage(new { mustCongifAccount = false }); } public async Task OnPostSendVerificationEmailAsync() diff --git a/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml new file mode 100644 index 0000000..17318fd --- /dev/null +++ b/Msn.InteropDemo.Web/Areas/Identity/Pages/Account/Manage/_MustConfigAccount.cshtml @@ -0,0 +1,5 @@ + + diff --git a/Msn.InteropDemo.Web/Views/Home/Index.cshtml b/Msn.InteropDemo.Web/Views/Home/Index.cshtml index d86f2e4..f9ff116 100644 --- a/Msn.InteropDemo.Web/Views/Home/Index.cshtml +++ b/Msn.InteropDemo.Web/Views/Home/Index.cshtml @@ -2,12 +2,11 @@ ViewData["Title"] = "Inicio"; } -

Open-RSD

Este es un proyecto educativo, que demuestra cómo un sistema se conecta con la Red de Salud Digital, parte de la Estrategia de Salud Digital de la República Argentina.

-

Open-RSD contiene las funcionalidades básicas de un Índice Maestro de Pacientes y un +

Open-RSD contiene las funcionalidades básicas de un Índice Maestro de Pacientes y una Historia clínica electrónica.

Puede descargar el código fuente del GitHub de la DNSIS Open-RSD

Ingresar »

From 5f153e705dac1476f26317e13ca2386c83fdaa94 Mon Sep 17 00:00:00 2001 From: Miguel Amorese Date: Sun, 1 Sep 2019 23:27:20 -0300 Subject: [PATCH 8/8] Se incorpora template al Bin en Build --- Msn.InteropDemo.Web/Msn.InteropDemo.Web.csproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Msn.InteropDemo.Web/Msn.InteropDemo.Web.csproj b/Msn.InteropDemo.Web/Msn.InteropDemo.Web.csproj index 3048975..444dbd3 100644 --- a/Msn.InteropDemo.Web/Msn.InteropDemo.Web.csproj +++ b/Msn.InteropDemo.Web/Msn.InteropDemo.Web.csproj @@ -81,6 +81,13 @@ + + + Always + + + +