func encounterEvent(id, name, snomedCode string, start time.Time) plugin.Event { encounter := new(models.Encounter) encounter.Id = id encounter.Type = []models.CodeableConcept{ { Coding: []models.Coding{ models.Coding{System: "http://snomed.info/sct", Code: snomedCode, Display: name}, }, Text: name, }, } encounter.Period = &models.Period{ Start: &models.FHIRDateTime{Time: start, Precision: models.Timestamp}, } encounter.Status = "finished" return plugin.Event{ Date: start, Type: "Encounter", End: false, Value: encounter, } }