초기 정리: PIT3000 분석 자료 업로드
- 좌표/SQL/API 분석 문서화 - 재현 스크립트와 예시 응답 추가 - 개인정보/원본 실행파일 제외
This commit is contained in:
66
docs/api-response.md
Normal file
66
docs/api-response.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# API/JSON 응답 설계 예시
|
||||
|
||||
PIT 원본은 JSON API라기보다는 SQL + BLOB + health.kr HTML/이미지 URL을 조합합니다. 현대화할 때는 아래처럼 normalization하는 것을 권장합니다.
|
||||
|
||||
## Endpoint 예시
|
||||
|
||||
```http
|
||||
GET /api/drugs/{drugcode}
|
||||
GET /api/drugs/{drugcode}/images
|
||||
GET /api/drugs/{drugcode}/pictograms
|
||||
```
|
||||
|
||||
## 응답 예시
|
||||
|
||||
```json
|
||||
{
|
||||
"drugcode": "A000000001",
|
||||
"dik_code": "123456789",
|
||||
"sung_code": "1234567TB",
|
||||
"sung_code_kind": "ingredient_code",
|
||||
"names": {
|
||||
"etcname": "샘플정",
|
||||
"splname": "샘플제약",
|
||||
"ingredient_name_en": "Sample ingredient"
|
||||
},
|
||||
"classification": {
|
||||
"print_type": "해열진통소염제",
|
||||
"effctname": "정제",
|
||||
"character": "흰색 원형 정제"
|
||||
},
|
||||
"drug_info": {
|
||||
"save_medi": "실온 보관",
|
||||
"indic_medi": "용법용량 예시",
|
||||
"effect": "효능/효과 예시",
|
||||
"adr": "주의사항 예시",
|
||||
"interaction": "상호작용 예시",
|
||||
"gen_medi": "복약지도 예시"
|
||||
},
|
||||
"images": [
|
||||
{
|
||||
"source": "PM_IMAGE..DrugImg",
|
||||
"expr1": "1",
|
||||
"content_type": "image/jpeg",
|
||||
"url": "/api/drugs/A000000001/images/1.jpg",
|
||||
"width_hint": 183,
|
||||
"height_hint": 100
|
||||
},
|
||||
{
|
||||
"source": "health.kr",
|
||||
"url": "https://www.health.kr/drug_info/sb/zoom.asp?drug_code=123456789&print_front=&print_back="
|
||||
}
|
||||
],
|
||||
"pictograms": [
|
||||
{
|
||||
"pic_code": "P001",
|
||||
"source": "PM_DRUG..CD_PICTOGRAM",
|
||||
"url": "/api/drugs/A000000001/pictograms/P001.jpg"
|
||||
}
|
||||
],
|
||||
"external_links": {
|
||||
"health_kr_simple": "https://health.kr/searchDrug/result_drug_simple.asp?drug_cd=123456789",
|
||||
"health_kr_zoom": "https://www.health.kr/drug_info/sb/zoom.asp?drug_code=123456789&print_front=&print_back=",
|
||||
"pharm_or_kr_zoom": "https://www.pharm.or.kr/search/zoom.asp?drug_code=123456789"
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user