add table person-relative, add fk personrelative into person

This commit is contained in:
dpurbosakti
2025-09-02 13:33:01 +07:00
parent e8a7123f30
commit 53f798ce29
7 changed files with 163 additions and 40 deletions

No files matched your search

+33 -18
View File
@@ -11,6 +11,7 @@ type (
AgeGroupForMedicineCode string
RelativeCode string
ContactTypeCode string
RelationshipCode string
)
const (
@@ -18,9 +19,7 @@ const (
GCFemale GenderCode = "female"
GCNotStated GenderCode = "not-stated"
GCUnknown GenderCode = "unknown"
)
const (
BTCAPositive BloodTypeCode = "A+"
BTCANegative BloodTypeCode = "A-"
BTCBPositive BloodTypeCode = "B+"
@@ -29,25 +28,19 @@ const (
BTCABNegative BloodTypeCode = "AB-"
BTCOPositive BloodTypeCode = "O+"
BTCONegative BloodTypeCode = "O-"
)
const (
MSCBelumKawin MaritalStatusCode = "S"
MSCKawin MaritalStatusCode = "M"
MSCCeraiHidup MaritalStatusCode = "D"
MSCCeraiMati MaritalStatusCode = "W"
)
const (
RCIslam ReligionCode = "islam"
RCProtestan ReligionCode = "protestan"
RCKatolik ReligionCode = "katolik"
RCHindu ReligionCode = "hindu"
RCBudha ReligionCode = "budha"
RCKonghucu ReligionCode = "konghucu"
)
const (
ECTS EducationCode = "TS"
ECTK EducationCode = "TK"
ECSD EducationCode = "SD"
@@ -60,9 +53,7 @@ const (
ECS1 EducationCode = "S1"
ECS2 EducationCode = "S2"
ECS3 EducationCode = "S3"
)
const (
OCTidakBekerja OcupationCode = "tidak-bekerja"
OCPns OcupationCode = "pns"
OCTniPolisi OcupationCode = "polisi"
@@ -71,9 +62,7 @@ const (
OCWiraswasta OcupationCode = "wiraswasta"
OCKarySwasta OcupationCode = "kary-swasta"
OCLainlain OcupationCode = "lainnya"
)
const (
AGCEUnknown AgeGroupCode = "unkown"
AGCLTE5 AgeGroupCode = "LT5"
AGCEU19 AgeGroupCode = "UE19"
@@ -82,17 +71,13 @@ const (
AGCEU49 AgeGroupCode = "UE49"
AGCEU59 AgeGroupCode = "UE50"
AGCGE60 AgeGroupCode = "E60"
)
const (
AGMCNew AgeGroupForMedicineCode = "new-born"
AGMCInfant AgeGroupForMedicineCode = "infant"
AGMCToddler AgeGroupForMedicineCode = "toddler"
AGMCKid AgeGroupForMedicineCode = "kid"
AGMCAdult AgeGroupForMedicineCode = "adult"
)
const (
RCMSuami RelativeCode = "suami"
RCMIstri RelativeCode = "istri"
RCMAnak RelativeCode = "anak"
@@ -107,13 +92,23 @@ const (
RCMBibi RelativeCode = "bibi"
RCMPamanKakek RelativeCode = "kakek"
RCMPamanNenek RelativeCode = "nenek"
)
const (
CTPhone ContactTypeCode = "phone"
CTMPhone ContactTypeCode = "m-phone"
CTEmail ContactTypeCode = "email"
CTFax ContactTypeCode = "fax"
RCMother RelationshipCode = "mother" // Ibu
RCFather RelationshipCode = "father" // Ayah
RCUncle RelationshipCode = "uncle" // Paman
RCAunt RelationshipCode = "aunt" // Bibi
RCSibling RelationshipCode = "sibling" // Saudara
RCGdMother RelationshipCode = "gd-mother" // Nenek
RCGdFather RelationshipCode = "gd-father" // Kakek
RCChild RelationshipCode = "child" // Anak
RCNephew RelationshipCode = "nephew" // Keponakan
RCGdChild RelationshipCode = "gd-child" // Cucu
RCOther RelationshipCode = "other" // Lainnya
)
func GetGenderCodes() map[GenderCode]string {
@@ -239,6 +234,22 @@ func GetContactTypeCodes() map[ContactTypeCode]string {
}
}
func GetRelationshipCodes() map[RelationshipCode]string {
return map[RelationshipCode]string{
RCMother: "Ibu",
RCFather: "Ayah",
RCUncle: "Paman",
RCAunt: "Bibi",
RCSibling: "Saudara",
RCGdMother: "Nenek",
RCGdFather: "Kakek",
RCChild: "Anak",
RCNephew: "Keponakan",
RCGdChild: "Cucu",
RCOther: "Lainnya",
}
}
func (obj GenderCode) String() string {
return GetGenderCodes()[obj]
}
@@ -273,3 +284,7 @@ func (obj RelativeCode) String() string {
func (obj ContactTypeCode) String() string {
return GetContactTypeCodes()[obj]
}
func (obj RelationshipCode) String() string {
return GetRelationshipCodes()[obj]
}