feat/action-report: done

This commit is contained in:
2025-12-01 17:47:59 +07:00
parent ece6a0b7a5
commit 8306e1217e
15 changed files with 930 additions and 2 deletions
@@ -0,0 +1,89 @@
package actionreport
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
pa "simrs-vx/internal/lib/auth"
)
type CreateDto struct {
Encounter_Id uint64 `json:"encounter_id"`
Date string `json:"date"`
Doctor_Code string `json:"doctor_code"`
Operator_Employe_Id *uint `json:"operator_employe_id"`
Assistant_Employe_Id *uint `json:"assistant_employe_id"`
Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"`
Diagnose *string `json:"diagnose"`
Nurse_Code *string `json:"nurse_code"`
Value string `json:"value"`
pa.AuthInfo
}
type ReadListDto struct {
FilterDto
Includes string `json:"includes"`
Pagination ecore.Pagination
}
type FilterDto struct {
Encounter_Id *uint `json:"encounter-id"`
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
}
type MetaDto struct {
PageNumber int `json:"page_number"`
PageSize int `json:"page_size"`
Count int `json:"count"`
}
type ResponseDto struct {
ecore.Main
Encounter_Id uint64 `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty"`
Date string `json:"date"`
Doctor_Code string `json:"doctor_code"`
Operator_Employe_Id *uint `json:"operator_employe_id"`
Assistant_Employe_Id *uint `json:"assistant_employe_id"`
Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"`
Diagnose *string `json:"diagnose"`
Nurse_Code *string `json:"nurse_code"`
Value *string `json:"value"`
}
func (d ActionReport) ToResponse() ResponseDto {
resp := ResponseDto{
Encounter_Id: d.Encounter_Id,
Encounter: d.Encounter,
Date: d.Date,
Doctor_Code: d.Doctor_Code,
Operator_Employe_Id: d.Operator_Employe_Id,
Assistant_Employe_Id: d.Assistant_Employe_Id,
Instrumentor_Employe_Id: d.Instrumentor_Employe_Id,
Nurse_Code: d.Nurse_Code,
Value: &d.Value,
}
resp.Main = d.Main
return resp
}
func ToResponseList(data []ActionReport) []ResponseDto {
resp := make([]ResponseDto, len(data))
for i, u := range data {
resp[i] = u.ToResponse()
}
return resp
}
@@ -0,0 +1,45 @@
package actionreport
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/encounter"
)
type ActionReport struct {
ecore.Main // adjust this according to the needs
Encounter_Id uint64 `json:"encounter_id" gorm:"foreignKey"`
Encounter *ee.Encounter `json:"doctor,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Date string `json:"date" gorm:"not null;size:20"`
Doctor_Code string `json:"doctor_code" gorm:"size:10"`
Operator_Employe_Id *uint `json:"operator_employe_id"`
Assistant_Employe_Id *uint `json:"assistant_employe_id"`
Instrumentor_Employe_Id *uint `json:"instrumentor_employe_id"`
Diagnose *string `json:"diagnose" gorm:"size:1024"`
Procedures *string `json:"procedures" gorm:"size:10240"`
Nurse_Code *string `json:"nurse_code" gorm:"size:10"`
Value string `json:"value"`
// SurgerySize_Code *string `json:"surgerySize_code" gorm:"size:10"`
// Billing_Code *string `json:"billing_code" gorm:"size:10"`
// SurgerySystem_Code *string `json:"surgerySystem_code" gorm:"size:10"`
// StartAt *string `json:"startAt" gorm:"size:20"`
// EndAt *string `json:"endAt" gorm:"size:20"`
// AnesthesiaStartAt *string `json:"anesthesiaStartAt" gorm:"size:20"`
// AnesthesiaEndAt *string `json:"anesthesiaEndAt" gorm:"size:20"`
// SurgeryType_Code *string `json:"surgeryType_code" gorm:"size:10"`
// SurgeryStage_Code *string `json:"surgeryStage_code" gorm:"size:10"`
// BornMortality_Code *string `json:"bornMortality_code" gorm:"size:10"`
// BornLocation_Code *string `json:"bornLocation_code" gorm:"size:10"`
// Weight *string `json:"weight" gorm:"size:10"`
// BornNotes *string `json:"bornNotes" gorm:"size:1024"`
// Description *string `json:"notes" gorm:"size:1024"`
// BleedingAmount *uint16 `json:"bleedingAmount" gorm:"size:10"`
// BloodInType_Code *string `json:"bloodInType_code" gorm:"size:10"`
// BloodInAmount *uint16 `json:"bloodInAmount" gorm:"size:10"`
// Brand *string `json:"brand" gorm:"size:100"`
// ImplantName *string `json:"implantName" gorm:"size:100"`
// ImplantRegisterNumber *string `json:"implantRegisterNumber" gorm:"size:100"`
// ImplantCompanionName *string `json:"implantCompanionName" gorm:"size:100"`
// SpecimentDest_Code *string `json:"specimentDest" gorm:"size:100"`
// TissueInfo *string `json:"tissueInfo" gorm:"size:100"`
}
@@ -23,6 +23,13 @@ type (
LangClassCode string
TranslatorSrcCode string
ScreeningFormTypeCode string
SurgerySizeCode string
SurgerySystemCode string
SurgeryTypeCode string
SurgeryStageCode string
BornMortalityCode string
BornLocationCode string
SpecimentDestCode string
)
const (
@@ -191,6 +198,38 @@ const (
SFTCA ScreeningFormTypeCode = "form-a" // Formu A
SFTCB ScreeningFormTypeCode = "form-b" // Formu B
SSCSmall SurgerySizeCode = ""
SSCMedium SurgerySizeCode = ""
SSCLarge SurgerySizeCode = ""
SSCSpecial SurgerySizeCode = ""
SSyCCito SurgerySystemCode = ""
SSyCUrgent SurgerySystemCode = ""
SSyCEfective SurgerySystemCode = ""
SSyCSpecial SurgerySystemCode = ""
STCClean SurgeryTypeCode = ""
STCCleanCtm SurgeryTypeCode = ""
STCUncleanCtm SurgeryTypeCode = ""
STCUnclean SurgeryTypeCode = ""
SStCFirst SurgeryStageCode = ""
SStCRepeat SurgeryStageCode = ""
BMCAlive BornMortalityCode = ""
BMCDead BornMortalityCode = ""
BLCExtMiw BornLocationCode = ""
BLCExtDoc BornLocationCode = ""
BLCTradMiw BornLocationCode = ""
BLCLocalMed BornLocationCode = ""
BLCExtParamedic BornLocationCode = ""
SDCAp SpecimentDestCode = ""
SDCMicro SpecimentDestCode = ""
SDCLab SpecimentDestCode = ""
SDCNone SpecimentDestCode = ""
)
type Soapi struct {
@@ -315,3 +354,30 @@ type HeadToToe struct {
Neuron string `json:"neuron,omitempty"`
BodyOthers string `json:"body-others,omitempty"`
}
type RecordAction struct {
Procedures []string `json:"procedures"`
SurgerySize_Code *string `json:"surgerySize_code"`
Billing_Code *string `json:"billing_code"`
SurgerySystem_Code *string `json:"surgerySystem_code"`
StartAt *string `json:"startAt"`
EndAt *string `json:"endAt"`
AnesthesiaStartAt *string `json:"anesthesiaStartAt"`
AnesthesiaEndAt *string `json:"anesthesiaEndAt"`
SurgeryType_Code *string `json:"surgeryType_code"`
SurgeryStage_Code *string `json:"surgeryStage_code"`
BornMortality_Code *string `json:"bornMortality_code"`
BornLocation_Code *string `json:"bornLocation_code"`
Weight *string `json:"weight"`
BornNotes *string `json:"bornNotes" gorm:"size:1024"`
Description *string `json:"notes" gorm:"size:1024"`
BleedingAmount *uint16 `json:"bleedingAmount"`
BloodInType_Code *string `json:"bloodInType_code"`
BloodInAmount *uint16 `json:"bloodInAmount"`
Brand *string `json:"brand" gorm:"size:100"`
ImplantName *string `json:"implantName" gorm:"size:100"`
ImplantRegisterNumber *string `json:"implantRegisterNumber" gorm:"size:100"`
ImplantCompanionName *string `json:"implantCompanionName" gorm:"size:100"`
SpecimentDest_Code *string `json:"specimentDest" gorm:"size:100"`
TissueInfo []string `json:"tissueInfo" gorm:"size:100"`
}
@@ -8,6 +8,7 @@ type (
InfraGroupCode string
UnitTypeCode string
DoctorFeeTypeCode string
ActionBillingCode string
)
const (
@@ -62,4 +63,8 @@ const (
DFTCInp DoctorFeeTypeCode = "inpatient" // Rawat Inap
DFTCEme DoctorFeeTypeCode = "emergency" // Darurat
DFTCReh DoctorFeeTypeCode = "medic-rehab" // Rehab Medik
ABCGeneral ActionBillingCode = "general"
ABCRegional ActionBillingCode = "regional"
ABCLocal ActionBillingCode = "local"
)