Documentation modifications

This commit is contained in:
julian
2026-06-27 15:23:26 -07:00
parent a633fe6c06
commit a19fb90902
218 changed files with 2882 additions and 0 deletions
@@ -13,12 +13,20 @@ namespace adas_core.Infrastructure.Migrations.MongoMigrations;
/// </remarks>
public class U_0_1_0_UpdateDataPatien : Migration
{
/// <summary>
/// Initializes a new instance of the <see cref="U_0_1_0_UpdateDataPatien"/> migration, passing the version <c>10</c> to the base constructor and assigning the Description that explains how person historical identifiers and locations are transformed into date-indexed arrays and merged into patients.
/// </summary>
/// <!-- aidoc:v1 sig=ccd8376 body=50d3df0 -->
public U_0_1_0_UpdateDataPatien() : base(10)
{
Description =
"Transforma person.historicalIds y historicalLocations en arrays con fechas y realiza merge sobre patients.";
}
/// <summary>
/// Migrates <c>person.historicalIds</c> and <c>historicalLocations</c> fields in the <c>patients</c>, <c>admissions</c>, and <c>archive_patient</c> MongoDB collections from a document representation to an array of objects, converting each key (a date string) into a <c>Date</c> value via <c>$dateFromString</c>. If a field is already an array it is preserved unchanged; otherwise it is reshaped using <c>$objectToArray</c> and <c>$map</c>, and the result is merged back into the same collection with <c>$merge</c>.
/// </summary>
/// <!-- aidoc:v1 sig=2ec5b05 body=7693e10 -->
public override void Update()
{
var collectionPatient = Database.GetCollection<BsonDocument>("patients");
@@ -231,6 +239,10 @@ public class U_0_1_0_UpdateDataPatien : Migration
// NO usado por MongoMigrations.Core
// Solo para ejecución manual si hiciera falta
/// <summary>
/// Reverts a schema migration on the <c>patients</c>, <c>admissions</c>, and <c>archive_patient</c> MongoDB collections by converting array representations of <c>person.historicalIds</c> and <c>historicalLocations</c> back into documents keyed by an ISO-8601 timestamp. When the target fields are already documents they are left unchanged via a <c>$cond</c> guard, and each aggregation result is persisted back to its source collection using <c>$merge</c> with <c>whenMatched: replace</c>.
/// </summary>
/// <!-- aidoc:v1 sig=6a4f4d3 body=e02e3dc -->
public void Down()
{
var collectionPatient = Database.GetCollection<BsonDocument>("patients");
@@ -12,6 +12,10 @@ namespace adas_core.Infrastructure.Migrations.MongoMigrations;
/// </remarks>
public class U_0_1_2_UpdatePointOfCareConfig : Migration
{
/// <summary>
/// Initializes a new instance of <see cref="U_0_1_2_UpdatePointOfCareConfig"/>, assigning a Description stating that it removes the PointOfCare configuration elements for poc, relay, camera, and beacon while keeping the placeholder for the new model, and passing 12 to the base constructor.
/// </summary>
/// <!-- aidoc:v1 sig=9495cc3 body=582e2e0 -->
public U_0_1_2_UpdatePointOfCareConfig() : base(12)
{
Description =
@@ -9,12 +9,20 @@ namespace adas_core.Infrastructure.Migrations.MongoMigrations;
/// </summary>
public class U_0_1_3_UpdateLanguageBarrier : Migration
{
/// <summary>
/// Initializes a new instance of the <see cref="U_0_1_3_UpdateLanguageBarrier"/> class, passing identifier <c>13</c> to the base constructor and assigning the Description property to describe the removal of poc, relay, camera and beacon configuration elements for the new model.
/// </summary>
/// <!-- aidoc:v1 sig=5e97941 body=582e2e0 -->
public U_0_1_3_UpdateLanguageBarrier() : base(13)
{
Description =
"Borra los elementos de configuracion de poc, relay, camera y beacon y deja el place holder del nuevo modelo";
}
/// <summary>
/// Converts the <c>languageBarrier</c> field in the <c>patients</c> and <c>admissions</c> collections from a scalar value into a <see cref="MongoDB.Bson.BsonArray"/>, preserving the original value as the first element when it is not null. Documents where the field is already an array are left untouched, and null values are replaced with an empty array.
/// </summary>
/// <!-- aidoc:v1 sig=2ec5b05 body=932d7f9 -->
public override void Update()
{
string[] collectionsToUpdate = { "patients", "admissions" };