{"id":22190985,"url":"https://github.com/yuhexiong/hospital-register-api-typescript","last_synced_at":"2026-04-19T14:09:34.606Z","repository":{"id":209669556,"uuid":"719569622","full_name":"yuhexiong/hospital-register-api-typescript","owner":"yuhexiong","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-29T12:48:45.000Z","size":250,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T22:42:48.988Z","etag":null,"topics":["api","backend","error-handling","express","mariadb","nodejs","restful-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuhexiong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-16T12:58:06.000Z","updated_at":"2024-09-29T12:48:48.000Z","dependencies_parsed_at":"2025-03-24T20:51:43.705Z","dependency_job_id":null,"html_url":"https://github.com/yuhexiong/hospital-register-api-typescript","commit_stats":null,"previous_names":["yuhexiong/hospital-register-api-typescript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yuhexiong/hospital-register-api-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Fhospital-register-api-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Fhospital-register-api-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Fhospital-register-api-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Fhospital-register-api-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuhexiong","download_url":"https://codeload.github.com/yuhexiong/hospital-register-api-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Fhospital-register-api-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","error-handling","express","mariadb","nodejs","restful-api","typescript"],"created_at":"2024-12-02T12:13:49.254Z","updated_at":"2026-04-19T14:09:34.580Z","avatar_url":"https://github.com/yuhexiong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hospital Register Api\n\n## Overview\n\n- Language: TypeScript\n- Web FrameWork: Express\n- DataBase: MariaDB v10.9\n\n## ENV\n\ncopy .env.example and rename as .env\n\n```bash\nDB_HOST=\nDB_PORT=\nDB_USER=\nDB_PASS=\nDB_NAME=\n\n# port \nPORT=\n\n# swagger\nSWAGGER_MOUNT_PATH=/api\n\n```\n\n## Run\n\n### install dependencies\n\n```bash\n\nnpm install\n\n```\n\n### run migration file\n\n```bash\n\nnpm run migration:run\n\n```\n\n### run\n\n```bash\n\nnpm run start\n\n```\n\n## ER Diagram\n![image](https://github.com/yuhexiong/hospital-register-api-typescript/blob/main/image/hospital_register_schema_v2.png)\n\n\n## API\n\n### patient\n\n- `POST /patient`：新增一位病人\n- `GET /patient/name/{name}`：由姓名取得符合的病人, 支援正規表達式搜尋\n- `GET /patient/{id}`：由id取得一位病人\n- `GET /patients`：取得所有病人\n- `PUT /patient/{id}`：修改一位病人\n- `DELETE /patient/{id}`：刪除一位病人\n\n### doctor\n\n- `POST /doctor`：新增一位醫師\n- `GET /doctor/{id}`：由id取得一位醫師\n- `GET /doctors`：取得所有醫師\n- `PATCH /doctor/{id}/{name}`：修改一位醫師名字\n\n### reservation\n\n- `POST /reservation/list`：新增一張預約班表, 預設可預約, 總看診號50, 不足的給號類別依是否可預約給預設\n- `POST /reservation`：預約門診, 依給號類別和預約來源決定是否預約成功\n- `GET /reservation/{year}/{month}`：取得指定月分所有預約班表\n- `PATCH /reservation/{reservationDetailId}/{type}`：修改預約給號類別\n\n### clinic\n\n- `POST /clinic/register`：掛號\n- `GET /clinic/{id}`：由id取得門診\n- `POST /clinic/start/{id}`：開始看診或重新看診\n- `PATCH /clinic/{id}`：更新主訴與觀察\n- `POST /clinic/finish/{id}`：完診, 未開始看診則不能完診\n- `POST /clinic/paid/{id}`：批價繳費, 未完診則不能完診\n- `POST /clinic/unregister/{id}`：退掛, 已批價則不能退掛\n- `GET /clinic/patient/{patientId}`：取得指定病人指定區間所有門診, 並顯示是否有欠款\n\n## Custom Error Code\n\n```\nSUCCESSFUL = 0\nINSUFFICIENT_DATA = '000107'\nINVALID_PARAMETER = '000108'\nCOLUMN_MISMATCH = '000109'\nINVALID_TYPE_RESERVATION = '000120'\nINVALID_STATUS_CLINIC = '000121'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuhexiong%2Fhospital-register-api-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuhexiong%2Fhospital-register-api-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuhexiong%2Fhospital-register-api-typescript/lists"}