clear general tool
This commit is contained in:
70
internal/models/reference/aplicare.go
Normal file
70
internal/models/reference/aplicare.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package reference
|
||||
|
||||
// === REFERENSI MODELS ===
|
||||
|
||||
// ReferensiRequest represents referensi lookup request
|
||||
type ReferensiRequest struct {
|
||||
BaseRequest
|
||||
JenisReferensi string `json:"jenis_referensi" validate:"required,oneof=diagnosa procedure obat alkes faskes dokter poli"`
|
||||
Keyword string `json:"keyword,omitempty"`
|
||||
KodeReferensi string `json:"kode_referensi,omitempty"`
|
||||
PaginationRequest
|
||||
}
|
||||
|
||||
// ReferensiData represents referensi information
|
||||
type ReferensiData struct {
|
||||
Kode string `json:"kode"`
|
||||
Nama string `json:"nama"`
|
||||
Kategori string `json:"kategori,omitempty"`
|
||||
Status string `json:"status"`
|
||||
TglBerlaku string `json:"tgl_berlaku,omitempty"`
|
||||
TglBerakhir string `json:"tgl_berakhir,omitempty"`
|
||||
Keterangan string `json:"keterangan,omitempty"`
|
||||
}
|
||||
|
||||
// ReferensiResponse represents referensi API response
|
||||
type ReferensiResponse struct {
|
||||
BaseResponse
|
||||
Data []ReferensiData `json:"data,omitempty"`
|
||||
Pagination *PaginationResponse `json:"pagination,omitempty"`
|
||||
}
|
||||
|
||||
// === MONITORING MODELS ===
|
||||
|
||||
// MonitoringRequest represents monitoring data request
|
||||
type MonitoringRequest struct {
|
||||
BaseRequest
|
||||
TanggalAwal string `json:"tanggal_awal" validate:"required"`
|
||||
TanggalAkhir string `json:"tanggal_akhir" validate:"required"`
|
||||
JenisLaporan string `json:"jenis_laporan" validate:"required,oneof=kunjungan klaim rujukan sep"`
|
||||
PPK string `json:"ppk,omitempty"`
|
||||
StatusData string `json:"status_data,omitempty"`
|
||||
PaginationRequest
|
||||
}
|
||||
|
||||
// MonitoringData represents monitoring information
|
||||
type MonitoringData struct {
|
||||
Tanggal string `json:"tanggal"`
|
||||
PPK string `json:"ppk"`
|
||||
NamaPPK string `json:"nama_ppk"`
|
||||
JumlahKasus int `json:"jumlah_kasus"`
|
||||
TotalTarif float64 `json:"total_tarif"`
|
||||
StatusData string `json:"status_data"`
|
||||
Keterangan string `json:"keterangan,omitempty"`
|
||||
}
|
||||
|
||||
// MonitoringResponse represents monitoring API response
|
||||
type MonitoringResponse struct {
|
||||
BaseResponse
|
||||
Data []MonitoringData `json:"data,omitempty"`
|
||||
Summary *MonitoringSummary `json:"summary,omitempty"`
|
||||
Pagination *PaginationResponse `json:"pagination,omitempty"`
|
||||
}
|
||||
|
||||
// MonitoringSummary represents monitoring summary
|
||||
type MonitoringSummary struct {
|
||||
TotalKasus int `json:"total_kasus"`
|
||||
TotalTarif float64 `json:"total_tarif"`
|
||||
RataRataTarif float64 `json:"rata_rata_tarif"`
|
||||
PeriodeLaporan string `json:"periode_laporan"`
|
||||
}
|
||||
53
internal/models/reference/base.go
Normal file
53
internal/models/reference/base.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package reference
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// BaseRequest contains common fields for all BPJS requests
|
||||
type BaseRequest struct {
|
||||
RequestID string `json:"request_id,omitempty"`
|
||||
Timestamp time.Time `json:"timestamp,omitempty"`
|
||||
}
|
||||
|
||||
// BaseResponse contains common response fields
|
||||
type BaseResponse struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message,omitempty"`
|
||||
RequestID string `json:"request_id,omitempty"`
|
||||
Timestamp string `json:"timestamp,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse represents error response structure
|
||||
type ErrorResponse struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
RequestID string `json:"request_id,omitempty"`
|
||||
Errors map[string]interface{} `json:"errors,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
}
|
||||
|
||||
// PaginationRequest contains pagination parameters
|
||||
type PaginationRequest struct {
|
||||
Page int `json:"page" validate:"min=1"`
|
||||
Limit int `json:"limit" validate:"min=1,max=100"`
|
||||
SortBy string `json:"sort_by,omitempty"`
|
||||
SortDir string `json:"sort_dir,omitempty" validate:"omitempty,oneof=asc desc"`
|
||||
}
|
||||
|
||||
// PaginationResponse contains pagination metadata
|
||||
type PaginationResponse struct {
|
||||
CurrentPage int `json:"current_page"`
|
||||
TotalPages int `json:"total_pages"`
|
||||
TotalItems int64 `json:"total_items"`
|
||||
ItemsPerPage int `json:"items_per_page"`
|
||||
HasNext bool `json:"has_next"`
|
||||
HasPrev bool `json:"has_previous"`
|
||||
}
|
||||
|
||||
// MetaInfo contains additional metadata
|
||||
type MetaInfo struct {
|
||||
Version string `json:"version"`
|
||||
Environment string `json:"environment"`
|
||||
ServerTime string `json:"server_time"`
|
||||
}
|
||||
148
internal/models/reference/eclaim.go
Normal file
148
internal/models/reference/eclaim.go
Normal file
@@ -0,0 +1,148 @@
|
||||
package reference
|
||||
|
||||
// === KLAIM MODELS ===
|
||||
|
||||
// KlaimRequest represents klaim submission request
|
||||
type KlaimRequest struct {
|
||||
BaseRequest
|
||||
NoSep string `json:"nomor_sep" validate:"required"`
|
||||
NoKartu string `json:"nomor_kartu" validate:"required"`
|
||||
NoMR string `json:"nomor_mr" validate:"required"`
|
||||
TglPulang string `json:"tgl_pulang" validate:"required"`
|
||||
TglMasuk string `json:"tgl_masuk" validate:"required"`
|
||||
JnsPelayanan string `json:"jenis_pelayanan" validate:"required,oneof=1 2"`
|
||||
CaraPulang string `json:"cara_pulang" validate:"required"`
|
||||
Data KlaimData `json:"data" validate:"required"`
|
||||
}
|
||||
|
||||
// KlaimData represents detailed klaim information
|
||||
type KlaimData struct {
|
||||
Diagnosa []DiagnosaKlaim `json:"diagnosa" validate:"required,dive"`
|
||||
Procedure []ProcedureKlaim `json:"procedure,omitempty"`
|
||||
Investigasi []InvestigasiKlaim `json:"investigasi,omitempty"`
|
||||
ObatAlkes []ObatKlaim `json:"obat_alkes,omitempty"`
|
||||
TarifRS []TarifKlaim `json:"tarif_rs,omitempty"`
|
||||
DRG *DRGInfo `json:"drg,omitempty"`
|
||||
SpecialCMG *SpecialCMGInfo `json:"special_cmg,omitempty"`
|
||||
}
|
||||
|
||||
// DiagnosaKlaim represents diagnosis in klaim
|
||||
type DiagnosaKlaim struct {
|
||||
KodeDiagnosa string `json:"kode_diagnosa" validate:"required"`
|
||||
NamaDiagnosa string `json:"nama_diagnosa"`
|
||||
TipeDiagnosa string `json:"tipe_diagnosa" validate:"required,oneof=1 2"`
|
||||
}
|
||||
|
||||
// ProcedureKlaim represents procedure in klaim
|
||||
type ProcedureKlaim struct {
|
||||
KodeTindakan string `json:"kode_tindakan" validate:"required"`
|
||||
NamaTindakan string `json:"nama_tindakan"`
|
||||
TanggalTindakan string `json:"tanggal_tindakan" validate:"required"`
|
||||
Keterangan string `json:"keterangan,omitempty"`
|
||||
}
|
||||
|
||||
// InvestigasiKlaim represents investigation/lab results
|
||||
type InvestigasiKlaim struct {
|
||||
KodeInvestigasi string `json:"kode_investigasi" validate:"required"`
|
||||
NamaInvestigasi string `json:"nama_investigasi"`
|
||||
Hasil string `json:"hasil,omitempty"`
|
||||
Satuan string `json:"satuan,omitempty"`
|
||||
NilaiNormal string `json:"nilai_normal,omitempty"`
|
||||
}
|
||||
|
||||
// ObatKlaim represents medication in klaim
|
||||
type ObatKlaim struct {
|
||||
KodeObat string `json:"kode_obat" validate:"required"`
|
||||
NamaObat string `json:"nama_obat"`
|
||||
Dosis string `json:"dosis,omitempty"`
|
||||
Frekuensi string `json:"frekuensi,omitempty"`
|
||||
Jumlah float64 `json:"jumlah" validate:"min=0"`
|
||||
Harga float64 `json:"harga" validate:"min=0"`
|
||||
}
|
||||
|
||||
// TarifKlaim represents hospital tariff
|
||||
type TarifKlaim struct {
|
||||
KodeTarif string `json:"kode_tarif" validate:"required"`
|
||||
NamaTarif string `json:"nama_tarif"`
|
||||
Jumlah int `json:"jumlah" validate:"min=0"`
|
||||
Tarif float64 `json:"tarif" validate:"min=0"`
|
||||
Total float64 `json:"total"`
|
||||
}
|
||||
|
||||
// DRGInfo represents DRG information
|
||||
type DRGInfo struct {
|
||||
KodeDRG string `json:"kode_drg"`
|
||||
NamaDRG string `json:"nama_drg"`
|
||||
TarifDRG float64 `json:"tarif_drg"`
|
||||
Severity string `json:"severity,omitempty"`
|
||||
}
|
||||
|
||||
// SpecialCMGInfo represents Special CMG information
|
||||
type SpecialCMGInfo struct {
|
||||
KodeCMG string `json:"kode_cmg"`
|
||||
NamaCMG string `json:"nama_cmg"`
|
||||
TarifCMG float64 `json:"tarif_cmg"`
|
||||
SubAcute string `json:"sub_acute,omitempty"`
|
||||
}
|
||||
|
||||
// KlaimResponse represents klaim API response
|
||||
type KlaimResponse struct {
|
||||
BaseResponse
|
||||
Data *KlaimResponseData `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
// KlaimResponseData represents processed klaim data
|
||||
type KlaimResponseData struct {
|
||||
NoKlaim string `json:"nomor_klaim"`
|
||||
NoSep string `json:"nomor_sep"`
|
||||
StatusKlaim string `json:"status_klaim"`
|
||||
TarifAktual float64 `json:"tarif_aktual"`
|
||||
TarifRS float64 `json:"tarif_rs"`
|
||||
TarifApproved float64 `json:"tarif_approved"`
|
||||
Grouper *GrouperResult `json:"grouper,omitempty"`
|
||||
}
|
||||
|
||||
// === GROUPER MODELS ===
|
||||
|
||||
// GrouperRequest represents grouper processing request
|
||||
type GrouperRequest struct {
|
||||
BaseRequest
|
||||
NoSep string `json:"nomor_sep" validate:"required"`
|
||||
NoKartu string `json:"nomor_kartu" validate:"required"`
|
||||
TglMasuk string `json:"tgl_masuk" validate:"required"`
|
||||
TglPulang string `json:"tgl_pulang" validate:"required"`
|
||||
JnsPelayanan string `json:"jenis_pelayanan" validate:"required,oneof=1 2"`
|
||||
CaraPulang string `json:"cara_pulang" validate:"required"`
|
||||
DiagnosaPrimer string `json:"diagnosa_primer" validate:"required"`
|
||||
DiagnosaSkunder []string `json:"diagnosa_skunder,omitempty"`
|
||||
Procedure []string `json:"procedure,omitempty"`
|
||||
AdlScore int `json:"adl_score,omitempty"`
|
||||
AgeAtAdmission int `json:"age_at_admission" validate:"min=0"`
|
||||
}
|
||||
|
||||
// GrouperResult represents grouper processing result
|
||||
type GrouperResult struct {
|
||||
KodeDRG string `json:"kode_drg"`
|
||||
NamaDRG string `json:"nama_drg"`
|
||||
TarifDRG float64 `json:"tarif_drg"`
|
||||
KodeCMG string `json:"kode_cmg,omitempty"`
|
||||
NamaCMG string `json:"nama_cmg,omitempty"`
|
||||
TarifCMG float64 `json:"tarif_cmg,omitempty"`
|
||||
Severity string `json:"severity"`
|
||||
SubAcute bool `json:"sub_acute"`
|
||||
Chronic bool `json:"chronic"`
|
||||
TopUp *TopUpInfo `json:"top_up,omitempty"`
|
||||
}
|
||||
|
||||
// TopUpInfo represents top-up information
|
||||
type TopUpInfo struct {
|
||||
Eligible bool `json:"eligible"`
|
||||
Percentage float64 `json:"percentage"`
|
||||
Amount float64 `json:"amount"`
|
||||
}
|
||||
|
||||
// GrouperResponse represents grouper API response
|
||||
type GrouperResponse struct {
|
||||
BaseResponse
|
||||
Data *GrouperResult `json:"data,omitempty"`
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package models
|
||||
|
||||
// PesertaResponse represents the response structure for BPJS participant data
|
||||
type PesertaResponse struct {
|
||||
Message string `json:"message"`
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// PesertaRawResponse represents the raw response structure from BPJS API
|
||||
type PesertaRawResponse struct {
|
||||
MetaData struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
} `json:"metaData"`
|
||||
Response interface{} `json:"response"`
|
||||
}
|
||||
|
||||
// PesertaRequest represents the request structure for BPJS participant search
|
||||
type PesertaRequest struct {
|
||||
NIK string `json:"nik" binding:"required"`
|
||||
TglSEP string `json:"tglSEP" binding:"required"`
|
||||
}
|
||||
|
||||
// PesertaData represents the participant data structure
|
||||
type PesertaData struct {
|
||||
NoKartu string `json:"noKartu"`
|
||||
NIK string `json:"nik"`
|
||||
Nama string `json:"nama"`
|
||||
Pisa string `json:"pisa"`
|
||||
Sex string `json:"sex"`
|
||||
TglLahir string `json:"tglLahir"`
|
||||
Pob string `json:"pob"`
|
||||
KdProvider string `json:"kdProvider"`
|
||||
NmProvider string `json:"nmProvider"`
|
||||
KelasRawat string `json:"kelasRawat"`
|
||||
Keterangan string `json:"keterangan"`
|
||||
NoTelepon string `json:"noTelepon"`
|
||||
Alamat string `json:"alamat"`
|
||||
KdPos string `json:"kdPos"`
|
||||
Pekerjaan string `json:"pekerjaan"`
|
||||
StatusKawin string `json:"statusKawin"`
|
||||
TglCetakKartu string `json:"tglCetakKartu"`
|
||||
TglTAT string `json:"tglTAT"`
|
||||
TglTMT string `json:"tglTMT"`
|
||||
ProvUmum struct {
|
||||
KdProvider string `json:"kdProvider"`
|
||||
NmProvider string `json:"nmProvider"`
|
||||
} `json:"provUmum"`
|
||||
JenisPeserta struct {
|
||||
KdJenisPeserta string `json:"kdJenisPeserta"`
|
||||
NmJenisPeserta string `json:"nmJenisPeserta"`
|
||||
} `json:"jenisPeserta"`
|
||||
KelasTanggungan struct {
|
||||
KdKelas string `json:"kdKelas"`
|
||||
NmKelas string `json:"nmKelas"`
|
||||
} `json:"kelasTanggungan"`
|
||||
Informasi struct {
|
||||
Dinsos string `json:"dinsos"`
|
||||
NoSKTM string `json:"noSKTM"`
|
||||
ProlanisPRB string `json:"prolanisPRB"`
|
||||
} `json:"informasi"`
|
||||
Cob struct {
|
||||
NoAsuransi string `json:"noAsuransi"`
|
||||
NmAsuransi string `json:"nmAsuransi"`
|
||||
TglTAT string `json:"tglTAT"`
|
||||
TglTMT string `json:"tglTMT"`
|
||||
} `json:"cob"`
|
||||
HakKelas struct {
|
||||
Kode string `json:"kode"`
|
||||
Nama string `json:"nama"`
|
||||
} `json:"hakKelas"`
|
||||
Mr struct {
|
||||
NoMR string `json:"noMR"`
|
||||
NoTelepon string `json:"noTelepon"`
|
||||
} `json:"mr"`
|
||||
ProvRujuk struct {
|
||||
KdProvider string `json:"kdProvider"`
|
||||
NmProvider string `json:"nmProvider"`
|
||||
} `json:"provRujuk"`
|
||||
StatusPeserta struct {
|
||||
Kode string `json:"kode"`
|
||||
Nama string `json:"nama"`
|
||||
} `json:"statusPeserta"`
|
||||
}
|
||||
29
internal/models/reference/services.go
Normal file
29
internal/models/reference/services.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// internal/models/reference/services.go
|
||||
package reference
|
||||
|
||||
import "context"
|
||||
|
||||
// VClaimService defines VClaim service interface
|
||||
type VClaimService interface {
|
||||
GetPeserta(ctx context.Context, noKartu string) (*PesertaData, error)
|
||||
CreateSEP(ctx context.Context, req *SEPRequest) (*SEPData, error)
|
||||
GetSEP(ctx context.Context, noSep string) (*SEPData, error)
|
||||
UpdateSEP(ctx context.Context, noSep string, req *SEPRequest) (*SEPData, error)
|
||||
DeleteSEP(ctx context.Context, noSep string) error
|
||||
GetRujukan(ctx context.Context, noRujukan string) (*RujukanData, error)
|
||||
}
|
||||
|
||||
// EClaimService defines EClaim service interface
|
||||
type EClaimService interface {
|
||||
CreateKlaim(ctx context.Context, req *KlaimRequest) (*KlaimResponseData, error)
|
||||
GetKlaim(ctx context.Context, noKlaim string) (*KlaimResponseData, error)
|
||||
UpdateKlaim(ctx context.Context, noKlaim string, req *KlaimRequest) (*KlaimResponseData, error)
|
||||
ProcessGrouper(ctx context.Context, req *GrouperRequest) (*GrouperResult, error)
|
||||
}
|
||||
|
||||
// AplicareService defines Aplicare service interface
|
||||
type AplicareService interface {
|
||||
GetReferensi(ctx context.Context, req *ReferensiRequest) ([]ReferensiData, *PaginationResponse, error)
|
||||
GetMonitoring(ctx context.Context, req *MonitoringRequest) ([]MonitoringData, *MonitoringSummary, *PaginationResponse, error)
|
||||
CreateMonitoring(ctx context.Context, req *MonitoringRequest) error
|
||||
}
|
||||
106
internal/models/reference/validation.go
Normal file
106
internal/models/reference/validation.go
Normal file
@@ -0,0 +1,106 @@
|
||||
package reference
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
)
|
||||
|
||||
// CustomValidator wraps the validator
|
||||
type CustomValidator struct {
|
||||
Validator *validator.Validate
|
||||
}
|
||||
|
||||
// Validate validates struct
|
||||
func (cv *CustomValidator) Validate(i interface{}) error {
|
||||
return cv.Validator.Struct(i)
|
||||
}
|
||||
|
||||
// RegisterCustomValidations registers custom validation rules
|
||||
func RegisterCustomValidations(v *validator.Validate) {
|
||||
// Validate Indonesian phone number
|
||||
v.RegisterValidation("indonesian_phone", validateIndonesianPhone)
|
||||
|
||||
// Validate BPJS card number format
|
||||
v.RegisterValidation("bpjs_card", validateBPJSCard)
|
||||
|
||||
// Validate Indonesian NIK
|
||||
v.RegisterValidation("indonesian_nik", validateIndonesianNIK)
|
||||
|
||||
// Validate date format YYYY-MM-DD
|
||||
v.RegisterValidation("date_format", validateDateFormat)
|
||||
|
||||
// Validate ICD-10 code format
|
||||
v.RegisterValidation("icd10", validateICD10)
|
||||
|
||||
// Validate ICD-9-CM procedure code
|
||||
v.RegisterValidation("icd9cm", validateICD9CM)
|
||||
}
|
||||
|
||||
func validateIndonesianPhone(fl validator.FieldLevel) bool {
|
||||
phone := fl.Field().String()
|
||||
if phone == "" {
|
||||
return true // Optional field
|
||||
}
|
||||
|
||||
// Indonesian phone number pattern: +62, 62, 08, or 8
|
||||
pattern := `^(\+?62|0?8)[1-9][0-9]{7,11}$`
|
||||
matched, _ := regexp.MatchString(pattern, phone)
|
||||
return matched
|
||||
}
|
||||
|
||||
func validateBPJSCard(fl validator.FieldLevel) bool {
|
||||
card := fl.Field().String()
|
||||
if len(card) != 13 {
|
||||
return false
|
||||
}
|
||||
|
||||
// BPJS card should be numeric
|
||||
pattern := `^\d{13}$`
|
||||
matched, _ := regexp.MatchString(pattern, card)
|
||||
return matched
|
||||
}
|
||||
|
||||
func validateIndonesianNIK(fl validator.FieldLevel) bool {
|
||||
nik := fl.Field().String()
|
||||
if len(nik) != 16 {
|
||||
return false
|
||||
}
|
||||
|
||||
// NIK should be numeric
|
||||
pattern := `^\d{16}$`
|
||||
matched, _ := regexp.MatchString(pattern, nik)
|
||||
return matched
|
||||
}
|
||||
|
||||
func validateDateFormat(fl validator.FieldLevel) bool {
|
||||
dateStr := fl.Field().String()
|
||||
_, err := time.Parse("2006-01-02", dateStr)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func validateICD10(fl validator.FieldLevel) bool {
|
||||
code := fl.Field().String()
|
||||
if code == "" {
|
||||
return true
|
||||
}
|
||||
|
||||
// Basic ICD-10 pattern: Letter followed by 2 digits, optional dot and more digits
|
||||
pattern := `^[A-Z]\d{2}(\.\d+)?$`
|
||||
matched, _ := regexp.MatchString(pattern, strings.ToUpper(code))
|
||||
return matched
|
||||
}
|
||||
|
||||
func validateICD9CM(fl validator.FieldLevel) bool {
|
||||
code := fl.Field().String()
|
||||
if code == "" {
|
||||
return true
|
||||
}
|
||||
|
||||
// Basic ICD-9-CM procedure pattern: 2-4 digits with optional decimal
|
||||
pattern := `^\d{2,4}(\.\d+)?$`
|
||||
matched, _ := regexp.MatchString(pattern, code)
|
||||
return matched
|
||||
}
|
||||
144
internal/models/reference/vclaim.go
Normal file
144
internal/models/reference/vclaim.go
Normal file
@@ -0,0 +1,144 @@
|
||||
// internal/models/reference/vclaim.go
|
||||
package reference
|
||||
|
||||
// === PESERTA MODELS ===
|
||||
|
||||
// PesertaRequest represents peserta lookup request
|
||||
type PesertaRequest struct {
|
||||
BaseRequest
|
||||
NoKartu string `json:"nokartu" validate:"required,min=13,max=13"`
|
||||
NIK string `json:"nik,omitempty" validate:"omitempty,min=16,max=16"`
|
||||
TanggalSEP string `json:"tglsep" validate:"required" example:"2024-01-15"`
|
||||
NoTelepon string `json:"notelp,omitempty" validate:"omitempty,max=15"`
|
||||
}
|
||||
|
||||
// PesertaData represents peserta information from BPJS
|
||||
type PesertaData struct {
|
||||
NoKartu string `json:"noKartu"`
|
||||
NIK string `json:"nik"`
|
||||
Nama string `json:"nama"`
|
||||
Pisa string `json:"pisa"`
|
||||
Sex string `json:"sex"`
|
||||
TanggalLahir string `json:"tglLahir"`
|
||||
TelephoneMsisdn string `json:"tglTAT"`
|
||||
TelephoneAsat string `json:"tglTMT"`
|
||||
KodeCabang string `json:"kdCabang"`
|
||||
NamaCabang string `json:"nmCabang"`
|
||||
KodeJenisPeserta string `json:"kdJnsPst"`
|
||||
NamaJenisPeserta string `json:"nmJnsPst"`
|
||||
KelasRawat string `json:"klsRawat"`
|
||||
Status string `json:"statusPeserta"`
|
||||
Aktif string `json:"aktif"`
|
||||
KeteranganAktif string `json:"ketAktif"`
|
||||
NoSKTM string `json:"noSKTM,omitempty"`
|
||||
NoKTP string `json:"noKtp"`
|
||||
Asuransi string `json:"asuransi,omitempty"`
|
||||
CoB string `json:"cob,omitempty"`
|
||||
TunggakanIuran string `json:"tglTunggak,omitempty"`
|
||||
MR struct {
|
||||
NoMR string `json:"noMR"`
|
||||
NamaMR string `json:"nmMR"`
|
||||
Sex string `json:"sex"`
|
||||
TglLahir string `json:"tglLahir"`
|
||||
TglMeninggal string `json:"tglMeninggal,omitempty"`
|
||||
} `json:"mr,omitempty"`
|
||||
}
|
||||
|
||||
// PesertaResponse represents peserta API response
|
||||
type PesertaResponse struct {
|
||||
BaseResponse
|
||||
Data *PesertaData `json:"data,omitempty"`
|
||||
MetaData interface{} `json:"metaData,omitempty"`
|
||||
}
|
||||
|
||||
// === SEP (Surat Eligibilitas Peserta) MODELS ===
|
||||
|
||||
// SEPRequest represents SEP creation/update request
|
||||
type SEPRequest struct {
|
||||
BaseRequest
|
||||
NoKartu string `json:"noKartu" validate:"required"`
|
||||
TglSep string `json:"tglSep" validate:"required"`
|
||||
PPKPelayanan string `json:"ppkPelayanan" validate:"required"`
|
||||
JnsPelayanan string `json:"jnsPelayanan" validate:"required,oneof=1 2"`
|
||||
KlsRawat string `json:"klsRawat" validate:"required,oneof=1 2 3"`
|
||||
NoMR string `json:"noMR" validate:"required"`
|
||||
Rujukan *SEPRujukan `json:"rujukan"`
|
||||
Catatan string `json:"catatan,omitempty"`
|
||||
Diagnosa string `json:"diagnosa" validate:"required"`
|
||||
PoliTujuan string `json:"poli" validate:"required"`
|
||||
ExternalUser string `json:"user" validate:"required"`
|
||||
NoTelp string `json:"noTelp,omitempty"`
|
||||
}
|
||||
|
||||
// SEPRujukan represents rujukan information in SEP
|
||||
type SEPRujukan struct {
|
||||
AsalRujukan string `json:"asalRujukan" validate:"required,oneof=1 2"`
|
||||
TglRujukan string `json:"tglRujukan" validate:"required"`
|
||||
NoRujukan string `json:"noRujukan" validate:"required"`
|
||||
PPKRujukan string `json:"ppkRujukan" validate:"required"`
|
||||
}
|
||||
|
||||
// SEPData represents SEP response data
|
||||
type SEPData struct {
|
||||
NoSep string `json:"noSep"`
|
||||
TglSep string `json:"tglSep"`
|
||||
JnsPelayanan string `json:"jnsPelayanan"`
|
||||
PoliTujuan string `json:"poli"`
|
||||
KlsRawat string `json:"klsRawat"`
|
||||
NoMR string `json:"noMR"`
|
||||
Rujukan SEPRujukan `json:"rujukan"`
|
||||
Catatan string `json:"catatan"`
|
||||
Diagnosa string `json:"diagnosa"`
|
||||
Peserta PesertaData `json:"peserta"`
|
||||
Informasi struct {
|
||||
NoSKDP string `json:"noSKDP,omitempty"`
|
||||
DPJPLayan string `json:"dpjpLayan"`
|
||||
NoTelepon string `json:"noTelp"`
|
||||
SubSpesialis string `json:"subSpesialis,omitempty"`
|
||||
} `json:"informasi"`
|
||||
}
|
||||
|
||||
// SEPResponse represents SEP API response
|
||||
type SEPResponse struct {
|
||||
BaseResponse
|
||||
Data *SEPData `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
// === RUJUKAN MODELS ===
|
||||
|
||||
// RujukanRequest represents rujukan lookup request
|
||||
type RujukanRequest struct {
|
||||
BaseRequest
|
||||
NoRujukan string `json:"noRujukan" validate:"required"`
|
||||
NoKartu string `json:"noKartu,omitempty"`
|
||||
}
|
||||
|
||||
// RujukanData represents rujukan information
|
||||
type RujukanData struct {
|
||||
NoRujukan string `json:"noRujukan"`
|
||||
TglRujukan string `json:"tglRujukan"`
|
||||
NoKartu string `json:"noKartu"`
|
||||
Nama string `json:"nama"`
|
||||
KelasRawat string `json:"kelasRawat"`
|
||||
Diagnosa struct {
|
||||
KodeDiagnosa string `json:"kdDiagnosa"`
|
||||
NamaDiagnosa string `json:"nmDiagnosa"`
|
||||
} `json:"diagnosa"`
|
||||
PoliRujukan struct {
|
||||
KodePoli string `json:"kdPoli"`
|
||||
NamaPoli string `json:"nmPoli"`
|
||||
} `json:"poliRujukan"`
|
||||
ProvPerujuk struct {
|
||||
KodeProvider string `json:"kdProvider"`
|
||||
NamaProvider string `json:"nmProvider"`
|
||||
} `json:"provPerujuk"`
|
||||
PelayananInfo string `json:"pelayanan"`
|
||||
StatusRujukan string `json:"statusRujukan"`
|
||||
}
|
||||
|
||||
// RujukanResponse represents rujukan API response
|
||||
type RujukanResponse struct {
|
||||
BaseResponse
|
||||
Data *RujukanData `json:"data,omitempty"`
|
||||
List []RujukanData `json:"list,omitempty"`
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
package models
|
||||
|
||||
// SepPostRequest represents the request payload for creating a SEP
|
||||
type SepPostRequest struct {
|
||||
TSep TSepPost `json:"tsep" binding:"required"`
|
||||
}
|
||||
|
||||
// TSepPost contains the main SEP data for creation
|
||||
type TSepPost struct {
|
||||
NoKartu string `json:"noKartu" binding:"required"`
|
||||
TglSep string `json:"tglSep" binding:"required"` // yyyy-MM-dd
|
||||
PpkPelayanan string `json:"ppkPelayanan" binding:"required"`
|
||||
JnsPelayanan string `json:"jnsPelayanan" binding:"required"`
|
||||
KlsRawat KlsRawatPost `json:"klsRawat" binding:"required"`
|
||||
NoMR string `json:"noMR" binding:"required"`
|
||||
Rujukan Rujukan `json:"rujukan" binding:"required"`
|
||||
Catatan string `json:"catatan"`
|
||||
DiagAwal string `json:"diagAwal" binding:"required"`
|
||||
Poli Poli `json:"poli" binding:"required"`
|
||||
Cob Flag `json:"cob" binding:"required"`
|
||||
Katarak Flag `json:"katarak" binding:"required"`
|
||||
Jaminan Jaminan `json:"jaminan" binding:"required"`
|
||||
TujuanKunj string `json:"tujuanKunj"`
|
||||
FlagProcedure string `json:"flagProcedure"`
|
||||
KdPenunjang string `json:"kdPenunjang"`
|
||||
AssesmentPel string `json:"assesmentPel"`
|
||||
Skdp Skdp `json:"skdp" binding:"required"`
|
||||
DpjpLayan string `json:"dpjpLayan"`
|
||||
NoTelp string `json:"noTelp"`
|
||||
User string `json:"user" binding:"required"`
|
||||
}
|
||||
|
||||
// KlsRawatPost represents class of care data for POST requests
|
||||
type KlsRawatPost struct {
|
||||
KlsRawatHak string `json:"klsRawatHak" binding:"required"`
|
||||
KlsRawatNaik string `json:"klsRawatNaik"`
|
||||
Pembiayaan string `json:"pembiayaan"`
|
||||
PenanggungJawab string `json:"penanggungJawab"`
|
||||
}
|
||||
|
||||
// Rujukan represents referral data
|
||||
type Rujukan struct {
|
||||
AsalRujukan string `json:"asalRujukan" binding:"required"`
|
||||
TglRujukan string `json:"tglRujukan" binding:"required"`
|
||||
NoRujukan string `json:"noRujukan" binding:"required"`
|
||||
PpkRujukan string `json:"ppkRujukan" binding:"required"`
|
||||
}
|
||||
|
||||
// Poli represents poly/department data
|
||||
type Poli struct {
|
||||
Tujuan string `json:"tujuan" binding:"required"`
|
||||
Eksekutif string `json:"eksekutif" binding:"required"`
|
||||
}
|
||||
|
||||
// Flag represents a generic flag structure
|
||||
type Flag struct {
|
||||
Flag string `json:"flag" binding:"required"`
|
||||
}
|
||||
|
||||
// Jaminan represents insurance guarantee data
|
||||
type Jaminan struct {
|
||||
LakaLantas string `json:"lakaLantas" binding:"required"`
|
||||
NoLP string `json:"noLP"`
|
||||
Penjamin Penjamin `json:"penjamin"`
|
||||
}
|
||||
|
||||
// Penjamin represents guarantor data
|
||||
type Penjamin struct {
|
||||
TglKejadian string `json:"tglKejadian"`
|
||||
Keterangan string `json:"keterangan"`
|
||||
Suplesi Suplesi `json:"suplesi"`
|
||||
}
|
||||
|
||||
// Suplesi represents supplementary data
|
||||
type Suplesi struct {
|
||||
Suplesi string `json:"suplesi"`
|
||||
NoSepSuplesi string `json:"noSepSuplesi"`
|
||||
LokasiLaka LokasiLaka `json:"lokasiLaka"`
|
||||
}
|
||||
|
||||
// LokasiLaka represents accident location data
|
||||
type LokasiLaka struct {
|
||||
KdPropinsi string `json:"kdPropinsi"`
|
||||
KdKabupaten string `json:"kdKabupaten"`
|
||||
KdKecamatan string `json:"kdKecamatan"`
|
||||
}
|
||||
|
||||
// Skdp represents SKDP data
|
||||
type Skdp struct {
|
||||
NoSurat string `json:"noSurat" binding:"required"`
|
||||
KodeDPJP string `json:"kodeDPJP" binding:"required"`
|
||||
}
|
||||
|
||||
// SepPutRequest represents the request payload for updating a SEP
|
||||
type SepPutRequest struct {
|
||||
TSep TSepPut `json:"tsep" binding:"required"`
|
||||
}
|
||||
|
||||
// TSepPut contains the main SEP data for updates
|
||||
type TSepPut struct {
|
||||
NoSep string `json:"noSep" binding:"required"`
|
||||
KlsRawat KlsRawatPut `json:"klsRawat"`
|
||||
NoMR string `json:"noMR"`
|
||||
Catatan string `json:"catatan"`
|
||||
DiagAwal string `json:"diagAwal"`
|
||||
Poli Poli `json:"poli"`
|
||||
Cob Flag `json:"cob"`
|
||||
Katarak Flag `json:"katarak"`
|
||||
Jaminan Jaminan `json:"jaminan"`
|
||||
DpjpLayan string `json:"dpjpLayan"`
|
||||
NoTelp string `json:"noTelp"`
|
||||
User string `json:"user" binding:"required"`
|
||||
}
|
||||
|
||||
// KlsRawatPut represents class of care data for PUT requests
|
||||
type KlsRawatPut struct {
|
||||
KlsRawatHak string `json:"klsRawatHak"`
|
||||
KlsRawatNaik string `json:"klsRawatNaik"`
|
||||
Pembiayaan string `json:"pembiayaan"`
|
||||
PenanggungJawab string `json:"penanggungJawab"`
|
||||
}
|
||||
|
||||
// SepDeleteRequest represents the request payload for deleting a SEP
|
||||
type SepDeleteRequest struct {
|
||||
TSep struct {
|
||||
NoSep string `json:"noSep" binding:"required"`
|
||||
User string `json:"user" binding:"required"`
|
||||
} `json:"tsep" binding:"required"`
|
||||
}
|
||||
|
||||
// SepResponse represents the standard response for SEP operations
|
||||
type SepResponse struct {
|
||||
Message string `json:"message"`
|
||||
Data map[string]interface{} `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
// SepRawResponse represents the raw response from BPJS API
|
||||
type SepRawResponse struct {
|
||||
MetaData struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
} `json:"metaData"`
|
||||
Response interface{} `json:"response"`
|
||||
}
|
||||
Reference in New Issue
Block a user