healthcrm

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 14 Imported by: 3

README

healthcrm

Linting and Tests Coverage Status

healthcrm Library

healthcrm is a library that abstracts the interaction with SIL's health CRM service.

Installing it

healthcrm is compatible with modern Go releases in module mode, with Go installed:

go get -u github.com/savannahghi/healthcrm

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "github.com/savannahghi/healthcrm"

and run go get without parameters.

The package name is healthcrm

Developing

The default branch library is main

We try to follow semantic versioning ( https://semver.org/ ). For that reason, every major, minor and point release should be tagged.

git tag -m "v0.0.1" "v0.0.1"
git push --tags

Continuous integration tests must pass on Github CI. Our coverage threshold is >=80% i.e you must keep coverage above 80%.

Environment variables

In order to run tests, you need to have an env.sh file similar to this one:

# Application settings
export HEALTH_CRM_AUTH_SERVER_ENDPOINT=""
export HEALTH_CRM_CLIENT_ID=""
export HEALTH_CRM_CLIENT_SECRET=""
export HEALTH_CRM_GRANT_TYPE=""
export HEALTH_CRM_USERNAME=""
export HEALTH_CRM_PASSWORD=""

This file must not be committed to version control.

It is important to export the environment variables. If they are not exported, they will not be visible to child processes e.g go test ./....

These environment variables should also be set up on github CI environment variable section.

Contributing

I would like to cover the entire GitHub API and contributions are of course always welcome. The calling pattern is pretty well established, so adding new methods is relatively straightforward. See CONTRIBUTING.md for details.

Versioning

In general, enumutils follows semver as closely as we can for tagging releases of the package. For self-contained libraries, the application of semantic versioning is relatively straightforward and generally understood. We've adopted the following versioning policy:

  • We increment the major version with any incompatible change to non-preview functionality, including changes to the exported Go API surface or behavior of the API.
  • We increment the minor version with any backwards-compatible changes to functionality, as well as any changes to preview functionality in the GitHub API. GitHub makes no guarantee about the stability of preview functionality, so neither do we consider it a stable part of the go-github API.
  • We increment the patch version with any backwards-compatible bug fixes.

License

This library is distributed under the MIT license found in the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BusinessHours added in v1.0.3

type BusinessHours struct {
	Day         string `json:"day"`
	OpeningTime string `json:"opening_time"`
	ClosingTime string `json:"closing_time"`
}

BusinessHours models data to store business hours

type BusinessHoursOutput added in v1.0.1

type BusinessHoursOutput struct {
	ID          string `json:"id"`
	Day         string `json:"day"`
	OpeningTime string `json:"opening_time"`
	ClosingTime string `json:"closing_time"`
	FacilityID  string `json:"facility_id"`
}

BusinessHoursOutput models data that show facility's operational hours

type Config added in v1.6.0

type Config struct {
	AuthServerEndpoint string
	ClientID           string
	ClientSecret       string
	GrantType          string
	Username           string
	Password           string
	BaseURL            string
}

Config contains the settings required to initialize a health crm client

type ContactType added in v1.1.6

type ContactType string
const (
	ContactTypePhoneNumber ContactType = "PHONE_NUMBER"
	ContactTypeEmail       ContactType = "EMAIL"
)

func (ContactType) IsValid added in v1.1.6

func (f ContactType) IsValid() bool

IsValid returns true if a contact type is valid

func (ContactType) MarshalGQL added in v1.1.6

func (f ContactType) MarshalGQL(w io.Writer)

MarshalGQL writes the contact type to the supplied writer

func (ContactType) String added in v1.1.6

func (f ContactType) String() string

String converts the contact type enum to a string

func (*ContactType) UnmarshalGQL added in v1.1.6

func (f *ContactType) UnmarshalGQL(v interface{}) error

UnmarshalGQL converts the supplied value to a contact type.

type Contacts

type Contacts struct {
	ContactType  string `json:"contact_type,omitempty"`
	ContactValue string `json:"contact_value,omitempty"`
	Role         string `json:"role,omitempty"`
}

Contacts models facility's model data class

type ContactsOutput

type ContactsOutput struct {
	ID           string `json:"id"`
	ContactType  string `json:"contact_type"`
	ContactValue string `json:"contact_value"`
	Active       bool   `json:"active"`
	Role         string `json:"role"`
	FacilityID   string `json:"facility_id"`
}

ContactsOutput is used to show facility contacts

type Coordinates

type Coordinates struct {
	Latitude  string `json:"latitude,omitempty"`
	Longitude string `json:"longitude,omitempty"`
	Radius    string `json:"radius,omitempty"`
}

Coordinates represents geographical coordinates using latitude and longitude. Latitude measures the north-south position, while longitude measures the east-west position.

func (Coordinates) ToString added in v1.0.10

func (c Coordinates) ToString() (string, error)

ToString returns the location in comma-separated values format. The order of values in the string is longitude,latitude. The latitude and longitude are formatted up to 5 decimal places. For example, if the Location has Latitude 36.79 and Longitude -1.29, the returned string will be "-1.29, 36.79".

type CoordinatesOutput

type CoordinatesOutput struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

CoordinatesOutput is used to show geographical coordinates

type Facility

type Facility struct {
	ID            string          `json:"id,omitempty"`
	Name          string          `json:"name,omitempty"`
	Description   string          `json:"description,omitempty"`
	FacilityType  string          `json:"facility_type,omitempty"`
	County        string          `json:"county,omitempty"`
	Country       string          `json:"country,omitempty"`
	Address       string          `json:"address,omitempty"`
	Coordinates   *Coordinates    `json:"coordinates,omitempty"`
	Contacts      []Contacts      `json:"contacts,omitempty"`
	Identifiers   []Identifiers   `json:"identifiers,omitempty"`
	BusinessHours []BusinessHours `json:"businesshours,omitempty"`
}

Facility is the hospitals data class

type FacilityIdentifierType added in v1.3.9

type FacilityIdentifierType string

FacilityIdentifierType is a list of all the facility identifier types.

const (
	FacilityIdentifierTypeMFLCode                FacilityIdentifierType = "MFL_CODE"                  //nolint:all
	FacilityIdentifierTypeHealthCRM              FacilityIdentifierType = "HEALTH_CRM"                //nolint:all
	FacilityIdentifierTypeSladeCode              FacilityIdentifierType = "SLADE_CODE"                //nolint:all
	FacilityIdentifierTypeSHASladeCode           FacilityIdentifierType = "SHA_SLADE_CODE"            //nolint:all
	FacilityIdentifierTypeFIDCode                FacilityIdentifierType = "FID_CODE"                  //nolint:all
	FacilityIdentifierTypeFRCode                 FacilityIdentifierType = "FR_CODE"                   //nolint:all
	FacilityIdentifierTypeKMPDCRegNumber         FacilityIdentifierType = "KMPDC_REG_NUMBER"          //nolint:all
	FacilityIdentifierTypeSladeAdvantageBranchID FacilityIdentifierType = "SLADE_ADVANTAGE_BRANCH_ID" //nolint:all
)

func (FacilityIdentifierType) String added in v1.3.9

func (f FacilityIdentifierType) String() string

type FacilityOutput

type FacilityOutput struct {
	ID            string                `json:"id,omitempty"`
	Created       time.Time             `json:"created,omitempty"`
	Slug          string                `json:"slug"`
	Name          string                `json:"name,omitempty"`
	Description   string                `json:"description,omitempty"`
	FacilityType  string                `json:"facility_type,omitempty"`
	County        string                `json:"county,omitempty"`
	Country       string                `json:"country,omitempty"`
	Coordinates   CoordinatesOutput     `json:"coordinates,omitempty"`
	Distance      float64               `json:"distance,omitempty"`
	Status        string                `json:"status,omitempty"`
	Address       string                `json:"address,omitempty"`
	Contacts      []ContactsOutput      `json:"contacts,omitempty"`
	Identifiers   []IdentifiersOutput   `json:"identifiers,omitempty"`
	BusinessHours []BusinessHoursOutput `json:"businesshours,omitempty"`
	Services      []FacilityService     `json:"services,omitempty"`
	IsAIResult    bool                  `json:"is_ai_result,omitempty"`
	Photos        []FacilityPhoto       `json:"facility_images,omitempty"`
}

FacilityOutput is used to display facility(ies)

type FacilityOutputs added in v1.1.9

type FacilityOutputs struct {
	Results []*FacilityOutput `json:"results"`
}

FacilityOutputs is used to get a list of facilities

type FacilityPage

type FacilityPage struct {
	Count       int              `json:"count"`
	Next        string           `json:"next"`
	Previous    any              `json:"previous"`
	PageSize    int              `json:"page_size"`
	CurrentPage int              `json:"current_page"`
	TotalPages  int              `json:"total_pages"`
	StartIndex  int              `json:"start_index"`
	EndIndex    int              `json:"end_index"`
	Results     []FacilityOutput `json:"results"`
}

FacilityPage is the hospitals model used to show facility details

type FacilityPhoto added in v1.3.7

type FacilityPhoto struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	ImageURL    string `json:"document"`
	Size        int64  `json:"size"`
	Description string `json:"description"`
	ContentType string `json:"content_type"`
	Facility    string `json:"facility_id"`
}

