medicalhistory

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package medicalhistory is a demo module: the same crudview.New pattern. platformd/modules/devices uses for a full CRUD view, with one addition — a selectsearch.SelectSearch fills crudview.Config.Filter instead of the default searchbar.SearchBar. SelectSearch satisfies widget.Filterable (github.com/tinywasm/components v0.5.0) the same generic contract a SearchBar fills, so picking a patient from today's agenda narrows the visit list to that patient's fichas — no bespoke wiring in crudview or rightpanel.

Index

Constants

View Source
const Icon = svg.Icon("mod-medicalhistory")

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module is the platformd.UIModule. It carries the platform because, like devices, it notifies save/delete results in the chassis message bar.

func New

func New(p *platformd.Platform) *Module

func (*Module) Icon

func (m *Module) Icon() svg.Icon

func (*Module) IconSvg

func (m *Module) IconSvg() *sprite.Sprite

IconSvg registers the module's glyph — the original medicalhistory icon: a clipboard (patient chart) with a checkmark badge and two list lines. tinywasm/ssr fuses every IconSvg() in the graph into one sprite injected into <body>.

The receiver is instantiated as a zero value (&medicalhistory.Module{}), so this method must not touch any field — it only returns definitions.

func (*Module) Label

func (m *Module) Label() string

func (*Module) ModelName

func (m *Module) ModelName() string

func (*Module) View

func (m *Module) View() Component

type Patient

type Patient struct {
	ID   string
	Name string
	Time string
	Age  string
	Run  string
}

Patient is a LOCAL FAKE type for this demo only — today's agenda. A real deployment replaces todayAgenda with a router.Caller call into appointment_booking (today's reservations for a staff member); this repo never imports it. Every patient/visit record here is fake, package-level, in-memory data, same tier as devices' deviceDB below.

type Visit

type Visit struct {
	Id, Patient, Doctor, Date, Reason, Diagnosis string
}

func (*Visit) DecodeFields added in v0.1.13

func (v *Visit) DecodeFields(r model.FieldReader)

func (*Visit) EncodeFields added in v0.1.13

func (v *Visit) EncodeFields(w model.FieldWriter)

func (*Visit) IsNil added in v0.1.13

func (v *Visit) IsNil() bool

func (*Visit) Item added in v0.1.13

func (v *Visit) Item() view.Item

Item projects a visit as a list row: the leading badge carries the date (see leadFromDate), Label the reason, Description the attending doctor — the list is always reached by picking a patient first (see medicalhistory.go's requirePatient), so every visible row already belongs to that one patient; what a row's own badge still needs to say is WHO saw them, not whose visit it was.

func (*Visit) ModelName added in v0.1.13

func (v *Visit) ModelName() string

func (*Visit) Pointers added in v0.1.13

func (v *Visit) Pointers() []any

func (*Visit) Schema added in v0.1.13

func (v *Visit) Schema() []model.Field

Jump to

Keyboard shortcuts

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