event.gno

4.17 Kb · 80 lines
 1package event
 2
 3import (
 4	zenaov1 "gno.land/p/zenao/zenao/v1"
 5	"gno.land/p/zenao/events"
 6	"gno.land/p/zenao/basedao"
 7	"gno.land/p/zenao/daokit"
 8	"gno.land/p/zenao/daocond"
 9	"gno.land/r/demo/profile"
10	"gno.land/r/zenao/eventreg"
11	"gno.land/r/zenao/social_feed"
12)
13
14var (
15	DAO      daokit.DAO
16	localDAO daokit.DAO
17
18	event  *events.Event // XXX: needed for backward compatibility with frontend queries
19	feedId string        // XXX: workaround for "unexpected zero object id" issue
20)
21
22func init() {
23	// XXX: workaround for "unexpected zero object id" issue
24	feedId = social_feed.NewFeed(cross, "main", false, feedAuth)
25}
26
27func init() {
28	conf := events.Config{
29		Organizers: []string{"gno.land/r/zenao/users/u376"},
30		Gatekeepers: []string{"gno.land/r/zenao/users/u377"},
31		Title: "Hack ta psy",
32		Description: "# Hack ta psy\n\n## Le Défi\n\nLa psychiatrie adulte fait face à des défis majeurs : files d'attente interminables, suivi thérapeutique complexe, manque d'outils d'évaluation en temps réel, et difficultés de coordination entre professionnels. Comment le numérique peut-il transformer l'accompagnement des patients et optimiser les pratiques soignantes ?\n\n## Votre Mission\n\n**35h pour imaginer, prototyper et présenter des solutions numériques concrètes** qui révolutionneront le quotidien de la psychiatrie adulte au CHU de Brest.\n\n## Axes d'Innovation Possibles\n\n🔹 **Suivi patient intelligent** : Applications de monitoring des symptômes, alertes précoces, tableaux de bord personnalisés\n\n🔹 **Coordination d'équipe** : Plateformes collaboratives, planification automatisée, partage sécurisé d'informations\n\n🔹 **Outils d'évaluation** : Questionnaires adaptatifs, analyses prédictives, visualisation des progrès\n\n🔹 **Support thérapeutique** : Serious games, réalité virtuelle, chatbots d'accompagnement\n\n🔹 **Gestion administrative** : Automatisation des tâches, optimisation des parcours, analytics\n\n## L'Impact Recherché\n\n✅ Améliorer la qualité de vie des patients  \n✅ Réduire la charge administrative des soignants  \n✅ Optimiser l'efficacité thérapeutique  \n✅ Faciliter la coordination interprofessionnelle  \n\n## Qui Participe ?\n\n- **Data scientists** \n- **Designers**\n- **Développeurs** \n- **Patients** \u0026 **aidants**\n- **Professionnels de santé mentale**\n\n## Pourquoi Participer ?\n\n- 💡 **Impact social réel** sur la santé mentale  \n- 🤝 **Collaboration interdisciplinaire** unique  \n- 🏆 **Prototypes déployables** dans de vrais services  \n- 🚀 **Opportunités de développement** post-hackathon  \n\n**Prêt·e à coder pour le bien-être mental ?**\n\n## One more thing\n\nL'inscription à cet événement implique  que vous acceptez de rejoindre la liste de diffusion [hack-ta-psy@listes.infini.fr](mailto:hack-ta-psy@listes.infini.fr)\n\nPour plus d'informations, contacter [mathieu@hack-ta-psy.fr](mailto:mathieu@hack-ta-psy.fr)",
33		ImageURI: "ipfs://bafkreiayqbcgugcwtmorsj4cuwpkz7gx7423q5ga7ijjsk6apx5cxbks7i",
34		StartDate: 1760716800,
35		EndDate: 1760907600,
36		Capacity: 30,
37		Discoverable: true,
38		GetProfileString: profile.GetStringField,
39		SetProfileString: profile.SetStringField,
40		ZenaoAdminAddr: "g1djrkw9tf4px658j85cc6fhsvm50uf9s0g6kfsm",
41		Location: &zenaov1.EventLocation{
42			Address: &zenaov1.AddressCustom{
43				Address: "Lieu à déterminer",
44				Timezone: "Europe/Paris",
45			},
46		},
47		ParticipationPubkey: "hNovc6750ofOEY67UJggI1--UTabUBYIwtQ4GKUACVw",
48		CrossFn: crossFn,
49		SetImplemFn: setImplem,
50		FeedId: feedId,
51		PrivateVarName: "event",
52	}
53	event = events.NewEvent(&conf)
54	eventreg.Register(cross, func() *zenaov1.EventInfo { return event.Info() })
55}
56
57func Vote(_ realm, proposalID uint64, vote daocond.Vote) {
58	localDAO.Vote(proposalID, vote)
59}
60
61func Execute(_ realm, proposalID uint64) {
62	localDAO.Execute(proposalID)
63}
64
65func Render(path string) string {
66	return localDAO.Render(path)
67}
68
69func feedAuth() (string, bool) {
70	caller := event.DAOPrivate.CallerID() // XXX: this should be upgradable
71	return caller, basedao.MustGetMembersViewExtension(localDAO).IsMember(caller)
72}
73
74func crossFn(_ realm, cb func()) {
75	cb()
76}
77
78func setImplem(newLocalDAO daokit.DAO, newDAO daokit.DAO) {
79	localDAO, DAO = newLocalDAO, newDAO
80}