wip encounter + medication

This commit is contained in:
dpurbosakti
2025-09-17 11:47:03 +07:00
parent c8e32e8239
commit 86a073164d
14 changed files with 164 additions and 57 deletions

No files matched your search

@@ -17,6 +17,8 @@ type CreateDto struct {
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
IsRedeemed bool `json:"isRedeemed"`
Quantity float64 `json:"quantity"`
Note *string `json:"note" gorm:"size:1024"`
}
type ReadListDto struct {
@@ -34,6 +36,8 @@ type FilterDto struct {
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
IsRedeemed bool `json:"isRedeemed"`
Quantity float64 `json:"quantity"`
Note *string `json:"note" gorm:"size:1024"`
Page int `json:"page"`
PageSize int `json:"page_size"`
@@ -71,6 +75,8 @@ type ResponseDto struct {
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
IsRedeemed bool `json:"isRedeemed"`
Quantity float64 `json:"quantity"`
Note *string `json:"note" gorm:"size:1024"`
}
func (d MedicationItem) ToResponse() ResponseDto {
@@ -86,6 +92,8 @@ func (d MedicationItem) ToResponse() ResponseDto {
Interval: d.Interval,
IntervalUnit_Code: d.IntervalUnit_Code,
IsRedeemed: d.IsRedeemed,
Quantity: d.Quantity,
Note: d.Note,
}
resp.Main = d.Main
return resp
@@ -35,18 +35,19 @@ type FilterDto struct {
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
Encounter_Id *uint `json:"encounter_id"`
pa.AuthInfo
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
}
type MetaDto struct {
@@ -16,6 +16,7 @@ type CreateDto struct {
Usage float64 `json:"usage"`
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
Quantity float64 `json:"quantity"`
}
type ReadListDto struct {
@@ -32,6 +33,7 @@ type FilterDto struct {
Usage float64 `json:"usage"`
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
Quantity float64 `json:"quantity"`
Page int `json:"page"`
PageSize int `json:"page_size"`
@@ -68,6 +70,7 @@ type ResponseDto struct {
Usage float64 `json:"usage"`
Interval uint8 `json:"interval"`
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
Quantity float64 `json:"quantity"`
}
func (d PrescriptionItem) ToResponse() ResponseDto {
@@ -82,6 +85,7 @@ func (d PrescriptionItem) ToResponse() ResponseDto {
Usage: d.Usage,
Interval: d.Interval,
IntervalUnit_Code: d.IntervalUnit_Code,
Quantity: d.Quantity,
}
resp.Main = d.Main
return resp
@@ -4,13 +4,17 @@ import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
erc "simrs-vx/internal/domain/references/common"
)
type CreateDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
IssuedAt *time.Time `json:"issuedAt"`
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code *erc.DataStatusCode `json:"status_code"`
}
type ReadListDto struct {
@@ -20,25 +24,27 @@ type ReadListDto struct {
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
IssuedAt *time.Time `json:"issuedAt"`
Encounter_Id *uint `json:"encounter_id"`
Doctor_Id *uint `json:"doctor_id"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code *erc.DataStatusCode `json:"status_code"`
Page int `json:"page"`
PageSize int `json:"page_size"`
NoPagination int `json:"no_pagination"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
Encounter_Id *uint `json:"encounter_id"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id uint `json:"id"`
}
type MetaDto struct {
@@ -49,11 +55,12 @@ type MetaDto struct {
type ResponseDto struct {
ecore.Main
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
IssuedAt *time.Time `json:"issuedAt"`
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor,omitempty"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code *erc.DataStatusCode `json:"status_code"`
}
func (d Prescription) ToResponse() ResponseDto {
@@ -63,6 +70,7 @@ func (d Prescription) ToResponse() ResponseDto {
Doctor_Id: d.Doctor_Id,
Doctor: d.Doctor,
IssuedAt: d.IssuedAt,
Status_Code: d.Status_Code,
}
resp.Main = d.Main
return resp