service

package
v0.0.0-...-5c38267 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: GPL-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityDefinitionService

type ActivityDefinitionService struct {
	FHIRService FHIRService
}

func NewActivityDefinitionService

func NewActivityDefinitionService(FHIRService FHIRService) ActivityDefinitionService

func (*ActivityDefinitionService) CreateActivityDefinition

func (a *ActivityDefinitionService) CreateActivityDefinition(activityDefinition fhir.ActivityDefinition, context context.Context) (*fhir.ActivityDefinition, error)

CreateActivityDefinition ...

func (*ActivityDefinitionService) GetActivityDefinition

func (a *ActivityDefinitionService) GetActivityDefinition(ID string, context context.Context) (*fhir.ActivityDefinition, error)

GetActivityDefinition ...

func (*ActivityDefinitionService) GetActivityDefinitionByName

func (a *ActivityDefinitionService) GetActivityDefinitionByName(name string, context context.Context) (*fhir.Bundle, error)

GetActiveDefinitionByName...

func (*ActivityDefinitionService) UpdateActivityDefinition

func (a *ActivityDefinitionService) UpdateActivityDefinition(activityDefinition fhir.ActivityDefinition, context context.Context) (*fhir.ActivityDefinition, error)

UpdateActivityDefinition ...

type AppointmentService

type AppointmentService struct {
	FHIRService         FHIRService
	EncounterService    EncounterService
	SlotService         SlotService
	OrganizationService OrganizationService
	UserService         UserService
	ExtensionService    ExtensionService
}

func NewAppointmentService

func NewAppointmentService(fhirService FHIRService, encounterService EncounterService, slotService SlotService, organizationService OrganizationService, userService UserService, extensionService ExtensionService) AppointmentService

func (*AppointmentService) CreateAppointment

func (a *AppointmentService) CreateAppointment(p fhir.Appointment, context context.Context) (*fhir.Appointment, error)

CreateAppointment ...

func (*AppointmentService) CreateAppointmentResponse

func (a *AppointmentService) CreateAppointmentResponse(p fhir.AppointmentResponse, context context.Context) (*fhir.AppointmentResponse, error)

CreateAppointmentResponse ...

func (*AppointmentService) GetAppointment

func (a *AppointmentService) GetAppointment(ID string, context context.Context) (*fhir.Appointment, error)

GetAppointment ...

func (*AppointmentService) GetBySlot_Count

func (a *AppointmentService) GetBySlot_Count(slotId string, context context.Context) (*float64, error)

GetBySlotCount ...

func (*AppointmentService) SaveAppointmentResponse

func (a *AppointmentService) SaveAppointmentResponse(response fhir.AppointmentResponse, accessToken string, context context.Context) (*fhir.Appointment, error)

SaveAppointmentResponse ...

func (*AppointmentService) UpdateAppointment

func (a *AppointmentService) UpdateAppointment(p fhir.Appointment, context context.Context) (*fhir.Appointment, error)

UpdateAppointment ...

type AuthService

type AuthService struct {
}

func NewAuthService

func NewAuthService() AuthService

func (*AuthService) CreateUser

func (a *AuthService) CreateUser(d map[string]interface{}) (*tpepmodels.User, error)

func (*AuthService) GetMetadata

func (a *AuthService) GetMetadata(userID string) (map[string]interface{}, error)

func (*AuthService) GetUser

func (a *AuthService) GetUser(userID string) (*tpepmodels.User, error)

func (*AuthService) UpdateUser

func (a *AuthService) UpdateUser(userID string, d map[string]interface{}) error

func (*AuthService) UpdateUserMetadata

func (a *AuthService) UpdateUserMetadata(userId string, metadata map[string]interface{}) (map[string]interface{}, error)

type CareTeamService

type CareTeamService struct {
	FHIRService FHIRService
}

func NewCareTeamService

func NewCareTeamService(FHIRService FHIRService) CareTeamService

func (*CareTeamService) CreateCareTeam

func (c *CareTeamService) CreateCareTeam(en fhir.CareTeam, context context.Context) (*fhir.CareTeam, error)

CreateCareTeam ...

func (*CareTeamService) CreateCareTeamBatch

func (c *CareTeamService) CreateCareTeamBatch(careTeams []fhir.CareTeam, context context.Context) (*fhir.Bundle, error)

CreateCareTeamBatch ...

func (*CareTeamService) GetOneCareTeam

