Turnero organises a patient’s clinical history across seven specialised controllers, each responsible for a distinct category of medical data. Most controllers in this group carry a class-levelDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pabloeferreyra/Turnero/llms.txt
Use this file to discover all available pages before exploring further.
[Authorize(Roles = "Medico")] attribute (VisitsController, VaccinesController, GrowthChartController, PermMedController, PersonalBackgroundController). AllergiesController has no authorization attributes at all, and PerinatalBackgroundController also carries no class-level [Authorize] — for both, access is governed by the application’s global middleware policies. All list endpoints follow the same DataTables server-side pattern: a GET action renders a partial view containing an empty <table> placeholder, and a companion POST initialisation endpoint provides the JSON data feed. Create and edit forms are delivered as partial views embedded inside the patient detail page, keeping the UI entirely Ajax-driven without full page reloads.
The patientId parameter accepted by the DataTables initialisation endpoints is resolved flexibly: the server checks (in priority order) a querystring parameter, a form field named patientId or patientid, a form column-search value ending in [search][value], any GUID-shaped form value, and — for JSON content types — a JSON body property. This resilience means the endpoints work regardless of how DataTables serialises the extra search parameter.
Visits
VisitsController manages consultation records. Each Visit captures the date, reason, diagnosis, diagnosis description, treatment, evolution notes, laboratory results, other studies, and free-form observations. The creating doctor’s ID is automatically resolved from the authenticated user’s claims — the client never sends MedicId.
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /Visits/Index/{id} | Medico | Returns _VisitsTable partial for a patient |
POST | /Visits/InitializeVisits | Medico | DataTables data feed for a patient’s visits |
GET | /Visits/Create/{id} | Medico | Returns _CreateVisit partial |
POST | /Visits/Create | Medico | Inserts a new visit |
GET | /Visits/Details/{id} | Medico | Returns _Details partial for a visit |
GET /Visits/Index/
Returns the_VisitsTable partial view. Sets ViewData["PatientId"] so the embedded DataTables script knows which patient to filter on.
The
Patient.Id whose visit history to display._VisitsTable, or 400 Bad Request when id is empty.
POST /Visits/InitializeVisits
DataTables server-side feed for a patient’s visits. AcceptspatientId through multiple resolution strategies (see introduction above). Returns VisitDTO records sorted and paginated according to the DataTables request.
Request — application/x-www-form-urlencoded
The patient whose visits to retrieve.
DataTables draw counter.
Pagination offset.
Page size.
200 OK, application/json
GET /Visits/Create/
Returns the_CreateVisit partial view pre-initialised with a Visit model where PatientId is set. Also generates and injects a fresh anti-forgery token into ViewData["RequestVerificationToken"] so the partial form can submit safely.
The
Patient.Id for which to create a visit._CreateVisit with a Visit model, or 400 Bad Request when id is empty.
POST /Visits/Create
Inserts a newVisit. The MedicId is resolved from the authenticated user’s identity claims — the controller calls CheckMedic() internally and sets visit.MedicId before persisting. The client does not submit a medic identifier.
Required: [ValidateAntiForgeryToken]
Request — application/x-www-form-urlencoded
The patient this visit belongs to. Must not be
Guid.Empty.Date and time of the visit.
Chief complaint or reason for the visit.
Diagnosis code or label.
Detailed description of the diagnosis.
Treatment plan.
Clinical evolution notes.
Laboratory result summary.
Other diagnostic studies.
Free-form observations.
| Status | Meaning |
|---|---|
200 OK | Visit created. |
400 Bad Request | PatientId is empty. |
500 Internal Server Error | Unexpected error during persistence. |
GET /Visits/Details/
Returns the_Details partial view for a single visit, populated with the full Visit entity.
The
Visit.Id (i.e. BaseEntity.Id) to retrieve._Details with the Visit model, or 400 Bad Request when id is empty.
Allergies
AllergiesController tracks a patient’s allergy history. Each Allergies record captures the allergen name, begin and optional end date, description, severity (8-level enum from Ninguna to Fatal), allergy type (Comida, Medicina, Ambiental, Insecto, Otra), frequency of occurrence (Una, Sporadica, Frequente, Constante), and free-form comments.
AllergiesController carries no class-level [Authorize] attribute and no method-level authorization annotations on any action. Access control is enforced at the application’s global middleware/policy level rather than in the controller itself.
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /Allergies/Index/{id} | None (global policy) | Returns _AllergiesTable partial |
POST | /Allergies/InitializeAllergies | None (global policy) | DataTables data feed |
GET | /Allergies/Create/{id} | None (global policy) | Returns _Create partial |
POST | /Allergies/Create | None (global policy) | Inserts a new allergy |
GET | /Allergies/Edit/{id} | None (global policy) | Returns _Create partial pre-filled for editing |
POST | /Allergies/Edit | None (global policy) | Updates an allergy |
DELETE | /Allergies/Delete/{id} | None (global policy) | Deletes an allergy |
GET | /Allergies/Details/{id} | None (global policy) | Returns _Details partial for one allergy |
GET /Allergies/Index/
Returns the_AllergiesTable partial and sets ViewData["PatientId"].
The
Patient.Id whose allergies to display.POST /Allergies/InitializeAllergies
DataTables feed. AcceptspatientId via the flexible resolution strategy described in the introduction.
The patient whose allergies to retrieve.
200 OK, application/json
GET /Allergies/Create/
Returns the_Create partial with a new Allergies model where PatientId is set. Populates ViewBag.Occurrency, ViewBag.Severity, and ViewBag.Type with enum-based SelectListItem lists. Generates an anti-forgery token in ViewData["RequestVerificationToken"].
The patient to associate the new allergy with.
POST /Allergies/Create
Inserts a new allergy record. Requires a valid anti-forgery token. Request —application/x-www-form-urlencoded
Must not be
Guid.Empty.Allergen name.
Date the allergy was first identified (
DateOnly).Date the allergy resolved, if applicable (
DateOnly). Nullable.Clinical description of the allergic reaction.
Severity enum value: 0=Ninguna, 1=Minima, 2=Baja, 3=Media, 4=Alta, 5=Severa, 6=Critica, 7=Fatal.AllergyType enum value: 0=Comida, 1=Medicina, 2=Ambiental, 3=Insecto, 4=Otra.Occurrency enum value: 0=Una, 1=Sporadica, 2=Frequente, 3=Constante.Additional free-text comments.
200 OK, 400 Bad Request, or 500 Internal Server Error.
GET /Allergies/Edit/
Returns the_Create partial pre-filled with the existing allergy data for editing. Also refreshes the enum select lists and anti-forgery token.
The
Allergies.Id to edit._Create with the existing Allergies model, or 404 Not Found.
POST /Allergies/Edit
Updates an existing allergy. Requires a valid anti-forgery token. The request body shape is identical toPOST /Allergies/Create.
Responses: 200 OK, 400 Bad Request, or 500 Internal Server Error.
DELETE /Allergies/Delete/
Deletes the specified allergy record.The
Allergies.Id to delete.200 OK
GET /Allergies/Details/
Returns the_Details partial view for a single allergy.
The
Allergies.Id to display.Vaccines
VaccinesController records vaccination events. Each VaccinesDto captures the vaccine description (selected from a VaccinesEnum list, with spaces substituted for underscores in display), an optional free-text OtherDescription, the application date, and the owning patient ID.
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /Vaccines/Index/{id} | Medico | Returns _Table partial |
POST | /Vaccines/InitializeVaccines | Medico | DataTables data feed |
GET | /Vaccines/Create/{id} | Medico | Returns _Create partial |
POST | /Vaccines/Create | Medico | Inserts a vaccine record |
GET | /Vaccines/Edit/{id} | Medico | Returns _Create partial for editing |
POST | /Vaccines/Edit | Medico | Updates a vaccine record |
DELETE | /Vaccines/Delete/{id} | Medico | Deletes a vaccine record |
GET /Vaccines/Index/
Fetches all vaccine records for the patient viaget.GetByPatientId and returns the _Table partial view with the data.
The
Patient.Id._Table with IEnumerable<Vaccines>, or 400 Bad Request.
POST /Vaccines/InitializeVaccines
DataTables feed for a patient’s vaccines.The patient whose vaccine records to retrieve.
200 OK, application/json
GET /Vaccines/Create/
Returns the_Create partial with a new Vaccines model. Populates ViewBag.Description with a SelectListItem list built from VaccinesEnum names (underscores replaced with spaces). Generates an anti-forgery token.
The patient to associate the vaccine with.
POST /Vaccines/Create
Inserts a new vaccine record. AcceptsVaccinesDto. Requires anti-forgery token.
Must not be
Guid.Empty.Vaccine name from
VaccinesEnum (underscores replaced with spaces).Free-text description for vaccines not in the standard list.
Date the vaccine was administered (
DateOnly, nullable).200 OK, 400 Bad Request, or 500 Internal Server Error.
GET /Vaccines/Edit/
Returns the_Create partial filled with the existing Vaccines record. Anti-forgery token and Description list are regenerated.
The
Vaccines.Id to edit._Create with existing data, 400 Bad Request for empty ID, or 404 Not Found.
POST /Vaccines/Edit
Updates a vaccine record. Body shape mirrorsPOST /Vaccines/Create; Id and PatientId must both be non-empty GUIDs. Requires anti-forgery token.
Responses: 200 OK, 400 Bad Request, or 500 Internal Server Error.
DELETE /Vaccines/Delete/
Deletes the specified vaccine record.The
Vaccines.Id to delete.200 OK, 400 Bad Request for empty ID, or 500 Internal Server Error.
Growth Chart
GrowthChartController records anthropometric measurements over time for a patient. Each GrowthChart entry stores the patient’s age (decimal years), a time label, weight with percentile, height with percentile, head circumference with percentile, and BMI. All numeric fields have database precision of (13,3).
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /GrowthChart/Index/{id} | Medico | Returns _Table partial |
POST | /GrowthChart/Initialize | Medico | DataTables data feed |
GET | /GrowthChart/Create/{id} | Medico | Returns _Create partial |
POST | /GrowthChart/Create | Medico | Inserts a growth chart entry |
GET | /GrowthChart/Edit/{id} | Medico | Returns _Create partial for editing |
POST | /GrowthChart/Edit | Medico | Updates a growth chart entry |
DELETE | /GrowthChart/Delete/{id} | Medico | Deletes a growth chart entry |
GET /GrowthChart/Index/
Fetches all growth chart records for the patient and returns the_Table partial.
The
Patient.Id._Table with IEnumerable<GrowthChart>, or 400 Bad Request.
POST /GrowthChart/Initialize
DataTables feed for a patient’s growth chart records.The patient whose growth chart entries to retrieve.
200 OK, application/json
GET /GrowthChart/Create/
Returns the_Create partial with a new GrowthChart model (PatientId set). Generates an anti-forgery token.
The patient to associate the entry with.
POST /GrowthChart/Create
Inserts a new growth chart entry. Requires[ValidateAntiForgeryToken] and a valid ModelState.
Must not be
Guid.Empty.Patient age in decimal years (precision
6,3).Human-readable age/time label (e.g.
"18 meses").Weight in kilograms (precision
13,3).Weight percentile label.
Height in centimetres (precision
13,3).Height percentile label.
Head circumference in centimetres (precision
13,3).Head circumference percentile label.
Body mass index (precision
13,3).200 OK, 400 Bad Request, or 500 Internal Server Error.
GET /GrowthChart/Edit/
Returns the_Create partial pre-filled with the existing entry for editing.
The
GrowthChart.Id to edit._Create with existing data, 400 Bad Request for empty ID, or 404 Not Found.
POST /GrowthChart/Edit
Updates an existing growth chart entry.Id must be non-empty. Requires anti-forgery token and valid ModelState.
Responses: 200 OK, 400 Bad Request, or 500 Internal Server Error.
DELETE /GrowthChart/Delete/
Deletes the specified growth chart entry.The
GrowthChart.Id to delete.200 OK, 400 Bad Request for empty ID, or 500 Internal Server Error.
Permanent Medications (PermMed)
PermMedController maintains the list of medications a patient takes on an ongoing basis. Each PermMed record contains a Description string and the owning PatientId. There is no edit action — corrections are made by deleting and re-creating the entry.
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /PermMed/Index/{id} | Medico | Returns _Table partial |
POST | /PermMed/Initialize | Medico | DataTables data feed |
GET | /PermMed/Create/{id} | Medico | Returns _Create partial |
POST | /PermMed/Create | Medico | Inserts a medication entry |
DELETE | /PermMed/Delete/{id} | Medico | Deletes a medication entry |
GET /PermMed/Index/
Fetches all permanent medication records for the patient and returns the_Table partial.
The
Patient.Id._Table with IEnumerable<PermMed>, or 400 Bad Request.
POST /PermMed/Initialize
DataTables feed for a patient’s permanent medication list.The patient whose medication records to retrieve.
200 OK, application/json
GET /PermMed/Create/
Returns the_Create partial with a new PermMed model pre-set with PatientId. Generates an anti-forgery token.
The patient to associate the medication with.
POST /PermMed/Create
Inserts a new permanent medication entry. Requires anti-forgery token.Must not be
Guid.Empty.Description of the medication, including dosage and schedule.
200 OK, 400 Bad Request, or 500 Internal Server Error.
DELETE /PermMed/Delete/
Deletes the specified permanent medication entry.The
PermMed.Id to delete.200 OK, 400 Bad Request for empty ID, or 500 Internal Server Error.
Personal Background
PersonalBackgroundController manages a patient’s personal medical history — a fixed set of boolean flags covering common conditions and past medical events. Because the PersonalBackground entity uses the patient’s own Guid as its primary key (via PatientFKEntity), there is no “create” action; the record is seeded when the patient is registered and subsequently edited in place.
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /PersonalBackground/Index/{id} | Medico | Returns _Details partial |
GET | /PersonalBackground/Edit/{id} | Medico | Returns _Edit partial |
PUT | /PersonalBackground/Edit | Medico | Updates the personal background record |
GET /PersonalBackground/Index/
Loads the personal background record for the given patient (using the patient’s ownGuid as the record key) and returns the _Details partial view.
The
Patient.Id (= PersonalBackground.Id)._Details, or 400 Bad Request.
GET /PersonalBackground/Edit/
Returns the_Edit partial pre-filled with the existing record. Injects an anti-forgery token.
The patient ID whose personal background to edit.
_Edit with the PersonalBackground model, or 400 Bad Request.
PUT /PersonalBackground/Edit
Updates thePersonalBackground record. The Patient navigation property is removed from ModelState before validation to avoid spurious failures when the navigation object is absent. On success the action calls GET /PersonalBackground/Index internally and returns the refreshed _Details partial — the client receives updated HTML rather than a plain status code.
Request body — boolean flag fields of PersonalBackground:
The
PersonalBackground.Id (= Patient.Id).Asma
Alergias
Neumonológicos
Neumonías
Paperas
Psicologicos
Accidentes
Hematooncológicos
Rubeola
Otítis
Sarampión
Varicela
Infec. Urinarias
Cirugías
Diabetes
Digestivos
Free-text field for other conditions not listed above.
_Details partial HTML on success, 400 Bad Request for invalid model, or 500 Internal Server Error.
Perinatal Background
PerinatalBackgroundController records obstetric and neonatal history for a patient. Like PersonalBackground, the PerinatalBackground entity shares the patient’s Guid as its primary key, so there is no create action. Note that PerinatalBackgroundController does not carry an [Authorize] attribute at the class level in source — access control is enforced at the route level via the application’s global policies, but there is no role assertion in the controller attributes themselves.
Endpoint summary
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /PerinatalBackground/Index/{id} | Medico | Returns _Details partial |
GET | /PerinatalBackground/Edit/{id} | Medico | Returns _Edit partial |
PUT | /PerinatalBackground/Edit | Medico | Updates the perinatal background record |
GET /PerinatalBackground/Index/
Loads the perinatal background for the patient and returns the_Details partial view.
The
Patient.Id (= PerinatalBackground.Id)._Details, or 400 Bad Request.
GET /PerinatalBackground/Edit/
Returns the_Edit partial pre-filled with the existing record. Returns 404 Not Found when no record exists. Injects an anti-forgery token.
The perinatal background record ID (= patient ID).
_Edit, 400 Bad Request, or 404 Not Found.
PUT /PerinatalBackground/Edit
Updates thePerinatalBackground record. The Patient navigation property is excluded from ModelState validation. On success, the action calls GET /PerinatalBackground/Index internally and returns the refreshed _Details partial.
Request body — numeric obstetric fields of PerinatalBackground:
The
PerinatalBackground.Id (= Patient.Id).Number of pregnancies (Gesta).
Number of vaginal deliveries (Parto).
Number of caesarean deliveries (Cesárea).
Number of spontaneous/voluntary abortions (Aborto).
Birth weight in grams (Peso).
Birth length in centimetres (Talla).
Cephalic perimeter at birth in centimetres (Perimetro Cefálico).
Apgar score at 1 minute.
Apgar score at 5 minutes.
Gestational age in weeks at birth (Edad Gestacional).
Free-text list of perinatal pathologies.
Free-text description of congenital errors.
_Details partial HTML on success, 400 Bad Request for invalid model, or 500 Internal Server Error.