Beispiel #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;
 }
Beispiel #2
0
        public async Task <List <IRecordGrain> > GetRecordsFromPatient(IPatientGrain patient)
        {
            var records     = new List <IRecordGrain>();
            var recordGuids = await patient.GetAllRecords();

            foreach (var recordGuid in recordGuids)
            {
                records.Add(this.GrainFactory.GetGrain <IRecordGrain>(recordGuid));
            }
            return(records);
        }
Beispiel #3
0
        public static RecordItem genRecordItem(Guid guid, IPatientGrain patient, IUserGrain reporter, Random random)
        {
            var type = (RecordType)random.Next(0, 2);

            var record = new RecordItem(guid, patient, reporter, SecurityLevel.Private, "Random description", type);

            // half of the records have results with them
            if (random.Next(0, 2) == 0)
            {
                var RecordItemResult = genRecordItemResult(guid, reporter, random);
                return(record.WithResult(RecordItemResult));
            }

            return(record);
        }
Beispiel #4
0
 public RecordItem(Guid key, IPatientGrain patient, IUserGrain reporter, SecurityLevel securityLabel, string description, RecordType type)
     : this(key, patient, reporter, securityLabel, description, type, DateTime.UtcNow, null)
 {
 }