Merge branch 'dev' of github.com:dikstub-rssa/simrs-be into migration
This commit is contained in:
@@ -6,6 +6,9 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
VclaimSep_Number *string `json:"vclaimSep_number"`
|
||||
Number *string `json:"number" gorm:"unique;size:20"`
|
||||
Value *string `json:"value"`
|
||||
FileUrl *string `json:"fileUrl" gorm:"unique;size:1024"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -20,7 +23,8 @@ type FilterDto struct {
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id *uint `json:"id"`
|
||||
Number *string `json:"number"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
@@ -29,7 +33,8 @@ type UpdateDto struct {
|
||||
}
|
||||
|
||||
type DeleteDto struct {
|
||||
Id uint `json:"id"`
|
||||
Id uint `json:"id"`
|
||||
Number *string `json:"number"`
|
||||
}
|
||||
|
||||
type MetaDto struct {
|
||||
@@ -41,12 +46,17 @@ type MetaDto struct {
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
VclaimSep_Number *string `json:"vclaimSep_number"`
|
||||
Counter *uint `json:"counter"`
|
||||
Number *string `json:"number"`
|
||||
Value *string `json:"value"`
|
||||
FileUrl *string `json:"fileUrl"`
|
||||
}
|
||||
|
||||
func (d VclaimSepControlLetter) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
VclaimSep_Number: d.VclaimSep_Number,
|
||||
Number: d.Number,
|
||||
Value: d.Value,
|
||||
FileUrl: d.FileUrl,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Parent_Code *string `json:"parent_code"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package encounter_document
|
||||
|
||||
import (
|
||||
eru "simrs-vx/internal/domain/references/upload"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
// internal - domain - base-entities
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Type_Code eru.DocTypeCode `json:"type_code"`
|
||||
Type_Code ere.DocTypeCode `json:"type_code"`
|
||||
Name string `json:"name"`
|
||||
FilePath string `json:"filePath"`
|
||||
Filename string `json:"-"`
|
||||
@@ -25,7 +25,7 @@ type ReadListDto struct {
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
Type_Code eru.DocTypeCode `json:"type-code"`
|
||||
Type_Code ere.DocTypeCode `json:"type-code"`
|
||||
Upload_Employee_Id *string `json:"encounter-document-employee-id"`
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ type MetaDto struct {
|
||||
type ResponseDto struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Type_Code eru.DocTypeCode `json:"type_code"`
|
||||
Type_Code ere.DocTypeCode `json:"type_code"`
|
||||
Name string `json:"name"`
|
||||
FilePath *string `json:"filePath"`
|
||||
FileName *string `json:"fileName"`
|
||||
|
||||
@@ -3,13 +3,13 @@ package encounter_document
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ee "simrs-vx/internal/domain/main-entities/employee"
|
||||
eru "simrs-vx/internal/domain/references/upload"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
)
|
||||
|
||||
type EncounterDocument struct {
|
||||
ecore.Main
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Type_Code eru.DocTypeCode `json:"type_code"`
|
||||
Type_Code ere.DocTypeCode `json:"type_code"`
|
||||
Name string `json:"name"`
|
||||
FilePath *string `json:"filePath"`
|
||||
FileName *string `json:"fileName"`
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package generalconsent
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Encounter_Id *uint `json:"encounter-id"`
|
||||
}
|
||||
|
||||
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
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Value *string `json:"value"`
|
||||
FileUrl *string `json:"fileUrl"`
|
||||
}
|
||||
|
||||
func (d GeneralConsent) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Encounter_Id: d.Encounter_Id,
|
||||
Value: d.Value,
|
||||
FileUrl: d.FileUrl,
|
||||
}
|
||||
resp.Main = d.Main
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []GeneralConsent) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package general_consent
|
||||
package generalconsent
|
||||
|
||||
import (
|
||||
"simrs-vx/internal/domain/base-entities/core"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
epr "simrs-vx/internal/domain/main-entities/person-relative"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
eru "simrs-vx/internal/domain/references/upload"
|
||||
ere "simrs-vx/internal/domain/references/encounter"
|
||||
|
||||
pa "simrs-vx/internal/lib/auth"
|
||||
)
|
||||
@@ -28,6 +28,7 @@ type CreateDto struct {
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
RegisteredBy_User_Name *string `json:"registeredBy_user_name" validate:"maxLength=100"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
Number *string `json:"number"`
|
||||
|
||||
pa.AuthInfo
|
||||
}
|
||||
@@ -68,7 +69,7 @@ type SearchDto struct {
|
||||
|
||||
type UploadDto struct {
|
||||
Id uint `json:"-"`
|
||||
Code eru.DocTypeCode `json:"-"`
|
||||
Code ere.DocTypeCode `json:"-"`
|
||||
File multipart.File `json:"-"`
|
||||
FileHeader *multipart.FileHeader `json:"-"`
|
||||
Filename string `json:"-"`
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Id *uint `json:"id"`
|
||||
Installation_Code *string `json:"installation_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
package upload
|
||||
|
||||
import (
|
||||
"mime/multipart"
|
||||
eru "simrs-vx/internal/domain/references/upload"
|
||||
|
||||
// internal - domain - base-entities
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
EntityType_Code eru.EntityTypeCode `form:"entityType_code"`
|
||||
Ref_Id *uint `form:"ref_id"`
|
||||
Type_Code eru.DocTypeCode `form:"type_code"`
|
||||
Name string `form:"name"`
|
||||
Upload_Employee_Id *uint `form:"upload_employee_id"`
|
||||
FilePath string `json:"-"`
|
||||
|
||||
File multipart.File `json:"-"`
|
||||
FileHeader *multipart.FileHeader `json:"-"`
|
||||
Filename string `json:"filename"`
|
||||
Size int64 `json:"-"`
|
||||
MimeType string `json:"-"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
FilterDto
|
||||
Includes string `json:"includes"`
|
||||
Pagination ecore.Pagination
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
EntityType_Code eru.EntityTypeCode `json:"entityType-code"`
|
||||
Ref_Id *uint `json:"ref-id"`
|
||||
Type_Code eru.DocTypeCode `json:"type-code"`
|
||||
Name string `json:"name"`
|
||||
FilePath *string `json:"filePath"`
|
||||
FileName *string `json:"fileName"`
|
||||
Upload_Employee_Id *string `json:"encounter-document-employee-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 {
|
||||
EntityType_Code eru.EntityTypeCode `json:"entityType_code"`
|
||||
Ref_Id *uint `json:"ref_id"`
|
||||
Type_Code eru.DocTypeCode `json:"type_code"`
|
||||
Name string `json:"name"`
|
||||
Upload_Employee_Id *uint `json:"upload_employee_id"`
|
||||
FilePath string `json:"filePath"`
|
||||
Filename string `json:"filename"`
|
||||
FileHeader *multipart.FileHeader `json:"fileHeader"`
|
||||
Size int64 `json:"size"`
|
||||
MimeType string `json:"mimeType"`
|
||||
}
|
||||
|
||||
func (d CreateDto) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
EntityType_Code: d.EntityType_Code,
|
||||
Ref_Id: d.Ref_Id,
|
||||
Type_Code: d.Type_Code,
|
||||
Name: d.Name,
|
||||
Upload_Employee_Id: d.Upload_Employee_Id,
|
||||
FilePath: d.FilePath,
|
||||
Filename: d.Filename,
|
||||
FileHeader: d.FileHeader,
|
||||
Size: d.Size,
|
||||
MimeType: d.MimeType,
|
||||
}
|
||||
return resp
|
||||
}
|
||||
@@ -17,6 +17,7 @@ type (
|
||||
CrudCode string
|
||||
DataApprovalCode string
|
||||
ProcessStatusCode string
|
||||
DocFormatTypeCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -106,6 +107,11 @@ const (
|
||||
|
||||
PSCSuccess ProcessStatusCode = "success"
|
||||
PSCFailed ProcessStatusCode = "failed"
|
||||
|
||||
DFTCPDF DocFormatTypeCode = "pdf"
|
||||
DFTCTXLSX DocFormatTypeCode = "xlsx"
|
||||
DFTCTCSV DocFormatTypeCode = "csv"
|
||||
DFTCTXLS DocFormatTypeCode = "xls"
|
||||
)
|
||||
|
||||
func GetDayCodes() map[DayCode]string {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package encounter
|
||||
|
||||
import "fmt"
|
||||
|
||||
type (
|
||||
EncounterClassCode string
|
||||
QueueStatusCode string
|
||||
@@ -18,6 +20,8 @@ type (
|
||||
SEPRefTypeCode string
|
||||
VisitModeCode string
|
||||
PolySwitchCode string
|
||||
DocTypeCode string
|
||||
EntityTypeCode string
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -104,6 +108,23 @@ const (
|
||||
|
||||
PSCConsulPoly PolySwitchCode = "consul-poly" // Konsultasi Poliklinik Lain
|
||||
PSCConsulExecutive PolySwitchCode = "consul-executive" // Konsultasi Antar Dokter Eksekutif
|
||||
|
||||
DTCPRN DocTypeCode = "person-resident-number" // Person Resident Number
|
||||
DTCPDL DocTypeCode = "person-driver-license" // Person Driver License
|
||||
DTCPP DocTypeCode = "person-passport" // Person Passport
|
||||
DTCPFC DocTypeCode = "person-family-card" // Person Family Card
|
||||
DTCMIR DocTypeCode = "mcu-item-result" // Mcu Item Result
|
||||
DTCEnPatient DocTypeCode = "encounter-patient"
|
||||
DTCEnSupport DocTypeCode = "encounter-support"
|
||||
DTCEnOther DocTypeCode = "encounter-other"
|
||||
DTCSEP DocTypeCode = "vclaim-sep" // SEP
|
||||
DTCSIPP DocTypeCode = "vclaim-sipp" // SIPP
|
||||
DTCGC DocTypeCode = "general-consent"
|
||||
DTCVSCL DocTypeCode = "vclaim-control-letter" // vclaim control letter
|
||||
|
||||
ETCPerson EntityTypeCode = "person"
|
||||
ETCEncounter EntityTypeCode = "encounter"
|
||||
ETCMCU EntityTypeCode = "mcu"
|
||||
)
|
||||
|
||||
func (ec EncounterClassCode) Code() string {
|
||||
@@ -118,3 +139,30 @@ func (ec EncounterClassCode) Code() string {
|
||||
return "UNKNOWN"
|
||||
}
|
||||
}
|
||||
|
||||
var validUploadCodesByEntity = map[EntityTypeCode][]DocTypeCode{
|
||||
ETCPerson: {
|
||||
DTCPRN, DTCPDL, DTCPP, DTCPFC,
|
||||
},
|
||||
ETCEncounter: {
|
||||
DTCSEP, DTCSIPP, DTCEnPatient, DTCEnSupport, DTCGC, DTCEnOther,
|
||||
},
|
||||
ETCMCU: {
|
||||
DTCMIR,
|
||||
},
|
||||
}
|
||||
|
||||
func IsValidUploadCode(entity EntityTypeCode, code DocTypeCode) (bool, string) {
|
||||
allowedCodes, ok := validUploadCodesByEntity[entity]
|
||||
if !ok {
|
||||
return false, fmt.Sprintf("unknown entityType_code: %s", entity)
|
||||
}
|
||||
|
||||
for _, c := range allowedCodes {
|
||||
if c == code {
|
||||
return true, ""
|
||||
}
|
||||
}
|
||||
|
||||
return false, fmt.Sprintf("invalid doctype_code '%s' for entityType_code '%s'", code, entity)
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
package upload
|
||||
|
||||
import "fmt"
|
||||
|
||||
type (
|
||||
DocTypeCode string
|
||||
EntityTypeCode string
|
||||
)
|
||||
|
||||
const (
|
||||
DTCPRN DocTypeCode = "person-resident-number" // Person Resident Number
|
||||
DTCPDL DocTypeCode = "person-driver-license" // Person Driver License
|
||||
DTCPP DocTypeCode = "person-passport" // Person Passport
|
||||
DTCPFC DocTypeCode = "person-family-card" // Person Family Card
|
||||
DTCMIR DocTypeCode = "mcu-item-result" // Mcu Item Result
|
||||
DTCEnPatient DocTypeCode = "encounter-patient"
|
||||
DTCEnSupport DocTypeCode = "encounter-support"
|
||||
DTCEnOther DocTypeCode = "encounter-other"
|
||||
DTCSEP DocTypeCode = "vclaim-sep" // SEP
|
||||
DTCSIPP DocTypeCode = "vclaim-sipp" // SIPP
|
||||
DTCGC DocTypeCode = "general-consent"
|
||||
|
||||
ETCPerson EntityTypeCode = "person"
|
||||
ETCEncounter EntityTypeCode = "encounter"
|
||||
ETCMCU EntityTypeCode = "mcu"
|
||||
)
|
||||
|
||||
var validUploadCodesByEntity = map[EntityTypeCode][]DocTypeCode{
|
||||
ETCPerson: {
|
||||
DTCPRN, DTCPDL, DTCPP, DTCPFC,
|
||||
},
|
||||
ETCEncounter: {
|
||||
DTCSEP, DTCSIPP, DTCEnPatient, DTCEnSupport, DTCEnOther,
|
||||
},
|
||||
ETCMCU: {
|
||||
DTCMIR,
|
||||
},
|
||||
}
|
||||
|
||||
func IsValidUploadCode(entity EntityTypeCode, code DocTypeCode) (bool, string) {
|
||||
allowedCodes, ok := validUploadCodesByEntity[entity]
|
||||
if !ok {
|
||||
return false, fmt.Sprintf("unknown entityType_code: %s", entity)
|
||||
}
|
||||
|
||||
for _, c := range allowedCodes {
|
||||
if c == code {
|
||||
return true, ""
|
||||
}
|
||||
}
|
||||
|
||||
return false, fmt.Sprintf("invalid doctype_code '%s' for entityType_code '%s'", code, entity)
|
||||
}
|
||||
@@ -4,14 +4,14 @@ import "time"
|
||||
|
||||
type MPasien struct {
|
||||
Id uint `json:"id" gorm:"primaryKey;autoIncrement;column:id"`
|
||||
Nomr string `json:"nomr" gorm:"column:nomr"`
|
||||
Nomr string `json:"nomr" gorm:"uniqueIndex;column:nomr"`
|
||||
Title string `json:"title" gorm:"column:title"`
|
||||
Nama string `json:"nama" gorm:"column:nama"`
|
||||
Tempat string `json:"tempat" gorm:"column:tempat"`
|
||||
Tgllahir *time.Time `json:"tgllahir" gorm:"column:tgllahir"`
|
||||
Jeniskelamin string `json:"jeniskelamin" gorm:"column:jeniskelamin"`
|
||||
Alamat string `json:"alamat" gorm:"column:alamat"`
|
||||
Kelurahan uint `json:"kelurahan" gorm:"column:kelurahan"`
|
||||
Kelurahan uint64 `json:"kelurahan" gorm:"column:kelurahan"`
|
||||
Kdkecamatan uint `json:"kdkecamatan" gorm:"column:kdkecamatan"`
|
||||
Kota uint `json:"kota" gorm:"column:kota"`
|
||||
Kdprovinsi uint `json:"kdprovinsi" gorm:"column:kdprovinsi"`
|
||||
|
||||
Reference in New Issue
Block a user