private static Practitioner ExtractEmbeddedPractitioner(MedicationRequest medicationRequest) { var agentReference = medicationRequest.Requester?.Agent; if (agentReference == null) { return(null); } return(medicationRequest.GetReferencedResource(agentReference, (reference) => new Practitioner { Name = new System.Collections.Generic.List <HumanName> { new HumanName { Text = agentReference.Display } } })); }