본문으로 건너뛰기
버전: 개발 버전 (최신)

사이트 관리 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_atcreatedAt)

삭제된 필드

  • uuid: 응답에서 제거되었습니다.
  • accountCount: 응답에서 제거되었습니다.
  • organizationId: 응답에서 제거되었습니다.

  • HTTP Method: GET
  • 인증: 액세스 토큰 (accessToken) 필요

Headers

HeaderTypeDescriptionRequired
AuthorizationBearer {accessToken}사용자 인증을 통해 발급받은 액세스 토큰 입니다.

Query Parameters

파라미터타입설명RequiredDefault
searchKeystring검색어 (code, name 검색)-
limitnumber한 페이지당 조회할 사이트 수 (최대 100)10
pagenumber조회할 페이지 번호1
orderBystring정렬 기준 (createdAt, name, code)createdAt
orderDirectionstring정렬 방식 (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"
}
]
}
필드타입설명
paginationobject페이지네이션 정보
pagination.pagenumber현재 페이지 번호
pagination.limitnumber페이지당 항목 수
pagination.totalCountnumber총 항목 수
pagination.totalPagesnumber총 페이지 수
pagination.nextstring | null다음 페이지 URL
pagination.previousstring | null이전 페이지 URL
itemsarray사이트 데이터 배열
items[].idstring사이트 ID
items[].namestring사이트 이름
items[].codestring요양기관등록번호
items[].descriptionstring사이트 설명
items[].registrationIdstring등록 ID
items[].clinicalResearchboolean임상 연구 여부
items[].managedByCrmbooleanCRM 관리 여부
items[].matchingKeywordsstring[]매칭 키워드 배열
items[].createdAtstring생성일 (KST)
items[].updatedAtstring수정일 (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

HeaderTypeDescriptionRequired
AuthorizationBearer {accessToken}사용자 인증을 통해 발급받은 액세스 토큰 입니다.

Path Parameters

파라미터타입설명Required
siteIdstring사이트 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"
}
필드타입설명
idstring사이트 ID
namestring사이트 이름
codestring요양기관등록번호
descriptionstring사이트 설명
registrationIdstring등록 ID
clinicalResearchboolean임상 연구 여부
managedByCrmbooleanCRM 관리 여부
matchingKeywordsstring[]매칭 키워드 배열
createdAtstring생성일 (KST)
updatedAtstring수정일 (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

HeaderTypeDescriptionRequired
AuthorizationBearer {accessToken}사용자 인증을 통해 발급받은 액세스 토큰 입니다.
Content-Typeapplication/json요청 본문 형식

Request Body

필드타입설명Required
namestring사이트 이름
codestring요양기관등록번호
descriptionstring사이트 설명
registrationIdstring등록 ID
clinicalResearchboolean임상 연구 여부
managedByCrmbooleanCRM 관리 여부
matchingKeywordsstring[]매칭 키워드 배열

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

HeaderTypeDescriptionRequired
AuthorizationBearer {accessToken}사용자 인증을 통해 발급받은 액세스 토큰 입니다.
Content-Typeapplication/json요청 본문 형식

Path Parameters

파라미터타입설명Required
siteIdstring사이트 ID

Request Body

필드타입설명Required
namestring사이트 이름
codestring요양기관등록번호
descriptionstring사이트 설명
matchingKeywordsstring[]매칭 키워드 배열
clinicalResearchboolean임상 연구 여부
managedByCrmbooleanCRM 관리 여부
registrationIdstring등록 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

HeaderTypeDescriptionRequired
AuthorizationBearer {accessToken}사용자 인증을 통해 발급받은 액세스 토큰 입니다.

Path Parameters

파라미터타입설명Required
siteIdstring사이트 ID

Query Parameters

파라미터타입설명RequiredDefault
hardboolean물리 삭제 여부 (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

HeaderTypeDescriptionRequired
Content-Typeapplication/json요청 본문 형식

Request Body

필드타입설명Required
site.namestring사이트(병원) 이름
account.emailstring관리자 이메일
account.passwordstring관리자 비밀번호
account.namestring관리자 이름
account.phoneNumberstring관리자 전화번호
account.authorizedToPrescribebool처방 권한 여부

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
}
필드타입설명
successboolean성공 여부 (true)
400 Bad Request - 잘못된 요청
{
"status": 400,
"code": 40000,
"message": "이미 동일한 병원 정보가 존재합니다."
}

발생 가능한 에러 메시지:

  • "이미 동일한 병원 정보가 존재합니다." - 동일한 이름의 사이트가 이미 존재
  • "유효하지 않은 전화번호 형식입니다." - 전화번호 형식 오류
  • "이미 동일한 이메일 정보가 존재합니다." - 동일한 이메일의 계정이 이미 존재
500 Internal Server Error - 서버 내부 오류
{
"status": 500,
"code": 50000,
"message": "INTERNAL_SERVER_ERROR"
}