dto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseValues

func ParseValues[T Output](concreteType T, values []byte) (*T, error)

ParseValues is a generic function that takes in any concrete type, parses the values with the provided slice of bytes and validates the parsed generic is not empty

Types

type AgeRangeInput

type AgeRangeInput struct {
	LowerBound int `json:"lowerBound"`
	UpperBound int `json:"upperBound"`
}

AgeRangeInput defines the channel users age input

type AllergyPayload

type AllergyPayload struct {
	Name              string    `json:"allergy"`
	AllergyConceptID  *string   `json:"allergyConceptId"`
	Reaction          string    `json:"reaction"`
	ReactionConceptID *string   `json:"reactionConceptId"`
	Severity          string    `json:"severity"`
	SeverityConceptID *string   `json:"severityConceptId"`
	Date              time.Time `json:"allergyDateTime"`
}

AllergyPayload contains allergy details for a client/patient

type AllergyReaction

type AllergyReaction struct {
	Name      string  `json:"name"`
	ConceptID *string `json:"conceptID"`
}

AllergyReaction ...

type AllergySeverity

type AllergySeverity struct {
	Name      string  `json:"name"`
	ConceptID *string `json:"conceptID"`
}

AllergySeverity ...

type AppointmentPayload

type AppointmentPayload struct {
	CCCNumber         string           `json:"ccc_number"`
	ExternalID        string           `json:"appointment_id"`
	AppointmentDate   scalarutils.Date `json:"appointment_date"`
	AppointmentReason string           `json:"appointment_reason"`
}

AppointmentPayload is the payload representing an appointment

type AppointmentResponse

type AppointmentResponse struct {
	CCCNumber         string           `json:"ccc_number"`
	ExternalID        string           `json:"appointment_id"`
	AppointmentDate   scalarutils.Date `json:"appointment_date"`
	AppointmentReason string           `json:"appointment_reason"`
}

AppointmentResponse is the response representing an appointment

type AppointmentServiceRequestInput

type AppointmentServiceRequestInput struct {
	MFLCode      int        `json:"MFLCODE"`
	LastSyncTime *time.Time `json:"lastSyncTime"`
}

AppointmentServiceRequestInput models the payload that is passed when fetching appointment service requests

type AppointmentServiceRequestsOutput

type AppointmentServiceRequestsOutput struct {
	AppointmentServiceRequests []domain.AppointmentServiceRequests `json:"Results"`
}

AppointmentServiceRequestsOutput is the response returned after querying the appointment service requests for a specific facility

type AuthCredentials

type AuthCredentials struct {
	RefreshToken string `json:"refreshToken"`
	IDToken      string `json:"idToken"`
	ExpiresIn    string `json:"expiresIn"`
}

AuthCredentials is the authentication credentials for a given user

type BasicUserInput

type BasicUserInput struct {
	Username string          `json:"username"`
	Flavour  feedlib.Flavour `json:"flavour" validate:"required"`
}

BasicUserInput is used to define the inputs needed carrying out an activity that requires either a username, phone number and flavour.

type BookingOutput

type BookingOutput struct {
	ID                     string                   `json:"id"`
	Active                 bool                     `json:"active"`
	Services               []domain.FacilityService `json:"services"`
	Date                   time.Time                `json:"date"`
	Facility               domain.Facility          `json:"facility"`
	Client                 domain.ClientProfile     `json:"clientProfile"`
	OrganisationID         string                   `json:"organisationID"`
	ProgramID              string                   `json:"programID"`
	VerificationCode       string                   `json:"verificationCode"`
	VerificationCodeStatus enums.BookingCodeStatus  `json:"verificationCodeStatus"`
	BookingStatus          enums.BookingStatus      `json:"bookingStatus"`
}

BookingOutput is used to show the booking response

type BookingPage

type BookingPage struct {
	Results    []BookingOutput   `json:"results"`
	Pagination domain.Pagination `json:"pagination"`
}

BookingPage is the dataclass that models paginated list of bookings

type BusinessHoursInput

type BusinessHoursInput struct {
	Day         enums.DayOfWeek `json:"day"`
	OpeningTime string          `json:"openingTime"`
	ClosingTime string          `json:"closingTime"`
}

BusinessHoursInput is used to model business hours data input

type CMDDateInput

type CMDDateInput struct {
	Year  string `json:"year" validate:"required"`
	Month string `json:"month" validate:"required"`
	Day   string `json:"day" validate:"required"`
}

CMDDateInput defines the input of the date to be used in the CLI

func (*CMDDateInput) ParseDate

func (d *CMDDateInput) ParseDate() (scalarutils.Date, error)

ParseDate converts the CMD input to a date and also validates it

type CMDGenderInput

type CMDGenderInput struct {
	Gender string `json:"gender" validate:"required"`
}

CMDGenderInput defines the input of gender that will be used in CLI

func (*CMDGenderInput) ParseGender

func (g *CMDGenderInput) ParseGender() (enumutils.Gender, error)

ParseGender converts the CMD input to a gender and also validates it

type CMDIDNumberInput

type CMDIDNumberInput struct {
	IDNumber string `json:"idNumber" validate:"required"`
}

CMDIDNumberInput defines the input of ID number that will be used in CLI

func (*CMDIDNumberInput) ParseIDNumber

func (i *CMDIDNumberInput) ParseIDNumber() (string, error)

ParseIDNumber converts the CMD input to aN ID number and also validates it

type CMDNameInput

type CMDNameInput struct {
	FirstName string `json:"firstName" validate:"required"`
	LastName  string `json:"lastName" validate:"required"`
}

CMDNameInput describes the user's name format to be used on the CLI

func (*CMDNameInput) ParseName

func (s *CMDNameInput) ParseName() (string, error)

ParseName ensures that the input is valid

type CMDPhoneInput

type CMDPhoneInput struct {
	Phone string `json:"phone" validate:"required"`
}

CMDPhoneInput defines the input of phone that will be used in CLI

func (*CMDPhoneInput) ParsePhone

func (p *CMDPhoneInput) ParsePhone() (string, error)

ParsePhone converts the CMD input to a phone and also validates it

type CMDSendInviteInput

type CMDSendInviteInput struct {
	SendInvite string `json:"sendInvite" validate:"required"`
}

CMDSendInviteInput defines the input of send invite that will be used in CLI

func (*CMDSendInviteInput) ParseSendInvite

func (s *CMDSendInviteInput) ParseSendInvite() (bool, error)

ParseSendInvite converts yes/no responses from the CMD to boolean values and validates them

type CMDStaffInput

type CMDStaffInput struct {
	StaffNumber string `json:"staffNumber" validate:"required"`
}

CMDStaffInput defines the input of staff number that will be used in CLI

func (*CMDStaffInput) ParseStaffNumber

func (s *CMDStaffInput) ParseStaffNumber() (string, error)

CMDStaffInput converts the CMD input to a staff number and also validates it

type CMDUsernameInput

type CMDUsernameInput struct {
	Username string `json:"username" validate:"required,alphanum"`
}

CMDUsernameInput describes the username format to be used on the CLI

func (*CMDUsernameInput) ParseUsername

func (u *CMDUsernameInput) ParseUsername() (string, error)

ParseUsername ensures the username entered is alphanumeric and not empty

type CMSLinkFacilityToProgramPayload

type CMSLinkFacilityToProgramPayload struct {
	FacilityID []string `json:"facilities"`
	ProgramID  string   `json:"program_id,omitempty"`
}

CMSLinkFacilityToProgramPayload is the payload passed when adding a facility to a program on the CMS service using PubSub

type CaregiverInput

