moved functionality from fhirbase