func (c *CareTeamService) GetOneCareTeam(ID string, context context.Context) (*fhir.CareTeam, error)

GetOneCareTeam ...

func (*CareTeamService) UpdateCareTeam

func (c *CareTeamService) UpdateCareTeam(en fhir.CareTeam, context context.Context) (*fhir.CareTeam, error)

UpdateCareTeam ...

type CodeSystemService

type CodeSystemService struct{}

func (*CodeSystemService) GetSeviceTypes

func (f *CodeSystemService) GetSeviceTypes() (*fhir.CodeSystem, error)

func (*CodeSystemService) Unmarshal

func (f *CodeSystemService) Unmarshal(bytes []byte) (*fhir.CodeSystem, error)

type EncounterService

type EncounterService struct {
	FHIRService               FHIRService
	CareTeamService           CareTeamService
	PatientService            PatientService
	ActivityDefinitionService ActivityDefinitionService
	TaskService               TaskService
	SqlDB                     *pgx.Conn
}

func NewEncounterService

func NewEncounterService(FHIRService FHIRService, careTeamService CareTeamService, patientService PatientService, activityDefinitionService ActivityDefinitionService, taskService TaskService, db *pgx.Conn) EncounterService

func (*EncounterService) CreateEncounter

func (e *EncounterService) CreateEncounter(en fhir.Encounter, context context.Context) (*fhir.Encounter, error)

CreateEncounter ...

func (*EncounterService) CreateEncounterFromPayload

func (e *EncounterService) CreateEncounterFromPayload(payload payload.CreateEncounterPayload, context context.Context) (*fhir.Encounter, error)

CreateEncounter ...

func (*EncounterService) CreateEncounterID

func (e *EncounterService) CreateEncounterID(tx pgx.Tx) (int, error)

CreateEncounterID ...

func (*EncounterService) GetOneEncounter

func (e *EncounterService) GetOneEncounter(ID string, context context.Context) (*fhir.Encounter, error)

GetOneEncounter ...

func (*EncounterService) GetOneEncounterByAppointment

func (e *EncounterService) GetOneEncounterByAppointment(ID string, context context.Context) (*fhir.Encounter, error)

GetOneEncounterByAppointment ...

func (*EncounterService) UpdateEncounter

func (s *EncounterService) UpdateEncounter(en fhir.Encounter, context context.Context) (*fhir.Encounter, error)

UpdateEncounter ...

type ExtensionService

type ExtensionService struct {
	ExtensionUrl string
}

func NewExtensionService

func NewExtensionService(extensionUrl string) ExtensionService

func (*ExtensionService) GetExtensions

func (e *ExtensionService) GetExtensions(context context.Context) (map[string]interface{}, error)

type FHIRConfig

type FHIRConfig struct {
	URL      string
	Username string
	Password string
}

type FHIRService

type FHIRService struct {
	Config FHIRConfig
}

func NewFHIRService

func NewFHIRService(config FHIRConfig) FHIRService

func (*FHIRService) CreateBundle

func (f *FHIRService) CreateBundle(bundle fhir.Bundle, pref *string, context context.Context) ([]byte, *http.Response, error)

func (*FHIRService) CreateResource

func (f *FHIRService) CreateResource(resourceType string, body []byte, pref *string, context context.Context) ([]byte, *http.Response, error)

func (*FHIRService) DeleteResource

func (f *FHIRService) DeleteResource(resourceType string, ID string, pref *string, context context.Context) ([]byte, *http.Response, error)

func (*FHIRService) GetResource

func (f *FHIRService) GetResource(resourceType string, pref *string, context context.Context) ([]byte, *http.Response, error)

func (*FHIRService) HaveConnection

func (f *FHIRService) HaveConnection(context context.Context) (*http.Response, error)

func (*FHIRService) UpdateResource

func (f *FHIRService) UpdateResource(resourceType string, body []byte, pref *string, context context.Context) ([]byte, *http.Response, error)

type KetoService

type KetoService struct {
	URL         string
	AccessToken string
}

func NewKetoService

func NewKetoService(url, accessToken string) KetoService

func (*KetoService) GetSubjectRelations

func (k *KetoService) GetSubjectRelations(subjectID string) (map[string]interface{}, error)

type LoincService

type LoincService struct {
	Client       *redisearch.Client
	LoincConnect LouicConnect
}

func NewLoincService

func NewLoincService(redisClient *redisearch.Client, louicConnect LouicConnect) LoincService