FacilityPhoto is the photo related to a Facility in HealthCRM

type FacilityService added in v1.0.1

type FacilityService struct {
	ID          string               `json:"id"`
	Name        string               `json:"name"`
	Description string               `json:"description"`
	Identifiers []*ServiceIdentifier `json:"identifiers"`
}

FacilityService models the data class that is used to show facility services

type FacilityServiceInput added in v1.0.9

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

FacilityServiceInput models is used to create a new service

type FacilityServicePage added in v1.0.1

type FacilityServicePage struct {
	Results     []FacilityService `json:"results"`
	Count       int               `json:"count"`
	Next        string            `json:"next"`
	Previous    string            `json:"previous"`
	PageSize    int               `json:"page_size"`
	CurrentPage int               `json:"current_page"`
	TotalPages  int               `json:"total_pages"`
	StartIndex  int               `json:"start_index"`
	EndIndex    int               `json:"end_index"`
}

FacilityServicePage models the services offered in a facility

type FacilityServices added in v1.1.8

type FacilityServices struct {
	Results []*FacilityService `json:"results"`
}

FacilityServices is used to get a list of facility Services

type FilterFacilitiesInput added in v1.3.9

type FilterFacilitiesInput struct {
	Location        *Coordinates
	ServiceIDs      []string
	SearchParameter string
	Pagination      *Pagination
	CrmServiceCode  string
	IdentifierType  FacilityIdentifierType
	IdentifierValue string
}

