From 6a68b8366af5fe6ca04c1a22786750784209639a Mon Sep 17 00:00:00 2001 From: kangcheolung Date: Thu, 9 Jul 2026 17:52:01 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20Medication=EC=97=90=20usageStorageI?= =?UTF-8?q?nfo=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit memo와 분리 — 복용법+보관법 자동 생성 전용 필드 Co-Authored-By: Claude Sonnet 4.6 --- .../callcare/domain/medication/entity/Medication.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/piuda/callcare/domain/medication/entity/Medication.java b/src/main/java/com/piuda/callcare/domain/medication/entity/Medication.java index 72fbcdd..342c992 100644 --- a/src/main/java/com/piuda/callcare/domain/medication/entity/Medication.java +++ b/src/main/java/com/piuda/callcare/domain/medication/entity/Medication.java @@ -64,8 +64,11 @@ public class Medication extends BaseEntity { @Column(name = "prescription_date") private LocalDate prescriptionDate; // 처방 날짜 + @Column(name = "usage_storage_info", columnDefinition = "TEXT") + private String usageStorageInfo; // DrugInfo 연결 시 자동 생성 (복용법 + 보관법), OCR 등록 시 null + @Column(name = "memo", columnDefinition = "TEXT") - private String memo; // 복용 방법 + 보관법 자동 입력 + private String memo; // 사용자 자유 입력, 항상 빈값으로 시작 @Column(name = "is_active", nullable = false) private Boolean isActive; // 현재 복용 중인지 여부 (복용 종료 시 false로 변경) @@ -78,7 +81,8 @@ public Medication(Senior senior, String hospitalName, DrugInfo drugInfo, String drugName, String drugNickname, String drugType, String imageUrl, String dosagePerTime, Integer timesPerDay, Integer totalDays, LocalDate startDate, LocalDate endDate, - LocalDate prescriptionDate, String memo, Boolean isActive, Long ocrResultId) { + LocalDate prescriptionDate, String usageStorageInfo, String memo, + Boolean isActive, Long ocrResultId) { this.senior = senior; this.hospitalName = hospitalName; this.drugInfo = drugInfo; @@ -92,6 +96,7 @@ public Medication(Senior senior, String hospitalName, DrugInfo drugInfo, this.startDate = startDate; this.endDate = endDate; this.prescriptionDate = prescriptionDate; + this.usageStorageInfo = usageStorageInfo; this.memo = memo; this.isActive = isActive; this.ocrResultId = ocrResultId; From c41afa706f5dd2b32a0005ccb2bab71345915249 Mon Sep 17 00:00:00 2001 From: kangcheolung Date: Thu, 9 Jul 2026 17:52:05 +0900 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20MedicationCreateRequest=20memo?= =?UTF-8?q?=20=EC=84=A4=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 복용법+보관법 자동 생성 제거, 사용자 자유 입력 전용으로 변경 Co-Authored-By: Claude Sonnet 4.6 --- .../domain/medication/dto/request/MedicationCreateRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/piuda/callcare/domain/medication/dto/request/MedicationCreateRequest.java b/src/main/java/com/piuda/callcare/domain/medication/dto/request/MedicationCreateRequest.java index d6c55d9..4593b63 100644 --- a/src/main/java/com/piuda/callcare/domain/medication/dto/request/MedicationCreateRequest.java +++ b/src/main/java/com/piuda/callcare/domain/medication/dto/request/MedicationCreateRequest.java @@ -40,6 +40,6 @@ public record MedicationCreateRequest( @Schema(description = "병원 이름 — 직접 입력, 없으면 null") String hospitalName, - @Schema(description = "메모 (복용방법 + 보관방법 자동 생성 또는 사용자 직접 입력, 없으면 null)") + @Schema(description = "사용자 자유 입력 메모 (항상 빈값으로 시작, 없으면 null)") String memo ) {} From 22248770254c2c5fbdaea7c5601bc566770c5f6b Mon Sep 17 00:00:00 2001 From: kangcheolung Date: Thu, 9 Jul 2026 17:52:10 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20MedicationGroupItemResponse?= =?UTF-8?q?=EC=97=90=20usageStorageInfo=20=ED=95=84=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../medication/dto/response/MedicationGroupItemResponse.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/piuda/callcare/domain/medication/dto/response/MedicationGroupItemResponse.java b/src/main/java/com/piuda/callcare/domain/medication/dto/response/MedicationGroupItemResponse.java index d5f5f74..a851253 100644 --- a/src/main/java/com/piuda/callcare/domain/medication/dto/response/MedicationGroupItemResponse.java +++ b/src/main/java/com/piuda/callcare/domain/medication/dto/response/MedicationGroupItemResponse.java @@ -34,6 +34,9 @@ public record MedicationGroupItemResponse( @Schema(description = "총 복용 일수 (없으면 null)") Integer totalDays, - @Schema(description = "메모 — OCR 자동 생성 또는 사용자 직접 입력 (없으면 null)") + @Schema(description = "복용법 + 보관법 자동 생성 — DrugInfo 연결 시에만 채워짐, OCR 등록 시 null") + String usageStorageInfo, + + @Schema(description = "사용자 자유 입력 메모 (없으면 null)") String memo ) {} From 0f479c6e7de1fdcdadb5f51c87cd9e42bc5e0dcb Mon Sep 17 00:00:00 2001 From: kangcheolung Date: Thu, 9 Jul 2026 17:52:15 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20DrugInfo=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EC=8B=9C=20usageStorageInfo=20=EC=9E=90=EB=8F=99=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit useMethodQesitm + depositMethodQesitm 조합, OCR 등록 시 null Co-Authored-By: Claude Sonnet 4.6 --- .../service/command/MedicationCommandService.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java b/src/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java index 2f15ba7..2fbe12e 100644 --- a/src/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java +++ b/src/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java @@ -64,9 +64,10 @@ private MedicationResponse doRegister(Long userId, MedicationCreateRequest reque .startDate(request.startDate()) .endDate(endDate) .prescriptionDate(request.prescriptionDate()) + .usageStorageInfo(buildUsageStorageInfo(drugInfo)) + .memo(request.memo()) .isActive(true) .ocrResultId(request.ocrResultId()) - .memo(request.memo()) .build(); Medication saved = medicationRepository.save(medication); @@ -105,4 +106,14 @@ private DrugInfo resolveDrugInfo(Long drugInfoId) { return drugInfoRepository.findById(drugInfoId) .orElseThrow(() -> new CallCareException(ErrorCode.DRUG_NOT_FOUND)); } + + private String buildUsageStorageInfo(DrugInfo drugInfo) { + if (drugInfo == null) return null; + String usage = drugInfo.getUseMethodQesitm(); + String deposit = drugInfo.getDepositMethodQesitm(); + if (usage == null && deposit == null) return null; + if (usage == null) return deposit; + if (deposit == null) return usage; + return usage + "\n\n" + deposit; + } } From 5adffd17822a883e35b86dd5c8734ad0fc577868 Mon Sep 17 00:00:00 2001 From: kangcheolung Date: Thu, 9 Jul 2026 17:52:20 +0900 Subject: [PATCH 5/5] =?UTF-8?q?refactor:=20toGroupItemResponse=EC=97=90=20?= =?UTF-8?q?usageStorageInfo=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../domain/medication/converter/MedicationConverter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/piuda/callcare/domain/medication/converter/MedicationConverter.java b/src/main/java/com/piuda/callcare/domain/medication/converter/MedicationConverter.java index 48d3245..9bfa8d5 100644 --- a/src/main/java/com/piuda/callcare/domain/medication/converter/MedicationConverter.java +++ b/src/main/java/com/piuda/callcare/domain/medication/converter/MedicationConverter.java @@ -25,6 +25,7 @@ public MedicationGroupItemResponse toGroupItemResponse(Medication medication) { medication.getStartDate(), medication.getEndDate(), medication.getTotalDays(), + medication.getUsageStorageInfo(), medication.getMemo() ); }