VitrinaAPI

Esterilización de la clínica

El registro de ciclos de esterilización: equipo, lote, fecha y hora, quién lo realizó, resultado con su indicador y los paquetes del ciclo, con exportación CSV y PDF por período y equipo; el lote usado queda anotado en la atención.

Beta
Puede cambiar en cualquier momento, con una entrada en el changelog y aviso a quienes la llamaron recientemente — ver versionado.

Descarga la proyección completa de la API pública: openapi.json.

MétodoRutaQué hace
GET/clinic/sterilization/cyclesList sterilisation cycles
POST/clinic/sterilization/cyclesLog a sterilisation cycle
GET/clinic/sterilization/cycles/{id}Get one sterilisation cycle
PATCH/clinic/sterilization/cycles/{id}Correct a sterilisation cycle
GET/clinic/sterilization/cycles/exportExport the cycle log as CSV or PDF
GET/clinic/sterilization/equipmentList the sterilisation equipment
POST/clinic/sterilization/equipmentAdd a piece of sterilisation equipment
PATCH/clinic/sterilization/equipment/{id}Rename or withdraw a piece of equipment

GET /clinic/sterilization/cycles

List sterilisation cycles

Newest first, with the equipment name. Filter by from / to (the clinic's calendar days, inclusive), equipment_id, result and a partial lote. Requires clinic:read.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

ParámetroEnTipoObligatorioRestricciones
fromquerystringnopatrón ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
toquerystringnopatrón ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
equipment_idqueryuuidno
resultqueryapproved \rejectedno
lotequerystringnomáx. 60
pagequeryintegerno≥ 1, por defecto 1
limitqueryintegerno≥ 1, ≤ 200, por defecto 50
curl https://api.vitrinadev.com/api/v1/clinic/sterilization/cycles \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": {
    "data": [
      {
        "id": "c0e57121-0000-4000-8000-0000000005ab",
        "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
        "equipment_id": "c0e57121-0000-4000-8000-0000000004ab",
        "equipment_name": "Autoclave 1",
        "lote": "A-0412",
        "run_at": "2026-10-09T17:30:00.000Z",
        "operator_name": "Camila Rojas",
        "result": "approved",
        "indicator": "Indicador químico clase 5",
        "packs": [
          "Pack exodoncia",
          "Pack básico"
        ],
        "notes": null,
        "created_by": "5e5e5e5e-0000-4000-8000-000000000001",
        "created_at": "2026-10-09T17:45:00.000Z",
        "updated_at": "2026-10-09T17:45:00.000Z"
      }
    ],
    "total": 1,
    "page": 1,
    "limit": 50
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

POST /clinic/sterilization/cycles

Log a sterilisation cycle

Records lote, run_at, who ran it (operator_name), the equipment, the result (approved / rejected) with the indicator used, and the packs it contained. 409 when the equipment already has that lote; 400 for a withdrawn equipment or a future run_at. Requires clinic:write.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

Cuerpo

CampoTipoObligatorioRestricciones
equipment_iduuidsí
lotestringsímín. 1, máx. 60
run_atstringsídate-time
operator_namestringsímín. 1, máx. 120
resultapproved \rejectedsí
indicatorstring | null—máx. 120
packsstring[]—
notesstring | null—máx. 1000
curl -X POST https://api.vitrinadev.com/api/v1/clinic/sterilization/cycles \
  -H "Authorization: Bearer $VITRINA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "equipment_id": "c0e57121-0000-4000-8000-0000000004ab",
    "lote": "A-0412",
    "run_at": "2026-10-09T14:30:00-03:00",
    "operator_name": "Camila Rojas",
    "result": "approved",
    "indicator": "Indicador químico clase 5",
    "packs": [
      "Pack exodoncia",
      "Pack básico"
    ]
  }'

Ejemplo de respuesta (201)

{
  "data": {
    "id": "c0e57121-0000-4000-8000-0000000005ab",
    "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
    "equipment_id": "c0e57121-0000-4000-8000-0000000004ab",
    "equipment_name": "Autoclave 1",
    "lote": "A-0412",
    "run_at": "2026-10-09T17:30:00.000Z",
    "operator_name": "Camila Rojas",
    "result": "approved",
    "indicator": "Indicador químico clase 5",
    "packs": [
      "Pack exodoncia",
      "Pack básico"
    ],
    "notes": null,
    "created_by": "5e5e5e5e-0000-4000-8000-000000000001",
    "created_at": "2026-10-09T17:45:00.000Z",
    "updated_at": "2026-10-09T17:45:00.000Z"
  }
}

Responde: 201 · 400 · 401 · 403 · 404 · 409 · 429

GET /clinic/sterilization/cycles/{id}

Get one sterilisation cycle

Requires clinic:read.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

ParámetroEnTipoObligatorioRestricciones
idpathuuidsí
curl https://api.vitrinadev.com/api/v1/clinic/sterilization/cycles/<id> \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": {
    "id": "c0e57121-0000-4000-8000-0000000005ab",
    "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
    "equipment_id": "c0e57121-0000-4000-8000-0000000004ab",
    "equipment_name": "Autoclave 1",
    "lote": "A-0412",
    "run_at": "2026-10-09T17:30:00.000Z",
    "operator_name": "Camila Rojas",
    "result": "approved",
    "indicator": "Indicador químico clase 5",
    "packs": [
      "Pack exodoncia",
      "Pack básico"
    ],
    "notes": null,
    "created_by": "5e5e5e5e-0000-4000-8000-000000000001",
    "created_at": "2026-10-09T17:45:00.000Z",
    "updated_at": "2026-10-09T17:45:00.000Z"
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