FilterFacilitiesInput takes in the parameters to filter facilities

type FilterPractitionersInput added in v1.4.1

type FilterPractitionersInput struct {
	SearchParameter string
	Specialty       []string
	Service         []string
	Pagination      *Pagination
	CrmServiceCode  string
	IdentifierType  string
	IdentifierValue string
}

FilterPractitionersInput takes in the parameters to filter practitioners

type GenderType added in v1.2.0

type GenderType string
const (
	GenderTypeMale   GenderType = "MALE"
	GenderTypeFemale GenderType = "FEMALE"
	GenderTypeOther  GenderType = "OTHER"
	// GenderTypeASKU stands for Asked but Unknown
	GenderTypeASKU GenderType = "ASKU"
	// GenderTypeUNK stands for Unknown
	GenderTypeUNK GenderType = "UNK"
)

func ConvertEnumutilsGenderToCRMGender added in v1.2.3

func ConvertEnumutilsGenderToCRMGender(gender enumutils.Gender) GenderType

ConvertEnumutilsGenderToCRMGender converts an enumutils Gender to a CRM gender type

func (GenderType) IsValid added in v1.2.0

func (f GenderType) IsValid() bool

IsValid returns true if a Gender type is valid

func (GenderType) MarshalGQL added in v1.2.0

func (f GenderType) MarshalGQL(w io.Writer)

MarshalGQL writes the gender type to the supplied writer

func (GenderType) String added in v1.2.0

func (f GenderType) String() string

String converts the Gender type enum to a string

func (*GenderType) UnmarshalGQL added in v1.2.0

func (f *GenderType) UnmarshalGQL(v interface{}) error

UnmarshalGQL converts the supplied value to a Gender type.

type HealthCRMLib

type HealthCRMLib struct {
	// contains filtered or unexported fields
}

HealthCRMLib interacts with the healthcrm APIs

func NewHealthCRMLib

func NewHealthCRMLib(cfg Config) (*HealthCRMLib, error)

NewHealthCRMLib initializes a new instance of healthCRM SDK

func (*HealthCRMLib) CreateFacility

func (h *HealthCRMLib) CreateFacility(ctx context.Context, facility *Facility) (*FacilityOutput, error)

CreateFacility is used to create facility in health CRM service

func (*HealthCRMLib) CreateProfile added in v1.1.5

func (h *HealthCRMLib) CreateProfile(ctx context.Context, profile *ProfileInput) (*ProfileOutput, error)

CreateProfile is used to create profile in health CRM service

func (*HealthCRMLib) CreateService added in v1.0.9

