Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into fix/anything-moko
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
package medicineform
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code *string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (d MedicineForm) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicineForm) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package medicineform
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type MedicineForm struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ein "simrs-vx/internal/domain/main-entities/infra"
|
||||
eit "simrs-vx/internal/domain/main-entities/item"
|
||||
emf "simrs-vx/internal/domain/main-entities/medicine-form"
|
||||
emg "simrs-vx/internal/domain/main-entities/medicine-group"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-method"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
@@ -71,6 +72,8 @@ type ResponseDto struct {
|
||||
MedicineGroup *emg.MedicineGroup `json:"medicineGroup"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
MedicineMethod *emm.MedicineMethod `json:"medicineMethod"`
|
||||
MedicineForm_Code *string `json:"medicineForm_code"`
|
||||
MedicineForm *emf.MedicineForm `json:"medicineForm"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Uom *eu.Uom `json:"uom"`
|
||||
Dose uint8 `json:"dose"`
|
||||
@@ -89,6 +92,8 @@ func (d Medicine) ToResponse() ResponseDto {
|
||||
MedicineGroup: d.MedicineGroup,
|
||||
MedicineMethod_Code: d.MedicineMethod_Code,
|
||||
MedicineMethod: d.MedicineMethod,
|
||||
MedicineForm_Code: d.MedicineForm_Code,
|
||||
MedicineForm: d.MedicineForm,
|
||||
Uom_Code: d.Uom_Code,
|
||||
Uom: d.Uom,
|
||||
Dose: d.Dose,
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ein "simrs-vx/internal/domain/main-entities/infra"
|
||||
eit "simrs-vx/internal/domain/main-entities/item"
|
||||
emf "simrs-vx/internal/domain/main-entities/medicine-form"
|
||||
emg "simrs-vx/internal/domain/main-entities/medicine-group"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-method"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
@@ -17,6 +18,8 @@ type Medicine struct {
|
||||
MedicineGroup *emg.MedicineGroup `json:"medicineGroup,omitempty" gorm:"foreignKey:MedicineGroup_Code;references:Code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code" gorm:"size:10"`
|
||||
MedicineMethod *emm.MedicineMethod `json:"medicineMethod,omitempty" gorm:"foreignKey:MedicineMethod_Code;references:Code"`
|
||||
MedicineForm_Code *string `json:"medicineForm_code" gorm:"size:20"`
|
||||
MedicineForm *emf.MedicineForm `json:"medicineForm,omitempty" gorm:"foreignKey:MedicineForm_Code;references:Code"`
|
||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
|
||||
@@ -19,7 +19,7 @@ type CreateDto struct {
|
||||
Usage string `json:"usage"`
|
||||
Interval uint8 `json:"interval"`
|
||||
IntervalUnit_Code erc.TimeUnitCode `json:"intervalUnit_code"`
|
||||
IntervalMultiplier *uint16 `json:"intervalMultiplier" validate:"required"`
|
||||
IntervalMultiplier *uint16 `json:"intervalMultiplier"`
|
||||
Quantity float64 `json:"quantity"`
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ type Prescription struct {
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d Prescription) IsNotNew() bool {
|
||||
return d.Status_Code != erc.DSCNew
|
||||
}
|
||||
|
||||
func (d Prescription) IsApproved() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
@@ -16,16 +16,17 @@ type TherapyProtocol struct {
|
||||
Doctor_Code *string `json:"doctor_code"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
|
||||
|
||||
Anamnesis *string `json:"anamnesis" gorm:"size:2048"`
|
||||
MedicalDiagnoses *string `json:"medicalDiagnoses"`
|
||||
FunctionDiagnoses *string `json:"functionDiagnoses"`
|
||||
Procedures *string `json:"procedures"`
|
||||
SupportingExams *string `json:"supportingExams" gorm:"size:2048"`
|
||||
Instruction *string `json:"instruction" gorm:"size:2048"`
|
||||
Evaluation *string `json:"evaluation" gorm:"size:2048"`
|
||||
WorkCauseStatus *string `json:"workCauseStatus" gorm:"size:2048"`
|
||||
Frequency *uint `json:"frequency"`
|
||||
IntervalUnit_Code *common.TimeUnitCode `json:"intervalUnit_code" gorm:"size:10"`
|
||||
Duration *uint `json:"duration"`
|
||||
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code" gorm:"size:10"`
|
||||
Anamnesis *string `json:"anamnesis" gorm:"size:2048"`
|
||||
MedicalDiagnoses *string `json:"medicalDiagnoses"`
|
||||
FunctionDiagnoses *string `json:"functionDiagnoses"`
|
||||
Procedures *string `json:"procedures"`
|
||||
SupportingExams *string `json:"supportingExams" gorm:"size:2048"`
|
||||
Instruction *string `json:"instruction" gorm:"size:2048"`
|
||||
Evaluation *string `json:"evaluation" gorm:"size:2048"`
|
||||
WorkCauseStatus *string `json:"workCauseStatus" gorm:"size:2048"`
|
||||
Frequency *uint `json:"frequency"`
|
||||
IntervalUnit_Code *common.TimeUnitCode `json:"intervalUnit_code" gorm:"size:10"`
|
||||
Duration *uint `json:"duration"`
|
||||
DurationUnit_Code *common.TimeUnitCode `json:"durationUnit_code" gorm:"size:10"`
|
||||
Status_Code *common.DataVerifiedCode `json:"status_code" gorm:"size:10"`
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ type (
|
||||
DataVerifiedCode string
|
||||
CrudCode string
|
||||
DataApprovalCode string
|
||||
ProcessStatusCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -58,6 +59,7 @@ const (
|
||||
SCInactive ActiveStatusCode = "inactive" // Tidak aktif
|
||||
|
||||
DSCNew DataStatusCode = "new" // Baru
|
||||
DSCSubmited DataStatusCode = "submited" // Submited
|
||||
DSCReview DataStatusCode = "review" // Review
|
||||
DSCProcess DataStatusCode = "process" // Proses
|
||||
DSCDone DataStatusCode = "done" // Selesai
|
||||
@@ -101,6 +103,9 @@ const (
|
||||
DACNew DataApprovalCode = "new"
|
||||
DACApproved DataApprovalCode = "approved"
|
||||
DACRejected DataApprovalCode = "rejected"
|
||||
|
||||
PSCSuccess ProcessStatusCode = "success"
|
||||
PSCFailed ProcessStatusCode = "failed"
|
||||
)
|
||||
|
||||
func GetDayCodes() map[DayCode]string {
|
||||
|
||||
@@ -8,13 +8,16 @@ type (
|
||||
)
|
||||
|
||||
const (
|
||||
UCPRN UploadCode = "person-resident-number" // Person Resident Number
|
||||
UCPDL UploadCode = "person-driver-license" // Person Driver License
|
||||
UCPP UploadCode = "person-passport" // Person Passport
|
||||
UCPFC UploadCode = "person-family-card" // Person Family Card
|
||||
UCMIR UploadCode = "mcu-item-result" // Mcu Item Result
|
||||
UCSEP UploadCode = "vclaim-sep" // SEP
|
||||
UCSIPP UploadCode = "vclaim-sipp" // SIPP
|
||||
UCPRN UploadCode = "person-resident-number" // Person Resident Number
|
||||
UCPDL UploadCode = "person-driver-license" // Person Driver License
|
||||
UCPP UploadCode = "person-passport" // Person Passport
|
||||
UCPFC UploadCode = "person-family-card" // Person Family Card
|
||||
UCMIR UploadCode = "mcu-item-result" // Mcu Item Result
|
||||
UCEnPatient UploadCode = "encounter-patient"
|
||||
UCEnSupport UploadCode = "encounter-support"
|
||||
UcEnOther UploadCode = "encounter-other"
|
||||
UCSEP UploadCode = "vclaim-sep" // SEP
|
||||
UCSIPP UploadCode = "vclaim-sipp" // SIPP
|
||||
|
||||
ETCPerson EntityTypeCode = "person"
|
||||
ETCEncounter EntityTypeCode = "encounter"
|
||||
@@ -26,7 +29,7 @@ var validUploadCodesByEntity = map[EntityTypeCode][]UploadCode{
|
||||
UCPRN, UCPDL, UCPP, UCPFC,
|
||||
},
|
||||
ETCEncounter: {
|
||||
UCSEP, UCSIPP,
|
||||
UCSEP, UCSIPP, UCEnPatient, UCEnSupport, UcEnOther,
|
||||
},
|
||||
ETCMCU: {
|
||||
UCMIR,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package installation
|
||||
|
||||
type MInstalasi struct {
|
||||
No_Instalasi uint `json:"no_instalasi" gorm:"primaryKey;autoIncrement;column:no_instalasi"`
|
||||
Nama_Instalasi string `json:"nama_instalasi" gorm:"column:nama_instalasi"`
|
||||
Status_Rawat_Inap uint `json:"status_rawat_inap" gorm:"column:status_rawat_inap"`
|
||||
St_Aktif uint `json:"st_aktif" gorm:"column:st_aktif"`
|
||||
}
|
||||
|
||||
func (MInstalasi) TableName() string {
|
||||
return "m_instalasi"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package installation
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type InstallationLink struct {
|
||||
ecore.Main
|
||||
Simx_Id uint `json:"simx_id" gorm:"unique"`
|
||||
Simgos_Id uint `json:"simgos_id" gorm:"unique"`
|
||||
}
|
||||
|
||||
type InstallationSimxLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
|
||||
type InstallationSimgosLog struct {
|
||||
ecore.Main
|
||||
Value *string `json:"value"`
|
||||
Date *time.Time `json:"date"`
|
||||
Status erc.ProcessStatusCode `json:"status"`
|
||||
ErrMessage *string `json:"errMessage"`
|
||||
}
|
||||
Reference in New Issue
Block a user