func (*LoincService) GetLoincQuestionnaire

func (l *LoincService) GetLoincQuestionnaire(loincId string, context context.Context) (*json.RawMessage, error)

GetLoincQuestionnaire ...

func (*LoincService) SearchForms

func (l *LoincService) SearchForms(term string) ([]redisearch.Document, int, error)

SearchForms ...

type LouicConnect

type LouicConnect struct {
	LoincFhirBaseURL  string
	LoincFhirUsername string
	LoincFhirPassword string
}

type OrganizationService

type OrganizationService struct {
	FHIRService FHIRService
}

func NewOrganizationService

func NewOrganizationService(FHIRService FHIRService) OrganizationService

func (*OrganizationService) CreateOrganization

func (o *OrganizationService) CreateOrganization(en fhir.Organization, context context.Context) (*fhir.Organization, error)

CreateOrganization ...

func (*OrganizationService) GetCurrentOrganization

func (o *OrganizationService) GetCurrentOrganization(context context.Context) (*fhir.Bundle, error)

GetCurrentOrganization ...

func (*OrganizationService) GetOneOrganization

func (o *OrganizationService) GetOneOrganization(ID string, context context.Context) (*fhir.Organization, error)

GetOneOrganization ...

func (*OrganizationService) GetOrganizationByIdentifier

func (o *OrganizationService) GetOrganizationByIdentifier(ID string, context context.Context) (*fhir.Bundle, error)

GetOneOrganization ...

func (*OrganizationService) UpdateOrganization

func (o *OrganizationService) UpdateOrganization(en fhir.Organization, context context.Context) (*fhir.Organization, error)

UpdateOrganization ...

type PatientService

type PatientService struct {
	FHIRService FHIRService
	SqlDB       *pgx.Conn
}

func NewPatientService

func NewPatientService(FHIRService FHIRService, db *pgx.Conn) PatientService

func (*PatientService) CreatePatient

func (p *PatientService) CreatePatient(patient fhir.Patient, context context.Context) (*fhir.Patient, error)

func (*PatientService) CreatePatientID

func (p *PatientService) CreatePatientID(tx pgx.Tx) (int, error)

func (*PatientService) GetOnePatient

func (p *PatientService) GetOnePatient(ID string, context context.Context) (*fhir.Patient, error)

GetOneCareTeam ...

type PractitionerService

type PractitionerService struct {
	FHIRService FHIRService
}

func NewPractitionerService

func NewPractitionerService(fhirService FHIRService) PractitionerService

func (*PractitionerService) CreatePractitionerWithRole

func (p *PractitionerService) CreatePractitionerWithRole(practitioner fhir.Practitioner, practitionerRole fhir.PractitionerRole, context context.Context) (*fhir.Practitioner, *http.Response, error)

func (*PractitionerService) UpdatePractitionerWithRole

func (p *PractitionerService) UpdatePractitionerWithRole(practitioner fhir.Practitioner, practitionerRole fhir.PractitionerRole, context context.Context) (*fhir.Practitioner, *http.Response, error)

type QuestionnaireService

type QuestionnaireService struct {
	FHIRService FHIRService
}

func NewQuestionnaireService

func NewQuestionnaireService(FHIRService FHIRService) QuestionnaireService

func (*QuestionnaireService) CreateQuestionnaire

func (q *QuestionnaireService) CreateQuestionnaire(qu fhir.Questionnaire, context context.Context) (*fhir.Questionnaire, error)

CreateQuestionnaire ...

func (*QuestionnaireService) GetOneQuestionnaire

func (q *QuestionnaireService) GetOneQuestionnaire(ID string, context context.Context) (*fhir.Questionnaire, error)

GetOneQuestionnaire ...

func (*QuestionnaireService) UpdateQuestionnaire

func (q *QuestionnaireService) UpdateQuestionnaire(qu fhir.Questionnaire, context context.Context) (*fhir.Questionnaire, error)

UpdateQuestionnaire ...

type RedisService

type RedisService struct {
	RedisClient *redis.Client
}

func NewRedisService

func NewRedisService(client *redis.Client) RedisService

func (*RedisService) CreatePatient

func (r *RedisService) CreatePatient(patient map[string]interface{}) (int64, error)

type RoleService

type RoleService struct {
}

func NewRoleService

func NewRoleService() RoleService

func (*RoleService) AddRoleToUser

func (r *RoleService) AddRoleToUser(userID string, role string) error

