clqms-fe1/docs/patient-visits.yaml

520 lines
15 KiB
YAML
Raw Normal View History

/api/patvisit:
get:
tags: [Patient Visits]
summary: List patient visits
security:
- bearerAuth: []
parameters:
- name: InternalPID
in: query
schema:
type: integer
description: Filter by internal patient ID (exact match)
- name: PVID
in: query
schema:
type: string
description: Filter by visit ID (partial match)
- name: PatientID
in: query
schema:
type: string
description: Filter by patient ID (partial match)
- name: PatientName
in: query
schema:
type: string
description: Search by patient name (searches in both first and last name)
- name: CreateDateFrom
in: query
schema:
type: string
format: date-time
description: Filter visits created on or after this date
- name: CreateDateTo
in: query
schema:
type: string
format: date-time
description: Filter visits created on or before this date
- name: page
in: query
schema:
type: integer
- name: perPage
in: query
schema:
type: integer
responses:
'200':
description: List of patient visits
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
data:
type: array
items:
$ref: '../components/schemas/patient-visit.yaml#/PatientVisit'
total:
type: integer
description: Total number of records
page:
type: integer
description: Current page number
per_page:
type: integer
description: Number of records per page
post:
tags: [Patient Visits]
summary: Create patient visit
description: |
Creates a new patient visit. PVID is auto-generated with 'DV' prefix if not provided.
Can optionally include PatDiag (diagnosis) and PatVisitADT (ADT information).
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- InternalPID
properties:
PVID:
type: string
description: Visit ID (auto-generated with DV prefix if not provided)
InternalPID:
type: integer
description: Patient ID (required)
EpisodeID:
type: string
description: Episode identifier
SiteID:
type: integer
description: Site reference
PatDiag:
type: object
description: Optional diagnosis information
properties:
DiagCode:
type: string
Diagnosis:
type: string
PatVisitADT:
type: object
description: Optional ADT information
properties:
ADTCode:
type: string
enum: [A01, A02, A03, A04, A08]
LocationID:
type: integer
AttDoc:
type: integer
RefDoc:
type: integer
AdmDoc:
type: integer
CnsDoc:
type: integer
responses:
'201':
description: Visit created successfully
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
data:
type: object
properties:
PVID:
type: string
InternalPVID:
type: integer
patch:
tags: [Patient Visits]
summary: Update patient visit
description: |
Updates an existing patient visit. InternalPVID is required.
Can update main visit data, PatDiag, and add new PatVisitADT records.
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- InternalPVID
properties:
InternalPVID:
type: integer
description: Visit ID (required)
PVID:
type: string
InternalPID:
type: integer
EpisodeID:
type: string
SiteID:
type: integer
PatDiag:
type: object
description: Diagnosis information (will update if exists)
properties:
DiagCode:
type: string
Diagnosis:
type: string
PatVisitADT:
type: array
description: Array of ADT records to add (new records only)
items:
type: object
properties:
ADTCode:
type: string
enum: [A01, A02, A03, A04, A08]
LocationID:
type: integer
AttDoc:
type: integer
RefDoc:
type: integer
AdmDoc:
type: integer
CnsDoc:
type: integer
sequence:
type: integer
description: Used for ordering multiple ADT records
responses:
'200':
description: Visit updated successfully
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
data:
type: object
properties:
PVID:
type: string
InternalPVID:
type: integer
delete:
tags: [Patient Visits]
summary: Delete patient visit
security:
- bearerAuth: []
responses:
'200':
description: Visit deleted successfully
/api/patvisit/{id}:
get:
tags: [Patient Visits]
summary: Get visit by ID
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
description: PVID (visit identifier like DV00001)
responses:
'200':
description: Visit details
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
data:
$ref: '../components/schemas/patient-visit.yaml#/PatientVisit'
/api/patvisit/patient/{patientId}:
get:
tags: [Patient Visits]
summary: Get visits by patient ID
security:
- bearerAuth: []
parameters:
- name: patientId
in: path
required: true
schema:
type: integer
description: Internal Patient ID (InternalPID)
responses:
'200':
description: Patient visits list
content:
application/json:
schema:
type: object
properties:
status:
type: string
data:
type: array
items:
$ref: '../components/schemas/patient-visit.yaml#/PatientVisit'
/api/patvisitadt:
post:
tags: [Patient Visits]
summary: Create ADT record
description: Create a new Admission/Discharge/Transfer record
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/schemas/patient-visit.yaml#/PatVisitADT'
responses:
'201':
description: ADT record created successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
patch:
tags: [Patient Visits]
summary: Update ADT record
description: Update an existing ADT record
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/schemas/patient-visit.yaml#/PatVisitADT'
responses:
'200':
description: ADT record updated successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
delete:
tags: [Patient Visits]
summary: Delete ADT visit (soft delete)
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- PVADTID
properties:
PVADTID:
type: integer
description: ADT record ID to delete
responses:
'200':
description: ADT visit deleted successfully
/api/patvisitadt/visit/{visitId}:
get:
tags: [Patient Visits]
summary: Get ADT history by visit ID
description: Retrieve the complete Admission/Discharge/Transfer history for a visit, including all locations and doctors
security:
- bearerAuth: []
parameters:
- name: visitId
in: path
required: true
schema:
type: integer
description: Internal Visit ID (InternalPVID)
responses:
'200':
description: ADT history retrieved successfully
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: success
message:
type: string
example: ADT history retrieved
data:
type: array
items:
type: object
properties:
PVADTID:
type: integer
InternalPVID:
type: integer
ADTCode:
type: string
enum: [A01, A02, A03, A04, A08]
LocationID:
type: integer
LocationName:
type: string
AttDoc:
type: integer
AttDocFirstName:
type: string
AttDocLastName:
type: string
RefDoc:
type: integer
RefDocFirstName:
type: string
RefDocLastName:
type: string
AdmDoc:
type: integer
AdmDocFirstName:
type: string
AdmDocLastName:
type: string
CnsDoc:
type: integer
CnsDocFirstName:
type: string
CnsDocLastName:
type: string
CreateDate:
type: string
format: date-time
EndDate:
type: string
format: date-time
delete:
tags: [Patient Visits]
summary: Delete ADT visit (soft delete)
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- PVADTID
properties:
PVADTID:
type: integer
description: ADT record ID to delete
responses:
'200':
description: ADT visit deleted successfully
/api/patvisitadt/{id}:
get:
tags: [Patient Visits]
summary: Get ADT record by ID
description: Retrieve a single ADT record by its ID, including location and doctor details
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: ADT record ID (PVADTID)
responses:
'200':
description: ADT record retrieved successfully
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: success
message:
type: string
example: ADT record retrieved
data:
type: object
properties:
PVADTID:
type: integer
InternalPVID:
type: integer
ADTCode:
type: string
enum: [A01, A02, A03, A04, A08]
LocationID:
type: integer
LocationName:
type: string
AttDoc:
type: integer
AttDocFirstName:
type: string
AttDocLastName:
type: string
RefDoc:
type: integer
RefDocFirstName:
type: string
RefDocLastName:
type: string
AdmDoc:
type: integer
AdmDocFirstName:
type: string
AdmDocLastName:
type: string
CnsDoc:
type: integer
CnsDocFirstName:
type: string
CnsDocLastName:
type: string
CreateDate:
type: string
format: date-time
EndDate:
type: string
format: date-time