-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
31 lines (27 loc) · 855 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"flag"
"log"
"github.com/uc-cdis/cohort-middleware/config"
"github.com/uc-cdis/cohort-middleware/db"
"github.com/uc-cdis/cohort-middleware/models"
"github.com/uc-cdis/cohort-middleware/server"
"github.com/uc-cdis/cohort-middleware/utils"
)
func runDataValidation() {
conf := config.GetConfig()
observationConceptIdsToCheck, _ := utils.SliceAtoi(conf.GetStringSlice("validate.single_observation_for_concept_ids"))
var cohortDataModel = new(models.CohortData)
nrIssues, _ := cohortDataModel.ValidateObservationData(observationConceptIdsToCheck)
if nrIssues > 0 {
log.Printf("WARNING: found %d data issues!", nrIssues)
}
}
func main() {
environment := flag.String("e", "development", "Environment/prefix of config file name")
flag.Parse()
config.Init(*environment)
db.Init()
runDataValidation()
server.Init()
}