type CaregiverInput struct {
	Username        string                 `json:"username"`
	Name            string                 `json:"name"`
	Gender          enumutils.Gender       `json:"gender"`
	DateOfBirth     scalarutils.Date       `json:"dateOfBirth"`
	PhoneNumber     string                 `json:"phoneNumber"`
	CaregiverNumber string                 `json:"caregiverNumber"`
	SendInvite      bool                   `json:"sendInvite"`
	AssignedClients []ClientCaregiverInput `json:"assignedClients"`
}

CaregiverInput defines the field passed when creating a caregiver

func (*CaregiverInput) Validate

func (f *CaregiverInput) Validate() error

Validate helps with validation of CaregiverInput fields

type CaregiverProfileOutputPage

type CaregiverProfileOutputPage struct {
	Pagination *domain.Pagination         `json:"pagination"`
	Caregivers []*domain.CaregiverProfile `json:"caregivers"`
}

CaregiverProfileOutputPage returns a paginated list of users caregiver profile

type ClientCaregiverInput

type ClientCaregiverInput struct {
	ClientID      string              `json:"clientID"`
	CaregiverID   string              `json:"caregiverID"`
	CaregiverType enums.CaregiverType `json:"caregiverType"`
	Consent       enums.ConsentState  `json:"consentState"`
}

ClientCaregiverInput is the input for used to assign a caregiver to a client

type ClientFacilityInput

type ClientFacilityInput struct {
	ClientID   *string `json:"clientID"`
	FacilityID *string `json:"facilityID"`
	ProgramID  string  `json:"programID"`
}

ClientFacilityInput is the input for getting a client facility from the through table

type ClientFilterParamsInput

type ClientFilterParamsInput struct {
	ClientTypes []enums.ClientType `json:"clientTypes"`
	AgeRange    *AgeRangeInput     `json:"ageRange"`
	Gender      []enumutils.Gender `json:"gender"`
}

ClientFilterParamsInput is the payload for filtering clients

type ClientRegistrationInput

type ClientRegistrationInput struct {
	Username       string             `json:"username" validate:"required"`
	Facility       string             `json:"facility" validate:"required"`
	ClientTypes    []enums.ClientType `json:"clientTypes" validate:"required"`
	ClientName     string             `json:"clientName" validate:"required"`
	Gender         enumutils.Gender   `json:"gender" validate:"required"`
	DateOfBirth    scalarutils.Date   `json:"dateOfBirth" validate:"required"`
	PhoneNumber    string             `json:"phoneNumber" validate:"required"`
	EnrollmentDate scalarutils.Date   `json:"enrollmentDate" validate:"required"`
	CCCNumber      string             `json:"cccNumber" validate:"required"`
	Counselled     bool               `json:"counselled" validate:"required"`
	InviteClient   bool               `json:"inviteClient"`
	ProgramID      string             `json:"programID"`
}

ClientRegistrationInput defines the fields passed as a payload to the client registration API

func (*ClientRegistrationInput) Validate

func (f *ClientRegistrationInput) Validate() error

Validate helps with validation of ClientRegistrationInput fields

type ClientRegistrationOutput

type ClientRegistrationOutput struct {
	ID                string             `json:"id"`
	Active            bool               `json:"active"`
	ClientTypes       []enums.ClientType `json:"client_types"`
	EnrollmentDate    *time.Time         `json:"enrollment_date"`
	FHIRPatientID     string             `json:"fhir_patient_id"`
	EMRHealthRecordID string             `json:"emr_health_record_id"`
	TreatmentBuddy    string             `json:"treatment_buddy"`
	Counselled        bool               `json:"counselled"`
	Organisation      string             `json:"organisation"`
	UserID            string             `json:"user"`
	CurrentFacilityID string             `json:"current_facility"`
	CHV               string             `json:"chv"`
	Caregiver         string             `json:"caregiver"`
}

ClientRegistrationOutput models the client registration API response

type ClientSelfSignUp

type ClientSelfSignUp struct {
	Username    string           `json:"username" validate:"required"`
	ClientName  string           `json:"clientName" validate:"required"`
	Gender      enumutils.Gender `json:"gender" validate:"required"`
	DateOfBirth scalarutils.Date `json:"dateOfBirth" validate:"required"`
	PhoneNumber string           `json:"phoneNumber" validate:"required"`
}

ClientSelfSignUp defines the fields passed as a payload to self registering clients

type ClinicalTenantIdentifier

type ClinicalTenantIdentifier struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

ClinicalTenantIdentifier models the clinical's tenant identification model

type ClinicalTenantPayload

type ClinicalTenantPayload struct {
	Name        string                     `json:"name,omitempty"`
	PhoneNumber string                     `json:"phoneNumber,omitempty"`
	Identifiers []ClinicalTenantIdentifier `json:"identifiers,omitempty"`
}

ClinicalTenantPayload is the dataclass to create a clinical tenant

type CommunityInput

type CommunityInput struct {
	Name           string              `json:"name"`
	Topic          string              `json:"topic"`
	AgeRange       *AgeRangeInput      `json:"ageRange"`
	Gender         []*enumutils.Gender `json:"gender"`
	Visibility     enums.Visibility    `json:"visibility"`
	Preset         enums.Preset        `json:"preset"`
	ClientType     []*enums.ClientType `json:"clientType"`
	OrganisationID string              `json:"organisationID"`
	ProgramID      string              `json:"programID"`
	FacilityID     string              `json:"facilityID"`
}

CommunityInput defines the payload to create a channel

type CoordinatesInput

type CoordinatesInput struct {
	Lat string `json:"lat"`
	Lng string `json:"lng"`
}

CoordinatesInput is used to get the coordinates of a facility

type Counts

type Counts struct {
	MissedCalls int `json:"missed_calls,omitempty"`
	Unread      int `json:"unread,omitempty"`
}

Counts dictionary of the current number of unacknowledged communications for the recipient user. Counts whose value is zero should be omitted.

type CreateCMSFacilityPayload

type CreateCMSFacilityPayload struct {
	FacilityID string `json:"id"`
	Name       string `json:"name"`
}

CreateCMSFacilityPayload is the payload passed when creating a facility on the CMS service using PubSub

type CreateCMSOrganisationPayload

type CreateCMSOrganisationPayload struct {
	OrganisationID string `json:"organisation_id"`
	Name           string `json:"name"`
	Email          string `json:"email"`
	PhoneNumber    string `json:"phone_number"`
	Code           int    `json:"code"`
}

CreateCMSOrganisationPayload is the payload passed when creating an organisation on the CMS service using PubSub

type CreateCMSProgramPayload

type CreateCMSProgramPayload struct {
	ProgramID      string `json:"program_id"`
	Name           string `json:"name"`
	OrganisationID string `json:"organisation_id"`
}

CreateCMSProgramPayload is the payload passed when creating a program on the CMS service using PubSub

type Data

type Data struct {
	URL    string `json:"url,omitempty"`
	Format string `json:"format,omitempty"`
}

Data is a dictionary of additional pusher-specific data. For ‘http’ pushers, this is the data dictionary passed in at pusher creation minus the url key.

type DeleteCMSUserPayload

type DeleteCMSUserPayload struct {
	UserID string `json:"user_id"`
}

DeleteCMSUserPayload contains the ID of the user that is to be deleted from the CMS service database

type Devices

type Devices struct {
	AppID            string `json:"app_id,omitempty"`
	Data             Data   `json:"data,omitempty"`
	Pushkey          string `json:"pushkey,omitempty"`
	PushkeyTimeStamp int    `json:"pushkey_ts,omitempty"`
	Tweaks           Tweaks `json:"tweaks,omitempty"`
}

Devices is the device to which the notification should be sent to.

type EventContent

type EventContent struct {
	Body    string `json:"body,omitempty"`
	Msgtype string `json:"msgtype,omitempty"`
}

EventContent is the events content

type ExistingUserClientInput

