=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===

This commit is contained in:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -26,6 +26,7 @@ public class ObservationDemoService(
/// <param name="patient">The patient to associate with the generated alarms.</param>
/// <param name="dataAlarmfields">The list of fields used to look up alarm configurations and produce alarms.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of mapped <see cref="PatientObservationAlarm"/> instances that were successfully resolved.</returns>
/// <!-- aidoc:v1 sig=bc2b31e body=f044666 -->
public async Task<List<PatientObservationAlarm>> GenerateAlarmByField(Patient patient, List<Field> dataAlarmfields)
{
var listToReturn = new List<PatientObservationAlarm>();
@@ -87,6 +88,7 @@ public class ObservationDemoService(
/// <param name="patient">The patient to associate the generated observations with.</param>
/// <param name="dataFields">The list of fields used to look up observation configurations and drive observation generation.</param>
/// <returns>A task that returns the list of generated <see cref="PatientObservation"/> instances; entries are omitted when no configuration is found for a field.</returns>
/// <!-- aidoc:v1 sig=1045c66 body=1145e03 -->
public async Task<List<PatientObservation>> GenerateObservationByField(Patient patient, List<Field> dataFields)
{
var listToReturn = new List<PatientObservation>();
@@ -161,6 +163,7 @@ public class ObservationDemoService(
/// <param name="patient">The patient to associate the generated grouped observation with.</param>
/// <param name="groupedField">The grouped field configuration that defines the names, results, regularity, and maximum number of observations to generate.</param>
/// <returns>A task that returns the populated <see cref="GroupedObservation"/> containing the generated observations.</returns>
/// <!-- aidoc:v1 sig=32f5cfc body=c681ea4 -->
public async Task<GroupedObservation> GenerateGroupedObservation(Patient patient, GroupedField groupedField)
{
if (groupedField.Names.IsNullOrEmpty() && groupedField.Name != null) groupedField.Names.Add(groupedField.Name);
@@ -235,6 +238,7 @@ public class ObservationDemoService(
/// <param name="firstCof">The configuration observation whose <c>DemoConfig</c> drives the value generation. If null or its <c>DemoConfig</c> is null, the method returns "-".</param>
/// <param name="prevValue">The previous value, passed through to <c>PickSingleValue</c> as context for the new random value generation.</param>
/// <returns>A list of generated values when the configuration indicates an array, or a single generated value otherwise. Null is returned when no value could be picked.</returns>
/// <!-- aidoc:v1 sig=22e46d9 body=7abbfc1 -->
private static object? GenerateValueRandom(ConfigObservation? firstCof, object? prevValue)
{
if (firstCof?.DemoConfig == null)
@@ -261,6 +265,8 @@ public class ObservationDemoService(
/// <param name="config">The configuration that defines how the value should be selected, including the list of options, the numeric range, and the selection mode.</param>
/// <param name="prevValue">The previously selected value, used as the base for percentage-based variation when generating a new numeric value; ignored when no previous integer value is available.</param>
/// <returns>A randomly selected value from the configured options or a generated numeric value clamped within the defined range; <c>null</c> when the configuration does not allow a value to be produced.</returns>
/// <!-- aidoc-review:v1 severity=medium kind=wrong_summary
/// "The summary and returns tag state the method returns null when the options list is empty, but the code throws ArgumentOutOfRangeException via rnd.Next(0) on the empty list rather than returning null." -->
private static object? PickSingleValue(DemoConfig? config, object? prevValue)
{
if (config == null) return null;