func (h *HealthCRMLib) CreateService(ctx context.Context, input FacilityServiceInput) (*FacilityService, error)

CreateService is used to create a new service in health crm

func (*HealthCRMLib) GetFacilities

func (h *HealthCRMLib) GetFacilities(ctx context.Context, filters FilterFacilitiesInput) (*FacilityPage, error)

GetFacilities retrieves a list of facilities associated with MyCareHub stored in HealthCRM. The method allows for filtering facilities by location proximity and services offered.

Parameters:

  • location: A Location struct that represents the reference location. If provided, facilities will be filtered based on proximity to this location.
  • pagination: A Pagination struct containing options for paginating the results.
  • serviceIDs: A parameter that allows specifying one or more service IDs. Facilities offering these services will be included in the results. You can pass multiple service IDs as separate arguments (e.g., GetFacilities(ctx, location, pagination, []string{"1234", "178"})).
  • searchParameter: A parameter used to search a facility by the facility name or a service name Note that this parameter cannot be passed together with the serviceIDs

Usage: Example 1: Retrieve facilities by location and service IDs: --> E.g If we are searching with service ID that represents Chemotherapy, the response will be a list of facilities that offer Chemotherapy and it will be ordered with proximity

Example 2: Retrieve facilities by location without specifying services: This will return a list of all facilities ordered by the proximity

Example 3: Retrieve all facilities without specifying location or services:

func (*HealthCRMLib) GetFacilitiesOfferingAService added in v1.0.6

func (h *HealthCRMLib) GetFacilitiesOfferingAService(ctx context.Context, serviceID string, pagination *Pagination) (*FacilityPage, error)

GetFacilitiesOfferingAService fetches the facilities that offer a particular service

func (*HealthCRMLib) GetFacilityByID

func (h *HealthCRMLib) GetFacilityByID(ctx context.Context, id string) (*FacilityOutput, error)

GetFacilityByID is used to fetch facilities from health crm facility registry using its ID

func (*HealthCRMLib) GetMultipleFacilities added in v1.1.9

func (h *HealthCRMLib) GetMultipleFacilities(ctx context.Context, facilityIDs []string) ([]*FacilityOutput, error)

GetMultipleFacilities is used to fetch multiple facilities

Parameters:

  • facilityIDs: A parameter that is a list of IDs specifying one or more facility IDs. Facility identifiers, contacts, services and business hours linked to a facility will be included in the results. You can **ONLY** pass a single or multiple facility IDs which should be of type **UUID** (e.g., GetMultipleFacilities(ctx, []string{"0fee2792-dffc-40d3-a744-2a70732b1053", "56c62083-c7b4-4055-8d44-6cc7446ac1d0", "8474ea55-8ede-4bc6-aa67-f53ed5456a03"})).

func (*HealthCRMLib) GetMultipleServices added in v1.1.8

func (h *HealthCRMLib) GetMultipleServices(ctx context.Context, servicesIDs []string) ([]*FacilityService, error)

GetMultipleServices is used to fetch multiple services

Parameters:

  • serviceIDs: A parameter that is a list of IDs specifying one or more service IDs. Service identifiers identifying these services will be included in the results. You can **ONLY** pass a single or multiple service IDs which should be of type **UUID** (e.g., GetMultipleServices(ctx, []string{"0fee2792-dffc-40d3-a744-2a70732b1053", "56c62083-c7b4-4055-8d44-6cc7446ac1d0", "8474ea55-8ede-4bc6-aa67-f53ed5456a03"})).

func (*HealthCRMLib) GetPersonContacts added in v1.2.5

func (h *HealthCRMLib) GetPersonContacts(ctx context.Context, healthID string) ([]*ProfileContactOutput, error)

GetPersonContacts fetches a persons Contacts using their HealthID

func (*HealthCRMLib) GetPersonIdentifiers added in v1.2.5

func (h *HealthCRMLib) GetPersonIdentifiers(ctx context.Context, healthID string, identifierTypes []*IdentifierType) ([]*ProfileIdentifierOutput, error)

GetPersonIdentifiers fetches a persons identifiers using their HealthID, a filter for identifier_type can be passed

func (*HealthCRMLib) GetPractitionerByID added in v1.4.1

func (h *HealthCRMLib) GetPractitionerByID(ctx context.Context, practitionerID string) (*Practitioner, error)

GetPractitionerByID retrieves a practitioner by their ID or slug.

func (*HealthCRMLib) GetPractitioners added in v1.3.5

