Skip to content

Commit

Permalink
TMH | Veena | Fixes codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Veena-tw committed Jul 28, 2020
1 parent 1a8a29b commit ab4ddf0
Showing 1 changed file with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions src/In.ProjectEKA.TMHHip/DataFlow/Collect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,16 @@ private static IEnumerable<CareBundle> ProcessObservationsData(DataRequest dataR
}
}

if (tmhPatientData.SurgeryHistories == null || !tmhPatientData.SurgeryHistories.Any()) return careBundles;
if (tmhPatientData.SurgeryHistories != null && tmhPatientData.SurgeryHistories.Any())
{
var surgeryHistoriesData =
FetchSurgeryHistoryData(dataRequest, tmhPatientData.SurgeryHistories, patientName).GetAwaiter()
.GetResult();
if (!surgeryHistoriesData.HasValue) return careBundles;
if (!surgeryHistoriesData.HasValue)
{
return careBundles;
}

var serializeObject = JsonConvert.SerializeObject(
surgeryHistoriesData.ValueOr((ObservationResponse) null),
jsonSerializerSettings);
Expand Down Expand Up @@ -282,7 +286,11 @@ private static async Task<Option<MedicationResponse>> FindMedicationRequestData(
list.Add(medicationRepresentation);
}

if (!list.Any()) return Option.None<MedicationResponse>();
if (!list.Any())
{
return Option.None<MedicationResponse>();
}

var medicationResponse = new MedicationResponse
{
Entry = list,
Expand All @@ -309,7 +317,11 @@ where WithinRange(dataRequest.DateRange, clinicalNote.CreatedDate)
clinicalNote.CreatedDate, clinicalNote.Note),
}).ToList();

if (!observations.Any()) return Option.None<ObservationResponse>();
if (!observations.Any())
{
return Option.None<ObservationResponse>();
}

var observationResponse = new ObservationResponse
{
Entry = observations,
Expand Down Expand Up @@ -340,7 +352,11 @@ where WithinRange(dataRequest.DateRange, swellingSymptomData.RecordedDate)
}),
}).Cast<ICondition>().ToList();

if (!conditions.Any()) return Option.None<ConditionResponse>();
if (!conditions.Any())
{
return Option.None<ConditionResponse>();
}

var conditionResponse = new ConditionResponse
{
Entry = conditions,
Expand All @@ -367,7 +383,11 @@ where WithinRange(dataRequest.DateRange, allergyData.AllergyDate)
new List<Note> {new Note(allergyData.AllergyRemark)}),
}).ToList();

if (!observations.Any()) return Option.None<ObservationResponse>();
if (!observations.Any())
{
return Option.None<ObservationResponse>();
}

var observationResponse = new ObservationResponse
{
Entry = observations,
Expand All @@ -394,7 +414,11 @@ where WithinRange(dataRequest.DateRange, abdomenExaminationData.EffectiveDateTim
abdomenExaminationData.CAbdomen),
}).ToList();

if (!observations.Any()) return Option.None<ObservationResponse>();
if (!observations.Any())
{
return Option.None<ObservationResponse>();
}

var observationResponse = new ObservationResponse
{
Entry = observations,
Expand Down Expand Up @@ -422,7 +446,11 @@ where WithinRange(dataRequest.DateRange, surgeryHistory.SurgeryWhen)
new List<Note> {new Note(surgeryHistory.SurgeryRemarks)}),
}).ToList();

if (!observations.Any()) return Option.None<ObservationResponse>();
if (!observations.Any())
{
return Option.None<ObservationResponse>();
}

var observationResponse = new ObservationResponse
{
Entry = observations,
Expand Down Expand Up @@ -475,7 +503,11 @@ private static async Task<Option<ObservationResponse>> FetchOralCavityExaminatio
observations.Add(new OralCavityExaminationObservationRepresention(buccalmcsaResource));
}

if (!observations.Any()) return Option.None<ObservationResponse>();
if (!observations.Any())
{
return Option.None<ObservationResponse>();
}

var oralCavityExmResponse = new ObservationResponse
{
Entry = observations,
Expand Down

0 comments on commit ab4ddf0

Please sign in to comment.