Merge branch 'dev' into feat/encounter
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package core
|
||||
|
||||
type Pagination struct {
|
||||
PageNumber int `json:"page-number"`
|
||||
PageSize int `json:"page-size"`
|
||||
PageNoLimit bool `json:"page-no-limit"`
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package member
|
||||
|
||||
type ReadListDto struct {
|
||||
ReferenceType ReferenceType `json:"-"`
|
||||
PathValue1 string `json:"-"`
|
||||
PathValue2 string `json:"-"`
|
||||
PathValue3 string `json:"-"`
|
||||
}
|
||||
|
||||
type ReferenceType string
|
||||
|
||||
const (
|
||||
RTNik ReferenceType = "nik"
|
||||
RTBpjs ReferenceType = "bpjs"
|
||||
)
|
||||
@@ -0,0 +1,78 @@
|
||||
package member
|
||||
|
||||
type Response struct {
|
||||
MetaData *MetaData `json:"metaData"`
|
||||
Response *BPJSDataRes `json:"response"`
|
||||
}
|
||||
|
||||
type MetaData struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type BPJSDataRes struct {
|
||||
Peserta *Peserta `json:"peserta"`
|
||||
}
|
||||
|
||||
type Peserta struct {
|
||||
Cob *COB `json:"cob"`
|
||||
HakKelas *HakKelas `json:"hakKelas"`
|
||||
Informasi *Informasi `json:"informasi"`
|
||||
JenisPeserta *JenisPeserta `json:"jenisPeserta"`
|
||||
Mr *MR `json:"mr"`
|
||||
Nama *string `json:"nama"`
|
||||
Nik *string `json:"nik"`
|
||||
NoKartu *string `json:"noKartu"`
|
||||
Pisa *string `json:"pisa"`
|
||||
ProvUmum *ProvUmum `json:"provUmum"`
|
||||
Sex *string `json:"sex"`
|
||||
StatusPeserta *StatusPeserta `json:"statusPeserta"`
|
||||
TglCetakKartu *string `json:"tglCetakKartu"`
|
||||
TglLahir *string `json:"tglLahir"`
|
||||
TglTAT *string `json:"tglTAT"`
|
||||
TglTMT *string `json:"tglTMT"`
|
||||
Umur *Umur `json:"umur"`
|
||||
}
|
||||
|
||||
type COB struct {
|
||||
NmAsuransi *string `json:"nmAsuransi"`
|
||||
NoAsuransi *string `json:"noAsuransi"`
|
||||
TglTAT *string `json:"tglTAT"`
|
||||
TglTMT *string `json:"tglTMT"`
|
||||
}
|
||||
|
||||
type HakKelas struct {
|
||||
Keterangan *string `json:"keterangan"`
|
||||
Kode *string `json:"kode"`
|
||||
}
|
||||
|
||||
type Informasi struct {
|
||||
Dinsos *string `json:"dinsos"`
|
||||
NoSKTM *string `json:"noSKTM"`
|
||||
ProlanisPRB *string `json:"prolanisPRB"`
|
||||
}
|
||||
|
||||
type JenisPeserta struct {
|
||||
Keterangan *string `json:"keterangan"`
|
||||
Kode *string `json:"kode"`
|
||||
}
|
||||
|
||||
type MR struct {
|
||||
NoMR *string `json:"noMR"`
|
||||
NoTelepon *string `json:"noTelepon"`
|
||||
}
|
||||
|
||||
type ProvUmum struct {
|
||||
KdProvider *string `json:"kdProvider"`
|
||||
NmProvider *string `json:"nmProvider"`
|
||||
}
|
||||
|
||||
type StatusPeserta struct {
|
||||
Keterangan *string `json:"keterangan"`
|
||||
Kode *string `json:"kode"`
|
||||
}
|
||||
|
||||
type Umur struct {
|
||||
UmurSaatPelayanan *string `json:"umurSaatPelayanan"`
|
||||
UmurSekarang *string `json:"umurSekarang"`
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package monitoring
|
||||
|
||||
type ReadListDto struct {
|
||||
ReferenceType ReferenceType `json:"-"`
|
||||
PathValue1 string `json:"-"`
|
||||
PathValue2 string `json:"-"`
|
||||
PathValue3 string `json:"-"`
|
||||
}
|
||||
|
||||
type ReferenceType string
|
||||
|
||||
const (
|
||||
RTVisit ReferenceType = "visit"
|
||||
RTHist ReferenceType = "hist"
|
||||
)
|
||||
@@ -0,0 +1,43 @@
|
||||
package monitoring
|
||||
|
||||
type Response struct {
|
||||
MetaData MetaData `json:"metaData"`
|
||||
Response *BPJSDataRes `json:"response"`
|
||||
}
|
||||
|
||||
type MetaData struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type BPJSDataRes struct {
|
||||
Sep []Sep `json:"sep"`
|
||||
Histori []Histori `json:"histori"`
|
||||
}
|
||||
|
||||
type Sep struct {
|
||||
Diagnosa string `json:"diagnosa"`
|
||||
JnsPelayanan string `json:"jnsPelayanan"`
|
||||
KelasRawat string `json:"kelasRawat"`
|
||||
Nama string `json:"nama"`
|
||||
NoKartu string `json:"noKartu"`
|
||||
NoSep string `json:"noSep"`
|
||||
NoRujukan string `json:"noRujukan"`
|
||||
Poli *string `json:"poli"`
|
||||
TglPlgSep string `json:"tglPlgSep"`
|
||||
TglSep string `json:"tglSep"`
|
||||
}
|
||||
|
||||
type Histori struct {
|
||||
Diagnosa string `json:"diagnosa"`
|
||||
JnsPelayanan string `json:"jnsPelayanan"`
|
||||
KelasRawat *string `json:"kelasRawat"`
|
||||
NamaPeserta string `json:"namaPeserta"`
|
||||
NoKartu string `json:"noKartu"`
|
||||
NoSep string `json:"noSep"`
|
||||
NoRujukan string `json:"noRujukan"`
|
||||
Poli string `json:"poli"`
|
||||
PpkPelayanan string `json:"ppkPelayanan"`
|
||||
TglPlgSep string `json:"tglPlgSep"`
|
||||
TglSep string `json:"tglSep"`
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package reference
|
||||
|
||||
type ReadListDto struct {
|
||||
ReferenceType ReferenceType `json:"-"`
|
||||
PathValue1 string `json:"-"`
|
||||
PathValue2 string `json:"-"`
|
||||
PathValue3 string `json:"-"`
|
||||
}
|
||||
|
||||
type ReferenceType string
|
||||
|
||||
const (
|
||||
RTProvince ReferenceType = "province"
|
||||
RTDistrict ReferenceType = "district"
|
||||
RTCities ReferenceType = "cities"
|
||||
RTDiagnose ReferenceType = "diagnose"
|
||||
RTDiagnosePrb ReferenceType = "diagnose-prb"
|
||||
RTMedicinePrb ReferenceType = "medicine-prb"
|
||||
RTUnit ReferenceType = "unit"
|
||||
RTHealthcare ReferenceType = "healthcare"
|
||||
RTDoctor ReferenceType = "doctor"
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
package reference
|
||||
|
||||
type Response struct {
|
||||
MetaData MetaData `json:"metaData"`
|
||||
Response *CodeNameList `json:"response"` // pointer to handle possible null
|
||||
}
|
||||
|
||||
type MetaData struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type CodeNameList struct {
|
||||
List []CodeName `json:"list,omitempty"`
|
||||
Diagnosa []CodeName `json:"diagnosa,omitempty"`
|
||||
Poli []CodeName `json:"poli,omitempty"`
|
||||
Faskes []CodeName `json:"faskes,omitempty"`
|
||||
}
|
||||
|
||||
type CodeName struct {
|
||||
Kode string `json:"kode"`
|
||||
Nama string `json:"nama"`
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package vclaimsephist
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
RequestPayload string `json:"requestPayload"`
|
||||
ResponseBody string `json:"responseBody"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
RequestPayload *string `json:"requestPayload"`
|
||||
ResponseBody *string `json:"responseBody"`
|
||||
Message *string `json:"message"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
RequestPayload *string `json:"requestPayload"`
|
||||
ResponseBody *string `json:"responseBody"`
|
||||
Message *string `json:"message"`
|
||||
}
|
||||
|
||||
func (d VclaimSepHist) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
RequestPayload: d.RequestPayload,
|
||||
ResponseBody: d.ResponseBody,
|
||||
Message: d.Message,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []VclaimSepHist) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package vclaimsephist
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type VclaimSepHist struct {
|
||||
ecore.Main
|
||||
RequestPayload *string `json:"requestPayload"`
|
||||
ResponseBody *string `json:"responseBody"`
|
||||
Message *string `json:"message"`
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package vclaimsepprint
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
VclaimSep_Number *string `json:"vclaimSep_number"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
VclaimSep_Number *string `json:"vclaimSep_number"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
VclaimSep_Number *string `json:"vclaimSep_number"`
|
||||
Counter *uint `json:"counter"`
|
||||
}
|
||||
|
||||
func (d VclaimSepPrint) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
VclaimSep_Number: d.VclaimSep_Number,
|
||||
Counter: d.Counter,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []VclaimSepPrint) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package vclaimsepprint
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
evs "simrs-vx/internal/domain/bpjs-entities/vclaim-sep"
|
||||
)
|
||||
|
||||
type VclaimSepPrint struct {
|
||||
ecore.Main
|
||||
VclaimSep_Number *string `json:"vclaimSep_number"`
|
||||
VclaimSep *evs.VclaimSep `json:"vclaimSep,omitempty" gorm:"foreignKey:VclaimSep_Number;references:Number"`
|
||||
Counter *uint `json:"counter"`
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package vclaimsep
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
evsh "simrs-vx/internal/domain/bpjs-entities/vclaim-sep-hist"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Number *string `json:"number" validate:"maxLength=19"`
|
||||
RequestPayload []byte `json:"requestPayload" validate:"maxLength=1024"`
|
||||
|
||||
VclaimSepHist evsh.CreateDto
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Number *string `json:"number"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
Number *string `json:"number"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
Number *string `json:"number"`
|
||||
}
|
||||
|
||||
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"`
|
||||
Number *string `json:"number"`
|
||||
}
|
||||
|
||||
func (d VclaimSep) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Number: d.Number,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []VclaimSep) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
func (c CreateDto) IsMessageSuccess() bool {
|
||||
return c.VclaimSepHist.Message == "Sukses"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package vclaimsep
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type VclaimSep struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Number *string `json:"number" gorm:"unique;size:19"`
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package adime
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eem "simrs-vx/internal/domain/main-entities/employee"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Employee_Id *uint `json:"-"`
|
||||
Time *time.Time `json:"time"`
|
||||
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"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
Time *time.Time `json:"time"`
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *eem.Employee `json:"employee,omitempty"`
|
||||
Time *time.Time `json:"time"`
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
func (d Adime) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
Time: d.Time,
|
||||
Value: d.Value,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Adime) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package adime
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eem "simrs-vx/internal/domain/main-entities/employee"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Adime struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *eem.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
Time *time.Time `json:"time"`
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package ambulance_transport_req
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eds "simrs-vx/internal/domain/main-entities/district"
|
||||
ept "simrs-vx/internal/domain/main-entities/patient"
|
||||
epr "simrs-vx/internal/domain/main-entities/province"
|
||||
erg "simrs-vx/internal/domain/main-entities/regency"
|
||||
evl "simrs-vx/internal/domain/main-entities/village"
|
||||
"time"
|
||||
|
||||
eren "simrs-vx/internal/domain/references/encounter"
|
||||
erp "simrs-vx/internal/domain/references/person"
|
||||
)
|
||||
|
||||
type AmbulanceTransportReq struct {
|
||||
ecore.Main
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ept.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
||||
|
||||
Diagnoses *string `json:"diagnoses" gorm:"size:1024"`
|
||||
RequestData *time.Time `json:"requestData"`
|
||||
UsageDate *time.Time `json:"usageDate"`
|
||||
|
||||
Address *string `json:"address" gorm:"size:100"`
|
||||
RtRw *string `json:"rtRw" gorm:"size:10"`
|
||||
|
||||
Province_Code *string `json:"province_code" gorm:"size:2"`
|
||||
Province *epr.Province `json:"province,omitempty" gorm:"foreignKey:Province_Code;references:Code"`
|
||||
|
||||
Regency_Code *string `json:"regency_code" gorm:"size:4"`
|
||||
Regency *erg.Regency `json:"regency,omitempty" gorm:"foreignKey:Regency_Code;references:Code"`
|
||||
|
||||
District_Code *string `json:"district_code" gorm:"size:6"`
|
||||
District *eds.District `json:"district,omitempty" gorm:"foreignKey:District_Code;references:Code"`
|
||||
|
||||
Village_Code *string `json:"village_code" gorm:"size:10"`
|
||||
Village *evl.Village `json:"village,omitempty" gorm:"foreignKey:Village_Code;references:Code"`
|
||||
|
||||
Facility_Code *eren.AmbulanceFacilityCode `json:"facility_code" gorm:"size:10"`
|
||||
Needs_Code *eren.AmbulanceNeedsCode `json:"needs_code" gorm:"size:10"`
|
||||
Contact_Name *string `json:"contact_name" gorm:"size:100"`
|
||||
Contact_Relationship_Code *erp.RelationshipCode `json:"contact_relationship_code" gorm:"size:10"`
|
||||
Contact_PhoneNumber *string `json:"contact_phoneNumber" gorm:"size:20"`
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package ambulatory
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.AmbulatoryClassCode `json:"class_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Class_Code ere.AmbulatoryClassCode `json:"class-code"`
|
||||
}
|
||||
|
||||
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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Class_Code ere.AmbulatoryClassCode `json:"class_code"`
|
||||
}
|
||||
|
||||
func (d Ambulatory) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Ambulatory) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package ambulatory
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Ambulatory struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Class_Code ere.AmbulatoryClassCode `json:"class_code" gorm:"size:10"`
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package appointment
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
eps "simrs-vx/internal/domain/main-entities/practice-schedule"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
PracticeSchedule_Id *uint `json:"practiceSchedule_id"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Person_ResidentIdentityNumber string `json:"person_residentIdentityNumber"`
|
||||
Person_Name string `json:"person_name"`
|
||||
Person_PhoneNumber string `json:"person_phoneNumber"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code"`
|
||||
RefNumber string `json:"refNumber"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
PracticeSchedule_Id *uint `json:"practiceSchedule-id"`
|
||||
Patient_Id *uint `json:"patient-id"`
|
||||
Person_ResidentIdentityNumber string `json:"person-residentIdentityNumber"`
|
||||
Person_Name string `json:"person-name"`
|
||||
Person_PhoneNumber string `json:"person-phoneNumber"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod-code"`
|
||||
RefNumber string `json:"refNumber"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
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
|
||||
PracticeSchedule_Id *uint `json:"practiceSchedule_id"`
|
||||
PracticeSchedule *eps.PracticeSchedule `json:"practiceSchedule,omitempty"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty"`
|
||||
Person_ResidentIdentityNumber string `json:"person_residentIdentityNumber"`
|
||||
Person_Name string `json:"person_name"`
|
||||
Person_PhoneNumber string `json:"person_phoneNumber"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code"`
|
||||
RefNumber string `json:"refNumber"`
|
||||
}
|
||||
|
||||
func (d Appointment) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
PracticeSchedule_Id: d.PracticeSchedule_Id,
|
||||
PracticeSchedule: d.PracticeSchedule,
|
||||
Patient_Id: d.Patient_Id,
|
||||
Patient: d.Patient,
|
||||
Person_ResidentIdentityNumber: d.Person_ResidentIdentityNumber,
|
||||
Person_Name: d.Person_Name,
|
||||
Person_PhoneNumber: d.Person_PhoneNumber,
|
||||
PaymentMethod_Code: d.PaymentMethod_Code,
|
||||
RefNumber: d.RefNumber,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Appointment) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package appointment
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
eps "simrs-vx/internal/domain/main-entities/practice-schedule"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type Appointment struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
PracticeSchedule_Id *uint `json:"practiceSchedule_id"`
|
||||
PracticeSchedule *eps.PracticeSchedule `json:"practiceSchedule,omitempty" gorm:"foreignKey:PracticeSchedule_Id;references:Id"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
||||
Person_ResidentIdentityNumber string `json:"person_residentIdentityNumber" gorm:"size:16"`
|
||||
Person_Name string `json:"person_name" gorm:"size:100"`
|
||||
Person_PhoneNumber string `json:"person_phoneNumber" gorm:"size:30"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code" gorm:"size:10"`
|
||||
RefNumber string `json:"refNumber" gorm:"size:20"`
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package chemo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eun "simrs-vx/internal/domain/main-entities/unit"
|
||||
eus "simrs-vx/internal/domain/main-entities/user"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
SrcUnit_Id *uint `json:"srcUnit_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Status_Code *erc.DataVerifiedCode `json:"status-code"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy-user-id"`
|
||||
SrcUnit_Id *uint `json:"srcUnit-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type VerifyDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
|
||||
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"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
VerifiedAt *time.Time `json:"verifiedAt"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
|
||||
VerifiedBy *eus.User `json:"verifiedBy,omitempty"`
|
||||
SrcUnit_Id *uint `json:"srcUnit_id"`
|
||||
SrcUnit *eun.Unit `json:"srcUnit,omitempty"`
|
||||
}
|
||||
|
||||
func (d Chemo) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Status_Code: d.Status_Code,
|
||||
VerifiedAt: d.VerifiedAt,
|
||||
VerifiedBy_User_Id: d.VerifiedBy_User_Id,
|
||||
VerifiedBy: d.VerifiedBy,
|
||||
SrcUnit_Id: d.SrcUnit_Id,
|
||||
SrcUnit: d.SrcUnit,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Chemo) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package chemo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eun "simrs-vx/internal/domain/main-entities/unit"
|
||||
eus "simrs-vx/internal/domain/main-entities/user"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Chemo struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Status_Code erc.DataVerifiedCode `json:"status_code"`
|
||||
VerifiedAt *time.Time `json:"verifiedAt"`
|
||||
VerifiedBy_User_Id *uint `json:"verifiedBy_user_id"`
|
||||
VerifiedBy *eus.User `json:"verifiedBy,omitempty" gorm:"foreignKey:VerifiedBy_User_Id;references:Id"`
|
||||
SrcUnit_Id *uint `json:"src_unit_id"`
|
||||
SrcUnit *eun.Unit `json:"src_unit,omitempty" gorm:"foreignKey:SrcUnit_Id;references:Id"`
|
||||
Class_Code ere.ChemoClassCode `json:"class_code"`
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package consultation
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Date *time.Time `json:"date"`
|
||||
Problem *string `json:"problem" validate:"maxLength=10240"`
|
||||
DstUnit_Id *uint `json:"dstUnit_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
DstUnit_Id *uint `json:"dstUnit-id"`
|
||||
DstDoctor_Id *uint `json:"dstDoctor-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type ReplyDto struct {
|
||||
Id uint `json:"id"`
|
||||
Solution *string `json:"solution"`
|
||||
|
||||
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"`
|
||||
Date *time.Time `json:"date"`
|
||||
Problem *string `json:"problem"`
|
||||
Solution *string `json:"solution"`
|
||||
DstUnit_Id *uint `json:"dstUnit_id"`
|
||||
DstUnit *eu.Unit `json:"dstUnit,omitempty"`
|
||||
DstDoctor_Id *uint `json:"dstDoctor_id"`
|
||||
DstDoctor *ed.Doctor `json:"dstDoctor,omitempty"`
|
||||
RepliedAt *time.Time `json:"repliedAt"`
|
||||
}
|
||||
|
||||
func (d Consultation) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Date: d.Date,
|
||||
Problem: d.Problem,
|
||||
Solution: d.Solution,
|
||||
DstUnit_Id: d.DstUnit_Id,
|
||||
DstUnit: d.DstUnit,
|
||||
DstDoctor_Id: d.DstDoctor_Id,
|
||||
DstDoctor: d.DstDoctor,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Consultation) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package consultation
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type Consultation struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Date *time.Time `json:"date"`
|
||||
|
||||
Problem *string `json:"case" gorm:"size:10240"`
|
||||
Solution *string `json:"solution" gorm:"size:10240"`
|
||||
DstUnit_Id *uint `json:"dstUnit_id"`
|
||||
DstUnit *eu.Unit `json:"dstUnit" gorm:"foreignKey:DstUnit_Id;references:Id"`
|
||||
DstDoctor_Id *uint `json:"dstDoctor_id"`
|
||||
DstDoctor *ed.Doctor `json:"dstDoctor" gorm:"foreignKey:DstDoctor_Id;references:Id"`
|
||||
RepliedAt *time.Time `json:"repliedAt"`
|
||||
}
|
||||
@@ -17,13 +17,10 @@ type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Number uint8 `json:"number"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Type_Code string `json:"type_code"`
|
||||
Queue_Code string `json:"queue_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Parent_Id *uint16 `json:"parent-id"`
|
||||
Type_Code string `json:"type-code"`
|
||||
Queue_Code string `json:"queue-code"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package deviceorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/device"
|
||||
edo "simrs-vx/internal/domain/main-entities/device-order"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
Count uint8 `json:"count"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
DeviceOrder_Id *uint `json:"deviceOrder-id"`
|
||||
Device_Id *uint `json:"device-id"`
|
||||
Count uint8 `json:"count"`
|
||||
}
|
||||
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
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
DeviceOrder *edo.DeviceOrder `json:"deviceOrder,omitempty"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
Device *ed.Device `json:"device,omitempty"`
|
||||
Count uint8 `json:"count"`
|
||||
}
|
||||
|
||||
func (d DeviceOrderItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
DeviceOrder_Id: d.DeviceOrder_Id,
|
||||
DeviceOrder: d.DeviceOrder,
|
||||
Device_Id: d.Device_Id,
|
||||
Device: d.Device,
|
||||
Count: d.Count,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []DeviceOrderItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package deviceorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/device"
|
||||
edo "simrs-vx/internal/domain/main-entities/device-order"
|
||||
)
|
||||
|
||||
type DeviceOrderItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
DeviceOrder_Id *uint `json:"deviceOrder_id"`
|
||||
DeviceOrder *edo.DeviceOrder `json:"deviceOrder,omitempty" gorm:"foreignKey:DeviceOrder_Id;references:Id"`
|
||||
Device_Id *uint `json:"device_id"`
|
||||
Device *ed.Device `json:"device,omitempty" gorm:"foreignKey:Device_Id;references:Id"`
|
||||
Count uint8 `json:"count"`
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package deviceorder
|
||||
|
||||
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"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Status_Code erc.DataStatusCode `json:"status-code"`
|
||||
Doctor_Id *uint `json:"doctor-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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d DeviceOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []DeviceOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package deviceorder
|
||||
|
||||
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"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type DeviceOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d DeviceOrder) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
func (d DeviceOrder) IsSameDoctor(doctor_id *uint) bool {
|
||||
return d.Doctor_Id == doctor_id
|
||||
}
|
||||
@@ -17,20 +17,18 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Uom_Code string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -11,13 +11,17 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
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"`
|
||||
IndName string `json:"indName"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package base
|
||||
|
||||
type Basic struct {
|
||||
Id uint32 `json:"id" gorm:"primaryKey"`
|
||||
Regency_Code string `json:"regency_code" gorm:"size:4"`
|
||||
Code string `json:"code" gorm:"unique;size:6"` // NOTE: THE PROPER SIZE IS 6
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
}
|
||||
|
||||
func (Basic) TableName() string {
|
||||
return "District"
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
package district
|
||||
|
||||
import ev "simrs-vx/internal/domain/main-entities/village"
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
edb "simrs-vx/internal/domain/main-entities/district/base"
|
||||
er "simrs-vx/internal/domain/main-entities/regency"
|
||||
evb "simrs-vx/internal/domain/main-entities/village/base"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Regency_Code string `json:"regency_code" validate:"numeric;maxLength=4"`
|
||||
@@ -9,13 +14,17 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Regency_Code string `json:"regency_code"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Regency_Code string `json:"regency-code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -39,11 +48,9 @@ type MetaDto struct {
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
Id uint32 `json:"id"`
|
||||
Regency_Code string `json:"regency_code"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Villages []*ev.Village `json:"villages,omitempty"`
|
||||
edb.Basic
|
||||
Regency *er.Regency `json:"regency,omitempty"`
|
||||
Villages []*evb.Basic `json:"villages,omitempty"`
|
||||
}
|
||||
|
||||
func (d District) ToResponse() ResponseDto {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package district
|
||||
|
||||
import ev "simrs-vx/internal/domain/main-entities/village"
|
||||
import (
|
||||
edb "simrs-vx/internal/domain/main-entities/district/base"
|
||||
er "simrs-vx/internal/domain/main-entities/regency"
|
||||
evb "simrs-vx/internal/domain/main-entities/village/base"
|
||||
)
|
||||
|
||||
type District struct {
|
||||
Id uint32 `json:"id" gorm:"primaryKey"`
|
||||
Regency_Code string `json:"regency_code" gorm:"size:4"`
|
||||
Code string `json:"code" gorm:"unique;size:6"` // NOTE: THE PROPER SIZE IS 6
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Villages []*ev.Village `json:"villages,omitempty" gorm:"foreignKey:District_Code;references:Code"`
|
||||
edb.Basic
|
||||
Regency *er.Regency `json:"regency,omitempty" gorm:"foreignKey:Regency_Code;references:Code"`
|
||||
Villages []*evb.Basic `json:"villages,omitempty" gorm:"foreignKey:District_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -3,28 +3,31 @@ package divisionposition
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/division"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Division_Id *uint16 `json:"division_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
HeadStatus bool `json:"headStatus"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Division_Id *uint16 `json:"division_id"`
|
||||
Division_Id *uint16 `json:"division-id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
HeadStatus *bool `json:"head-status"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -53,6 +56,9 @@ type ResponseDto struct {
|
||||
Division *ed.Division `json:"division,omitempty"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
HeadStatus bool `json:"headStatus"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
}
|
||||
|
||||
func (d DivisionPosition) ToResponse() ResponseDto {
|
||||
@@ -60,6 +66,9 @@ func (d DivisionPosition) ToResponse() ResponseDto {
|
||||
Division_Id: d.Division_Id,
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
HeadStatus: d.HeadStatus,
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
if d.Division != nil {
|
||||
|
||||
@@ -3,6 +3,7 @@ package divisionposition
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/division"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type DivisionPosition struct {
|
||||
@@ -11,4 +12,7 @@ type DivisionPosition struct {
|
||||
Division *ed.Division `json:"division" gorm:"foreignKey:Division_Id"`
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
HeadStatus bool `json:"headStatus"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
}
|
||||
|
||||
@@ -5,19 +5,24 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
OnlyHaveChildren bool `json:"only-have-children"`
|
||||
}
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *uint16 `json:"parent-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -42,9 +47,11 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Division `json:"parent,omitempty"`
|
||||
Childrens []Division `json:"childrens,omitempty"`
|
||||
}
|
||||
|
||||
func (d Division) ToResponse() ResponseDto {
|
||||
@@ -52,6 +59,8 @@ func (d Division) ToResponse() ResponseDto {
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Parent_Id: d.Parent_Id,
|
||||
Parent: d.Parent,
|
||||
Childrens: d.Childrens,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
return resp
|
||||
|
||||
@@ -5,8 +5,10 @@ import (
|
||||
)
|
||||
|
||||
type Division struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
}
|
||||
|
||||
@@ -16,19 +16,15 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
FeeType_Code *ero.DoctorFeeTypeCode `json:"feeType_code"`
|
||||
Doctor_Id *uint `json:"doctor-id"`
|
||||
FeeType_Code *ero.DoctorFeeTypeCode `json:"feeType-code"`
|
||||
Price *float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -3,31 +3,33 @@ package doctor
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
IHS_Number *string `json:"ihs-number" validate:"maxLength=20"`
|
||||
SIP_Number *string `json:"sip-number" validate:"maxLength=20"`
|
||||
Unit_Id *uint `json:"unit-id"`
|
||||
Specialist_Id *uint16 `json:"specialist-id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -54,22 +56,30 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" `
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
}
|
||||
|
||||
func (d Doctor) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
SIP_Number: d.SIP_Number,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
SIP_Number: d.SIP_Number,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Specialist_Id: d.Specialist_Id,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Id: d.Subspecialist_Id,
|
||||
Subspecialist: d.Subspecialist,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -3,15 +3,21 @@ package doctor
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type Doctor struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"size:20"`
|
||||
SIP_Number *string `json:"sip_number" gorm:"size:20"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
SIP_Number *string `json:"sip_number" gorm:"unique;size:20"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package emergency
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class-code"`
|
||||
}
|
||||
|
||||
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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class_code"`
|
||||
}
|
||||
|
||||
func (d Emergency) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Emergency) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package emergency
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Emergency struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Class_Code ere.EmergencyClassCode `json:"class_code" gorm:"size:10"`
|
||||
}
|
||||
@@ -4,46 +4,31 @@ import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/division"
|
||||
ep "simrs-vx/internal/domain/main-entities/person"
|
||||
epa "simrs-vx/internal/domain/main-entities/person-address"
|
||||
epc "simrs-vx/internal/domain/main-entities/person-contact"
|
||||
eu "simrs-vx/internal/domain/main-entities/user"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ero "simrs-vx/internal/domain/references/organization"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.CreateDto `json:"user"`
|
||||
Person_Id *uint `json:"-"`
|
||||
Person *ep.UpdateDto `json:"person"`
|
||||
PersonAddresses []epa.UpdateDto `json:"personAddresses"`
|
||||
PersonContacts []epc.UpdateDto `json:"personContacts"`
|
||||
Position_Code ero.EmployeePosisitionCode `json:"position_code" validate:"maxLength=20"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Number *string `json:"number" validate:"maxLength=20"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Number *string `json:"number" validate:"maxLength=20"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
User_Id *uint `json:"user_id"`
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Position_Code ero.EmployeePosisitionCode `json:"position_code"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Number *string `json:"number"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
User_Id *uint `json:"user-id"`
|
||||
Person_Id *uint `json:"person-id"`
|
||||
Division_Code *string `json:"division-code"`
|
||||
Number *string `json:"number"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status-code"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -70,15 +55,14 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.User `json:"user,omitempty"`
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Person *ep.Person `json:"person,omitempty"`
|
||||
Position_Code ero.EmployeePosisitionCode `json:"position_code"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Division *ed.Division `json:"division,omitempty"`
|
||||
Number *string `json:"number"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.User `json:"user,omitempty"`
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Person *ep.Person `json:"person,omitempty"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Division *ed.Division `json:"division,omitempty"`
|
||||
Number *string `json:"number"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d Employee) ToResponse() ResponseDto {
|
||||
@@ -87,7 +71,6 @@ func (d Employee) ToResponse() ResponseDto {
|
||||
User: d.User,
|
||||
Person_Id: d.Person_Id,
|
||||
Person: d.Person,
|
||||
Position_Code: d.Position_Code,
|
||||
Division_Code: d.Division_Code,
|
||||
Division: d.Division,
|
||||
Number: d.Number,
|
||||
@@ -104,9 +87,3 @@ func ToResponseList(data []Employee) []ResponseDto {
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
func (c CreateDto) Sanitize() CreateDto {
|
||||
sanitized := c
|
||||
sanitized.User.Password = "[REDACTED]"
|
||||
return sanitized
|
||||
}
|
||||
|
||||
@@ -6,18 +6,18 @@ import (
|
||||
ep "simrs-vx/internal/domain/main-entities/person"
|
||||
eu "simrs-vx/internal/domain/main-entities/user"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ero "simrs-vx/internal/domain/references/organization"
|
||||
erg "simrs-vx/internal/domain/references/organization"
|
||||
)
|
||||
|
||||
type Employee struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"`
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
|
||||
Position_Code ero.EmployeePosisitionCode `json:"position_code" gorm:"not null;size:20"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Division *ed.Division `json:"division,omitempty" gorm:"foreignKey:Division_Code;references:Code"`
|
||||
Number *string `json:"number" gorm:"size:20"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"`
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"`
|
||||
Position_Code *erg.EmployeePosisitionCode `json:"position_code" gorm:"size:20"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Division *ed.Division `json:"division,omitempty" gorm:"foreignKey:Division_Code;references:Code"`
|
||||
Number *string `json:"number" gorm:"size:20"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
}
|
||||
|
||||
@@ -1,42 +1,76 @@
|
||||
package encounter
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
evs "simrs-vx/internal/domain/bpjs-entities/vclaim-sep"
|
||||
ea "simrs-vx/internal/domain/main-entities/appointment"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code" validate:"maxLength=10"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
Assignment_Doctor_Id *uint `json:"assignment_doctor_id"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
DischardeMethod_Code ere.DischargeMethodCode `json:"dischardeMethod_code" validate:"maxLength=10"`
|
||||
RefSource_Name *string `json:"refSource_name" validate:"maxLength=100"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code" validate:"maxLength=10"`
|
||||
SubClass_Code *string `json:"subClass_code" validate:"maxLength=10"` // for sub
|
||||
Infra_Id *uint16 `json:"infra_id"` // for inpatient
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code" gorm:"size:10"`
|
||||
InsuranceCompany_Id *uint `json:"insuranceCompany_id"`
|
||||
Member_Number *string `json:"member_number" validate:"maxLength=20"`
|
||||
Ref_Number *string `json:"ref_number" validate:"maxLength=20"`
|
||||
Trx_Number *string `json:"trx_number" validate:"maxLength=20"`
|
||||
Appointment_Doctor_Id *uint `json:"appointment_doctor_id"`
|
||||
Adm_Employee_Id *uint `json:"-"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
RefSource_Name *string `json:"refSource_name" validate:"maxLength=100"`
|
||||
Appointment_Id *uint `json:"appointment_id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
type FilterDto struct {
|
||||
Patient_Id *uint `json:"patient-id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class-code" validate:"maxLength=10"`
|
||||
Unit_Id *uint `json:"unit-id"`
|
||||
Specialist_Id *uint16 `json:"specialist-id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist-id"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
Appoinment_Doctor_Id *uint `json:"appointment-doctor-id"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible-doctor-id"`
|
||||
DischargeMethod_Code ere.DischargeMethodCode `json:"dischargeMethod-code" validate:"maxLength=10"`
|
||||
RefSource_Name *string `json:"refSource-name" validate:"maxLength=100"`
|
||||
Appointment_Id *uint `json:"appointment-id"`
|
||||
EarlyEducation *string `json:"earlyEducation"`
|
||||
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
@@ -44,6 +78,11 @@ type UpdateDto struct {
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type UpdateStatusDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
StatusCode erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
@@ -53,39 +92,85 @@ type MetaDto struct {
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
type DischargeDto struct {
|
||||
Id uint `json:"id"`
|
||||
DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code" validate:"maxLength=16"`
|
||||
EarlyEducation *string `json:"earlyEducation"`
|
||||
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
Assignment_Doctor_Id *uint `json:"assignment_doctor_id"`
|
||||
Assignment_Doctor *ed.Doctor `json:"assignment_doctor,omitempty"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty"`
|
||||
DischardeMethod_Code ere.DischargeMethodCode `json:"dischardeMethod_code`
|
||||
RefSource_Name *string `json:"refSource_name"`
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code"`
|
||||
InsuranceCompany_Id *uint `json:"insuranceCompany_id"`
|
||||
Member_Number *string `json:"member_number"`
|
||||
Ref_Number *string `json:"ref_number"`
|
||||
Trx_Number *string `json:"trx_number"`
|
||||
Appointment_Doctor_Id *uint `json:"assignment_doctor_id"`
|
||||
Appointment_Doctor *ed.Doctor `json:"assignment_doctor,omitempty"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty"`
|
||||
Adm_Employee_Id *uint `json:"adm_employee_id"`
|
||||
Adm_Employee *ee.Employee `json:"adm_employee,omitempty"`
|
||||
DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code"`
|
||||
RefSource_Name *string `json:"refSource_name"`
|
||||
Appointment_Id *uint `json:"appointment_id"`
|
||||
Appointment *ea.Appointment `json:"appointment,omitempty"`
|
||||
EarlyEducation *string `json:"earlyEducation"`
|
||||
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
VclaimSep *evs.VclaimSep `json:"vclaimSep,omitempty"`
|
||||
}
|
||||
|
||||
func (d Encounter) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Patient_Id: d.Patient_Id,
|
||||
Patient: d.Patient,
|
||||
RegisteredAt: d.RegisteredAt,
|
||||
Class_Code: d.Class_Code,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
VisitDate: d.VisitDate,
|
||||
Assignment_Doctor_Id: d.Assignment_Doctor_Id,
|
||||
Assignment_Doctor: d.Assignment_Doctor,
|
||||
Responsible_Doctor_Id: d.Responsible_Doctor_Id,
|
||||
Responsible_Doctor: d.Responsible_Doctor,
|
||||
DischardeMethod_Code: d.DischardeMethod_Code,
|
||||
RefSource_Name: d.RefSource_Name,
|
||||
Patient_Id: d.Patient_Id,
|
||||
Patient: d.Patient,
|
||||
RegisteredAt: d.RegisteredAt,
|
||||
Class_Code: d.Class_Code,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Specialist_Id: d.Specialist_Id,
|
||||
Specialist: d.Specialist,
|
||||
Subspecialist_Id: d.Subspecialist_Id,
|
||||
Subspecialist: d.Subspecialist,
|
||||
VisitDate: d.VisitDate,
|
||||
PaymentMethod_Code: d.PaymentMethod_Code,
|
||||
InsuranceCompany_Id: d.InsuranceCompany_Id,
|
||||
Member_Number: d.Member_Number,
|
||||
Ref_Number: d.Ref_Number,
|
||||
Trx_Number: d.Trx_Number,
|
||||
Appointment_Doctor_Id: d.Appointment_Doctor_Id,
|
||||
Appointment_Doctor: d.Appointment_Doctor,
|
||||
Adm_Employee_Id: d.Adm_Employee_Id,
|
||||
Adm_Employee: d.Adm_Employee,
|
||||
Responsible_Doctor_Id: d.Responsible_Doctor_Id,
|
||||
Responsible_Doctor: d.Responsible_Doctor,
|
||||
DischargeMethod_Code: d.DischargeMethod_Code,
|
||||
RefSource_Name: d.RefSource_Name,
|
||||
Appointment_Id: d.Appointment_Id,
|
||||
Appointment: d.Appointment,
|
||||
EarlyEducation: d.EarlyEducation,
|
||||
MedicalDischargeEducation: d.MedicalDischargeEducation,
|
||||
AdmDischargeEducation: d.AdmDischargeEducation,
|
||||
DischargeReason: d.DischargeReason,
|
||||
Status_Code: d.Status_Code,
|
||||
VclaimSep: d.VclaimSep,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -2,26 +2,58 @@ package encounter
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
evs "simrs-vx/internal/domain/bpjs-entities/vclaim-sep"
|
||||
ea "simrs-vx/internal/domain/main-entities/appointment"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/insurance-company"
|
||||
ep "simrs-vx/internal/domain/main-entities/patient"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Encounter struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code" gorm:"not null;size:10"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
Assignment_Doctor_Id *uint `json:"assignment_doctor_id"`
|
||||
Assignment_Doctor *ed.Doctor `json:"assignment_doctor,omitempty" gorm:"foreignKey:Assignment_Doctor_Id;references:Id"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty" gorm:"foreignKey:Responsible_Doctor_Id;references:Id"`
|
||||
DischardeMethod_Code ere.DischargeMethodCode `json:"dischardeMethod_code" gorm:"size:10"`
|
||||
RefSource_Name *string `json:"refSource_name" gorm:"size:100"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Patient_Id *uint `json:"patient_id"`
|
||||
Patient *ep.Patient `json:"patient,omitempty" gorm:"foreignKey:Patient_Id;references:Id"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Class_Code ere.EncounterClassCode `json:"class_code" gorm:"not null;size:10"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
|
||||
VisitDate time.Time `json:"visitDate"`
|
||||
PaymentMethod_Code erc.PaymentMethodCode `json:"paymentMethod_code" gorm:"size:10"`
|
||||
InsuranceCompany_Id *uint `json:"insuranceCompany_id"`
|
||||
InsuranceCompany *ei.InsuranceCompany `json:"insuranceCompany,omitempty" gorm:"foreignKey:InsuranceCompany_Id;references:Id"`
|
||||
Member_Number *string `json:"memberNumber" gorm:"unique;size:20"`
|
||||
Ref_Number *string `json:"refNumber" gorm:"unique;size:20"`
|
||||
Trx_Number *string `json:"trxNumber" gorm:"unique;size:20"`
|
||||
Appointment_Doctor_Id *uint `json:"appointment_doctor_id"`
|
||||
Appointment_Doctor *ed.Doctor `json:"appointment_doctor,omitempty" gorm:"foreignKey:Appointment_Doctor_Id;references:Id"`
|
||||
Adm_Employee_Id *uint `json:"adm_employee_id"`
|
||||
Adm_Employee *ee.Employee `json:"adm_employee,omitempty" gorm:"foreignKey:Adm_Employee_Id;references:Id"`
|
||||
Responsible_Doctor_Id *uint `json:"responsible_doctor_id"`
|
||||
Responsible_Doctor *ed.Doctor `json:"responsible_doctor,omitempty" gorm:"foreignKey:Responsible_Doctor_Id;references:Id"`
|
||||
DischargeMethod_Code *ere.DischargeMethodCode `json:"dischargeMethod_code" gorm:"size:16"`
|
||||
RefSource_Name *string `json:"refSource_name" gorm:"size:100"`
|
||||
Appointment_Id *uint `json:"appointment_id"`
|
||||
Appointment *ea.Appointment `json:"appointment,omitempty" gorm:"foreignKey:Appointment_Id;references:Id"`
|
||||
EarlyEducation *string `json:"earlyEducation"`
|
||||
MedicalDischargeEducation *string `json:"medicalDischargeEducation"`
|
||||
AdmDischargeEducation *string `json:"admDischargeEducation"`
|
||||
DischargeReason *string `json:"dischargeReason"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"size:10"`
|
||||
VclaimSep *evs.VclaimSep `json:"vclaimSep,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
}
|
||||
|
||||
func (d Encounter) IsDone() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
@@ -10,12 +10,16 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -3,34 +3,38 @@ package infra
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
erb "simrs-vx/internal/domain/main-entities/room/base"
|
||||
|
||||
ero "simrs-vx/internal/domain/references/organization"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=10"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=15"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Infra_Id *uint16 `json:"-"` // for room
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
OnlyHaveChildren bool `json:"only-have-children"`
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup-code"`
|
||||
Parent_Id *uint16 `json:"parent-id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -60,8 +64,11 @@ type ResponseDto struct {
|
||||
Name string `json:"name"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Infra `json:"parent,omitempty"`
|
||||
Childrens []Infra `json:"childrens,omitempty"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
Rooms []erb.Basic `json:"rooms,omitempty"`
|
||||
}
|
||||
|
||||
func (d Infra) ToResponse() ResponseDto {
|
||||
@@ -70,8 +77,11 @@ func (d Infra) ToResponse() ResponseDto {
|
||||
Name: d.Name,
|
||||
InfraGroup_Code: d.InfraGroup_Code,
|
||||
Parent_Id: d.Parent_Id,
|
||||
Parent: d.Parent,
|
||||
Childrens: d.Childrens,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
Rooms: d.Rooms,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
return resp
|
||||
|
||||
@@ -3,6 +3,7 @@ package infra
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
erb "simrs-vx/internal/domain/main-entities/room/base"
|
||||
|
||||
ero "simrs-vx/internal/domain/references/organization"
|
||||
)
|
||||
@@ -11,8 +12,11 @@ type Infra struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:10"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:15"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
Rooms []erb.Basic `json:"rooms" gorm:"foreignKey:Infra_Id"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package inpatient
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Class_Code ere.InpatientClassCode `json:"class_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Class_Code ere.InpatientClassCode `json:"class-code"`
|
||||
Infra_Id *uint16 `json:"infra-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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Class_Code ere.InpatientClassCode `json:"class_code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
}
|
||||
|
||||
func (d Inpatient) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Class_Code: d.Class_Code,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra: d.Infra,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Inpatient) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package inpatient
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type Inpatient struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Class_Code ere.InpatientClassCode `json:"class_code" gorm:"size:10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package installation
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
@@ -12,13 +13,17 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
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"`
|
||||
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -15,20 +15,18 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Regency_Code *string `json:"regency_code"`
|
||||
Regency_Code *string `json:"regency-code"`
|
||||
Address string `json:"address"`
|
||||
PhoneNumber string `json:"phoneNumber"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package intern
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ep "simrs-vx/internal/domain/main-entities/person"
|
||||
es "simrs-vx/internal/domain/main-entities/specialist"
|
||||
ess "simrs-vx/internal/domain/main-entities/subspecialist"
|
||||
eu "simrs-vx/internal/domain/main-entities/user"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Person *ep.Person `json:"person,omitempty"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id"`
|
||||
Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.User `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
func (d Intern) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Person_Id: d.Person_Id,
|
||||
Person: d.Person,
|
||||
User_Id: d.User_Id,
|
||||
User: d.User,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Intern) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package intern
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ep "simrs-vx/internal/domain/main-entities/person"
|
||||
eu "simrs-vx/internal/domain/main-entities/user"
|
||||
erg "simrs-vx/internal/domain/references/organization"
|
||||
)
|
||||
|
||||
type Intern struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Person_Id *uint `json:"person_id"`
|
||||
Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id"`
|
||||
Position_Code *erg.InternPosisitionCode `json:"position_code" gorm:"size:20"`
|
||||
User_Id *uint `json:"user_id"`
|
||||
User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id"`
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package internal_reference
|
||||
|
||||
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"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Doctor_Id *uint `json:"doctor_Id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Unit_Id *uint `json:"unit-id"`
|
||||
Doctor_Id *uint `json:"doctor-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
}
|
||||
|
||||
func (d InternalReference) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []InternalReference) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package internal_reference
|
||||
|
||||
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"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
type InternalReference struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
}
|
||||
@@ -14,18 +14,14 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *string `json:"insuranceCompany_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
InsuranceCompany_Code *string `json:"insuranceCompany-code"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
|
||||
@@ -17,21 +17,19 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup-code"`
|
||||
Uom_Code *string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -11,7 +11,7 @@ type Item struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:50"`
|
||||
Name string `json:"name" gorm:"size:100"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" gorm:"size:10"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" gorm:"size:15"`
|
||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package laborant
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
IHS_Number *string `json:"ihs-number"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
}
|
||||
|
||||
func (d Laborant) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Laborant) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package laborant
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type Laborant struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
}
|
||||
@@ -10,12 +10,16 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package materialorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/material"
|
||||
emo "simrs-vx/internal/domain/main-entities/material-order"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
MaterialOrder_Id *uint `json:"materialOrder-id"`
|
||||
Material_Id *uint `json:"material-id"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
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
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
MaterialOrder *emo.MaterialOrder `json:"materialOrder,omitempty"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Material *em.Material `json:"material,omitempty"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
|
||||
func (d MaterialOrderItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
MaterialOrder_Id: d.MaterialOrder_Id,
|
||||
MaterialOrder: d.MaterialOrder,
|
||||
Material_Id: d.Material_Id,
|
||||
Material: d.Material,
|
||||
Count: d.Count,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MaterialOrderItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package materialorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/material"
|
||||
emo "simrs-vx/internal/domain/main-entities/material-order"
|
||||
)
|
||||
|
||||
type MaterialOrderItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MaterialOrder_Id *uint `json:"materialOrder_id"`
|
||||
MaterialOrder *emo.MaterialOrder `json:"materialOrder,omitempty" gorm:"foreignKey:MaterialOrder_Id;references:Id"`
|
||||
Material_Id *uint `json:"material_id"`
|
||||
Material *em.Material `json:"material,omitempty" gorm:"foreignKey:Material_Id;references:Id"`
|
||||
Count *uint16 `json:"count"`
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package materialorder
|
||||
|
||||
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"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d MaterialOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MaterialOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package materialorder
|
||||
|
||||
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"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type MaterialOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d MaterialOrder) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
func (d MaterialOrder) IsSameDoctor(doctor_id *uint) bool {
|
||||
return d.Doctor_Id == doctor_id
|
||||
}
|
||||
@@ -18,21 +18,19 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Uom_Code string `json:"uom-code"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package mcuorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emo "simrs-vx/internal/domain/main-entities/mcu-order"
|
||||
ems "simrs-vx/internal/domain/main-entities/mcu-src"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
McuOrder_Id *uint `json:"mcuOrder-id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc-id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status-code"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type SetScheduleDto struct {
|
||||
Id uint `json:"id"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
McuOrder_Id *uint `json:"mcuOrder_id"`
|
||||
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
}
|
||||
|
||||
func (d McuOrderItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
McuOrder_Id: d.McuOrder_Id,
|
||||
McuOrder: d.McuOrder,
|
||||
McuSrc_Id: d.McuSrc_Id,
|
||||
McuSrc: d.McuSrc,
|
||||
Result: d.Result,
|
||||
Status_Code: d.Status_Code,
|
||||
ExaminationDate: d.ExaminationDate,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []McuOrderItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package mcuorderitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emo "simrs-vx/internal/domain/main-entities/mcu-order"
|
||||
ems "simrs-vx/internal/domain/main-entities/mcu-src"
|
||||
"time"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type McuOrderItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
McuOrder_Id *uint `json:"mcuOrder_id" gorm:"uniqueIndex:idx_order_src"`
|
||||
McuOrder *emo.McuOrder `json:"mcuOrder,omitempty" gorm:"foreignKey:McuOrder_Id;references:Id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id" gorm:"uniqueIndex:idx_order_src"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Id;references:Id"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d McuOrderItem) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package mcuordersubitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emoi "simrs-vx/internal/domain/main-entities/mcu-order-item"
|
||||
emss "simrs-vx/internal/domain/main-entities/mcu-sub-src"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
McuSubSrc_Id *uint `json:"mcuSubSrc_id"`
|
||||
McuOrderItem_Id *uint `json:"mcuOrderItem_id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
McuOrder_Id *uint `json:"mcuOrder-id"`
|
||||
McuSrc_Id *uint `json:"mcuSrc-id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status-code"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
McuSubSrc_Id *uint `json:"mcuSubSrc_id"`
|
||||
McuSubSrc *emss.McuSubSrc `json:"mcuSubSrc,omitempty"`
|
||||
McuOrderItem_Id *uint `json:"mcuOrderItem_id"`
|
||||
McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d McuOrderSubItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
McuSubSrc_Id: d.McuSubSrc_Id,
|
||||
McuSubSrc: d.McuSubSrc,
|
||||
McuOrderItem_Id: d.McuOrderItem_Id,
|
||||
McuOrderItem: d.McuOrderItem,
|
||||
Result: d.Result,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []McuOrderSubItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package mcuordersubitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emoi "simrs-vx/internal/domain/main-entities/mcu-order-item"
|
||||
emss "simrs-vx/internal/domain/main-entities/mcu-sub-src"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type McuOrderSubItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
McuSubSrc_Id *uint `json:"mcuSubSrc_id" gorm:"uniqueIndex:idx_order_sub_src"`
|
||||
McuSubSrc *emss.McuSubSrc `json:"mcuSubSrc,omitempty" gorm:"foreignKey:McuSubSrc_Id;references:Id"`
|
||||
McuOrderItem_Id *uint `json:"mcuOrderItem_id" gorm:"uniqueIndex:idx_order_sub_src"`
|
||||
McuOrderItem *emoi.McuOrderItem `json:"mcuOrderItem,omitempty" gorm:"foreignKey:McuOrderItem_Id;references:Id"`
|
||||
Result *string `json:"result"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d McuOrderSubItem) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package mcuorder
|
||||
|
||||
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"
|
||||
|
||||
ercl "simrs-vx/internal/domain/references/clinical"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel_code""`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Status_Code erc.DataStatusCode `json:"status-code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor-id"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel-code""`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type SetScheduleDto struct {
|
||||
Id uint `json:"id"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
}
|
||||
|
||||
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"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel_code""`
|
||||
}
|
||||
|
||||
func (d McuOrder) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
Status_Code: d.Status_Code,
|
||||
Doctor_Id: d.Doctor_Id,
|
||||
Doctor: d.Doctor,
|
||||
SpecimenPickTime: d.SpecimenPickTime,
|
||||
ExaminationDate: d.ExaminationDate,
|
||||
Number: d.Number,
|
||||
Temperature: d.Temperature,
|
||||
McuUrgencyLevel_Code: d.McuUrgencyLevel_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []McuOrder) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package mcuorder
|
||||
|
||||
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"
|
||||
|
||||
ercl "simrs-vx/internal/domain/references/clinical"
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type McuOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code" gorm:"not null;size:10"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
SpecimenPickTime *time.Time `json:"specimenPickTime"`
|
||||
ExaminationDate *time.Time `json:"examinationDate"`
|
||||
Number uint8 `json:"number"`
|
||||
Temperature float64 `json:"temperature"`
|
||||
McuUrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"mcuUrgencyLevel_code" gorm:"not null;size:15"`
|
||||
}
|
||||
|
||||
func (d McuOrder) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
|
||||
func (d McuOrder) IsSameDoctor(doctor_id *uint) bool {
|
||||
return d.Doctor_Id == doctor_id
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package division
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
@@ -12,13 +13,17 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
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"`
|
||||
Scope_Code *ere.CheckupScopeCode `json:"scope_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Scope_Code *ere.CheckupScopeCode `json:"scope-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -2,28 +2,28 @@ package mcusrc
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory_code" validate:"maxLength=20"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
McuSrcCategory_Code *string `json:"mcuSrcCategory_code" validate:"maxLength=20"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory_code"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
McuSrcCategory_Code *string `json:"mcuSrcCategory-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -47,19 +47,23 @@ type MetaDto struct {
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory_code"`
|
||||
ecore.Main
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
McuSrcCategory_Code *string `json:"mcuSrcCategory_code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d McuSrc) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
CheckupCategory_Code: d.CheckupCategory_Code,
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
McuSrcCategory_Code: d.McuSrcCategory_Code,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.SmallMain = d.SmallMain
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,16 @@ package mcusrc
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
emsc "simrs-vx/internal/domain/main-entities/mcu-src-category"
|
||||
)
|
||||
|
||||
type McuSrc struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory_code" gorm:"size:20"`
|
||||
CheckupCategory *emsc.McuSrcCategory `json:"checkupCategory,omitempty" gorm:"foreignKey:CheckupCategory_Code;references:Code"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
McuSrcCategory_Code *string `json:"mcuSrcCategory_code" gorm:"size:20"`
|
||||
McuSrcCategory *emsc.McuSrcCategory `json:"mcuSrcCategory,omitempty" gorm:"foreignKey:McuSrcCategory_Code;references:Code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package mcusubsrc
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
ems "simrs-vx/internal/domain/main-entities/mcu-src"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
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"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
}
|
||||
|
||||
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
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d McuSubSrc) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
McuSrc_Id: d.McuSrc_Id,
|
||||
McuSrc: d.McuSrc,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []McuSubSrc) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package mcusubsrc
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ei "simrs-vx/internal/domain/main-entities/item"
|
||||
ems "simrs-vx/internal/domain/main-entities/mcu-src"
|
||||
)
|
||||
|
||||
type McuSubSrc struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
McuSrc_Id *uint `json:"mcuSrc_id"`
|
||||
McuSrc *ems.McuSrc `json:"mcuSrc,omitempty" gorm:"foreignKey:McuSrc_Id;references:Id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
@@ -15,18 +15,14 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
MedicalActionSrc_Id *uint `json:"medicalActionSrc_id"`
|
||||
ProcedureSrc_Id *uint `json:"procedureSrc_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
MedicalActionSrc_Id *uint `json:"medicalActionSrc-id"`
|
||||
ProcedureSrc_Id *uint `json:"procedureSrc-id"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -6,25 +6,25 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Type_Code string `json:"type_code" validate:"maxLength=20"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Type_Code string `json:"type_code"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -49,18 +49,20 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Type_Code string `json:"type_code"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty"`
|
||||
}
|
||||
|
||||
func (d MedicalActionSrc) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
Code: d.Code,
|
||||
Name: d.Name,
|
||||
Type_Code: d.Type_Code,
|
||||
Item_Id: d.Item_Id,
|
||||
Item: d.Item,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -9,6 +9,7 @@ type MedicalActionSrc struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:20"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Type_Code string `json:"type_code" gorm:"size:20"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emi "simrs-vx/internal/domain/main-entities/medication-item"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
|
||||
"time"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain float64 `json:"remain"`
|
||||
Nurse_Id *uint `json:"nurse_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
MedicationItem_Id *uint `json:"medicationItem-id"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain float64 `json:"remain"`
|
||||
Nurse_Id *uint `json:"nurse-id"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
}
|
||||
|
||||
type ConsumeDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Usage float64 `json:"usage"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
MedicationItem *emi.MedicationItem `json:"medicationItem,omitempty"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain float64 `json:"remain"`
|
||||
Nurse_Id *uint `json:"nurse_id"`
|
||||
}
|
||||
|
||||
func (d MedicationItemDist) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
MedicationItem_Id: d.MedicationItem_Id,
|
||||
MedicationItem: d.MedicationItem,
|
||||
DateTime: d.DateTime,
|
||||
Remain: d.Remain,
|
||||
Nurse_Id: d.Nurse_Id,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicationItemDist) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emi "simrs-vx/internal/domain/main-entities/medication-item"
|
||||
en "simrs-vx/internal/domain/main-entities/nurse"
|
||||
)
|
||||
|
||||
type MedicationItemDist struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MedicationItem_Id *uint `json:"medicationItem_id"`
|
||||
MedicationItem *emi.MedicationItem `json:"medicationItem,omitempty" gorm:"foreignKey:MedicationItem_Id;references:Id"`
|
||||
DateTime *time.Time `json:"dateTime"`
|
||||
Remain float64 `json:"remain"`
|
||||
Nurse_Id *uint `json:"nurse_id"`
|
||||
Nurse *en.Nurse `json:"nurse,omitempty" gorm:"foreignKey:Nurse_Id;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eme "simrs-vx/internal/domain/main-entities/medication"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Frequency *uint16 `json:"frequency"`
|
||||
Dose float64 `json:"dose"`
|
||||
Usage string `json:"usage"`
|
||||
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"`
|
||||
IntervalMultiplier *uint16 `json:"intervalMultiplier"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Medication_Id *uint `json:"medication-id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine-id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix-id"`
|
||||
Usage float64 `json:"usage"`
|
||||
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 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
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
Medication *eme.Medication `json:"medication,omitempty"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||
Usage string `json:"usage"`
|
||||
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 {
|
||||
resp := ResponseDto{
|
||||
Medication_Id: d.Medication_Id,
|
||||
Medication: d.Medication,
|
||||
IsMix: d.IsMix,
|
||||
Medicine_Id: d.Medicine_Id,
|
||||
Medicine: d.Medicine,
|
||||
MedicineMix_Id: d.MedicineMix_Id,
|
||||
MedicineMix: d.MedicineMix,
|
||||
Usage: d.Usage,
|
||||
Interval: d.Interval,
|
||||
IntervalUnit_Code: d.IntervalUnit_Code,
|
||||
IsRedeemed: d.IsRedeemed,
|
||||
Quantity: d.Quantity,
|
||||
Note: d.Note,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []MedicationItem) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package medicationitem
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
eme "simrs-vx/internal/domain/main-entities/medication"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type MedicationItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Medication_Id *uint `json:"medication_id"`
|
||||
Medication *eme.Medication `json:"medication,omitempty" gorm:"foreignKey:Medication_Id;references:Id"`
|
||||
IsMix bool `json:"isMix"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||
Frequency *uint16 `json:"frequency"`
|
||||
Dose float64 `json:"dose"`
|
||||
Usage string `json:"usage" gorm:"size:255"`
|
||||
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"`
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package medication
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ep "simrs-vx/internal/domain/main-entities/pharmacist"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
|
||||
pa "simrs-vx/pkg/auth-helper"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist-id"`
|
||||
Status_Code erc.DataStatusCode `json:"status-code"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `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 *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
Pharmacist *ep.Pharmacist `json:"pharmacist,omitempty"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d Medication) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Encounter: d.Encounter,
|
||||
IssuedAt: d.IssuedAt,
|
||||
Pharmacist_Id: d.Pharmacist_Id,
|
||||
Pharmacist: d.Pharmacist,
|
||||
Status_Code: d.Status_Code,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Medication) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package medication
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
ep "simrs-vx/internal/domain/main-entities/pharmacist"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
)
|
||||
|
||||
type Medication struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
IssuedAt *time.Time `json:"issuedAt"`
|
||||
Pharmacist_Id *uint `json:"pharmacist_id"`
|
||||
Pharmacist *ep.Pharmacist `json:"pharmacist,omitempty" gorm:"foreignKey:Pharmacist_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
func (d Medication) IsCompleted() bool {
|
||||
return d.Status_Code == erc.DSCDone
|
||||
}
|
||||
@@ -10,12 +10,16 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -10,12 +10,16 @@ type CreateDto struct {
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -3,29 +3,26 @@ package medicinemixitem
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
Note *string `json:"note" gom:"size:1024"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
MedicineMix_Id *uint `json:"medicineMix-id"`
|
||||
Medicine_Id *uint `json:"medicine-id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
Note *string `json:"note" gom:"size:1024"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -49,20 +46,20 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
Note *string `json:"note" gom:"size:1024"`
|
||||
}
|
||||
|
||||
func (d MedicineMixItem) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
MedicineMix_Id: d.MedicineMix_Id,
|
||||
MedicineMix: d.MedicineMix,
|
||||
Medicine_Id: d.Medicine_Id,
|
||||
Medicine: d.Medicine,
|
||||
Dose: d.Dose,
|
||||
Note: d.Note,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -3,14 +3,13 @@ package medicinemixitem
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
em "simrs-vx/internal/domain/main-entities/medicine"
|
||||
emm "simrs-vx/internal/domain/main-entities/medicine-mix"
|
||||
)
|
||||
|
||||
type MedicineMixItem struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
MedicineMix *emm.MedicineMix `json:"medicineMix,omitempty" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
MedicineMix_Id *uint `json:"medicineMix_id"`
|
||||
Medicine_Id *uint `json:"medicine_id"`
|
||||
Medicine *em.Medicine `json:"medicine,omitempty" gorm:"foreignKey:Medicine_Id;references:Id"`
|
||||
Dose *uint8 `json:"dose"`
|
||||
Note *string `json:"note" gom:"size:1024"`
|
||||
}
|
||||
|
||||
@@ -2,18 +2,19 @@ package medicinemix
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
emmi "simrs-vx/internal/domain/main-entities/medicine-mix-item"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
Name string `json:"name"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code *string `json:"uom-code"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -37,12 +38,16 @@ type MetaDto struct {
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
MixItems []*emmi.MedicineMixItem `json:"mixItems"`
|
||||
}
|
||||
|
||||
func (d MedicineMix) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Name: d.Name,
|
||||
Name: d.Name,
|
||||
Uom_Code: d.Uom_Code,
|
||||
MixItems: d.MixItems,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -2,9 +2,14 @@ package medicinemix
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
emmi "simrs-vx/internal/domain/main-entities/medicine-mix-item"
|
||||
eu "simrs-vx/internal/domain/main-entities/uom"
|
||||
)
|
||||
|
||||
type MedicineMix struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
ecore.Main // adjust this according to the needs
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Uom_Code *string `json:"uom_code" gorm:"size:10"`
|
||||
Uom *eu.Uom `json:"uom" gorm:"foreignKey:Uom_Code;references:Code"`
|
||||
MixItems []*emmi.MedicineMixItem `json:"mixItems" gorm:"foreignKey:MedicineMix_Id;references:Id"`
|
||||
}
|
||||
|
||||
@@ -23,24 +23,22 @@ type CreateDto struct {
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Sort string `json:"sort"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup-code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod-code"`
|
||||
Uom_Code *string `json:"uom-code"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Item_Id *uint `json:"item-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package midwife
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
Id uint `json:"id"`
|
||||
CreateDto
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
PageNumber int `json:"page_number"`
|
||||
PageSize int `json:"page_size"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
}
|
||||
|
||||
func (d Midwife) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
IHS_Number: d.IHS_Number,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Midwife) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package midwife
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
)
|
||||
|
||||
type Midwife struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package nurse
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
@@ -10,22 +11,20 @@ type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Preloads []string `json:"-"`
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
NoPagination int `json:"no_pagination"`
|
||||
Employee_Id *uint `json:"employee-id"`
|
||||
IHS_Number *string `json:"ihs-number"`
|
||||
Unit_Id *uint16 `json:"unit-id"`
|
||||
Infra_Id *uint16 `json:"infra-id"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint16 `json:"id"`
|
||||
@@ -55,6 +54,8 @@ type ResponseDto struct {
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty"`
|
||||
}
|
||||
|
||||
func (d Nurse) ToResponse() ResponseDto {
|
||||
@@ -64,6 +65,8 @@ func (d Nurse) ToResponse() ResponseDto {
|
||||
IHS_Number: d.IHS_Number,
|
||||
Unit_Id: d.Unit_Id,
|
||||
Unit: d.Unit,
|
||||
Infra_Id: d.Infra_Id,
|
||||
Infra: d.Infra,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -3,6 +3,7 @@ package nurse
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
ei "simrs-vx/internal/domain/main-entities/infra"
|
||||
eu "simrs-vx/internal/domain/main-entities/unit"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,9 @@ type Nurse struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"size:20"`
|
||||
IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Infra *ei.Infra `json:"infra,omitempty" gorm:"foreignKey:Infra_Id;references:Id"`
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user