utils

package
v2.4.16 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAnteDiseaseInSymptoms

func CheckAnteDiseaseInSymptoms(session model.Session) (string, string, error)

func CheckSymptomDuration

func CheckSymptomDuration(symptoms []*model.SessionSymptomInput, lastQuestion string) ([]*model.SessionSymptomInput, string, string)

func GetSessionDiseases

func GetSessionDiseases(sessionContext []model.SessionSymptom, imc float64, hereditaryDisease []string) ([]*model.SessionDiseasesInput, error)

func SymptomsToString

func SymptomsToString(symptoms []Symptom) []string

func WakeNlpUp

func WakeNlpUp()

Types

type ByCoverage

type ByCoverage []exam.DiseaseCoverage

func (ByCoverage) Len

func (a ByCoverage) Len() int

func (ByCoverage) Less

func (a ByCoverage) Less(i, j int) bool

func (ByCoverage) Swap

func (a ByCoverage) Swap(i, j int)

type ExamResponseBody

type ExamResponseBody struct {
	Context    []model.SessionSymptom `json:"context"`
	Done       bool                   `json:"done"`
	Question   string                 `json:"question"`
	Symptoms   []string               `json:"symptoms"`
	AutoAnswer *string                `json:"auto_answer"`
	Alert      []string               `json:"alert"`
	Err        error                  `json:"err"`
}

func CallExam

func CallExam(context []model.SessionSymptom, imc float64, hereditaryDisease []string) ExamResponseBody

type NlpResponseBody

type NlpResponseBody struct {
	Context []Symptom `json:"context"`
}

func CallNlp

func CallNlp(sentence string, symptoms []string, durSymptom *string, isMedicine bool) (NlpResponseBody, int)

type Symptom

type Symptom struct {
	Name    string `json:"symptom"`
	Present *bool  `json:"present"`
	Days    *int   `json:"days"`
}

func StringToSymptoms

func StringToSymptoms(strings []string) []Symptom

Jump to

Keyboard shortcuts

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