사이트 관리 API
참고: 이 문서에 설명된 모든 API는
dta-wi-mono모노레포의dta-wi-medi-api애플리케이션에 구현되어 있습니다.
개요
사이트 관리 API는 병원/기관(Site)의 등록, 승인 및 CRUD 기능을 제공합니다.
주요기능
- 사이트 목록 조회: 페이징, 정렬, 검색이 가능한 사이트 목록 조회
- 사이트 상세 조회: 특정 사이트의 상세 정보 조회
- 사이트 생성: 새로운 사이트 생성
- 사이트 수정: 기존 사이트 정보 수정
- 사이트 삭제: 사이트 삭제 (소프트/하드 삭제 지원)
- 사이트 등록 요청: 새로운 사이트 등록 신청
[GET] /v1/admin/sites - 사이트 목록 조회
사이트 목록 조회
등록된 사이트(병원/기관) 목록을 조회합니다.
✅ 1.4 Migration 완료
⚠️ 변경 사항
주의: 이전 버전에서 다음 사항이 변경되었습니다. 클라이언트 코드 수정이 필요합니다.
변경된 필드
id: 응답의id필드 타입이string으로 변경되었습니다.registrationId: 타입이string으로 변경되었습니다.orderBy: 파라미터 값이 snake_case에서 camelCase로 변경되었습니다. (예:created_at→createdAt)
삭제된 필드
uuid: 응답에서 제거되었습니다.accountCount: 응답에서 제거되었습니다.organizationId: 응답에서 제거되었습니다.
- HTTP Method:
GET - 인증: 액세스 토큰 (
accessToken) 필요
Headers
| Header | Type | Description | Required |
|---|---|---|---|
| Authorization | Bearer {accessToken} | 사용자 인증을 통해 발급받은 액세스 토큰 입니다. | ✔ |
Query Parameters
| 파라미터 | 타입 | 설명 | Required | Default |
|---|---|---|---|---|
| searchKey | string | 검색어 (code, name 검색) | ✗ | - |
| limit | number | 한 페이지당 조회할 사이트 수 (최대 100) | ✗ | 10 |
| page | number | 조회할 페이지 번호 | ✗ | 1 |
| orderBy | string | 정렬 기준 (createdAt, name, code) | ✗ | createdAt |
| orderDirection | string | 정렬 방식 (asc, desc) | ✗ | desc |
Responses
| Http Status Code | 설명 | Error Code(s) |
|---|---|---|
200 OK | 조회 성공 | - |
401 Unauthorized | 인증 실패 | 1080 |
500 Internal Server Error | 서버 내부 오류 | 1092 |
200 OK - 성공
{
"pagination": {
"page": 1,
"limit": 10,
"totalCount": 100,
"totalPages": 10,
"next": "?page=2&limit=10",
"previous": null
},
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "WELT 의원",
"code": "103523",
"description": "Test hospital description",
"registrationId": "123e4567-e89b-12d3-a456-426614174000",
"clinicalResearch": true,
"managedByCrm": true,
"matchingKeywords": ["hospital", "clinic"],
"createdAt": "2024-09-30 14:12:08 KST",
"updatedAt": "2024-09-30 14:12:08 KST"
}
]
}
| 필드 | 타입 | 설명 |
|---|---|---|
| pagination | object | 페이지네이션 정보 |
| pagination.page | number | 현재 페이지 번호 |
| pagination.limit | number | 페이지당 항목 수 |
| pagination.totalCount | number | 총 항목 수 |
| pagination.totalPages | number | 총 페이지 수 |
| pagination.next | string | null | 다음 페이지 URL |
| pagination.previous | string | null | 이전 페이지 URL |
| items | array | 사이트 데이터 배열 |
| items[].id | string | 사이트 ID |
| items[].name | string | 사이트 이름 |
| items[].code | string | 요양기관등록번호 |
| items[].description | string | 사이트 설명 |
| items[].registrationId | string | 등록 ID |
| items[].clinicalResearch | boolean | 임상 연구 여부 |
| items[].managedByCrm | boolean | CRM 관리 여부 |
| items[].matchingKeywords | string[] | 매칭 키워드 배열 |
| items[].createdAt | string | 생성일 (KST) |
| items[].updatedAt | string | 수정일 (KST) |
401 Unauthorized - 인증 실패
{
"status": 401,
"code": 1080,
"message": "UNAUTHORIZED",
"detail": "{\"displayText\":\"No token found in Authorization header\"}"
}
[GET] /v1/admin/sites/{siteId} - 사이트 상세 조회
사이트 상세 조회
특정 사이트의 상세 정보를 조회합니다.
✅ 1.4 Migration 완료
⚠️ 변경 사항
주의: 이전 버전에서 다음 사항이 변경되었습니다. 클라이언트 코드 수정이 필요합니다.
변경된 필드
id: 응답의id필드 타입이string으로 변경되었습니다.registrationId: 타입이string으로 변경되었습니다.
삭제된 필드
uuid: 응답에서 제거되었습니다.accountCount: 응답에서 제거되었습니다.organizationId: 응답에서 제거되었습니다.
- HTTP Method:
GET - 인증: 액세스 토큰 (
accessToken) 필요
Headers
| Header | Type | Description | Required |
|---|---|---|---|
| Authorization | Bearer {accessToken} | 사용자 인증을 통해 발급받은 액세스 토큰 입니다. | ✔ |
Path Parameters
| 파라미터 | 타입 | 설명 | Required |
|---|---|---|---|
| siteId | string | 사이트 UUID | ✔ |
Responses
| Http Status Code | 설명 | Error Code(s) |
|---|---|---|
200 OK | 조회 성공 | - |
401 Unauthorized | 인증 실패 | 1080 |
404 Not Found | 사이트를 찾을 수 없음 | 1070 |
500 Internal Server Error | 서버 내부 오류 | 1092 |
200 OK - 성공
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "WELT 의원",
"code": "103523",
"description": "Test hospital description",
"registrationId": "123e4567-e89b-12d3-a456-426614174000",
"clinicalResearch": true,
"managedByCrm": true,
"matchingKeywords": ["hospital", "clinic"],
"createdAt": "2024-09-30 14:12:08 KST",
"updatedAt": "2024-09-30 14:12:08 KST"
}
| 필드 | 타입 | 설명 |
|---|---|---|
| id | string | 사이트 ID |
| name | string | 사이트 이름 |
| code | string | 요양기관등록번호 |
| description | string | 사이트 설명 |
| registrationId | string | 등록 ID |
| clinicalResearch | boolean | 임상 연구 여부 |
| managedByCrm | boolean | CRM 관리 여부 |
| matchingKeywords | string[] | 매칭 키워드 배열 |
| createdAt | string | 생성일 (KST) |
| updatedAt | string | 수정일 (KST) |
404 Not Found - 사이트를 찾을 수 없음
{
"status": 404,
"code": 1070,
"message": "SITE_NOT_FOUND",
"detail": "등록된 기관을 찾을 수 없습니다."
}
[POST] /v1/admin/sites - 사이트 생성
사이트 생성
새로운 사이트를 생성합니다.
✅ 1.4 Migration 완료
⚠️ 변경 사항
주의: 이전 버전에서 다음 사항이 변경되었습니다. 클라이언트 코드 수정이 필요합니다.
변경된 필드
id: 응답의id필드 타입이string으로 변경되었습니다.registrationId: 타입이string으로 변경되었습니다.
삭제된 필드
uuid: 응답에서 제거되었습니다.accountCount: 응답에서 제거되었습니다.organizationId: 응답에서 제거되었습니다.
- HTTP Method:
POST - 인증: 액세스 토큰 (
accessToken) 필요
Headers
| Header | Type | Description | Required |
|---|---|---|---|
| Authorization | Bearer {accessToken} | 사용자 인증을 통해 발급받은 액세스 토큰 입니다. | ✔ |
| Content-Type | application/json | 요청 본문 형식 | ✔ |
Request Body
| 필드 | 타입 | 설명 | Required |
|---|---|---|---|
| name | string | 사이트 이름 | ✔ |
| code | string | 요양기관등록번호 | ✗ |
| description | string | 사이트 설명 | ✗ |
| registrationId | string | 등록 ID | ✗ |
| clinicalResearch | boolean | 임상 연구 여부 | ✗ |
| managedByCrm | boolean | CRM 관리 여부 | ✗ |
| matchingKeywords | string[] | 매칭 키워드 배열 | ✗ |
Request Body 예시
{
"name": "WELT 의원",
"code": "103523",
"description": "Test hospital description",
"registrationId": "345e4567-e89b-12d3-a456-426614174000",
"clinicalResearch": true,
"managedByCrm": true,
"matchingKeywords": ["hospital", "clinic"]
}
Responses
| Http Status Code | 설명 | Error Code(s) |
|---|---|---|
200 OK | 생성 성공 | - |
401 Unauthorized | 인증 실패 | 1080 |
500 Internal Server Error | 서버 내부 오류 | 1092 |
200 OK - 성공
{
"id": "345e4567-e89b-12d3-a456-426614174000",
"name": "WELT 의원",
"code": "103523",
"description": "Test hospital description",
"registrationId": "345e4567-e89b-12d3-a456-426614174000",
"clinicalResearch": true,
"managedByCrm": true,
"matchingKeywords": ["hospital", "clinic"],
"createdAt": "2024-09-30 14:12:08 KST",
"updatedAt": "2024-09-30 14:12:08 KST"
}
[PATCH] /v1/admin/sites/{siteId} - 사이트 수정
사이트 수정
기존 사이트의 정보를 수정합니다.
✅ 1.4 Migration 완료
⚠️ 변경 사항
주의: 이전 버전에서 다음 사항이 변경되었습니다. 클라이언트 코드 수정이 필요합니다.
변경된 필드
id: 응답의id필드 타입이string으로 변경되었습니다.registrationId: 타입이string으로 변경되었습니다.
삭제된 필드
uuid: 응답에서 제거되었습니다.accountCount: 응답에서 제거되었습니다.organizationId: 응답에서 제거되었습니다.
- HTTP Method:
PATCH - 인증: 액세스 토큰 (
accessToken) 필요
Headers
| Header | Type | Description | Required |
|---|---|---|---|
| Authorization | Bearer {accessToken} | 사용자 인증을 통해 발급받은 액세스 토큰 입니다. | ✔ |
| Content-Type | application/json | 요청 본문 형식 | ✔ |
Path Parameters
| 파라미터 | 타입 | 설명 | Required |
|---|---|---|---|
| siteId | string | 사이트 ID | ✔ |
Request Body
| 필드 | 타입 | 설명 | Required |
|---|---|---|---|
| name | string | 사이트 이름 | ✗ |
| code | string | 요양기관등록번호 | ✗ |
| description | string | 사이트 설명 | ✗ |
| matchingKeywords | string[] | 매칭 키워드 배열 | ✗ |
| clinicalResearch | boolean | 임상 연구 여부 | ✗ |
| managedByCrm | boolean | CRM 관리 여부 | ✗ |
| registrationId | string | 등록 ID | ✗ |
Request Body 예시
{
"name": "Updated Hospital",
"code": "103523",
"description": "Updated description",
"matchingKeywords": ["hospital", "clinic", "medical"],
"clinicalResearch": false,
"managedByCrm": true,
"registrationId": 2
}
Responses
| Http Status Code | 설명 | Error Code(s) |
|---|---|---|
200 OK | 수정 성공 | - |
401 Unauthorized | 인증 실패 | 1080 |
404 Not Found | 사이트를 찾을 수 없음 | 1070 |
500 Internal Server Error | 서버 내부 오류 | 1092 |
200 OK - 성공
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Updated Hospital",
"code": "103523",
"description": "Updated description",
"registrationId": "123e4567-e89b-12d3-a456-426614174000",
"clinicalResearch": false,
"managedByCrm": true,
"matchingKeywords": ["hospital", "clinic", "medical"],
"createdAt": "2024-09-30 14:12:08 KST",
"updatedAt": "2024-10-01 10:30:15 KST"
}
[DELETE] /v1/admin/sites/{siteId} - 사이트 삭제
사이트 삭제
사이트를 삭제합니다. 소프트 삭제 또는 하드 삭제를 선택할 수 있습니다.
✅ 1.4 Migration 완료
⚠️ 변경 사항
주의: 이전 버전에서 다음 사항이 변경되었습니다. 클라이언트 코드 수정이 필요합니다.
변경된 필드
id: 응답의id필드 타입이string으로 변경되었습니다.registrationId: 타입이string으로 변경되었습니다.
삭제된 필드
-
uuid: 응답에서 제거되었습니다. -
accountCount: 응답에서 제거되었습니다. -
organizationId: 응답에서 제거되었습니다. -
HTTP Method:
DELETE -
인증: 액세스 토큰 (
accessToken) 필요
Headers
| Header | Type | Description | Required |
|---|---|---|---|
| Authorization | Bearer {accessToken} | 사용자 인증을 통해 발급받은 액세스 토큰 입니다. | ✔ |
Path Parameters
| 파라미터 | 타입 | 설명 | Required |
|---|---|---|---|
| siteId | string | 사이트 ID | ✔ |
Query Parameters
| 파라미터 | 타입 | 설명 | Required | Default |
|---|---|---|---|---|
| hard | boolean | 물리 삭제 여부 (true: hard delete, false: soft delete) | ✗ | false |
Responses
| Http Status Code | 설명 | Error Code(s) |
|---|---|---|
200 OK | 삭제 성공 | - |
401 Unauthorized | 인증 실패 | 1080 |
404 Not Found | 사이트를 찾을 수 없음 | 1070 |
500 Internal Server Error | 서버 내부 오류 | 1092 |
200 OK - 성공
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "WELT 의원",
"code": "103523",
"description": "Test hospital description",
"registrationId": "123e4567-e89b-12d3-a456-426614174000",
"clinicalResearch": true,
"managedByCrm": true,
"matchingKeywords": ["hospital", "clinic"],
"createdAt": "2024-09-30 14:12:08 KST",
"updatedAt": "2024-10-01 10:30:15 KST"
}
[POST] /v1/admin/sites/request-registration - 사이트 등록 요청
사이트 등록 요청
새로운 사이트(병원)과 관리자 계정의 등록을 신청합니다. 승인 후 사이트와 계정이 생성됩니다.
[클라이언트 수정 필요]
asis:/v1/sites/request-registration
tobe:/v1/admin/sites/request-registration
- HTTP Method:
POST - 인증: 액세스 토큰 필요 없음
Headers
| Header | Type | Description | Required |
|---|---|---|---|
| Content-Type | application/json | 요청 본문 형식 | ✔ |
Request Body
| 필드 | 타입 | 설명 | Required |
|---|---|---|---|
| site.name | string | 사이트(병원) 이름 | ✔ |
| account.email | string | 관리자 이메일 | ✔ |
| account.password | string | 관리자 비밀번호 | ✔ |
| account.name | string | 관리자 이름 | ✔ |
| account.phoneNumber | string | 관리자 전화번호 | ✔ |
| account.authorizedToPrescribe | bool | 처방 권한 여부 | ✔ |
Request Body 예시
{
"site": {
"name": "서울대학교병원"
},
"account": {
"email": "admin@hospital.com",
"password": "securePassword123!",
"name": "홍길동",
"phoneNumber": "01012345678",
"authorizedToPrescribe": true
}
}
Responses
| Http Status Code | 설명 | Error Code(s) |
|---|---|---|
200 OK | 사이트 등록 요청 성공 | - |
400 Bad Request | 잘못된 요청 | BAD_REQUEST (40000) |
500 Internal Server Error | 서버 내부 오류 | INTERNAL_SERVER_ERROR (50000) |
200 OK - 성공
{
"success": true
}
| 필드 | 타입 | 설명 |
|---|---|---|
| success | boolean | 성공 여부 (true) |
400 Bad Request - 잘못된 요청
{
"status": 400,
"code": 40000,
"message": "이미 동일한 병원 정보가 존재합니다."
}
발생 가능한 에러 메시지:
"이미 동일한 병원 정보가 존재합니다."- 동일한 이름의 사이트가 이미 존재"유효하지 않은 전화번호 형식입니다."- 전화번호 형식 오류"이미 동일한 이메일 정보가 존재합니다."- 동일한 이메일의 계정이 이미 존재
500 Internal Server Error - 서버 내부 오류
{
"status": 500,
"code": 50000,
"message": "INTERNAL_SERVER_ERROR"
}