Fix CUD Patient
This commit is contained in:
No files matched your search
@@ -2,12 +2,12 @@ package m_pasien
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
e "simrs-vx/internal/domain/main-entities/patient"
|
||||
pr "simrs-vx/internal/domain/main-entities/person"
|
||||
pa "simrs-vx/internal/domain/main-entities/person-address"
|
||||
pab "simrs-vx/internal/domain/main-entities/person-address/base"
|
||||
pc "simrs-vx/internal/domain/main-entities/person-contact"
|
||||
cm "simrs-vx/internal/domain/references/common"
|
||||
rf "simrs-vx/internal/domain/references/person"
|
||||
|
||||
"time"
|
||||
@@ -89,8 +89,9 @@ type MPasienDto struct {
|
||||
func (mp MPasienDto) ToPatient() e.Patient {
|
||||
|
||||
patient := e.Patient{
|
||||
// TODO get patient person_id from database
|
||||
Person_Id: &mp.Id,
|
||||
Main: ecore.Main{
|
||||
Id: mp.Id,
|
||||
},
|
||||
NewBornStatus: mp.ParentNomr != nil,
|
||||
RegisteredAt: parseTimeDateOnly(mp.Tgldaftar),
|
||||
RegisteredBy_User_Name: mp.Nip,
|
||||
@@ -116,9 +117,9 @@ func (mp MPasienDto) ToPatient() e.Patient {
|
||||
BirthDate: parseTimeDateOnly(mp.Tgllahir),
|
||||
BirthRegency_Code: &bc,
|
||||
Gender_Code: &gc,
|
||||
ResidentIdentityNumber: nilEmptyString(mp.Noktp),
|
||||
PassportNumber: nilEmptyString(*mp.Paspor),
|
||||
DrivingLicenseNumber: nilEmptyString(*mp.Sim),
|
||||
ResidentIdentityNumber: nilEmptyString(&mp.Noktp),
|
||||
PassportNumber: nilEmptyString(mp.Paspor),
|
||||
DrivingLicenseNumber: nilEmptyString(mp.Sim),
|
||||
Religion_Code: &rc,
|
||||
Education_Code: &ec,
|
||||
Ocupation_Name: &mp.Pekerjaan,
|
||||
@@ -166,18 +167,11 @@ func (mp MPasienDto) ToPatient() e.Patient {
|
||||
return patient
|
||||
}
|
||||
|
||||
func getActiveStatus(s uint) cm.ActiveStatusCode {
|
||||
if s == 1 {
|
||||
return cm.SCActive
|
||||
}
|
||||
return cm.SCInactive
|
||||
}
|
||||
|
||||
func nilEmptyString(s string) *string {
|
||||
if s == "" {
|
||||
func nilEmptyString(s *string) *string {
|
||||
if s == nil {
|
||||
return nil
|
||||
}
|
||||
return &s
|
||||
return s
|
||||
}
|
||||
|
||||
func getGender(g string) rf.GenderCode {
|
||||
|
||||
Reference in New Issue
Block a user