type ExistingUserClientInput struct {
	UserID         string             `json:"userID" validate:"required"`
	ProgramID      string             `json:"programID" validate:"required"`
	FacilityID     string             `json:"facilityID" validate:"required"`
	CCCNumber      *string            `json:"cccNumber" validate:"required"`
	ClientTypes    []enums.ClientType `json:"clientTypes" validate:"required"`
	EnrollmentDate scalarutils.Date   `json:"enrollmentDate" validate:"required"`
	Counselled     bool               `json:"counselled" validate:"required"`
	InviteClient   bool               `json:"inviteClient"`
}

ExistingUserClientInput defines the fields passed as a payload to create a client profile of an already existing user

func (*ExistingUserClientInput) Validate

func (e *ExistingUserClientInput) Validate() error

Validate helps with validation of ExistingUserClientRegistrationInput fields

type ExistingUserStaffInput

type ExistingUserStaffInput struct {
	UserID      string  `json:"userID"`
	ProgramID   string  `json:"programID" validate:"required"`
	FacilityID  string  `json:"facilityID" validate:"required"`
	IDNumber    *string `json:"idNumber"`
	StaffNumber string  `json:"staffNumber" validate:"required"`
	StaffRoles  string  `json:"staffRoles"`
	InviteStaff bool    `json:"inviteStaff"`
}

ExistingUserStaffInput is a model that represents the inputs passed when registering an existing staff user to a program

func (ExistingUserStaffInput) Validate

func (e ExistingUserStaffInput) Validate() error

Validate helps with validation of StaffRegistrationInput fields

type FCMNotificationMessage

type FCMNotificationMessage struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

FCMNotificationMessage models the payload passed when composing a notification payload

The title is what will appear as the notification's title message on the phone's notification tray Most of the notifications will be `BLIND` meaning that the body will be empty

type FacilityAppointmentsPayload

type FacilityAppointmentsPayload struct {
	MFLCode      string               `json:"MFLCODE"`
	Appointments []AppointmentPayload `json:"appointments"`
}

FacilityAppointmentsPayload is the payload sent for creating/updating an appointment

type FacilityAppointmentsResponse

type FacilityAppointmentsResponse struct {
	MFLCode      string                `json:"MFLCODE"`
	Appointments []AppointmentResponse `json:"appointments"`
}

FacilityAppointmentsResponse is the response sent after creating/updating an appointment

type FacilityCSVOutput

type FacilityCSVOutput struct {
	Code            string                       `json:"code" validate:"required"`
	IdentifierType  enums.FacilityIdentifierType `json:"identifierType" validate:"required"`
	Name            string                       `json:"name" validate:"required"`
	Level           string                       `json:"level" validate:"required"`
	FacilityType    string                       `json:"facilityType" validate:"required"`
	OwnerType       string                       `json:"ownerType" validate:"required"`
	RegulatoryBody  string                       `json:"regulatoryBody" validate:"required"`
	Country         string                       `json:"country" validate:"required"`
	County          string                       `json:"county" validate:"required"`
	OperationStatus string                       `json:"operationStatus" validate:"required"`
	Contact         string                       `json:"contact" validate:"required"`
}

FacilityCSVOutput is a struct that stores the output of facility csv values

func (*FacilityCSVOutput) ParseValues

func (f *FacilityCSVOutput) ParseValues(labels []string, values []string) (*FacilityCSVOutput, error)

ParseValues transforms the actual facility values from row 2 of the csv

func (*FacilityCSVOutput) ValidateLabels

func (f *FacilityCSVOutput) ValidateLabels(labels []string) error

ValidateLabels ensures the labels of the facility csv are valid. the json tag matches the respective label value

type FacilityIdentifierInput

type FacilityIdentifierInput struct {
	Type       enums.FacilityIdentifierType `json:"type" validate:"required"`
	Value      string                       `json:"value" validate:"required"`
	FacilityID string                       `json:"facilityID"`
}

FacilityIdentifierInput is the identifier of the facility

func (*FacilityIdentifierInput) Validate

func (f *FacilityIdentifierInput) Validate() error

Validate helps with validation of facility identifier input fields

type FacilityInput

type FacilityInput struct {
	Name               string                  `json:"name" validate:"required,min=3,max=100"`
	Phone              string                  `json:"phone" validate:"required"`
	Active             bool                    `json:"active"`
	Country            enums.Country           `json:"country" validate:"required"`
	County             string                  `json:"county"`
	Address            string                  `json:"address"`
	Description        string                  `json:"description" validate:"required,min=3,max=256"`
	FHIROrganisationID string                  `json:"fhirOrganisationID"`
	Identifier         FacilityIdentifierInput `json:"identifier" validate:"required"`
	Coordinates        CoordinatesInput        `json:"coordinates" validate:"required"`
	Services           []FacilityServiceInput  `json:"services"`
	BusinessHours      []BusinessHoursInput    `json:"businessHours"`
}

FacilityInput describes the facility input

func (*FacilityInput) Validate

func (f *FacilityInput) Validate() error

Validate helps with validation of facility input fields

type FacilityOutputPage

type FacilityOutputPage struct {
	Pagination *domain.Pagination
	Facilities []*domain.Facility
}

FacilityOutputPage returns a paginated list of users facility

type FacilityServiceInput

type FacilityServiceInput struct {
	Name        string                   `json:"name"`
	Description string                   `json:"description"`
	Identifiers []ServiceIdentifierInput `json:"identifiers"`
}

FacilityServiceInput is used to get the services offered in a facility

type FacilityServiceOutputPage

type FacilityServiceOutputPage struct {
	Results    []domain.FacilityService `json:"results"`
	Pagination domain.Pagination        `json:"pagination"`
}

FacilityServiceOutputPage is a mycarehub custom model to show facility services

type FeedbackEmail

type FeedbackEmail struct {
	User              string             `json:"user"`
	FeedbackType      enums.FeedbackType `json:"feedbackType"`
	SatisfactionLevel int                `json:"satisfactionLevel"`
	ServiceName       string             `json:"serviceName"`
	Feedback          string             `json:"feedback"`
	PhoneNumber       string             `json:"phoneNumber"`
	ProgramID         string             `json:"programID"`
}

FeedbackEmail defines the field to be parsed when sending feedback emails

type FeedbackResponseInput

type FeedbackResponseInput struct {
	UserID            string             `json:"userID" validate:"required"`
	FeedbackType      enums.FeedbackType `json:"feedbackType" validate:"required"`
	SatisfactionLevel int                `json:"satisfactionLevel" validate:"required"`
	ServiceName       string             `json:"serviceName" validate:"required"`
	Feedback          string             `json:"feedback" validate:"required"`
	RequiresFollowUp  bool               `json:"requiresFollowUp" validate:"required"`
}

FeedbackResponseInput defines the field passed when sending feedback

type FetchHealthDiaryEntries

type FetchHealthDiaryEntries struct {
	MFLCode      int        `json:"MFLCODE"`
	LastSyncTime *time.Time `json:"lastSyncTime"`
}

FetchHealthDiaryEntries models the payload that is passed when fetching the health diary entries that were recorded by patients assigned to the matching facility

type FiltersInput

type FiltersInput struct {
	DataType enums.FilterSortDataType `json:"dataType" validate:"required"`
	Value    string                   `json:"value" validate:"required"` // TODO: Clear spec on validation e.g dates must be ISO 8601. This is the actual data being filtered
}

FiltersInput contains fields required for filtering

func (*FiltersInput) Validate

func (f *FiltersInput) Validate() error

Validate helps with validation of FiltersInput fields

type GetSecurityQuestionsInput

type GetSecurityQuestionsInput struct {
	Flavour feedlib.Flavour `json:"flavour" validate:"required"`
}

GetSecurityQuestionsInput defines the field passed when getting the security questions