func (h *HealthCRMLib) GetPractitioners(ctx context.Context, filters FilterPractitionersInput) (*Practitioners, error)

GetPractitioners retrieves a list of practitioners associated with a specific CRM service code.

func (*HealthCRMLib) GetService added in v1.1.1

func (h *HealthCRMLib) GetService(ctx context.Context, serviceID string) (*FacilityService, error)

GetService is used to fetch a single service given its ID

func (*HealthCRMLib) GetServices added in v1.0.11

func (h *HealthCRMLib) GetServices(ctx context.Context, pagination *Pagination, crmServiceCode string) (*FacilityServicePage, error)

GetServices retrieves a list of healthcare services provided by facilities that are owned by a specific SIL service, such as Mycarehub or Advantage.

func (*HealthCRMLib) GetSpecialties added in v1.3.6

func (h *HealthCRMLib) GetSpecialties(ctx context.Context, pagination *Pagination, crmServiceCode string) (*Specialties, error)

GetSpecialties retrieves a list of specialties associated with a specific CRM service code.

func (*HealthCRMLib) LinkServiceToFacility added in v1.0.9

func (h *HealthCRMLib) LinkServiceToFacility(ctx context.Context, facilityID string, input []*FacilityServiceInput) (*FacilityService, error)

LinkServiceToFacility is used to link a service to a facility

func (*HealthCRMLib) MatchProfile added in v1.3.2

func (h *HealthCRMLib) MatchProfile(ctx context.Context, profile *ProfileInput) (*ProfileOutput, error)

MatchProfile is used to create profile in health CRM service

func (*HealthCRMLib) UpdateFacility

func (h *HealthCRMLib) UpdateFacility(ctx context.Context, id string, updatePayload *Facility) (*FacilityOutput, error)

UpdateFacility is used to update facility's data

func (*HealthCRMLib) VerifyIdentifierDocument added in v1.3.4

func (h *HealthCRMLib) VerifyIdentifierDocument(ctx context.Context, input IDVerificationInput) (*IDVerificationResult, error)

type IDVerificationInput added in v1.3.4

type IDVerificationInput struct {
	IDUrl string `json:"id_url"`
}

IDVerificationInput is the input used to verify an identifier

type IDVerificationResult added in v1.3.4

type IDVerificationResult struct {
	ConfidenceScore float64         `json:"confidence_score"`
	UserDetails     UserDetails     `json:"patient_details"`
	RegistryDetails RegistryDetails `json:"client_registry_details"`
}

IDVerificationResult is the result of a verification request

type IdentifierType added in v1.1.6

type IdentifierType string
const (
	// Identifier types
	IdentifierTypeNationalID           IdentifierType = "NATIONAL_ID"
	IdentifierTypePassportNo           IdentifierType = "PASSPORT_NO"
	IdentifierTypeMilitaryID           IdentifierType = "MILITARY_ID"
	IdentifierTypeAlienID              IdentifierType = "ALIEN_ID"
	IdentifierTypeNHIFNo               IdentifierType = "NHIF_NO"
	IdentifierTypePatientNo            IdentifierType = "PATIENT_NO"
	IdentifierTypePayerMemberNo        IdentifierType = "PAYER_MEMBER_NO"
	IdentifierTypeSmartMemberNo        IdentifierType = "SMART_MEMBER_NO"
	IdentifierTypeFHIRPatientID        IdentifierType = "FHIR_PATIENT_ID"
	IdentifierTypeERPCustomerID        IdentifierType = "ERP_CUSTOMER_ID"
	IdentifierTypeCCCNumber            IdentifierType = "CCC_NUMBER"
	IdentifierTypeRefugeeID            IdentifierType = "REFUGEE_ID"
	IdentifierTypeBirthCertificateNo   IdentifierType = "BIRTH_CERTIFICATE_NO"
	IdentifierTypeMandateNo            IdentifierType = "MANDATE_NO"
	IdentifierTypeClientRegistryNo     IdentifierType = "CLIENT_REGISTRY_NO"
	IdentifierTypeDRChronoChartID      IdentifierType = "DR_CHRONO_CHART_ID"
	IdentifierTypeBirthNotificationNo  IdentifierType = "BIRTH_NOTIFICATION_NO"
	IdentifierTypeSHANumber            IdentifierType = "SHA_NUMBER"
	IdentifierTypeHouseholdNumber      IdentifierType = "HOUSEHOLD_NUMBER"
	IdentifierTypeTemporaryID          IdentifierType = "TEMPORARY_ID"
	IdentifierTypeTemporaryDependentID IdentifierType = "TEMPORARY_DEPENDENT_ID"
)

func (IdentifierType) IsValid added in v1.1.6

func (f IdentifierType) IsValid() bool

IsValid returns true if an identifier type is valid

func (IdentifierType) MarshalGQL added in v1.1.6

func (f IdentifierType) MarshalGQL(w io.Writer)

MarshalGQL writes the identifier type to the supplied writer

func (IdentifierType) String added in v1.1.6

func (f IdentifierType) String() string

String converts the identifier type enum to a string

func (*IdentifierType) UnmarshalGQL added in v1.1.6

func (f *IdentifierType) UnmarshalGQL(v interface{}) error

UnmarshalGQL converts the supplied value to an identifier type.

type Identifiers

type Identifiers struct {
	IdentifierType  string `json:"identifier_type,omitempty"`
	IdentifierValue string `json:"identifier_value,omitempty"`
	ValidFrom       string `json:"valid_from,omitempty"`
	ValidTo         string `json:"valid_to,omitempty"`
}

Identifiers models facility's identifiers; can be MFL Code, Slade Code etc...

type IdentifiersOutput

type IdentifiersOutput struct {
	ID              string `json:"id"`
	IdentifierType  string `json:"identifier_type"`
	IdentifierValue string `json:"identifier_value"`
	ValidFrom       string `json:"valid_from"`
	ValidTo         string `json:"valid_to"`
	FacilityID      string `json:"facility_id"`
}

IdentifiersOutput is used to display facility identifiers

type MatchResult added in v1.3.2

type MatchResult string
const (
	MatchResultMatch         MatchResult = "MATCH"
	MatchResultPossibleMatch MatchResult = "POSSIBLE_MATCH"
	MatchResultNoMatch       MatchResult = "NO_MATCH"
)

func (MatchResult) IsValid added in v1.3.2

func (m MatchResult) IsValid() bool

IsValid returns true if a match result is valid

func (MatchResult) String added in v1.3.2

func (m MatchResult) String() string

String converts the match result enum to a string

type Pagination added in v1.0.8

type Pagination struct {
	Page     string `json:"page"`
	PageSize string `json:"page_size"`
}

Pagination is used to hold pagination values

type Practitioner added in v1.3.5

type Practitioner struct {
	ID             string                      `json:"id,omitempty"`
	Slug           string                      `json:"slug"`
	Title          string                      `json:"title"`
	FullName       string                      `json:"full_name"`
	FirstName      string                      `json:"first_name"`
	LastName       string                      `json:"last_name"`
	OtherName      string                      `json:"other_name"`
	DateOfBirth    string                      `json:"date_of_birth"`
	Gender         GenderType                  `json:"gender"`
	Country        string                      `json:"country,omitempty"`
	Status         PractitionerStatus          `json:"status,omitempty"`
	Address        string                      `json:"address,omitempty"`
	BusinessHours  []PractitionerBusinessHours `json:"business_hours,omitempty"`
	Coordinates    CoordinatesOutput           `json:"coordinates,omitempty"`
	Distance       *float64                    `json:"distance,omitempty"`
	Contacts       []PractitionerContact       `json:"contacts,omitempty"`
	Identifiers    []PractitionerIdentifier    `json:"identifiers,omitempty"`
	Specialties    []PractitionerSpecialty     `json:"specialties,omitempty"`
	Services       []FacilityService           `json:"services,omitempty"`
	Qualifications string                      `json:"qualifications"`
	Photos         []PractitionerPhoto         `json:"practitioner_images,omitempty"`
}

type PractitionerBusinessHours added in v1.3.5

type PractitionerBusinessHours struct {
	ID             string `json:"id"`
	Day            string `json:"day"`
	OpeningTime    string `json:"opening_time"`
	ClosingTime    string `json:"closing_time"`
	PractitionerID string `json:"practitioner_id"`
}

type PractitionerContact added in v1.3.5

type PractitionerContact struct {
	ID           string `json:"id"`
	ContactType  string `json:"contact_type"`
	ContactValue string `json:"contact_value"`
	Role         string `json:"role"`
}

ContactsOutput is used to show practitioners contacts

type PractitionerIdentifier added in v1.3.5

type PractitionerIdentifier struct {
	ID              string                     `json:"id"`
	IdentifierType  PractitionerIdentifierType `json:"identifier_type"`
	IdentifierValue string                     `json:"identifier_value"`
	ValidFrom       string                     `json:"valid_from"`
	ValidTo         string                     `json:"valid_to"`
}

IdentifiersOutput is used to display practitioners identifiers

type PractitionerIdentifierType added in v1.3.5

type PractitionerIdentifierType string
const (
	PractitionerIdentifierSladeCode               PractitionerIdentifierType = "SLADE_CODE"                //nolint:all
	PractitionerIdentifierShaSladeCode            PractitionerIdentifierType = "SHA_SLADE_CODE"            //nolint:all
	PractitionerIdentifierNationalId              PractitionerIdentifierType = "NATIONAL_ID"               //nolint:all
	PractitionerIdentifierPassport                PractitionerIdentifierType = "PASSPORT"                  //nolint:all
	PractitionerIdentifierKmpdcRegistrationNumber PractitionerIdentifierType = "KMPDC_REGISTRATION_NUMBER" //nolint:all
	PractitionerIdentifierKmpdcLicenceNumber      PractitionerIdentifierType = "KMPDC_LICENSE_NUMBER"      //nolint:all
	PractitionerIdentifierAlienId                 PractitionerIdentifierType = "ALIEN_ID"                  //nolint:all
	PractitionerIdentifierRefugeeId               PractitionerIdentifierType = "REFUGEE_ID"                //nolint:all
	PractitionerIdentifierClientRegistryId        PractitionerIdentifierType = "CLIENT_REGISTRY_ID"        //nolint:all
	PractitionerTypeSladeAdvantageBranchID        PractitionerIdentifierType = "SLADE_ADVANTAGE_BRANCH_ID" //nolint:all
)

type PractitionerPhoto added in v1.4.5

type PractitionerPhoto struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	ImageURL     string `json:"document"`
	Size         int64  `json:"size"`
	Description  string `json:"description"`
	ContentType  string `json:"content_type"`
	Practitioner string `json:"practitioner_id"`
}

PractitionerPhoto is the photo related to a Practitioner in HealthCRM

type PractitionerSpecialty added in v1.3.5

type PractitionerSpecialty struct {
	ID          string                `json:"id"`
	Name        string                `json:"name"`
	Description string                `json:"description"`
	Identifiers []SpecialtyIdentifier `json:"identifiers,omitempty"`
}

type PractitionerStatus added in v1.3.5

type PractitionerStatus string
const (
	PractitionerStatusDraft     PractitionerStatus = "DRAFT"
	PractitionerStatusPublished PractitionerStatus = "PUBLISHED"
)

type Practitioners added in v1.3.5

type Practitioners struct {
	Count       int            `json:"count"`
	Next        *string        `json:"next"`
	Previous    *string        `json:"previous"`
	PageSize    int            `json:"page_size"`
	CurrentPage int            `json:"current_page"`
	TotalPages  int            `json:"total_pages"`
	StartIndex  int            `json:"start_index"`
	EndIndex    int            `json:"end_index"`
	Results     []Practitioner `json:"results"`
}

type Profile added in v1.2.7

type Profile struct {
	Service    Service `json:"service"`
	Name       string  `json:"full_name"`
	SladeCode  string  `json:"slade_code"`
	ExternalID string  `json:"external_id"`
}

Profile models how a profile from a service is modelled.

type ProfileContactInput added in v1.1.5

type ProfileContactInput struct {
	ContactType  ContactType       `json:"contact_type"`
	ContactValue string            `json:"contact_value"`
	Verified     bool              `json:"verified"`
	ValidFrom    *scalarutils.Date `json:"valid_from,omitempty"`
	ValidTo      *scalarutils.Date `json:"valid_to,omitempty"`
}

ProfileContanctInput is used to create profile(s) contact(s)

type ProfileContactOutput added in v1.2.5

type ProfileContactOutput struct {
	ContactType  ContactType       `json:"contact_type"`
	ContactValue string            `json:"contact_value"`
	Verified     bool              `json:"verified"`
	ValidFrom    *scalarutils.Date `json:"valid_from,omitempty"`
	ValidTo      *scalarutils.Date `json:"valid_to,omitempty"`
	Profile      Profile           `json:"profile"`
}

ProfileContactOutput is used to display profile(s) contact(s)

type ProfileContactOutputs added in v1.2.5

type ProfileContactOutputs struct {
	Results []*ProfileContactOutput `json:"results"`
}

ProfileContactOutputs is used to get a list of contacts

type ProfileIdentifierInput added in v1.1.5

type ProfileIdentifierInput struct {
	IdentifierType  IdentifierType    `json:"identifier_type"`
	IdentifierValue string            `json:"identifier_value"`
	Verified        bool              `json:"verified"`
	ValidFrom       *scalarutils.Date `json:"valid_from,omitempty"`
	ValidTo         *scalarutils.Date `json:"valid_to,omitempty"`
}

ProfileIdentifierInput is used to create profile(s) identifier(s)

type ProfileIdentifierOutput added in v1.2.5

type ProfileIdentifierOutput struct {
	IdentifierType  IdentifierType    `json:"identifier_type"`
	IdentifierValue string            `json:"identifier_value"`
	Verified        bool              `json:"verified"`
	ValidFrom       *scalarutils.Date `json:"valid_from,omitempty"`
	ValidTo         *scalarutils.Date `json:"valid_to,omitempty"`
	Profile         Profile           `json:"profile"`
}

ProfileIdentifierOutput is used to display profile(s) identifier(s)

type ProfileIdentifierOutputs added in v1.2.5

type ProfileIdentifierOutputs struct {
	Results []*ProfileIdentifierOutput `json:"results"`
}

ProfileIdentifierOutputs is used to get a list of identifiers

type ProfileInput added in v1.1.5

type ProfileInput struct {
	ProfileID     string                    `json:"profile_id"`
	HealthID      string                    `json:"health_id,omitempty"`
	FirstName     string                    `json:"first_name"`
	LastName      string                    `json:"last_name"`
	OtherName     string                    `json:"other_name,omitempty"`
	DateOfBirth   string                    `json:"date_of_birth,omitempty"`
	Gender        GenderType                `json:"gender"`
	EnrolmentDate string                    `json:"enrolment_date,omitempty"`
	SladeCode     string                    `json:"slade_code"`
	ServiceCode   string                    `json:"service_code"`
	Contacts      []*ProfileContactInput    `json:"contacts,omitempty"`
	Identifiers   []*ProfileIdentifierInput `json:"identifiers,omitempty"`
}

ProfileInput is the host of users data or a brief description of a person

type ProfileOutput added in v1.1.5

type ProfileOutput struct {
	ID             string      `json:"id"`
	ProfileID      string      `json:"profile_id"`
	HealthID       string      `json:"health_id,omitempty"`
	Classification MatchResult `json:"classification,omitempty"`
	SladeCode      string      `json:"slade_code"`
}

ProfileOutput is used to display profile(s)

type RegistryDetails added in v1.3.4

type RegistryDetails struct {
	ID    string `json:"id"`
	Phone string `json:"phone"`
}

type Service added in v1.2.7

type Service struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

Service is used get a service from HealthCRM. These are services such as advantage, edi , consumer etc

type ServiceIdentifier added in v1.0.1

type ServiceIdentifier struct {
	ID              string `json:"id"`
	IdentifierType  string `json:"identifier_type"`
	IdentifierValue string `json:"identifier_value"`
	ServiceID       string `json:"service_id"`
}

ServiceIdentifier models the structure of facility's service identifiers

type ServiceIdentifierInput added in v1.0.9

type ServiceIdentifierInput struct {
	IdentifierType  string `json:"identifier_type"`
	IdentifierValue string `json:"identifier_value"`
}

ServiceIdentifierInput is used to create an identifier

type Specialties added in v1.3.6

type Specialties struct {
	Count       int                     `json:"count"`
	Next        *string                 `json:"next"`
	Previous    *string                 `json:"previous"`
	PageSize    int                     `json:"page_size"`
	CurrentPage int                     `json:"current_page"`
	TotalPages  int                     `json:"total_pages"`
	StartIndex  int                     `json:"start_index"`
	EndIndex    int                     `json:"end_index"`
	Results     []PractitionerSpecialty `json:"results"`
}

type SpecialtyIdentifier added in v1.3.5

type SpecialtyIdentifier struct {
	ID              string `json:"id"`
	IdentifierType  string `json:"identifier_type"`
	IdentifierValue string `json:"identifier_value"`
	SpecialtyID     string `json:"specialty_id"`
}

specialty Identifier

type UserDetails added in v1.3.4

type UserDetails struct {
	IDNumber    string     `json:"id_number"`
	FullNames   string     `json:"full_names"`
	DateOfBirth string     `json:"date_of_birth"`
	Gender      GenderType `json:"gender"`
}

Jump to

Keyboard shortcuts

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