activeAllergyIntoleranceInEncounter static method
List<AllergyIntolerance>
activeAllergyIntoleranceInEncounter(
- List<
AllergyIntoleranceRelayEdge?> ? allergies
Implementation
static List<AllergyIntolerance> activeAllergyIntoleranceInEncounter(
List<AllergyIntoleranceRelayEdge?>? allergies) {
// get allergy intolerance that are active
final List<AllergyIntolerance> activeAllergyIntolerance =
activeAllergy(allergies);
// the allergy intolerance in the encounter
final List<AllergyIntolerance> activeAllergyIntoleranceInEncounter =
List<AllergyIntolerance>.empty(growable: true);
if (activeAllergyIntolerance.isEmpty) return activeAllergyIntolerance;
for (int i = 0; i < activeAllergyIntolerance.length; ++i) {
final AllergyIntolerance allergyIntolerance = activeAllergyIntolerance[i];
if (allergyIntolerance.encounter?.reference ==
getPatientInfo().encounterReference) {
activeAllergyIntoleranceInEncounter.add(allergyIntolerance);
}
}
return activeAllergyIntoleranceInEncounter;
}