type GetStreamToken

type GetStreamToken struct {
	Token string
}

GetStreamToken is the token generated from getstream

type GetUserRespondedSecurityQuestionsInput

type GetUserRespondedSecurityQuestionsInput struct {
	Username string          `json:"username" validate:"required"`
	Flavour  feedlib.Flavour `json:"flavour" validate:"required"`
	OTP      string          `json:"otp" validate:"required"`
}

GetUserRespondedSecurityQuestionsInput defines the field passed when getting the security questions

func (*GetUserRespondedSecurityQuestionsInput) Validate

Validate helps with validation of GetUserRespondedSecurityQuestionsInput fields

type HealthDiaryEntriesResponse

type HealthDiaryEntriesResponse struct {
	MFLCode            int                              `json:"MFLCODE"`
	HealthDiaryEntries []*domain.ClientHealthDiaryEntry `json:"healthDiaries"`
}

HealthDiaryEntriesResponse is the response returned after querying the health diary entries for a specific facility

type ILoginResponse

type ILoginResponse interface {
	SetUserProfile(user *User)
	GetUserProfile() *User

	SetResponseCode(code int, message string)

	SetAuthCredentials(credentials AuthCredentials)

	SetStreamToken(token string)

	SetRetryTime(seconds float64)

	SetFailedLoginCount(count int)

	SetIsCaregiver()
	GetIsCaregiver() bool

	SetIsClient()
	GetIsClient() bool

	ClearProfiles()
}

ILoginResponse represents a login response getter and setter

type LocationInput

type LocationInput struct {
	Lat    float64  `json:"lat,omitempty"`
	Lng    float64  `json:"lng,omitempty"`
	Radius *float64 `json:"radius,omitempty"`
}

LocationInput is used get the current location of a user

type LoginInput

type LoginInput struct {
	Username string          `json:"username" validate:"required"`
	PIN      string          `json:"pin" validate:"required"`
	Flavour  feedlib.Flavour `json:"flavour" validate:"required"`
}

LoginInput represents the Login input data structure

func (*LoginInput) Validate

func (f *LoginInput) Validate() error

Validate helps with validation of LoginInput fields

type LoginResponse

type LoginResponse struct {
	Response *Response `json:"response,omitempty"`
	Message  string    `json:"message,omitempty"`
	Code     int       `json:"code,omitempty"`

	RetryTime        float64 `json:"retryTime,omitempty"`
	Attempts         int     `json:"attempts,omitempty"`
	FailedLoginCount int     `json:"failed_login_count,omitempty"`
	IsCaregiver      bool    `json:"is_caregiver"`
	IsClient         bool    `json:"is_client"`
}

LoginResponse models the response to be returned on successful login

func NewLoginResponse

func NewLoginResponse() *LoginResponse

NewLoginResponse initializes a new login response

func (*LoginResponse) ClearProfiles

func (l *LoginResponse) ClearProfiles()

ClearProfiles removes the response containing the user profiles and client/staff profiles

func (*LoginResponse) GetIsCaregiver

func (l *LoginResponse) GetIsCaregiver() bool

GetIsCaregiver retrieves the is caregiver value

func (*LoginResponse) GetIsClient

func (l *LoginResponse) GetIsClient() bool

GetIsClient gets the is client value

func (*LoginResponse) GetUserProfile

func (l *LoginResponse) GetUserProfile() *User

GetUserProfile retrieves the user profile

func (*LoginResponse) SetAuthCredentials

func (l *LoginResponse) SetAuthCredentials(credentials AuthCredentials)

SetAuthCredentials sets the auth credentials

func (*LoginResponse) SetFailedLoginCount

func (l *LoginResponse) SetFailedLoginCount(count int)

SetFailedLoginCount sets the failed login count

func (*LoginResponse) SetIsCaregiver

func (l *LoginResponse) SetIsCaregiver()

SetIsCaregiver indicates whether the user is a caregiver

func (*LoginResponse) SetIsClient

func (l *LoginResponse) SetIsClient()

SetIsClient indicates whether the user is a client

func (*LoginResponse) SetResponseCode

func (l *LoginResponse) SetResponseCode(code int, message string)

SetResponseCode sets the response message and code

func (*LoginResponse) SetRetryTime

func (l *LoginResponse) SetRetryTime(seconds float64)

SetRetryTime sets the next attempt

func (*LoginResponse) SetStreamToken

func (l *LoginResponse) SetStreamToken(token string)

SetStreamToken sets the get-stream token

func (*LoginResponse) SetUserProfile

func (l *LoginResponse) SetUserProfile(user *User)

SetUserProfile sets the user profile

type ManagedClientOutputPage

type ManagedClientOutputPage struct {
	Pagination     *domain.Pagination      `json:"pagination"`
	ManagedClients []*domain.ManagedClient `json:"managedClients"`
}

ManagedClientOutputPage returns a paginated list of managed client profiles

type MatrixNotifyInput

type MatrixNotifyInput struct {
	Notification Notification `json:"notification,omitempty"`
}

MatrixNotifyInput is the input for receiving Matrix's notification event data

type MatrixNotifyOutput

type MatrixNotifyOutput struct {
	Rejected []string `json:"rejected,omitempty"`
}

MatrixNotifyOutput returns a list of the rejected push keys when a notification is sent from Matrix

type MatrixUserRegistrationOutput

type MatrixUserRegistrationOutput struct {
	Name        string `json:"name"`
	Admin       bool   `json:"admin"`
	DisplayName string `json:"displayname"`
}

MatrixUserRegistrationOutput is used to show the response after a user has been registered in Matrix

type MatrixUserRegistrationPayload

type MatrixUserRegistrationPayload struct {
	Auth             *domain.MatrixAuth             `json:"auth"`
	RegistrationData *domain.MatrixUserRegistration `json:"registrationData"`
}

MatrixUserRegistrationPayload is the payload passed when registering a Matrix user via pubsub

type MedicationDrug

type MedicationDrug struct {
	ConceptID *string `json:"conceptId"`
}

MedicationDrug ...

type MedicationPayload

type MedicationPayload struct {
	Name                string    `json:"medication"`
	MedicationConceptID *string   `json:"medicationConceptId"`
	Date                time.Time `json:"medicationDateTime"`
	Value               string    `json:"value"`
	DrugConceptID       *string   `json:"drugConceptId"`
}

MedicationPayload contains details for medication that a patient/client is prescribed or using

type NextOfKinPayload

type NextOfKinPayload struct {
	Name         string `json:"name"`
	Contact      string `json:"contact"`
	Relationship string `json:"relationship"`
	ProgramID    string `json:"programID"`
}

NextOfKinPayload defines the payload from KenyaEMR used for client registration

type Notification

type Notification struct {
	Content           EventContent `json:"content,omitempty"`
	Counts            Counts       `json:"counts,omitempty"`
	Devices           []Devices    `json:"devices,omitempty"`
	EventID           string       `json:"event_id,omitempty"`
	Prio              string       `json:"prio,omitempty"`
	RoomAlias         string       `json:"room_alias,omitempty"`
	RoomID            string       `json:"room_id,omitempty"`
	RoomName          string       `json:"room_name,omitempty"`
	Sender            string       `json:"sender,omitempty"`
	SenderDisplayName string       `json:"sender_display_name,omitempty"`
	Type              string       `json:"type,omitempty"`
}

Notification contains the notification data

type OauthClientInput

type OauthClientInput struct {
	Name          string   `json:"name"`
	Secret        string   `json:"secret"`
	RedirectURIs  []string `json:"redirectURIs"`
	ResponseTypes []string `json:"responseTypes"`
	Grants        []string `json:"grants"`
}

OauthClientInput is the input for creating an oauth client

type Organisation

type Organisation struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Organisation represents output for a tenant/organisation

