helpers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CenturyHours is the number of hours in a (fictional) century of leap years
	CenturyHours = 878400

	// StringTimeParseMonthNameLayout ...
	StringTimeParseMonthNameLayout = "2006-Jan-02"
	// StringTimeParseMonthNumberLayout ...
	StringTimeParseMonthNumberLayout = "2006-01-02"
)
View Source
const (
	DefaultCountry         = "ke"
	IDIdentifierSystem     = "healthcloud.iddocument"
	MSISDNIdentifierSystem = "healthcloud.msisdn"
	DefaultVersion         = "0.0.1"
)

simple patient registration defaults should be reviewed later (ticket created)

Variables

This section is empty.

Functions

func ComposeOneHealthEpisodeOfCare

func ComposeOneHealthEpisodeOfCare(
	validPhone string, fullAccess bool, organizationID, providerCode, patientID string,
) domain.FHIREpisodeOfCare

ComposeOneHealthEpisodeOfCare is used to create an episode of care

func ContactsToContactPoint

func ContactsToContactPoint(
	_ context.Context,
	phones []*domain.PhoneNumberInput,
	emails []*domain.EmailInput,
	firestoreClient *firestore.Client,
) ([]*domain.FHIRContactPoint, error)

ContactsToContactPoint translates phone and email contacts to FHIR contact points

func IDToIdentifier

func IDToIdentifier(
	ids []*domain.IdentificationDocument, phones []*domain.PhoneNumberInput) ([]*domain.FHIRIdentifierInput, error)

IDToIdentifier translates simple identification document details to FHIR identifiers

func LanguagesToCommunicationInputs

func LanguagesToCommunicationInputs(languages []enumutils.Language) []*domain.FHIRPatientCommunicationInput

LanguagesToCommunicationInputs translates the supplied languages to FHIR communication preferences

func MaritalStatusEnumToCodeableConcept

func MaritalStatusEnumToCodeableConcept(val domain.MaritalStatus) *domain.FHIRCodeableConcept

MaritalStatusEnumToCodeableConcept turns the simple enum selected in the user interface to a FHIR codeable concept

func MaritalStatusEnumToCodeableConceptInput

func MaritalStatusEnumToCodeableConceptInput(val domain.MaritalStatus) *domain.FHIRCodeableConceptInput

MaritalStatusEnumToCodeableConceptInput turns the simple enum selected in the user interface to a FHIR codeable concept

func NameToHumanName

func NameToHumanName(names []*domain.NameInput) []*domain.FHIRHumanNameInput

NameToHumanName translates the simple name input of simple patient registration to FHIR human names

func ParseDate

func ParseDate(date string) time.Time

ParseDate parses a formatted string and returns the time value it represents Try different layout due to Inconsistent date formats They include "2018-01-01", "2020-09-24T18:02:38.661033Z", "2018-Jan-01"

func PhysicalPostalAddressesToCombinedFHIRAddress

func PhysicalPostalAddressesToCombinedFHIRAddress(
	physical []*domain.PhysicalAddress,
	postal []*domain.PostalAddress,
) *domain.FHIRAddressInput

PhysicalPostalAddressesToCombinedFHIRAddress translates address inputs to a single FHIR address.

It is used for patient contacts (e.g next of kin) where the spec has only one address per next of kin.

func PhysicalPostalAddressesToFHIRAddresses

func PhysicalPostalAddressesToFHIRAddresses(
	physical []*domain.PhysicalAddress, postal []*domain.PostalAddress) []*domain.FHIRAddressInput

PhysicalPostalAddressesToFHIRAddresses translates address inputs to FHIR addresses

func ValidateEmail

func ValidateEmail(
	email string, _ bool, _ *firestore.Client) error

ValidateEmail returns an error if the supplied string does not have a valid format or resolvable host

Types

This section is empty.

Jump to

Keyboard shortcuts

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