Documentation ¶
Index ¶
- Variables
- func ArrayContains(strs []string, str string) (int, bool)
- func ContainsError(message string) bool
- func CreateLog(log_Folder string) *os.File
- func DT_ANSIC() string
- func DT_Date() string
- func DT_Day() string
- func DT_EPOCH() string
- func DT_Hour() string
- func DT_Kitchen() string
- func DT_MM_dd() string
- func DT_MilliSec() int
- func DT_Min() string
- func DT_Month() string
- func DT_SQL() string
- func DT_SQL_Future_Year() string
- func DT_Sec() string
- func DT_Stamp() string
- func DT_Time() string
- func DT_Unix() string
- func DT_Year() string
- func DT_Zulu() string
- func DT_Zulu_Future(future int64) string
- func DT_Zulu_Future_Year() string
- func DT_yyyyMMddhhmmSSsss() string
- func DT_yyyy_MM_dd() string
- func DT_yyyy_MM_dd_hh() string
- func DT_yyyy_MM_dd_hh_mm() string
- func DT_yyyy_MM_dd_hh_mm_SS() string
- func DT_yyyy_MM_dd_hh_mm_SS_sss() string
- func GetCodeSystemVal(key string) string
- func GetDocumentReturnList(message string) string
- func GetDuration(dur time.Duration) string
- func GetDurationSince(stime string) string
- func GetErrorMessage(message string) string
- func GetFileBytes(f string) ([]byte, error)
- func GetFolderFiles(folder string) ([]fs.DirEntry, error)
- func GetFutueDaysDate(startDate time.Time, days int) time.Time
- func GetFutureDate(startDate time.Time, years int, months int, days int, hours int, mins int) time.Time
- func GetGlypicon(tasktype string) string
- func GetHTMLWidgetFiles(basepath string) ([]string, error)
- func GetIdIncrementSeed(len int) int
- func GetIntFromString(input string) int
- func GetMilliseconds() int
- func GetServiceUrl(port int, scheme, host, url string) string
- func GetStringFromInt(i int) string
- func GetTimeFromString(timestr string) time.Time
- func GetXMLNodeList(message string, node string) string
- func GetXMLNodeVal(message string, node string) string
- func GetXdwConfigFiles(basepath string) (map[string][]byte, error)
- func GetXmlReturnNode(message string) string
- func IsAfterNow(inTime string) bool
- func IsBrokerExpression(exp string) bool
- func LoadCodeSystemFile(codesystemFile string) error
- func Loadjsonfile(jfp string) *json.Decoder
- func Log(i interface{})
- func Minus(n1 int, n2 int) string
- func MonitorApp()
- func New30mfutureyearzulu() string
- func NewUuid() string
- func Newdatetime() string
- func Newid() string
- func Newyearfuturezulu() string
- func Newzulu() string
- func NotEmpty(params []string) bool
- func OHT_FutureDate(startdate time.Time, htDate string) time.Time
- func OHT_ShouldEscalate(startdate time.Time, htDate string) bool
- func PrettyAuthorInstitution(institution string) string
- func PrettyAuthorPerson(author string) string
- func PrettyPrintDuration(duration time.Duration) string
- func PrettyTime(time string) string
- func Pretty_Time_Now() string
- func ReturnDecoded(s string) string
- func ReturnEncoded(s string) string
- func SetCodeSystem(cs map[string]string)
- func SetDebugMode(debug bool)
- func SimpleDateTime() string
- func SplitExpression(exp string) string
- func SplitFhirOid(oid string) string
- func SplitXDWKey(xdwkey string) (string, string)
- func Substr(input string, start int, length int) string
- func TemplateFuncMap() template.FuncMap
- func Time_Now() string
- func Tuk_Day() string
- func Tuk_Hour() string
- func Tuk_MilliSec() int
- func Tuk_Min() string
- func Tuk_Month() string
- func Tuk_Sec() string
- func Tuk_Year() string
- func UploadFile(w http.ResponseWriter, r *http.Request)
- func VALUE_LIKE(val string) string
- func WriteFileToTempFolder(data []byte, filename string) error
- func WriteResponseHeaders(fn http.HandlerFunc, secure bool) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
var ( ServerName = "" SeedRoot = "1.2.40.0.13.1.1.3542466645." IdSeed = getIdIncrementSeed(5) CodeSystem = make(map[string]string) )
Functions ¶
func ContainsError ¶
containsError checks to see if the supplied message contains one of the two error tags
func CreateLog ¶
CreateLog checks if the log folder exists and creates it if not. It then checks for a subfolder for the current year i.e. 2022 and creates it if it does not exist. It then checks for a log file with a name equal to the current day and month and extension .log i.e. 0905.log. If it exists log output is appended to the existing file otherwise a new log file is created.
func DT_Kitchen ¶
func DT_Kitchen() string
func DT_MilliSec ¶
func DT_MilliSec() int
func DT_SQL_Future_Year ¶
func DT_SQL_Future_Year() string
func DT_Zulu_Future ¶
func DT_Zulu_Future_Year ¶
func DT_Zulu_Future_Year() string
func DT_yyyyMMddhhmmSSsss ¶
func DT_yyyyMMddhhmmSSsss() string
func DT_yyyy_MM_dd ¶
func DT_yyyy_MM_dd() string
func DT_yyyy_MM_dd_hh ¶
func DT_yyyy_MM_dd_hh() string
func DT_yyyy_MM_dd_hh_mm ¶
func DT_yyyy_MM_dd_hh_mm() string
func DT_yyyy_MM_dd_hh_mm_SS ¶
func DT_yyyy_MM_dd_hh_mm_SS() string
func DT_yyyy_MM_dd_hh_mm_SS_sss ¶
func DT_yyyy_MM_dd_hh_mm_SS_sss() string
func GetCodeSystemVal ¶
GetCodeSystemVal takes a string input (key) and returns from the codesystem the string value corresponding to the input (key)
func GetDocumentReturnList ¶
getDocumentReturnList extracts the document return list from the SOAP response message
func GetDuration ¶
GetDuration takes 2 times as string inputs in RFC3339 format (yyyy-MM-ddThh:mm:ssZ) and returns the duration in days, hours and mins in a 'pretty format' eg '2 Days 0 Hrs 52 Mins' between the provided times as a string
Example : GetDuration("2022-09-04T13:15:20Z", "2022-09-14T16:20:01Z") returns `10 Days 3 Hrs 4 Mins`
func GetDurationSince ¶
GetDurationSince takes a time as string input in RFC3339 format (yyyy-MM-ddThh:mm:ssZ) and returns the duration in days, hours and mins in a 'pretty format' eg '2 Days 0 Hrs 52 Mins' between the provided time and time.Now() as a string
func GetErrorMessage ¶
getErrorMessage returns the error message within the SOAP response or returns a generic error message
func GetFileBytes ¶
func GetFolderFiles ¶
GetFolderFiles takes a string input of the complete folder path and returns a fs.DirEntry
func GetFutureDate ¶
func GetGlypicon ¶
func GetHTMLWidgetFiles ¶
func GetIdIncrementSeed ¶
func GetIntFromString ¶
GetIntFromString takes a string input with an integer value and returns an int of that value. If the input is not numeric, 0 is returned
func GetMilliseconds ¶
func GetMilliseconds() int
func GetServiceUrl ¶
func GetStringFromInt ¶
GetStringFromInt takes a int input and returns a string of that value.
func GetTimeFromString ¶
func GetXMLNodeList ¶
GetXMLNodeList takes an xml message as input and returns the xml node list as a string for the node input value provide
func GetXMLNodeVal ¶
func GetXmlReturnNode ¶
func IsAfterNow ¶
IsAfterNow takes a time as a string input in RFC3339 format (yyyy-MM-ddThh:mm:ssZ) and returns true if the input time is after time.Now() and false if input time is before time.Now()
func IsBrokerExpression ¶
func LoadCodeSystemFile ¶
LoadCodeSystemFile loads the `codesystem.json` file from the `configs` folder
func Loadjsonfile ¶
func Log ¶
func Log(i interface{})
Log takes any struc as input and logs out the struc as a json string
func MonitorApp ¶
func MonitorApp()
func New30mfutureyearzulu ¶
func New30mfutureyearzulu() string
func Newdatetime ¶
func Newdatetime() string
func Newid ¶
func Newid() string
returns unique id in format '1.2.40.0.13.1.1.3542466645.20211021090059143.32643' idroot constant - 1.2.40.0.13.1.1.3542466645. + datetime - 20211021090059143. + 5 digit seed - 32643 The seed is incremented after each call to newid().
func Newyearfuturezulu ¶
func Newyearfuturezulu() string
func OHT_FutureDate ¶
OHT_FutureDate takes a 'start date' and a period in the future as a string containing an OASIS Human Task api function eg. day(x) returns x days in the future from the `start date`. Valid periods are min(x),hour(x),day(x),month(x) and year(x)
func PrettyAuthorInstitution ¶
PrettyAuthorInstitution takes a string input (XDS Author.Institution format) and returns a string with just the Institution name
func PrettyAuthorPerson ¶
PrettyAuthorPerson takes a string input (XDS Author.Person format) and returns a string with the person last and first names
func PrettyPrintDuration ¶
func PrettyTime ¶
PrettyTime fist splits the input based on sep =`.`, it takes index 0 of the split and replaces any T with a space then removes any trailing Z. It then splits the resulting string on sep = `+` returning index 0 of the split
func Pretty_Time_Now ¶
func Pretty_Time_Now() string
Pretty_Time_Now returns a pretty version of the current time for location Europe/London (strips everything after the `.` in Tuk_Time)
func ReturnDecoded ¶
func ReturnEncoded ¶
func SetCodeSystem ¶
SetCodeSystem takes a map input and sets the codesystem map with the input
func SetDebugMode ¶ added in v1.3.12
func SetDebugMode(debug bool)
func SimpleDateTime ¶
func SimpleDateTime() string
func SplitExpression ¶
func SplitFhirOid ¶
func SplitXDWKey ¶
SplitXDWKey takes a string input (xdwkey) and returns the pathway and nhs id for the xdw
func Substr ¶
Substr takes a string input and returns the rune (Substring) defined by the start and length in th start and length input values
func TemplateFuncMap ¶
TemplateFuncMap returns a functionMap of ttutils for use in templates
func Time_Now ¶
func Time_Now() string
Time_Now returns the current time for location Europe/London.
func Tuk_MilliSec ¶
func Tuk_MilliSec() int
TUK_MilliSec returns the current milliseconds as a 3 digit int
func UploadFile ¶
func UploadFile(w http.ResponseWriter, r *http.Request)
func VALUE_LIKE ¶
func WriteFileToTempFolder ¶
func WriteResponseHeaders ¶
func WriteResponseHeaders(fn http.HandlerFunc, secure bool) http.HandlerFunc
Types ¶
This section is empty.