type OrganisationInput

type OrganisationInput struct {
	Code            string `json:"code"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	EmailAddress    string `json:"emailAddress"`
	PhoneNumber     string `json:"phoneNumber"`
	PostalAddress   string `json:"postalAddress"`
	PhysicalAddress string `json:"physicalAddress"`
	DefaultCountry  string `json:"defaultCountry"`
}

OrganisationInput is the input for creating an organisation

type OrganisationOutput

type OrganisationOutput struct {
	Name            string `json:"name" validate:"required"`
	Description     string `json:"description" validate:"required"`
	EmailAddress    string `json:"emailAddress" validate:"required"`
	PhoneNumber     string `json:"phoneNumber" validate:"required"`
	PostalAddress   string `json:"postalAddress" validate:"required"`
	PhysicalAddress string `json:"physicalAddress" validate:"required"`
	DefaultCountry  string `json:"defaultCountry" validate:"required"`
}

OrganisationOutput is a struct that stores the output of organisation json values

func (*OrganisationOutput) ParseValues

func (o *OrganisationOutput) ParseValues(values []byte) (*OrganisationInput, error)

ParseValues transforms and validates the json organisation to type OrganisationInput

type OrganisationOutputPage

type OrganisationOutputPage struct {
	Pagination    *domain.Pagination     `json:"pagination"`
	Organisations []*domain.Organisation `json:"organisations"`
}

type OrganisationsOutput

type OrganisationsOutput struct {
	Count         int            `json:"count"`
	Organisations []Organisation `json:"organisations"`
}

OrganisationsOutput is the output for fetching organisations associated with a contact

type Output

type Output interface {
	OrganisationOutput | ProgramJSONOutput
}

Output expresses a type constraint satisfied by the output structs

type PINInput

type PINInput struct {
	UserID     *string         `json:"userID" validate:"required"`
	PIN        *string         `json:"pin" validate:"required"`
	ConfirmPIN *string         `json:"confirmPIN" validate:"required"`
	Flavour    feedlib.Flavour `json:"flavour" validate:"required"`
}

PINInput represents the Pin input data structure

func (*PINInput) Validate

func (f *PINInput) Validate() error

Validate helps with validation of PINInput fields

type PaginationsInput

type PaginationsInput struct {
	Limit       int        `json:"limit"`
	CurrentPage int        `json:"currentPage" validate:"required"`
	Sort        SortsInput `json:"sort"`
}

PaginationsInput contains fields required for pagination

func (*PaginationsInput) Validate

func (f *PaginationsInput) Validate() error

Validate helps with validation of PaginationsInput fields

type PatientAllergyOutput

type PatientAllergyOutput struct {
	PatientID      string `json:"patientID"`
	OrganizationID string `json:"organizationID"`
	FacilityID     string `json:"facilityID"`

	Name      string          `json:"name"`
	ConceptID *string         `json:"conceptID"`
	Date      time.Time       `json:"date"`
	Reaction  AllergyReaction `json:"reaction"`
	Severity  AllergySeverity `json:"severity"`
}

PatientAllergyOutput contains allergy details for a client/patient

type PatientCreationOutput

type PatientCreationOutput struct {
	UserID      string           `json:"userID"`
	ClientID    string           `json:"clientID"`
	Name        string           `json:"name"`
	DateOfBirth *time.Time       `json:"dateOfBirth"`
	Gender      enumutils.Gender `json:"gender"`
	Active      bool             `json:"active"`
	PhoneNumber string           `json:"phoneNumber"`

	OrganizationID string `json:"organizationID"`
	FacilityID     string `json:"facilityID"`
}

PatientCreationOutput is the payload sent to the clinical service for creation of a patient

type PatientMedicationOutput

type PatientMedicationOutput struct {
	PatientID      string `json:"patientID"`
	OrganizationID string `json:"organizationID"`
	FacilityID     string `json:"facilityID"`

	Name      string          `json:"medication"`
	ConceptID *string         `json:"conceptId"`
	Date      time.Time       `json:"date"`
	Value     string          `json:"value"`
	Drug      *MedicationDrug `json:"drug"`
}

PatientMedicationOutput contains details for medication that a patient/client is prescribed or using

type PatientRecordPayload

type PatientRecordPayload struct {
	CCCNumber   string               `json:"ccc_number"`
	MFLCode     int                  `json:"MFLCODE"`
	Allergies   []*AllergyPayload    `json:"allergies"`
	VitalSigns  []*VitalSignPayload  `json:"vitalSigns"`
	TestOrders  []*TestOrderPayload  `json:"testOrders"`
	TestResults []*TestResultPayload `json:"testResults"`
	Medications []*MedicationPayload `json:"medications"`
}

PatientRecordPayload contains all the available records for a patient that is available from KenyaEMR for syncing an updating on myCareHub

type PatientRegistrationPayload

type PatientRegistrationPayload struct {
	MFLCode            string           `json:"MFLCODE"`
	CCCNumber          string           `json:"cccNumber"`
	Name               string           `json:"name"`
	DateOfBirth        scalarutils.Date `json:"dateOfBirth"`
	ClientType         enums.ClientType `json:"clientType"`
	PhoneNumber        string           `json:"phoneNumber"`
	EnrollmentDate     scalarutils.Date `json:"enrollmentDate"`
	BirthDateEstimated bool             `json:"birthDateEstimated"`
	Gender             string           `json:"gender"`
	Counselled         bool             `json:"counselled"`
	NextOfKin          NextOfKinPayload `json:"nextOfKin"`
	ProgramID          string           `json:"programID"`
}

PatientRegistrationPayload defines the payload from KenyaEMR used for client registration

type PatientSyncPayload

type PatientSyncPayload struct {
	MFLCode  int        `json:"MFLCODE"`
	SyncTime *time.Time `json:"lastSyncTime"`
}

PatientSyncPayload is the payload for polling newly created patients/clients since the last polling/sync time

type PatientSyncResponse

type PatientSyncResponse struct {
	MFLCode int `json:"MFLCODE"`
	// Patients is a slice of CCC numbers
	Patients []string `json:"patients"`
}

PatientSyncResponse is the response to a patient sync poll the patients payload contains ccc numbers

type PatientTestOrderOutput

type PatientTestOrderOutput struct {
	PatientID      string `json:"patientID"`
	OrganizationID string `json:"organizationID"`
	FacilityID     string `json:"facilityID"`

	Name      string    `json:"name"`
	ConceptID *string   `json:"conceptId"`
	Date      time.Time `json:"date"`
}

PatientTestOrderOutput contains details of an orderered test and the date

type PatientTestResultOutput

type PatientTestResultOutput struct {
	PatientID      string `json:"patientID"`
	OrganizationID string `json:"organizationID"`
	FacilityID     string `json:"facilityID"`

	Name      string     `json:"name"`
	ConceptID *string    `json:"conceptId"`
	Date      time.Time  `json:"date"`
	Result    TestResult `json:"result"`
}

PatientTestResultOutput contains results for a completed test

type PatientVitalSignOutput

type PatientVitalSignOutput struct {
	PatientID      string `json:"patientID"`
	OrganizationID string `json:"organizationID"`
	FacilityID     string `json:"facilityID"`

	Name      string    `json:"name"`
	ConceptID *string   `json:"conceptId"`
	Value     string    `json:"value"`
	Date      time.Time `json:"date"`
}

PatientVitalSignOutput contains vital signs collected for a particular client/patient

type PatientsPayload

type PatientsPayload struct {
	Patients []*PatientRegistrationPayload `json:"patients"`
}

PatientsPayload is the payload for registering patients

type PatientsRecordsPayload

type PatientsRecordsPayload struct {
	MFLCode string                 `json:"MFLCODE"`
	Records []PatientRecordPayload `json:"records"`
}

PatientsRecordsPayload is the payload sent from a Kenya EMR instance containing records of all newly created/updated patients/clients since the last sync

type PinResetServiceRequestPayload

type PinResetServiceRequestPayload struct {
	CCCNumber string          `json:"cccNumber"`
	Username  string          `json:"username"`
	Flavour   feedlib.Flavour `json:"flavour"`
}

PinResetServiceRequestPayload models the details passed to an API when a pin reset service request is being created

type ProgramInput

type ProgramInput struct {
	Name           string   `json:"name"  validate:"required"`
	Description    string   `json:"description"  validate:"required"`
	OrganisationID string   `json:"organisationID" validate:"required"`
	Facilities     []string `json:"facilities"`
}

ProgramInput defines the program input structure

func (ProgramInput) Validate

func (s ProgramInput) Validate() error

Validate helps with validation of a question response input

type ProgramJSONOutput

type ProgramJSONOutput struct {
	Name        string `json:"name" validate:"required"`
	Description string `json:"description" validate:"required"`
}

ProgramJSONOutput is a struct that stores the output of program json values

func (*ProgramJSONOutput) ParseValues

func (p *ProgramJSONOutput) ParseValues(values []byte) (*ProgramInput, error)

ParseValues transforms and validates the json program to type ProgramInput

type ProgramOutput

type ProgramOutput struct {
	Count    int               `json:"count"`
	Programs []*domain.Program `json:"programs"`
}

ProgramOutput represents the output for fetching programs

type PubSubCMSClientInput

type PubSubCMSClientInput struct {
	// user details
	UserID      string           `json:"user_id"`
	Name        string           `json:"name"`
	Gender      enumutils.Gender `json:"gender"`
	UserType    enums.UsersType  `json:"user_type"`
	PhoneNumber string           `json:"phone_number"`
	Handle      string           `json:"handle"`
	Flavour     feedlib.Flavour  `json:"flavour"`
	DateOfBirth scalarutils.Date `json:"date_of_birth"`

	// client details
	ClientID       string             `json:"client_id"`
	ClientTypes    []enums.ClientType `json:"client_types"`
	EnrollmentDate scalarutils.Date   `json:"enrollment_date"`

	// facility details
	FacilityID   string `json:"facility_id"`
	FacilityName string `json:"facility_name"`

	// organisation details
	OrganisationID string `json:"organisation_id"`
}

PubSubCMSClientInput is the subscribers input to make an api call to the cms service

type PubsubCreateCMSClientPayload

type PubsubCreateCMSClientPayload struct {
	ClientID       string           `json:"client_id"`
	Name           string           `json:"name"`
	Gender         string           `json:"gender"`
	DateOfBirth    scalarutils.Date `json:"date_of_birth"`
	OrganisationID string           `json:"organisation_id"`
	ProgramID      string           `json:"program_id"`
}

PubsubCreateCMSClientPayload contains the user's data model to be used to publish the user who is to be created in the content CMS service.

type PubsubCreateCMSStaffPayload

type PubsubCreateCMSStaffPayload struct {
	UserID         string           `json:"user_id"`
	Name           string           `json:"name"`
	Gender         enumutils.Gender `json:"gender"`
	UserType       enums.UsersType  `json:"user_type"`
	PhoneNumber    string           `json:"phone_number"`
	Handle         string           `json:"handle"`
	Flavour        feedlib.Flavour  `json:"flavour"`
	DateOfBirth    scalarutils.Date `json:"date_of_birth"`
	StaffNumber    string           `json:"staff_number"`
	StaffID        string           `json:"staff_id"`
	FacilityID     string           `json:"facility_id"`
	FacilityName   string           `json:"facility_name"`
	OrganisationID string           `json:"organisation_id"`
}

PubsubCreateCMSStaffPayload is the payload passed when creating a staff user on the CMS service

type QuestionInput

type QuestionInput struct {
	Text              string                          `json:"text" validate:"required"`
	QuestionType      enums.QuestionType              `json:"questionType" validate:"required"`
	ResponseValueType enums.QuestionResponseValueType `json:"responseValueType" validate:"required"`
	Required          bool                            `json:"required" validate:"required"`
	SelectMultiple    bool                            `json:"selectMultiple"`
	Sequence          int                             `json:"sequence" validate:"required"`
	Choices           []QuestionInputChoiceInput      `json:"choices"`
	ProgramID         string                          `json:"programID"`
}

QuestionInput represents the input for a Question for a given screening tool in a questionnaire

func (QuestionInput) Validate

func (s QuestionInput) Validate() error

Validate helps with validation of a question input

type QuestionInputChoiceInput

type QuestionInputChoiceInput struct {
	Choice    *string `json:"choice" validate:"required"`
	Value     string  `json:"value" validate:"required"`
	Score     int     `json:"score"`
	ProgramID string  `json:"programID"`
}

QuestionInputChoiceInput represents choices for a given question

type QuestionnaireInput

type QuestionnaireInput struct {
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Questions   []*QuestionInput `json:"questions"`
}

QuestionnaireInput represents the payload that is to be used when creating a questionnaire.

func (QuestionnaireInput) Validate

func (q QuestionnaireInput) Validate() error

Validate helps with validation of the QuestionnaireInput

type QuestionnaireScreeningToolQuestionResponseInput

type QuestionnaireScreeningToolQuestionResponseInput struct {
	QuestionID string `json:"questionID"  validate:"required"`
	Response   string `json:"response"`
	ProgramID  string `json:"programID"`
}

QuestionnaireScreeningToolQuestionResponseInput represents the payload that is to be used when creating a questionnaire screening tool question response.

func (QuestionnaireScreeningToolQuestionResponseInput) Validate

Validate helps with validation of a question response input

type QuestionnaireScreeningToolResponseInput

type QuestionnaireScreeningToolResponseInput struct {
	ScreeningToolID   string                                             `json:"screeningToolID" validate:"required"`
	ClientID          string                                             `json:"clientID" validate:"required"`
	QuestionResponses []*QuestionnaireScreeningToolQuestionResponseInput `json:"questionResponses" validate:"required"`
	ProgramID         string                                             `json:"programID"`
	CaregiverID       *string                                            `json:"caregiverID"`
}

QuestionnaireScreeningToolResponseInput represents the payload that is to be used when creating a questionnaire screening tool response.

func (QuestionnaireScreeningToolResponseInput) Validate

Validate helps with validation of a QuestionnaireScreeningToolResponseInput

type RedFlagServiceRequestResponse

type RedFlagServiceRequestResponse struct {
	RedFlagServiceRequests []*domain.ServiceRequest `json:"redFlags"`
}

RedFlagServiceRequestResponse models the response returned when fetching for red flags service requests

type RefreshTokenPayload

type RefreshTokenPayload struct {
	UserID *string `json:"userID"`
}

RefreshTokenPayload is used when calling the REST API to exchange a Refresh Token for new ID Token

type Response

type Response struct {
	User            *User           `json:"userProfile"`
	AuthCredentials AuthCredentials `json:"credentials"`
	GetStreamToken  string          `json:"getStreamToken"`
}

Response models the response that will be returned after a user logs in

type RestEndpointResponses

type RestEndpointResponses struct {
	Data map[string]interface{} `json:"data"`
}

RestEndpointResponses represents the rest endpoints response(s) output

type SavedNotification

type SavedNotification struct {
	ID                string                                         `json:"id,omitempty"`
	RegistrationToken string                                         `json:"registrationToken,omitempty"`
	MessageID         string                                         `json:"messageID,omitempty"`
	Timestamp         time.Time                                      `json:"timestamp,omitempty"`
	Data              map[string]interface{}                         `json:"data,omitempty"`
	Notification      *firebasetools.FirebaseSimpleNotificationInput `json:"notification,omitempty"`
	AndroidConfig     *firebasetools.FirebaseAndroidConfigInput      `json:"androidConfig,omitempty"`
	WebpushConfig     *firebasetools.FirebaseWebpushConfigInput      `json:"webpushConfig,omitempty"`
	APNSConfig        *firebasetools.FirebaseAPNSConfigInput         `json:"apnsConfig,omitempty"`
}

SavedNotification is used to serialize and save successful FCM notifications.

It's the basis for a primitive "inbox" - a mechanism by which an app can request it's messages in bulk.

type ScreeningToolInput

type ScreeningToolInput struct {
	Questionnaire QuestionnaireInput `json:"questionnaire"`
	Threshold     int                `json:"threshold"`
	ClientTypes   []enums.ClientType `json:"clientTypes"`
	Genders       []enumutils.Gender `json:"genders"`
	AgeRange      AgeRangeInput      `json:"ageRange"`
	ProgramID     string             `json:"programID"`
}

ScreeningToolInput represents the payload that is to be used when creating a questionnaire

type ScreeningToolOutputPage

type ScreeningToolOutputPage struct {
	Pagination     *domain.Pagination      `json:"pagination"`
	ScreeningTools []*domain.ScreeningTool `json:"screeningTools"`
}

ScreeningToolOutputPage returns a paginated list of screening tools

type SecurityQuestionResponseInput

type SecurityQuestionResponseInput struct {
	UserID             string `json:"userID" validate:"required"`
	SecurityQuestionID string `json:"securityQuestionID" validate:"required"`
	Response           string `json:"response" validate:"required"`
}

SecurityQuestionResponseInput represents the SecurityQuestionResponse input data structure

func (*SecurityQuestionResponseInput) Validate

func (f *SecurityQuestionResponseInput) Validate() error

Validate helps with validation of SecurityQuestionResponseInput fields

type SendOTPInput

type SendOTPInput struct {
	Username string          `json:"username" validate:"required"`
	Flavour  feedlib.Flavour `json:"flavour" validate:"required"`
}

SendOTPInput represents the send OTP input data structure

type SendRetryOTPPayload

type SendRetryOTPPayload struct {
	Username string          `json:"username" validate:"required"`
	Flavour  feedlib.Flavour `json:"flavour" validate:"required"`
}

SendRetryOTPPayload is used to define the inputs passed when calling the endpoint that resends an otp

type ServiceIdentifierInput

type ServiceIdentifierInput struct {
	IdentifierType  enums.Terminologies `json:"identifierType"`
	IdentifierValue string              `json:"identifierValue"`
}

ServiceIdentifierInput is used to hold the identifier values of the service that is offered in a facility

type ServiceRequestInput

type ServiceRequestInput struct {
	Active         bool                   `json:"active"`
	RequestType    string                 `json:"requestType"`
	Status         string                 `json:"status"`
	Request        string                 `json:"request"`
	ClientID       string                 `json:"clientID"`
	StaffID        string                 `json:"staffID"`
	InProgressBy   *string                `json:"inProgressBy"`
	ResolvedBy     *string                `json:"resolvedBy"`
	FacilityID     string                 `json:"facilityID"`
	ClientName     *string                `json:"clientName"`
	StaffName      string                 `json:"staffName"`
	Flavour        feedlib.Flavour        `json:"flavour"`
	Meta           map[string]interface{} `json:"meta"`
	ProgramID      string                 `json:"programID"`
	OrganisationID string                 `json:"organisationID"`
	CaregiverID    *string                `json:"caregiverID"`
}

ServiceRequestInput is a domain entity that represents a service request.

type ServiceRequestPayload

type ServiceRequestPayload struct {
	MFLCode      int        `json:"MFLCODE"`
	LastSyncTime *time.Time `json:"lastSyncTime"`
}

ServiceRequestPayload defines the payload from KenyaEMR used to fetch service requests.

type ShareContentInput

type ShareContentInput struct {
	ClientID  string `json:"clientID" validate:"required"`
	ContentID int    `json:"contentID" validate:"required"`
	Channel   string `json:"channel" validate:"required"`
}

ShareContentInput defines the field passed when sharing content

func (*ShareContentInput) Validate

func (f *ShareContentInput) Validate() error

Validate helps with validation of ShareContentInput fields

type SignUpPayload

type SignUpPayload struct {
	ClientInput *ClientRegistrationInput
	UserProfile *domain.User
	UserProgram *domain.Program
	Facility    *domain.Facility
	Matrix      *domain.MatrixAuth
}

SignUpPayload is a dataclass to help in he signup process for both self registering clients and staff

type SortsInput

type SortsInput struct {
	Direction enums.SortDataType       `json:"direction"`
	Field     enums.FilterSortDataType `json:"field"`
}

SortsInput includes the fields required for sorting the different types of fields

type StaffFacilityInput

type StaffFacilityInput struct {
	StaffID    *string `json:"staffID"`
	FacilityID *string `json:"facilityID"`
	ProgramID  string  `json:"programID"`
}

StaffFacilityInput is the input for getting a staff facility from the through table

type StaffRegistrationInput

type StaffRegistrationInput struct {
	Username            string           `json:"username" validate:"required"`
	Facility            string           `json:"facility" validate:"required"`
	StaffName           string           `json:"staffName" validate:"required"`
	Gender              enumutils.Gender `json:"gender" validate:"required"`
	DateOfBirth         scalarutils.Date `json:"dateOfBirth" validate:"required"`
	PhoneNumber         string           `json:"phoneNumber" validate:"required"`
	IDNumber            string           `json:"idNumber" validate:"required"`
	StaffNumber         string           `json:"staffNumber" validate:"required"`
	StaffRoles          string           `json:"staffRoles"`
	InviteStaff         bool             `json:"inviteStaff"`
	ProgramID           string           `json:"programID"`
	OrganisationID      string           `json:"organisationID"`
	IsOrganisationAdmin bool             `json:"isOrganisationAdmin"`
}

StaffRegistrationInput is a model that represents the inputs passed when registering a staff user

func (StaffRegistrationInput) Validate

func (s StaffRegistrationInput) Validate() error

Validate helps with validation of StaffRegistrationInput fields

type StaffRegistrationOutput

type StaffRegistrationOutput struct {
	ID                  string       `json:"id"`
	Active              bool         `json:"active"`
	StaffNumber         string       `json:"staff_number"`
	UserID              string       `json:"user"`
	DefaultFacility     string       `json:"default_facility"`
	UserProfile         *domain.User `json:"user_profile"`
	IsOrganisationAdmin bool         `json:"isOrganisationAdmin"`
}

StaffRegistrationOutput models the staff registration api response

type SurveyForm

type SurveyForm struct {
	ProjectID    int       `json:"projectId"`
	XMLFormID    string    `json:"xmlFormId"`
	State        string    `json:"state"`
	EnketoID     string    `json:"enketoId"`
	EnketoOnceID string    `json:"enketoOnceId"`
	CreatedAt    time.Time `json:"createdAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
	KeyID        string    `json:"keyId"`
	Version      string    `json:"version"`
	Hash         string    `json:"hash"`
	SHA          string    `json:"sha"`
	SHA256       string    `json:"sha256"`
	DraftToken   string    `json:"draftToken"`
	PublishedAt  time.Time `json:"publishedAt"`
	Name         string    `json:"name"`
}

