Example #1
0
 protected RecordItem(Guid key, IPatientGrain patient, IUserGrain reporter, SecurityLevel securityLabel, string description, RecordType type, DateTime timestamp, RecordItemResult result)
 {
     Key           = key;
     Patient       = patient;
     Reporter      = reporter;
     SecurityLabel = securityLabel;
     Description   = description;
     Type          = type;
     Timestamp     = timestamp;
     Result        = result;
 }
Example #2
0
        public async Task <bool> RegisterTestResult(RecordItemResult result)
        {
            logger.LogInformation($"{state.State.item.Result}");
            if (state.State.item.Result != null)
            {
                return(false);
            }
            state.State.item = state.State.item.WithResult(result);

            // Notify aggregator, Notify Doctor, Notify patient
            await GrainFactory.GetGrain <IAggregatorWorker>(0).AddRecord(state.State.item);

            await state.WriteStateAsync();

            return(true);
        }
Example #3
0
 public RecordItem WithResult(RecordItemResult result) =>
 new RecordItem(Key, Patient, Reporter, SecurityLabel, Description, Type, Timestamp, result);