{"openapi":"3.0.1","info":{"title":"EasyChong HIS Integration OpenAPI","description":"Unified API for HIS partners to synchronize hospital resources, patients, hospitalizations and medical orders.","contact":{"name":"EasyChong Integration Support"},"version":"1.0.0"},"servers":[{"url":"https://openapi.easychong.cn","description":"Generated server url"}],"paths":{"/openapi/v1/staff/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Stage a staff member for mapping","operationId":"staff","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/rooms/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or update a room","operationId":"room","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/patients/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or update a patient snapshot","operationId":"patient","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/owners/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or update an owner snapshot","operationId":"owner","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnerUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/medical-orders/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or revise a medical order","operationId":"medicalOrder","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalOrderUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/hospitalizations/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or update a hospitalization","operationId":"hospitalization","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HospitalizationUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/diagnoses/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or update a diagnosis","operationId":"diagnosis","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosisUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/beds/{externalId}":{"put":{"tags":["open-api-resource-controller"],"summary":"Create or update a bed","operationId":"bed","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BedUpsert"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/internal/admin/staff-mappings":{"put":{"tags":["admin-controller"],"operationId":"bindStaff","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindStaff"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/internal/admin/clients/{clientId}/status":{"put":{"tags":["admin-controller"],"operationId":"changeStatus","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeClientStatus"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/openapi/v1/medical-orders/{externalId}/stop":{"post":{"tags":["open-api-resource-controller"],"summary":"Stop a medical order","operationId":"stopOrder","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopOrderAction"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/openapi/v1/hospitalizations/{externalId}/discharge":{"post":{"tags":["open-api-resource-controller"],"summary":"Discharge a hospitalization","operationId":"discharge","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DischargeAction"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/AcceptedOperation"}}}}},"security":[{"bearerAuth":[]}]}},"/oauth2/token":{"post":{"tags":["o-auth-controller"],"operationId":"token","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"grant_type","in":"query","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}}}},"/internal/admin/operations/{operationId}/retry":{"post":{"tags":["admin-controller"],"operationId":"retryOperation","parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"}}}},"/internal/admin/clients":{"post":{"tags":["admin-controller"],"operationId":"createClient","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClient"}}},"required":true},"responses":{"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClientCreated"}}}}}}},"/internal/admin/clients/{clientId}/rotate-secret":{"post":{"tags":["admin-controller"],"operationId":"rotateSecret","parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ClientSecretRotated"}}}}}}},"/openapi/v1/operations/{operationId}":{"get":{"tags":["operation-controller"],"summary":"Get an asynchronous operation result","operationId":"get","parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OperationView"}}}}},"security":[{"bearerAuth":[]}]}}},"components":{"schemas":{"StaffUpsert":{"required":["active","name","roles","sourceUpdatedAt"],"type":"object","properties":{"name":{"maxLength":80,"minLength":0,"type":"string"},"roles":{"maxItems":8,"minItems":0,"uniqueItems":true,"type":"array","items":{"type":"string"}},"phone":{"maxLength":32,"minLength":0,"type":"string"},"licenseNumber":{"maxLength":80,"minLength":0,"type":"string"},"active":{"type":"boolean"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"AcceptedOperation":{"type":"object","properties":{"operationId":{"type":"string"},"status":{"type":"string"},"traceId":{"type":"string"},"statusUrl":{"type":"string"},"duplicate":{"type":"boolean"}}},"RoomUpsert":{"required":["name","roomType","sourceUpdatedAt"],"type":"object","properties":{"name":{"maxLength":80,"minLength":0,"type":"string"},"roomType":{"pattern":"CAT|DOG|ISOLATION|ICU|EXOTIC","type":"string"},"floor":{"maximum":200,"minimum":-10,"type":"integer","format":"int32"},"description":{"maxLength":500,"minLength":0,"type":"string"},"status":{"pattern":"ACTIVE|MAINTENANCE|DISABLED","type":"string"},"sortOrder":{"maximum":100000,"minimum":0,"type":"integer","format":"int32"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"PatientUpsert":{"required":["name","ownerExternalId","sourceUpdatedAt","species"],"type":"object","properties":{"ownerExternalId":{"maxLength":160,"minLength":0,"type":"string"},"name":{"maxLength":80,"minLength":0,"type":"string"},"caseNumber":{"maxLength":64,"minLength":0,"type":"string"},"species":{"pattern":"CAT|DOG|EXOTIC","type":"string"},"speciesDetail":{"maxLength":80,"minLength":0,"type":"string"},"breed":{"maxLength":120,"minLength":0,"type":"string"},"gender":{"pattern":"MALE|FEMALE|UNKNOWN","type":"string"},"ageMonths":{"maximum":1200,"minimum":0,"type":"integer","format":"int32"},"weightKg":{"maximum":500.00,"exclusiveMaximum":false,"minimum":0.01,"exclusiveMinimum":false,"type":"number"},"color":{"maxLength":80,"minLength":0,"type":"string"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"OwnerUpsert":{"required":["name","sourceUpdatedAt"],"type":"object","properties":{"name":{"maxLength":80,"minLength":0,"type":"string"},"phone":{"maxLength":32,"minLength":0,"type":"string"},"wechat":{"maxLength":80,"minLength":0,"type":"string"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"MedicalOrderUpsert":{"required":["category","doctorExternalId","hospitalizationExternalId","orderType","sourceUpdatedAt"],"type":"object","properties":{"hospitalizationExternalId":{"maxLength":160,"minLength":0,"type":"string"},"doctorExternalId":{"maxLength":160,"minLength":0,"type":"string"},"orderType":{"pattern":"LONG_TERM|TEMPORARY","type":"string"},"category":{"pattern":"DRUG|PROCEDURE|NURSING|DIET|OTHER","type":"string"},"orderForm":{"pattern":"STANDARD|INFUSION|CRI|INJECTION|ORAL|TOPICAL|MONITORING","type":"string"},"orderContent":{"maxLength":500,"minLength":0,"type":"string"},"taskTitle":{"maxLength":160,"minLength":0,"type":"string"},"taskInstructions":{"maxLength":1000,"minLength":0,"type":"string"},"drugName":{"maxLength":160,"minLength":0,"type":"string"},"dosage":{"maxLength":80,"minLength":0,"type":"string"},"unit":{"maxLength":32,"minLength":0,"type":"string"},"quantity":{"minimum":0.0,"exclusiveMinimum":false,"type":"number","format":"double"},"frequency":{"maxLength":64,"minLength":0,"type":"string"},"route":{"maxLength":64,"minLength":0,"type":"string"},"durationDays":{"maximum":3650,"minimum":1,"type":"integer","format":"int32"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"startClockTime":{"maxLength":16,"minLength":0,"type":"string"},"fixedTimes":{"maxItems":48,"minItems":0,"type":"array","items":{"type":"string"}},"infusionTotalVolumeMl":{"maximum":100000,"exclusiveMaximum":false,"minimum":0.01,"exclusiveMinimum":false,"type":"number"},"infusionRateMlPerHour":{"maximum":100000,"exclusiveMaximum":false,"minimum":0.01,"exclusiveMinimum":false,"type":"number"},"infusionDurationMinutes":{"maximum":100000,"minimum":1,"type":"integer","format":"int32"},"components":{"maxItems":30,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/OrderComponent"}},"previousOrderExternalId":{"maxLength":80,"minLength":0,"type":"string"},"sequenceDelayMinutes":{"maximum":100000,"minimum":0,"type":"integer","format":"int32"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"OrderComponent":{"required":["name","role"],"type":"object","properties":{"name":{"maxLength":160,"minLength":0,"type":"string"},"role":{"pattern":"BASE_FLUID|ADDITIVE|DRUG|SUPPLY","type":"string"},"dosage":{"maxLength":80,"minLength":0,"type":"string"},"unit":{"maxLength":32,"minLength":0,"type":"string"},"quantity":{"minimum":0.0,"exclusiveMinimum":false,"type":"number","format":"double"},"specification":{"maxLength":80,"minLength":0,"type":"string"},"externalLineId":{"maxLength":120,"minLength":0,"type":"string"}}},"HospitalizationUpsert":{"required":["admittedAt","bedExternalId","doctorExternalId","patientExternalId","primaryNurseExternalId","secondaryNurseExternalId","sourceUpdatedAt"],"type":"object","properties":{"patientExternalId":{"maxLength":160,"minLength":0,"type":"string"},"bedExternalId":{"maxLength":160,"minLength":0,"type":"string"},"doctorExternalId":{"maxLength":160,"minLength":0,"type":"string"},"primaryNurseExternalId":{"maxLength":160,"minLength":0,"type":"string"},"secondaryNurseExternalId":{"maxLength":160,"minLength":0,"type":"string"},"admittedAt":{"type":"string","format":"date-time"},"mainComplaint":{"maxLength":500,"minLength":0,"type":"string"},"initialDiagnosis":{"maxLength":500,"minLength":0,"type":"string"},"diagnosisBasis":{"maxLength":1000,"minLength":0,"type":"string"},"treatmentReason":{"maxLength":500,"minLength":0,"type":"string"},"attention":{"maxLength":500,"minLength":0,"type":"string"},"treatmentStatus":{"pattern":"FOCUS|MEDICATION|ROUTINE|ABNORMAL","type":"string"},"nursingLevel":{"maximum":1000,"minimum":1,"type":"integer","format":"int32"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"DiagnosisUpsert":{"required":["diagnosedAt","doctorExternalId","hospitalizationExternalId","result","sourceUpdatedAt"],"type":"object","properties":{"hospitalizationExternalId":{"maxLength":160,"minLength":0,"type":"string"},"result":{"maxLength":500,"minLength":0,"type":"string"},"basis":{"maxLength":1000,"minLength":0,"type":"string"},"doctorExternalId":{"maxLength":160,"minLength":0,"type":"string"},"diagnosedAt":{"type":"string","format":"date-time"},"treatmentReason":{"maxLength":500,"minLength":0,"type":"string"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"BedUpsert":{"required":["bedNo","roomExternalId","sourceUpdatedAt"],"type":"object","properties":{"roomExternalId":{"maxLength":160,"minLength":0,"type":"string"},"bedNo":{"maxLength":64,"minLength":0,"type":"string"},"bedName":{"maxLength":80,"minLength":0,"type":"string"},"status":{"pattern":"AVAILABLE|RESERVED|CLEANING","type":"string"},"sortOrder":{"maximum":100000,"minimum":0,"type":"integer","format":"int32"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"BindStaff":{"required":["internalUserId","partnerCode","staffExternalId","tenantId"],"type":"object","properties":{"partnerCode":{"maxLength":64,"minLength":0,"type":"string"},"tenantId":{"minimum":1,"type":"integer","format":"int64"},"staffExternalId":{"maxLength":160,"minLength":0,"type":"string"},"internalUserId":{"minimum":1,"type":"integer","format":"int64"}}},"ChangeClientStatus":{"required":["status"],"type":"object","properties":{"status":{"pattern":"ACTIVE|SUSPENDED|REVOKED","type":"string"}}},"StopOrderAction":{"required":["operatorExternalId","sourceUpdatedAt"],"type":"object","properties":{"reason":{"maxLength":500,"minLength":0,"type":"string"},"operatorExternalId":{"maxLength":160,"minLength":0,"type":"string"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"DischargeAction":{"required":["dischargedAt","operatorExternalId","sourceUpdatedAt"],"type":"object","properties":{"dischargedAt":{"type":"string","format":"date-time"},"summary":{"maxLength":2000,"minLength":0,"type":"string"},"advice":{"maxLength":2000,"minLength":0,"type":"string"},"finalDiagnosis":{"maxLength":500,"minLength":0,"type":"string"},"remark":{"maxLength":500,"minLength":0,"type":"string"},"operatorExternalId":{"maxLength":160,"minLength":0,"type":"string"},"sourceVersion":{"maxLength":80,"minLength":0,"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"}}},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer","format":"int64"},"scope":{"type":"string"}}},"CreateClient":{"required":["environment","hospitalExternalId","partnerCode","partnerName","scopes","tenantId"],"type":"object","properties":{"partnerCode":{"maxLength":64,"minLength":0,"pattern":"[a-z0-9][a-z0-9_-]{1,63}","type":"string"},"partnerName":{"maxLength":128,"minLength":0,"type":"string"},"tenantId":{"minimum":1,"type":"integer","format":"int64"},"hospitalExternalId":{"maxLength":128,"minLength":0,"type":"string"},"environment":{"pattern":"SANDBOX|PRODUCTION","type":"string"},"scopes":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"allowedIps":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"rateLimitPerMinute":{"maximum":10000,"minimum":10,"type":"integer","format":"int32"}}},"ClientCreated":{"type":"object","properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"},"partnerCode":{"type":"string"},"tenantId":{"type":"integer","format":"int64"},"environment":{"type":"string"},"scopes":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"warning":{"type":"string"}}},"ClientSecretRotated":{"type":"object","properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"},"warning":{"type":"string"}}},"OperationView":{"type":"object","properties":{"operationId":{"type":"string"},"resourceType":{"type":"string"},"action":{"type":"string"},"externalId":{"type":"string"},"status":{"type":"string"},"attemptCount":{"type":"integer","format":"int32"},"retryable":{"type":"boolean"},"errorCode":{"type":"string"},"errorDetail":{"type":"string"},"result":{"type":"object"},"traceId":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"},"finishedAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"securitySchemes":{"bearerAuth":{"type":"http","description":"Access token obtained from POST /oauth2/token","scheme":"bearer","bearerFormat":"JWT"}}}}