void CreateNote(NoteDescriptor n) { switch (n.noteType) { case NoteType.Normal: // create a normal note at the center GameObject go = Instantiate(singleNotePrefab) as GameObject; SingleNote note = go.GetComponent <SingleNote>(); note.noteType = NoteType.Normal; note.startTime = currTime; note.arriveTime = n.arriveTime; note.angle_deg = n.angle_deg; note.velocity = ringRad / flyTime; note.time = n.arriveTime; queues[(int)n.angle_deg / deg_perqueue].Enqueue(note); break; case NoteType.Long: go = Instantiate(longNotePrefab) as GameObject; LongNote ln = go.GetComponent <LongNote>(); ln.noteType = NoteType.Long; ln.startTime = currTime; ln.headArriveTime = n.arriveTime; ln.tailArriveTime = n.endTime; ln.angle_deg = n.angle_deg; ln.velocity = ringRad / flyTime; ln.time = n.arriveTime; queues[(int)n.angle_deg / deg_perqueue].Enqueue(ln); break; case NoteType.Special: go = Instantiate(specialNotePrefab) as GameObject; go.transform.parent = null; SpecialNote sn = go.GetComponent <SpecialNote>(); sn.noteType = NoteType.Special; sn.startTime = currTime; sn.arriveTime = n.arriveTime; sn.angle_deg = n.angle_deg; sn.velocity = ringRad / flyTime; sn.time = n.arriveTime; queues[(int)n.angle_deg / deg_perqueue].Enqueue(sn); break; default: break; } }
public async Task <IEnumerable <PhysicalExamAntiAgingViewModel> > GetExamAntiAgingByEpiRowIdAsync(long epiRowId) { var physicalExam = await _questionnaireRepository.GetPhysicalExamAntiAgingAsync(epiRowId); var results = new List <PhysicalExamAntiAgingViewModel>(); foreach (var item in physicalExam) { var history = new History() { QCC = item.QCC, QCCText = item.QCCText, QCCOtherText = item.QCCOtherText, QUnderlying = item.QUnderlying, QCurrentMed = item.QCurrentMed, QSupplementation = item.QSupplementation, QHistoryInvestigation = item.QHistoryInvestigation, QGI = item.QGI, QGOText = item.QGOText, QSleep = item.QSleep, QSleepHours = item.QSleepHours, QSleepText = item.QSleepText, QSkin = item.QSkin, QSkinText = item.QSkinText, QMemory = item.QMemory, QMemoryText = item.QMemoryText, QImmune = item.QImmune, QImmuneText = item.QImmuneText, QSexual = item.QSexual, QSexualText = item.QSexualText, QExercise = item.QExercise, }; var isHistory = history.GetType().GetProperties() .Where(h => h.GetValue(history) is string) .Select(h => (string)h.GetValue(history)) .Any(value => !String.IsNullOrEmpty(value)); var genetic = new Genetic() { QGenetic = item.QGenetic }; var isGenetic = genetic.GetType().GetProperties() .Where(g => g.GetValue(genetic) is string) .Select(g => (string)g.GetValue(genetic)) .Any(value => !String.IsNullOrEmpty(value)); var familyHistory = new FamilyHistory() { QFamilyFather = item.QFamilyFather, QFamilyMother = item.QFamilyMother }; var isFamilyHistory = familyHistory.GetType().GetProperties() .Where(f => f.GetValue(familyHistory) is string) .Select(f => (string)f.GetValue(familyHistory)) .Any(value => !String.IsNullOrEmpty(value)); var physicalExamination = new PhysicalExamination() { QENTPE = item.QENTPE, QAbdomenPE = item.QAbdomenPE, QAbdomenPEText = item.QAbdomenPEText, QCardiovascularPE = item.QCardiovascularPE, QCardiovascularPEText = item.QCardiovascularPEText, QENTNeckNode = item.QENTNeckNode, QENTPEText = item.QENTPEText, QENTPharynx = item.QENTPharynx, QENTTonsils = item.QENTTonsils, QGeneralPE = item.QGeneralPE, QGeneralPEText = item.QGeneralPEText, QPEText = item.QPEText, QRespiratoryPE = item.QRespiratoryPE, QRespiratoryPEText = item.QRespiratoryPEText }; var isPhysicalExamination = physicalExamination.GetType().GetProperties() .Where(p => p.GetValue(physicalExamination) is string) .Select(p => (string)p.GetValue(physicalExamination)) .Any(value => !String.IsNullOrEmpty(value)); var specialNote = new SpecialNote() { QSpecialNote = item.QSpecialNote }; var model = new PhysicalExamAntiAgingViewModel() { ID = item.ID, QUESPAAdmDR = item.QUESPAAdmDR, QUESPAPatMasDR = item.QUESPAPatMasDR, QUESDate = item.QUESDate, QUESTime = item.QUESTime, History = history, IsHistory = isHistory, Genetic = genetic, IsGenetic = isGenetic, FamilyHistory = familyHistory, IsFamilyHistory = isFamilyHistory, PhysicalExamination = physicalExamination, IsPhysicalExamination = isFamilyHistory, SpecialNote = specialNote, QDoctor = item.QDoctor, QUESUserDR = item.QUESUserDR }; results.Add(model); } return(results); }