PATCH /clinic/sterilization/cycles/{id}

Correct a sterilisation cycle

Any field of the cycle. A cycle is never deleted: the correction is audited with the values it replaced. 409 when the new lote is taken on that equipment. Requires clinic:write.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

ParámetroEnTipoObligatorioRestricciones
idpathuuidsí

Cuerpo

CampoTipoObligatorioRestricciones
equipment_iduuid—
lotestring—mín. 1, máx. 60
run_atstring—date-time
operator_namestring—mín. 1, máx. 120
resultapproved \rejected—
indicatorstring | null—máx. 120
packsstring[]—
notesstring | null—máx. 1000
curl -X PATCH https://api.vitrinadev.com/api/v1/clinic/sterilization/cycles/<id> \
  -H "Authorization: Bearer $VITRINA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "result": "rejected",
    "notes": "El indicador no virado."
  }'

Ejemplo de respuesta (200)

{
  "data": {
    "id": "c0e57121-0000-4000-8000-0000000005ab",
    "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
    "equipment_id": "c0e57121-0000-4000-8000-0000000004ab",
    "equipment_name": "Autoclave 1",
    "lote": "A-0412",
    "run_at": "2026-10-09T17:30:00.000Z",
    "operator_name": "Camila Rojas",
    "result": "rejected",
    "indicator": "Indicador químico clase 5",
    "packs": [
      "Pack exodoncia",
      "Pack básico"
    ],
    "notes": "El indicador no virado.",
    "created_by": "5e5e5e5e-0000-4000-8000-000000000001",
    "created_at": "2026-10-09T17:45:00.000Z",
    "updated_at": "2026-10-09T17:45:00.000Z"
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

GET /clinic/sterilization/cycles/export

Export the cycle log as CSV or PDF

The same filters as the list (from, to, equipment_id), oldest first, for an inspection. format=csv is ;-separated and BOM-prefixed for es-CL Excel; format=pdf is the clinic’s branded paper. Up to 5000 cycles per file (400 beyond that: narrow the dates). Requires clinic:read; every export is audited.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

ParámetroEnTipoObligatorioRestricciones
fromquerystringnopatrón ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
toquerystringnopatrón ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
equipment_idqueryuuidno
formatquerycsv \pdfsí
curl https://api.vitrinadev.com/api/v1/clinic/sterilization/cycles/export \
  -H "Authorization: Bearer $VITRINA_KEY"

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

GET /clinic/sterilization/equipment

List the sterilisation equipment

The autoclaves and equipment the clinic runs cycles on, active first. active=true is what the cycle form offers. Requires clinic:read.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

ParámetroEnTipoObligatorioRestricciones
activequerytrue \falseno
curl https://api.vitrinadev.com/api/v1/clinic/sterilization/equipment \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": [
    {
      "id": "c0e57121-0000-4000-8000-0000000004ab",
      "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
      "name": "Autoclave 1",
      "active": true,
      "created_at": "2026-10-01T13:00:00.000Z",
      "updated_at": "2026-10-01T13:00:00.000Z"
    }
  ]
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

POST /clinic/sterilization/equipment

Add a piece of sterilisation equipment

Names are unique per clinic, ignoring case (409 otherwise). Requires clinic_admin:write.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

Cuerpo

CampoTipoObligatorioRestricciones
namestringsímín. 1, máx. 120
curl -X POST https://api.vitrinadev.com/api/v1/clinic/sterilization/equipment \
  -H "Authorization: Bearer $VITRINA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Autoclave 1"
  }'

Ejemplo de respuesta (201)

{
  "data": {
    "id": "c0e57121-0000-4000-8000-0000000004ab",
    "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
    "name": "Autoclave 1",
    "active": true,
    "created_at": "2026-10-01T13:00:00.000Z",
    "updated_at": "2026-10-01T13:00:00.000Z"
  }
}

Responde: 201 · 400 · 401 · 403 · 404 · 409 · 429

PATCH /clinic/sterilization/equipment/{id}

Rename or withdraw a piece of equipment

active: false withdraws it from the cycle form; its cycles keep naming it. Equipment is never deleted. Requires clinic_admin:write.

Connected apps: every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, "M.F. · #1001" — unless the clinic allowed patient names, with RUT, phone and email masked in free text and meta.patient_privacy saying so. Clinical alerts (flags) are withheld in both modes, and a non-JSON body (an export, a file) is refused with 403 CONNECTED_APP_SENSITIVE_DATA.

ParámetroEnTipoObligatorioRestricciones
idpathuuidsí

Cuerpo

CampoTipoObligatorioRestricciones
namestring—mín. 1, máx. 120
activeboolean—
curl -X PATCH https://api.vitrinadev.com/api/v1/clinic/sterilization/equipment/<id> \
  -H "Authorization: Bearer $VITRINA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "active": false
  }'

Ejemplo de respuesta (200)

{
  "data": {
    "id": "c0e57121-0000-4000-8000-0000000004ab",
    "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
    "name": "Autoclave 1",
    "active": false,
    "created_at": "2026-10-01T13:00:00.000Z",
    "updated_at": "2026-10-01T13:00:00.000Z"
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

En esta página