func (*RoleService) CreateRole

func (r *RoleService) CreateRole(role string) error

type RxNormService

type RxNormService struct {
	RxNormRepository repository.RxNormRepository
}

func NewRxNormService

func NewRxNormService(repository repository.RxNormRepository) RxNormService

func (*RxNormService) GetAllRelatedInfo

func (r *RxNormService) GetAllRelatedInfo(rxcui string) (map[string]interface{}, error)

func (*RxNormService) GetApproximateTerms

func (r *RxNormService) GetApproximateTerms(term string) (map[string]interface{}, error)

func (*RxNormService) SaveDisplayNames

func (r *RxNormService) SaveDisplayNames() error

func (*RxNormService) Suggest

func (r *RxNormService) Suggest(prefix string) ([]redisearch.Suggestion, error)

type ScheduleService

type ScheduleService struct {
	FHIRService FHIRService
}

func NewScheduleService

func NewScheduleService(FHIRService FHIRService) ScheduleService

func (*ScheduleService) CreateSchedule

func (s *ScheduleService) CreateSchedule(sl fhir.Schedule, context context.Context) (*fhir.Schedule, error)

CreateSchedule ...

type SeedService

type SeedService struct {
	UserService UserService
	RoleService RoleService
}

func NewSeedService

func NewSeedService(userService UserService) SeedService

func (SeedService) SeedActivityDefinition

func (i SeedService) SeedActivityDefinition() error

func (SeedService) SeedCreateExaminationActivityDefinition

func (i SeedService) SeedCreateExaminationActivityDefinition() error

func (SeedService) SeedCreateTriageActivityDefinition

func (i SeedService) SeedCreateTriageActivityDefinition() error

func (SeedService) SeedOrganization

func (i SeedService) SeedOrganization() error

func (*SeedService) SeedRoles

func (s *SeedService) SeedRoles(context context.Context)

func (*SeedService) SeedUsers

func (s *SeedService) SeedUsers(context context.Context)

type SlotService

type SlotService struct {
	FHIRService FHIRService
}

func NewSlotService

func NewSlotService(FHIRService FHIRService) SlotService

func (*SlotService) CreateSlot

func (s *SlotService) CreateSlot(sl fhir.Slot, context context.Context) (*fhir.Slot, error)

CreateSlot ...

func (*SlotService) GetOneSlot

func (s *SlotService) GetOneSlot(ID string, context context.Context) (*fhir.Slot, error)

GetOneSlot ...

func (*SlotService) UpdateSlot

func (s *SlotService) UpdateSlot(sl fhir.Slot, context context.Context) (*fhir.Slot, error)

UpdateSlot ...

type TaskService

type TaskService struct {
	FHIRService FHIRService
}

func NewTaskService

func NewTaskService(FHIRService FHIRService) TaskService

func (*TaskService) CreateTask

func (t *TaskService) CreateTask(ts fhir.Task, context context.Context) (*fhir.Task, error)

CreateTask ...

func (*TaskService) CreateTaskBatch

func (t *TaskService) CreateTaskBatch(ts []fhir.Task, context context.Context) (*fhir.Bundle, error)

CreateTask ...

func (*TaskService) GetOneTask

func (t *TaskService) GetOneTask(ID string, context context.Context) (*fhir.Task, error)

GetOneTask ...

func (*TaskService) UpdateTask

func (t *TaskService) UpdateTask(en fhir.Task, context context.Context) (*fhir.Task, error)

UpdateTask ...

type UserService

type UserService struct {
	FHIRService         FHIRService
	PractitionerService PractitionerService
	AuthService         AuthService
	RoleService         RoleService
	Context             context.Context
}

func NewUserService

func NewUserService(fhirService FHIRService, practitionerService PractitionerService, authService AuthService, roleService RoleService, context context.Context) UserService

func (*UserService) CreateOneUser

func (u *UserService) CreateOneUser(p payload.CreateUserPayload, context context.Context) (*tpepmodels.User, int, error)

func (*UserService) GetOneUser

func (u *UserService) GetOneUser(ID string) (*model.User, error)

func (*UserService) UpdateUser

func (u *UserService) UpdateUser(p payload.UpdateUserPayload, context context.Context) (*tpepmodels.User, int, error)

type ValueSetService

type ValueSetService struct {
	FHIRService FHIRService
}

func NewValueSetService

func NewValueSetService(fhirService FHIRService) ValueSetService

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL