Documentation
¶
Index ¶
- Variables
- type BusinessHours
- type BusinessHoursOutput
- type Config
- type ConflictError
- type ContactType
- type Contacts
- type ContactsOutput
- type Coordinates
- type CoordinatesOutput
- type Facility
- type FacilityIdentifierInput
- type FacilityIdentifierType
- type FacilityOutput
- type FacilityOutputs
- type FacilityPage
- type FacilityPhoto
- type FacilityService
- type FacilityServiceInput
- type FacilityServicePage
- type FacilityServices
- type FilterFacilitiesInput
- type FilterPractitionersInput
- type GenderType
- type HealthCRMLib
- func (h *HealthCRMLib) CreateFacility(ctx context.Context, facility *Facility) (*FacilityOutput, error)
- func (h *HealthCRMLib) CreateFacilityIdentifier(ctx context.Context, input *FacilityIdentifierInput) (*IdentifiersOutput, error)
- func (h *HealthCRMLib) CreatePractitionerIdentifier(ctx context.Context, input *PractitionerIdentifierInput) (*PractitionerIdentifier, error)
- func (h *HealthCRMLib) CreateProfile(ctx context.Context, profile *ProfileInput) (*ProfileOutput, error)
- func (h *HealthCRMLib) CreateService(ctx context.Context, input FacilityServiceInput) (*FacilityService, error)
- func (h *HealthCRMLib) GetFacilities(ctx context.Context, filters FilterFacilitiesInput) (*FacilityPage, error)
- func (h *HealthCRMLib) GetFacilitiesOfferingAService(ctx context.Context, serviceID string, pagination *Pagination) (*FacilityPage, error)
- func (h *HealthCRMLib) GetFacilityByID(ctx context.Context, id string) (*FacilityOutput, error)
- func (h *HealthCRMLib) GetFacilityDetails(ctx context.Context, identifierType FacilityIdentifierType, ...) (*FacilityOutput, error)
- func (h *HealthCRMLib) GetMultipleFacilities(ctx context.Context, facilityIDs []string) ([]*FacilityOutput, error)
- func (h *HealthCRMLib) GetMultipleServices(ctx context.Context, servicesIDs []string) ([]*FacilityService, error)
- func (h *HealthCRMLib) GetPersonContacts(ctx context.Context, healthID string) ([]*ProfileContactOutput, error)
- func (h *HealthCRMLib) GetPersonIdentifiers(ctx context.Context, healthID string, identifierTypes []*IdentifierType) ([]*ProfileIdentifierOutput, error)
- func (h *HealthCRMLib) GetPractitionerByID(ctx context.Context, practitionerID string) (*Practitioner, error)
- func (h *HealthCRMLib) GetPractitioners(ctx context.Context, filters FilterPractitionersInput) (*Practitioners, error)
- func (h *HealthCRMLib) GetService(ctx context.Context, serviceID string) (*FacilityService, error)
- func (h *HealthCRMLib) GetServices(ctx context.Context, pagination *Pagination, crmServiceCode string) (*FacilityServicePage, error)
- func (h *HealthCRMLib) GetSpecialties(ctx context.Context, pagination *Pagination, crmServiceCode string) (*Specialties, error)
- func (h *HealthCRMLib) LinkServiceToFacility(ctx context.Context, facilityID string, input []*FacilityServiceInput) (*FacilityService, error)
- func (h *HealthCRMLib) MatchProfile(ctx context.Context, profile *ProfileInput) (*ProfileOutput, error)
- func (h *HealthCRMLib) SearchPersons(ctx context.Context, input SearchPersonsInput) (*PersonSearchPage, error)
- func (h *HealthCRMLib) UpdateFacility(ctx context.Context, id string, updatePayload *Facility) (*FacilityOutput, error)
- func (h *HealthCRMLib) VerifyIdentifierDocument(ctx context.Context, input IDVerificationInput) (*IDVerificationResult, error)
- type IDVerificationInput
- type IDVerificationResult
- type IdentifierType
- type Identifiers
- type IdentifiersOutput
- type MatchResult
- type NotFoundError
- type Pagination
- type PersonContactOutput
- type PersonOutput
- type PersonSearchPage
- type PersonServiceOutput
- type Practitioner
- type PractitionerBusinessHours
- type PractitionerContact
- type PractitionerIdentifier
- type PractitionerIdentifierInput
- type PractitionerIdentifierType
- type PractitionerPhoto
- type PractitionerSpecialty
- type PractitionerStatus
- type Practitioners
- type Profile
- type ProfileContactInput
- type ProfileContactOutput
- type ProfileContactOutputs
- type ProfileIdentifierInput
- type ProfileIdentifierOutput
- type ProfileIdentifierOutputs
- type ProfileInput
- type ProfileOutput
- type RegistryDetails
- type SearchPersonsInput
- type Service
- type ServiceIdentifier
- type ServiceIdentifierInput
- type Specialties
- type SpecialtyIdentifier
- type UserDetails
Constants ¶
This section is empty.
Variables ¶
var ErrFacilityNotFound = errors.New("facility not found")
ErrFacilityNotFound is the sentinel for a facility lookup that neither health CRM nor the Facility Registry behind it could answer. Match it with errors.Is.
var ErrIdentifierConflict = errors.New("identifier conflict")
ErrIdentifierConflict is the sentinel for an identifier write that clashes with one the record already holds. Match it with errors.Is.
Only the facility identifier endpoint produces this today. A facility holds at most one identifier per type, so writing a second value for a type it already carries is a conflict rather than a repeat. A practitioner may hold several values for one type, so its endpoint has no equivalent case.
Retrying will not clear it: the existing identifier has to be updated, which this SDK does not currently expose.
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 // nolint: gosec
GrantType string
Username string
Password string // nolint: gosec
BaseURL string
}
Config contains the settings required to initialize a health crm client
type ConflictError ¶ added in v1.9.1
type ConflictError struct {
// Body is the response body returned by health CRM, unmodified.
Body string
}
ConflictError carries the upstream response body for a conflicting identifier write. It unwraps to ErrIdentifierConflict, so callers can branch with errors.Is and still read the detail off the body.
func (*ConflictError) Error ¶ added in v1.9.1
func (e *ConflictError) Error() string
func (*ConflictError) Unwrap ¶ added in v1.9.1
func (e *ConflictError) Unwrap() error
Unwrap allows errors.Is(err, ErrIdentifierConflict) to match.
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 FacilityIdentifierInput ¶ added in v1.8.0
type FacilityIdentifierInput struct {
FacilityID string `json:"facility_id"`
IdentifierType FacilityIdentifierType `json:"identifier_type"`
IdentifierValue string `json:"identifier_value"`
ValidFrom *scalarutils.Date `json:"valid_from,omitempty"`
ValidTo *scalarutils.Date `json:"valid_to,omitempty"`
}
FacilityIdentifierInput is used to add an identifier to an existing facility.
The source field is deliberately absent: it is derived server side from the identifier type and is ignored if sent.
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) IsValid ¶ added in v1.8.0
func (f FacilityIdentifierType) IsValid() bool
IsValid returns true if a facility identifier type is valid
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"`
Level string `json:"level,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) CreateFacilityIdentifier ¶ added in v1.8.0
func (h *HealthCRMLib) CreateFacilityIdentifier(ctx context.Context, input *FacilityIdentifierInput) (*IdentifiersOutput, error)
CreateFacilityIdentifier adds an identifier to an existing facility.
A facility holds at most one identifier per type.
The write is idempotent upstream, so it is safe to retry: a new identifier returns 201 and a repeat of the same type and value returns 200 with the existing record. Both are treated as success here.
Reusing a type with a different value is a conflict(409), returned as a *ConflictError that matches errors.Is against ErrIdentifierConflict. Replacing the value on an existing identifier is not supported by this method.
func (*HealthCRMLib) CreatePractitionerIdentifier ¶ added in v1.8.0
func (h *HealthCRMLib) CreatePractitionerIdentifier(ctx context.Context, input *PractitionerIdentifierInput) (*PractitionerIdentifier, error)
CreatePractitionerIdentifier adds an identifier to an existing practitioner.
A practitioner may hold several identifiers of the same type as long as the values differ.
The write is idempotent upstream, so it is safe to retry: a new identifier returns 201 and a repeat returns 200 with the existing record. Both are treated as success here.
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) GetFacilityDetails ¶ added in v1.9.2
func (h *HealthCRMLib) GetFacilityDetails(ctx context.Context, identifierType FacilityIdentifierType, identifierValue string) (*FacilityOutput, error)
GetFacilityDetails fetches a facility by one of its identifiers.
When health CRM holds no facility with the identifier, it looks the identifier up in the Facility Registry and creates the facility from the registry record. Only FR_CODE, FID_CODE and KMPDC_REG_NUMBER can be looked up in the registry; any other type is answered from health CRM alone.
A facility health CRM already holds returns 200 and one it has just created returns 201. Both are treated as success here. A 404, from either health CRM or the registry, comes back as a *NotFoundError that unwraps to ErrFacilityNotFound.
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) SearchPersons ¶ added in v1.9.2
func (h *HealthCRMLib) SearchPersons(ctx context.Context, input SearchPersonsInput) (*PersonSearchPage, error)
SearchPersons searches for persons (patients/clients) by a free text search term and/or by identifier.
IdentifierValue must be provided whenever IdentifierTypes or IdentifierSladeCode is set, and IdentifierSladeCode must be provided when filtering by IdentifierTypePayerMemberNo; these are validated client side since HealthCRM rejects the request with a 400 otherwise.
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 is returned as the human readable label
// (e.g. "Slade Advantage Branch ID"), not the code that was sent. Comparing
// it against a FacilityIdentifierType constant will not match.
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"`
// Source is derived server side from the identifier type and is read only.
Source string `json:"source"`
}
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 NotFoundError ¶ added in v1.9.2
type NotFoundError struct {
// Body is the response body returned by health CRM, unmodified.
Body string
}
NotFoundError carries the upstream response body for a facility lookup that came back 404. It unwraps to ErrFacilityNotFound, so callers can branch with errors.Is and still read the detail off the body.
func (*NotFoundError) Error ¶ added in v1.9.2
func (e *NotFoundError) Error() string
func (*NotFoundError) Unwrap ¶ added in v1.9.2
func (e *NotFoundError) Unwrap() error
Unwrap allows errors.Is(err, ErrFacilityNotFound) to match.
type Pagination ¶ added in v1.0.8
Pagination is used to hold pagination values
type PersonContactOutput ¶ added in v1.9.2
type PersonContactOutput struct {
ID string `json:"id"`
ContactType string `json:"contact_type"`
ContactValue string `json:"contact_value"`
}
PersonContactOutput is used to display a person's contact as returned by the persons search endpoint. It is a slimmed down version of ProfileContactOutput.
type PersonOutput ¶ added in v1.9.2
type PersonOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Age int `json:"age"`
DateOfBirth string `json:"date_of_birth"`
Gender GenderType `json:"gender"`
Email string `json:"email"`
PhoneNumber string `json:"phone_number"`
SILGlobalIdentifier string `json:"sil_global_identifier"`
Services []PersonServiceOutput `json:"services"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Contacts []PersonContactOutput `json:"contacts"`
}
PersonOutput is used to display a person as returned by the persons search endpoint.
Email and PhoneNumber are always partially masked by HealthCRM for this endpoint. Name is additionally masked when SearchPersonsInput.MaskPII is set.
type PersonSearchPage ¶ added in v1.9.2
type PersonSearchPage 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 []PersonOutput `json:"results"`
}
PersonSearchPage is the paginated response returned by the persons search endpoint
type PersonServiceOutput ¶ added in v1.9.2
type PersonServiceOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Label string `json:"label"`
Code string `json:"code"`
CallbackURL string `json:"callback_url"`
CallbackURLs []string `json:"callback_urls"`
Description string `json:"description"`
NotificationEmails []string `json:"notification_emails"`
MatchingActive bool `json:"matching_active"`
MatchingPriority int `json:"matching_priority"`
}
PersonServiceOutput is used to display a service linked to a person's profile(s)
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 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"`
// PractitionerID is only populated when this identifier is fetched or
// created through the practitioner identifier resource. It is empty when
// the identifier arrives nested inside a Practitioner response.
PractitionerID string `json:"practitioner_id,omitempty"`
}
IdentifiersOutput is used to display practitioners identifiers
type PractitionerIdentifierInput ¶ added in v1.8.0
type PractitionerIdentifierInput struct {
PractitionerID string `json:"practitioner_id"`
IdentifierType PractitionerIdentifierType `json:"identifier_type"`
IdentifierValue string `json:"identifier_value"`
ValidFrom *scalarutils.Date `json:"valid_from,omitempty"`
ValidTo *scalarutils.Date `json:"valid_to,omitempty"`
}
PractitionerIdentifierInput is used to add an identifier to an existing practitioner.
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 )
func (PractitionerIdentifierType) IsValid ¶ added in v1.8.0
func (p PractitionerIdentifierType) IsValid() bool
IsValid returns true if a practitioner identifier type is valid
func (PractitionerIdentifierType) String ¶ added in v1.8.0
func (p PractitionerIdentifierType) String() string
String converts the practitioner identifier type enum to a string
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
func (ProfileInput) IsValid ¶ added in v1.9.1
func (p ProfileInput) IsValid() error
IsValid checks that every field ProfileInput marks as required carries a value. It reports all of the missing fields in one error rather than stopping at the first, so a caller fixing an input sees the whole list.
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 SearchPersonsInput ¶ added in v1.9.2
type SearchPersonsInput struct {
SearchParameter string
IdentifierTypes []IdentifierType
IdentifierValue string
IdentifierSladeCode string
ExcludePersonID string
MaskPII bool
Pagination *Pagination
}
SearchPersonsInput takes in the parameters used to search for persons by free text and/or by identifier.
IdentifierValue is required whenever IdentifierTypes or IdentifierSladeCode is set. Filtering by IdentifierTypePayerMemberNo additionally requires IdentifierSladeCode to be set.
type Service ¶ added in v1.2.7
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"`
}