feat (kfr): initial
This commit is contained in:
117
internal/domain/main-entities/kfr/dto.go
Normal file
117
internal/domain/main-entities/kfr/dto.go
Normal file
@@ -0,0 +1,117 @@
|
||||
package kfr
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
eem "simrs-vx/internal/domain/main-entities/employee"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
CreatedBy_Employee_Id *uint `json:"createdBy_employee_id"`
|
||||
Value *string `json:"value"`
|
||||
Type ere.KFRTypeCode `json:"type" gorm:"size:15"`
|
||||
Subjective string `json:"subjective"`
|
||||
Objective string `json:"objective"`
|
||||
Assessment string `json:"assessment"`
|
||||
TreatmentGoals string `json:"treatmentGoals"`
|
||||
Education string `json:"education"`
|
||||
Action string `json:"action"`
|
||||
Frequency *uint `json:"frequency"`
|
||||
IntervalUnit_Code *erc.TimeUnitCode `json:"intervalUnit_code" gorm:"size:10"`
|
||||
FollowUpType ere.KFRFollowUpTypeCode `json:"followUpType" gorm:"size:10"`
|
||||
FollowUpNote string `json:"dischargePlanning"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code" gorm:"not null;size:10"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
CreatedBy_Employee_Id *uint `json:"createdBy_employee-id"`
|
||||
Type ere.KFRTypeCode `json:"type" gorm:"size:15"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
CreatedBy_Employee_Id *uint `json:"createdBy_employee_id"`
|
||||
CreatedBy_Employee *eem.Employee `json:"createdBy_employee,omitempty" gorm:"foreignKey:CreatedBy_Employee_Id;references:Id"`
|
||||
Type ere.KFRTypeCode `json:"type" gorm:"size:15"`
|
||||
Subjective string `json:"subjective"`
|
||||
Objective string `json:"objective"`
|
||||
Assessment string `json:"assessment"`
|
||||
TreatmentGoals string `json:"treatmentGoals"`
|
||||
Education string `json:"education"`
|
||||
Action string `json:"action"`
|
||||
Frequency *uint `json:"frequency"`
|
||||
IntervalUnit_Code *erc.TimeUnitCode `json:"intervalUnit_code" gorm:"size:10"`
|
||||
FollowUpType ere.KFRFollowUpTypeCode `json:"followUpType" gorm:"size:10"`
|
||||
FollowUpNote string `json:"dischargePlanning"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code" gorm:"not null;size:10"`
|
||||
}
|
||||
|
||||
func (d KFR) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
CreatedBy_Employee_Id: d.CreatedBy_Employee_Id,
|
||||
CreatedBy_Employee: d.CreatedBy_Employee,
|
||||
Type: d.Type,
|
||||
Subjective: d.Subjective,
|
||||
Objective: d.Objective,
|
||||
Assessment: d.Assessment,
|
||||
TreatmentGoals: d.TreatmentGoals,
|
||||
Education: d.Education,
|
||||
Action: d.Action,
|
||||
Frequency: d.Frequency,
|
||||
IntervalUnit_Code: d.IntervalUnit_Code,
|
||||
FollowUpType: d.FollowUpType,
|
||||
FollowUpNote: d.FollowUpNote,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []KFR) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
30
internal/domain/main-entities/kfr/entitiy.go
Normal file
30
internal/domain/main-entities/kfr/entitiy.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package kfr
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
eem "simrs-vx/internal/domain/main-entities/employee"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
)
|
||||
|
||||
type KFR struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
CreatedBy_Employee_Id *uint `json:"createdBy_employee_id"`
|
||||
CreatedBy_Employee *eem.Employee `json:"createdBy_employee,omitempty" gorm:"foreignKey:CreatedBy_Employee_Id;references:Id"`
|
||||
Type ere.KFRTypeCode `json:"type" gorm:"size:15"`
|
||||
Subjective string `json:"subjective"`
|
||||
Objective string `json:"objective"`
|
||||
Assessment string `json:"assessment"`
|
||||
TreatmentGoals string `json:"treatmentGoals"`
|
||||
Education string `json:"education"`
|
||||
Action string `json:"action"`
|
||||
Frequency *uint `json:"frequency"`
|
||||
IntervalUnit_Code *erc.TimeUnitCode `json:"intervalUnit_code" gorm:"size:10"`
|
||||
FollowUpType ere.KFRFollowUpTypeCode `json:"followUpType" gorm:"size:10"`
|
||||
FollowUpNote string `json:"dischargePlanning"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code" gorm:"not null;size:10"`
|
||||
}
|
||||
@@ -23,6 +23,8 @@ type (
|
||||
DocTypeCode string
|
||||
EntityTypeCode string
|
||||
StatusProtocolChemo string
|
||||
KFRTypeCode string
|
||||
KFRFollowUpTypeCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -133,6 +135,14 @@ const (
|
||||
SPCComplete StatusProtocolChemo = "complete" // Terealisasi
|
||||
SPCPlanned StatusProtocolChemo = "planned" // Terencana
|
||||
SPCSchedule StatusProtocolChemo = "schedule" // Terjadwal
|
||||
|
||||
KFRAssessment KFRTypeCode = "assessment"
|
||||
KFRTherapy KFRTypeCode = "therapy"
|
||||
KFRReAssessment KFRTypeCode = "reassessment"
|
||||
|
||||
KFUTCEva KFRFollowUpTypeCode = "evaluation"
|
||||
KFUTCRef KFRFollowUpTypeCode = "referral"
|
||||
KFUTCFin KFRFollowUpTypeCode = "finish"
|
||||
)
|
||||
|
||||
func (ec EncounterClassCode) Code() string {
|
||||
|
||||
Reference in New Issue
Block a user