def build_imis_marital(cls, imis_insuree, fhir_patient):
     marital_status = fhir_patient.maritalStatus
     if marital_status is not None:
         for maritialCoding in marital_status.coding:
             if maritialCoding.system == Stu3MaritalConfig.get_fhir_marital_status_system():
                 code = maritialCoding.code
                 if code == Stu3MaritalConfig.get_fhir_married_code():
                     imis_insuree.marital = ImisMaritalStatus.MARRIED.value
                 elif code == Stu3MaritalConfig.get_fhir_never_married_code():
                     imis_insuree.marital = ImisMaritalStatus.SINGLE.value
                 elif code == Stu3MaritalConfig.get_fhir_divorced_code():
                     imis_insuree.marital = ImisMaritalStatus.DIVORCED.value
                 elif code == Stu3MaritalConfig.get_fhir_widowed_code():
                     imis_insuree.marital = ImisMaritalStatus.WIDOWED.value
                 elif code == Stu3MaritalConfig.get_fhir_unknown_marital_status_code():
                     imis_insuree.marital = ImisMaritalStatus.NOT_SPECIFIED.value
 def build_fhir_marital_status(cls, fhir_patient, imis_insuree):
     if imis_insuree.marital is not None:
         if imis_insuree.marital == ImisMaritalStatus.MARRIED.value:
             fhir_patient.maritalStatus = \
                 cls.build_codeable_concept(Stu3MaritalConfig.get_fhir_married_code(),
                                            Stu3MaritalConfig.get_fhir_marital_status_system())
         elif imis_insuree.marital == ImisMaritalStatus.SINGLE.value:
             fhir_patient.maritalStatus = \
                 cls.build_codeable_concept(Stu3MaritalConfig.get_fhir_never_married_code(),
                                            Stu3MaritalConfig.get_fhir_marital_status_system())
         elif imis_insuree.marital == ImisMaritalStatus.DIVORCED.value:
             fhir_patient.maritalStatus = \
                 cls.build_codeable_concept(Stu3MaritalConfig.get_fhir_divorced_code(),
                                            Stu3MaritalConfig.get_fhir_marital_status_system())
         elif imis_insuree.marital == ImisMaritalStatus.WIDOWED.value:
             fhir_patient.maritalStatus = \
                 cls.build_codeable_concept(Stu3MaritalConfig.get_fhir_widowed_code(),
                                            Stu3MaritalConfig.get_fhir_marital_status_system())
         elif imis_insuree.marital == ImisMaritalStatus.NOT_SPECIFIED.value:
             fhir_patient.maritalStatus = \
                 cls.build_codeable_concept(Stu3MaritalConfig.get_fhir_unknown_marital_status_code(),
                                            Stu3MaritalConfig.get_fhir_marital_status_system())