SurveyForm is contains the information about a survey form

type SurveyLinkInput

type SurveyLinkInput struct {
	ProjectID   int    `json:"projectID"`
	FormID      string `json:"formID"`
	DisplayName string `json:"displayName"`
	OnceOnly    bool   `json:"onceOnly"`
}

SurveyLinkInput is the payload for creating a survey public access link

type SurveyPublicLink struct {
	ID          int        `json:"id"`
	DisplayName string     `json:"displayName"`
	Once        bool       `json:"once"`
	Token       string     `json:"token"`
	ExpiresAt   time.Time  `json:"expiresAt"`
	CSRF        string     `json:"csrf"`
	CreatedAt   time.Time  `json:"createdAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
	DeletedAt   *time.Time `json:"deletedAt"`
}

SurveyPublicLink is contains the information about a survey public link

type SurveyResponseInput

type SurveyResponseInput struct {
	ProjectID   int    `json:" projectID"`
	FormID      string `json:"formID"`
	SubmitterID int    `json:"submitterID"`
	ProgramID   string `json:"programID"`
}

SurveyResponseInput is the input for getting a survey response

type SurveysWithServiceRequest

type SurveysWithServiceRequest struct {
	Title     string `json:"name"`
	ProjectID int    `json:"projectID"`
	LinkID    int    `json:"linkID"`
	FormID    string `json:"formID"`
}

SurveysWithServiceRequest is the domain model used to list surveys with a service request

type TestOrderPayload

type TestOrderPayload struct {
	Name      string    `json:"orderedTestName"`
	ConceptID *string   `json:"conceptId"`
	Date      time.Time `json:"orderDateTime"`
}

TestOrderPayload contains details of an orderered test and the date

type TestResult

type TestResult struct {
	Name      string  `json:"name"`
	ConceptID *string `json:"conceptId"`
}

TestResult ...

type TestResultPayload

type TestResultPayload struct {
	Name            string    `json:"test"`
	TestConceptID   *string   `json:"testConceptId"`
	Date            time.Time `json:"testDateTime"`
	Result          string    `json:"result"`
	ResultConceptID *string   `json:"resultConceptId"`
}

TestResultPayload contains results for a completed test

type Tweaks

type Tweaks struct {
	Sound string `json:"sound,omitempty"`
}

Tweaks are a dictionary of customizations made to the way this notification is to be presented.

type UpdateFacilityFHIRID

type UpdateFacilityFHIRID struct {
	FacilityID string `json:"facilityID"`
	FhirID     string `json:"fhirOrganisationID"`
}

UpdateFacilityFHIRID represents the data structure used for updating the fhir id field in a facility

type UpdatePatientFHIRID

type UpdatePatientFHIRID struct {
	FhirID   string `json:"fhirID"`
	ClientID string `json:"clientID"`
}

UpdatePatientFHIRID represents the data structure used for updating the FHIR ID in a user's profile.

type UpdateProgramFHIRID

type UpdateProgramFHIRID struct {
	ProgramID    string `json:"programID"`
	FHIRTenantID string `json:"fhirTenantID"`
}

UpdateProgramFHIRID represents the data structure used for updating the fhir id field in a program

type UpdateServiceRequestPayload

type UpdateServiceRequestPayload struct {
	ID           string    `json:"id" validate:"required"`
	RequestType  string    `json:"request_type" validate:"required"`
	Status       string    `json:"status" validate:"required"`
	InProgressAt time.Time `json:"in_progress_at"`
	InProgressBy string    `json:"in_progress_by"`
	ResolvedAt   time.Time `json:"resolved_at"`
	ResolvedBy   string    `json:"resolved_by"`
}

UpdateServiceRequestPayload defines the payload that is used to synchronize KenyaEMR service requests to MyCareHub.

type UpdateServiceRequestsPayload

type UpdateServiceRequestsPayload struct {
	ServiceRequests []UpdateServiceRequestPayload `json:"serviceRequests" validate:"required"`
}

UpdateServiceRequestsPayload defined a list of service requests to synchronize MyCareHub with.

type User

type User struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Active   bool   `json:"active"`

	NextAllowedLogin time.Time `json:"-"`
	FailedLoginCount int       `json:"-"`
	CurrentProgramID string    `json:"-"`

	PinChangeRequired      bool `json:"pinChangeRequired"`
	HasSetPin              bool `json:"hasSetPin"`
	HasSetSecurityQuestion bool `json:"hasSetSecurityQuestions"`
	IsPhoneVerified        bool `json:"isPhoneVerified"`
	TermsAccepted          bool `json:"termsAccepted"`
	Suspended              bool `json:"suspended"`
	FailedSecurityCount    int  `json:"-"`
	PinUpdateRequired      bool `json:"pinUpdateRequired"`
	HasSetNickname         bool `json:"hasSetNickname"`
}

User is the output dto for the user domain object

type UserResetPinInput

type UserResetPinInput struct {
	PhoneNumber string          `json:"phoneNumber"`
	Username    string          `json:"username" validate:"required"`
	Flavour     feedlib.Flavour `json:"flavour" validate:"required"`
	PIN         string          `json:"pin" validate:"required"`
	OTP         string          `json:"otp" validate:"required"`
}

UserResetPinInput contains the fields requires when a user is resetting a pin

func (*UserResetPinInput) Validate

func (f *UserResetPinInput) Validate() error

Validate checks to validate whether the field inputs for verifying user pin

type UserSurveyInput

type UserSurveyInput struct {
	UserID         string `json:"userID"`
	FormID         string `json:"formID"`
	ProjectID      int    `json:"projectID"`
	LinkID         int    `json:"linkID"`
	Title          string `json:"title"`
	Description    string `json:"description"`
	Link           string `json:"link"`
	Token          string `json:"token"`
	ProgramID      string `json:"programID"`
	OrganisationID string `json:"organisationID"`
}

UserSurveyInput represents a user survey input data structure

type VerifyOTPInput

type VerifyOTPInput struct {
	PhoneNumber string          `json:"phoneNumber"`
	Username    string          `json:"username" validate:"required"`
	OTP         string          `json:"otp" validate:"required"`
	Flavour     feedlib.Flavour `json:"flavour" validate:"required"`
}

VerifyOTPInput represents the verify OTP input data structure

func (*VerifyOTPInput) Validate

func (f *VerifyOTPInput) Validate() error

Validate helps with validation of VerifyOTPInput fields

type VerifyPhoneInput

type VerifyPhoneInput struct {
	Username string          `json:"username"`
	Flavour  feedlib.Flavour `json:"flavour"`
}

VerifyPhoneInput carries the OTP data used to send OTP messages to a particular phone number

type VerifySecurityQuestionInput

type VerifySecurityQuestionInput struct {
	QuestionID string          `json:"questionID" validate:"required"`
	Flavour    feedlib.Flavour `json:"flavour" validate:"required"`
	Response   string          `json:"response" validate:"required"`
	Username   string          `json:"username" validate:"required"`
}

VerifySecurityQuestionInput defines the field passed when verifying the set security questions

func (*VerifySecurityQuestionInput) Validate

func (f *VerifySecurityQuestionInput) Validate() error

Validate checks to validate whether the field inputs for verifying a security question are filled

type VerifySecurityQuestionsPayload

type VerifySecurityQuestionsPayload struct {
	SecurityQuestionsInput []*VerifySecurityQuestionInput `json:"verifySecurityQuestionsInput"`
}

VerifySecurityQuestionsPayload holds a list of security question inputs.

type VerifySurveySubmissionInput

type VerifySurveySubmissionInput struct {
	ProjectID   int     `json:"projectID"`
	FormID      string  `json:"formID"`
	SubmitterID int     `json:"submitterID"`
	CaregiverID *string `json:"caregiverID"`
}

VerifySurveySubmissionInput represents the payload that is to be sent when a user has filled a survey.

type VitalSignPayload

type VitalSignPayload struct {
	Name      string    `json:"name"`
	ConceptID *string   `json:"conceptId"`
	Value     string    `json:"value"`
	Date      time.Time `json:"obsDateTime"`
}

VitalSignPayload contains vital signs collected for a particular client/patient

Jump to

Keyboard shortcuts

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