Skip to main content

Documentation 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.

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-level [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

MethodPathRolesDescription
GET/Visits/Index/{id}MedicoReturns _VisitsTable partial for a patient
POST/Visits/InitializeVisitsMedicoDataTables data feed for a patient’s visits
GET/Visits/Create/{id}MedicoReturns _CreateVisit partial
POST/Visits/CreateMedicoInserts a new visit
GET/Visits/Details/{id}MedicoReturns _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.
id
string (GUID)
required
The Patient.Id whose visit history to display.
Response: Partial view _VisitsTable, or 400 Bad Request when id is empty.

POST /Visits/InitializeVisits

DataTables server-side feed for a patient’s visits. Accepts patientId through multiple resolution strategies (see introduction above). Returns VisitDTO records sorted and paginated according to the DataTables request. Requestapplication/x-www-form-urlencoded
patientId
string (GUID)
required
The patient whose visits to retrieve.
draw
string
required
DataTables draw counter.
start
integer
required
Pagination offset.
length
integer
required
Page size.
Response200 OK, application/json
{
  "draw": "1",
  "recordsFiltered": 5,
  "recordsTotal": 5,
  "data": [
    {
      "id": "aabbccdd-1234-5678-9abc-def012345678",
      "visitDate": "10/06/2025",
      "reason": "Fiebre",
      "patientId": "c1d2e3f4-0000-1111-2222-333344445555",
      "medic": "Dr. López"
    }
  ]
}

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.
id
string (GUID)
required
The Patient.Id for which to create a visit.
Response: Partial view _CreateVisit with a Visit model, or 400 Bad Request when id is empty.

POST /Visits/Create

Inserts a new Visit. 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] Requestapplication/x-www-form-urlencoded
PatientId
string (GUID)
required
The patient this visit belongs to. Must not be Guid.Empty.
VisitDate
string (datetime)
required
Date and time of the visit.
Reason
string
Chief complaint or reason for the visit.
Diagnosis
string
Diagnosis code or label.
DiagDescription
string
Detailed description of the diagnosis.
Treatment
string
Treatment plan.
EvolutionNotes
string
Clinical evolution notes.
LabResults
string
Laboratory result summary.
OtherStudies
string
Other diagnostic studies.
Observations
string
Free-form observations.
Responses
StatusMeaning
200 OKVisit created.
400 Bad RequestPatientId is empty.
500 Internal Server ErrorUnexpected error during persistence.

GET /Visits/Details/

Returns the _Details partial view for a single visit, populated with the full Visit entity.
id
string (GUID)
required
The Visit.Id (i.e. BaseEntity.Id) to retrieve.
Response: Partial view _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

MethodPathRolesDescription
GET/Allergies/Index/{id}None (global policy)Returns _AllergiesTable partial
POST/Allergies/InitializeAllergiesNone (global policy)DataTables data feed
GET/Allergies/Create/{id}None (global policy)Returns _Create partial
POST/Allergies/CreateNone (global policy)Inserts a new allergy
GET/Allergies/Edit/{id}None (global policy)Returns _Create partial pre-filled for editing
POST/Allergies/EditNone (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"].
id
string (GUID)
required
The Patient.Id whose allergies to display.

POST /Allergies/InitializeAllergies

DataTables feed. Accepts patientId via the flexible resolution strategy described in the introduction.
patientId
string (GUID)
required
The patient whose allergies to retrieve.
Response200 OK, application/json
{
  "draw": "1",
  "recordsFiltered": 2,
  "recordsTotal": 2,
  "data": [
    {
      "id": "ddee1122-abcd-ef01-2345-678901234567",
      "name": "Penicilina",
      "patientId": "c1d2e3f4-0000-1111-2222-333344445555",
      "begin": "2020-01-15",
      "end": null,
      "severity": 4,
      "type": 1,
      "occurrency": 2,
      "description": "Urticaria generalizada",
      "comments": "Verificado en 2022"
    }
  ]
}

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"].
id
string (GUID)
required
The patient to associate the new allergy with.

POST /Allergies/Create

Inserts a new allergy record. Requires a valid anti-forgery token. Requestapplication/x-www-form-urlencoded
PatientId
string (GUID)
required
Must not be Guid.Empty.
Name
string
required
Allergen name.
Begin
string (date)
required
Date the allergy was first identified (DateOnly).
End
string (date)
Date the allergy resolved, if applicable (DateOnly). Nullable.
Description
string
Clinical description of the allergic reaction.
Severity
integer
Severity enum value: 0=Ninguna, 1=Minima, 2=Baja, 3=Media, 4=Alta, 5=Severa, 6=Critica, 7=Fatal.
Type
integer
AllergyType enum value: 0=Comida, 1=Medicina, 2=Ambiental, 3=Insecto, 4=Otra.
Occurrency
integer
Occurrency enum value: 0=Una, 1=Sporadica, 2=Frequente, 3=Constante.
Comments
string
Additional free-text comments.
Responses: 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.
id
string (GUID)
required
The Allergies.Id to edit.
Response: Partial view _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 to POST /Allergies/Create. Responses: 200 OK, 400 Bad Request, or 500 Internal Server Error.

DELETE /Allergies/Delete/

Deletes the specified allergy record.
id
string (GUID)
required
The Allergies.Id to delete.
Response: 200 OK

GET /Allergies/Details/

Returns the _Details partial view for a single allergy.
id
string (GUID)
required
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

MethodPathRolesDescription
GET/Vaccines/Index/{id}MedicoReturns _Table partial
POST/Vaccines/InitializeVaccinesMedicoDataTables data feed
GET/Vaccines/Create/{id}MedicoReturns _Create partial
POST/Vaccines/CreateMedicoInserts a vaccine record
GET/Vaccines/Edit/{id}MedicoReturns _Create partial for editing
POST/Vaccines/EditMedicoUpdates a vaccine record
DELETE/Vaccines/Delete/{id}MedicoDeletes a vaccine record

GET /Vaccines/Index/

Fetches all vaccine records for the patient via get.GetByPatientId and returns the _Table partial view with the data.
id
string (GUID)
required
The Patient.Id.
Response: Partial view _Table with IEnumerable<Vaccines>, or 400 Bad Request.

POST /Vaccines/InitializeVaccines

DataTables feed for a patient’s vaccines.
patientId
string (GUID)
required
The patient whose vaccine records to retrieve.
Response200 OK, application/json
{
  "draw": "1",
  "recordsFiltered": 3,
  "recordsTotal": 3,
  "data": [
    {
      "id": "aabb1234-0000-aaaa-bbbb-ccccddddeeee",
      "description": "Triple Viral",
      "otherDescription": null,
      "dateApplied": "2024-03-10",
      "patientId": "c1d2e3f4-0000-1111-2222-333344445555"
    }
  ]
}

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.
id
string (GUID)
required
The patient to associate the vaccine with.

POST /Vaccines/Create

Inserts a new vaccine record. Accepts VaccinesDto. Requires anti-forgery token.
PatientId
string (GUID)
required
Must not be Guid.Empty.
Description
string
Vaccine name from VaccinesEnum (underscores replaced with spaces).
OtherDescription
string
Free-text description for vaccines not in the standard list.
DateApplied
string (date)
Date the vaccine was administered (DateOnly, nullable).
Responses: 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.
id
string (GUID)
required
The Vaccines.Id to edit.
Response: Partial view _Create with existing data, 400 Bad Request for empty ID, or 404 Not Found.

POST /Vaccines/Edit

Updates a vaccine record. Body shape mirrors POST /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.
id
string (GUID)
required
The Vaccines.Id to delete.
Response: 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

MethodPathRolesDescription
GET/GrowthChart/Index/{id}MedicoReturns _Table partial
POST/GrowthChart/InitializeMedicoDataTables data feed
GET/GrowthChart/Create/{id}MedicoReturns _Create partial
POST/GrowthChart/CreateMedicoInserts a growth chart entry
GET/GrowthChart/Edit/{id}MedicoReturns _Create partial for editing
POST/GrowthChart/EditMedicoUpdates a growth chart entry
DELETE/GrowthChart/Delete/{id}MedicoDeletes a growth chart entry

GET /GrowthChart/Index/

Fetches all growth chart records for the patient and returns the _Table partial.
id
string (GUID)
required
The Patient.Id.
Response: Partial view _Table with IEnumerable<GrowthChart>, or 400 Bad Request.

POST /GrowthChart/Initialize

DataTables feed for a patient’s growth chart records.
patientId
string (GUID)
required
The patient whose growth chart entries to retrieve.
Response200 OK, application/json
{
  "draw": "1",
  "recordsFiltered": 4,
  "recordsTotal": 4,
  "data": [
    {
      "id": "f0e1d2c3-b4a5-9687-7865-544332211000",
      "age": 2.500,
      "time": "30 meses",
      "weight": 12.500,
      "wPerc": "50",
      "height": 90.000,
      "hPerc": "50",
      "headCircumference": 49.000,
      "hcPerc": "50",
      "bmi": 15.400,
      "patientId": "c1d2e3f4-0000-1111-2222-333344445555"
    }
  ]
}

GET /GrowthChart/Create/

Returns the _Create partial with a new GrowthChart model (PatientId set). Generates an anti-forgery token.
id
string (GUID)
required
The patient to associate the entry with.

POST /GrowthChart/Create

Inserts a new growth chart entry. Requires [ValidateAntiForgeryToken] and a valid ModelState.
PatientId
string (GUID)
required
Must not be Guid.Empty.
Age
decimal
required
Patient age in decimal years (precision 6,3).
Time
string
Human-readable age/time label (e.g. "18 meses").
Weight
decimal
required
Weight in kilograms (precision 13,3).
WPerc
string
Weight percentile label.
Height
decimal
required
Height in centimetres (precision 13,3).
HPerc
string
Height percentile label.
HeadCircumference
decimal
required
Head circumference in centimetres (precision 13,3).
HCPerc
string
Head circumference percentile label.
Bmi
decimal
required
Body mass index (precision 13,3).
Responses: 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.
id
string (GUID)
required
The GrowthChart.Id to edit.
Response: Partial view _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.
id
string (GUID)
required
The GrowthChart.Id to delete.
Response: 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

MethodPathRolesDescription
GET/PermMed/Index/{id}MedicoReturns _Table partial
POST/PermMed/InitializeMedicoDataTables data feed
GET/PermMed/Create/{id}MedicoReturns _Create partial
POST/PermMed/CreateMedicoInserts a medication entry
DELETE/PermMed/Delete/{id}MedicoDeletes a medication entry

GET /PermMed/Index/

Fetches all permanent medication records for the patient and returns the _Table partial.
id
string (GUID)
required
The Patient.Id.
Response: Partial view _Table with IEnumerable<PermMed>, or 400 Bad Request.

POST /PermMed/Initialize

DataTables feed for a patient’s permanent medication list.
patientId
string (GUID)
required
The patient whose medication records to retrieve.
Response200 OK, application/json
{
  "draw": "1",
  "recordsFiltered": 2,
  "recordsTotal": 2,
  "data": [
    {
      "id": "11223344-aabb-ccdd-eeff-001122334455",
      "description": "Salbutamol 100mcg — 2 puffs cada 8 hs",
      "patientId": "c1d2e3f4-0000-1111-2222-333344445555"
    }
  ]
}

GET /PermMed/Create/

Returns the _Create partial with a new PermMed model pre-set with PatientId. Generates an anti-forgery token.
id
string (GUID)
required
The patient to associate the medication with.

POST /PermMed/Create

Inserts a new permanent medication entry. Requires anti-forgery token.
PatientId
string (GUID)
required
Must not be Guid.Empty.
Description
string
Description of the medication, including dosage and schedule.
Responses: 200 OK, 400 Bad Request, or 500 Internal Server Error.

DELETE /PermMed/Delete/

Deletes the specified permanent medication entry.
id
string (GUID)
required
The PermMed.Id to delete.
Response: 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

MethodPathRolesDescription
GET/PersonalBackground/Index/{id}MedicoReturns _Details partial
GET/PersonalBackground/Edit/{id}MedicoReturns _Edit partial
PUT/PersonalBackground/EditMedicoUpdates the personal background record

GET /PersonalBackground/Index/

Loads the personal background record for the given patient (using the patient’s own Guid as the record key) and returns the _Details partial view.
id
string (GUID)
required
The Patient.Id (= PersonalBackground.Id).
Response: Partial view _Details, or 400 Bad Request.

GET /PersonalBackground/Edit/

Returns the _Edit partial pre-filled with the existing record. Injects an anti-forgery token.
id
string (GUID)
required
The patient ID whose personal background to edit.
Response: Partial view _Edit with the PersonalBackground model, or 400 Bad Request.

PUT /PersonalBackground/Edit

Updates the PersonalBackground 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:
Id
string (GUID)
required
The PersonalBackground.Id (= Patient.Id).
Asthma
boolean
Asma
Allergy
boolean
Alergias
Pulmonologist
boolean
Neumonológicos
Pneumonia
boolean
Neumonías
Mumps
boolean
Paperas
Psicologicals
boolean
Psicologicos
Accidents
boolean
Accidentes
HematOnc
boolean
Hematooncológicos
Rubella
boolean
Rubeola
Otitis
boolean
Otítis
Measles
boolean
Sarampión
Chickenpox
boolean
Varicela
UrinaryInfections
boolean
Infec. Urinarias
Surgeries
boolean
Cirugías
Diabetes
boolean
Diabetes
Digestive
boolean
Digestivos
Other
string
Free-text field for other conditions not listed above.
Responses: Updated _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

MethodPathRolesDescription
GET/PerinatalBackground/Index/{id}MedicoReturns _Details partial
GET/PerinatalBackground/Edit/{id}MedicoReturns _Edit partial
PUT/PerinatalBackground/EditMedicoUpdates the perinatal background record

GET /PerinatalBackground/Index/

Loads the perinatal background for the patient and returns the _Details partial view.
id
string (GUID)
required
The Patient.Id (= PerinatalBackground.Id).
Response: Partial view _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.
id
string (GUID)
required
The perinatal background record ID (= patient ID).
Response: Partial view _Edit, 400 Bad Request, or 404 Not Found.

PUT /PerinatalBackground/Edit

Updates the PerinatalBackground 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:
Id
string (GUID)
required
The PerinatalBackground.Id (= Patient.Id).
Feat
integer
Number of pregnancies (Gesta).
Delivery
integer
Number of vaginal deliveries (Parto).
Cesarean
integer
Number of caesarean deliveries (Cesárea).
Abort
integer
Number of spontaneous/voluntary abortions (Aborto).
Weight
integer
Birth weight in grams (Peso).
Height
integer
Birth length in centimetres (Talla).
CefPer
integer
Cephalic perimeter at birth in centimetres (Perimetro Cefálico).
Apgar1
integer
Apgar score at 1 minute.
Apgar5
integer
Apgar score at 5 minutes.
GestAge
integer
Gestational age in weeks at birth (Edad Gestacional).
Pathologies
string
Free-text list of perinatal pathologies.
CongErrors
string
Free-text description of congenital errors.
Responses: Updated _Details partial HTML on success, 400 Bad Request for invalid model, or 500 Internal Server Error.

Build docs developers (and LLMs) love